Introduce /usr/src/nrelease which begins to implement the new 'live CD'
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 1 Dec 2003 09:59:46 +0000 (09:59 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 1 Dec 2003 09:59:46 +0000 (09:59 +0000)
ISO builder idea.  This initial commit is capable of creating bootable
ISO images which contain a complete working distribution but will boot
into a login prompt (login as root) rather then sysinstall or a
sysinstall-like utility.  Development is ongoing.  Critical subdirectories
are remounted as MFS so most normal commands, including vi, should work just
fine.

Makefile.inc1
nrelease/Makefile [new file with mode: 0644]
nrelease/root/boot/loader.conf [new file with mode: 0644]
nrelease/root/cpignore [new file with mode: 0644]
nrelease/root/etc/fstab [new file with mode: 0644]

index 2448a50..496f08c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
-# $DragonFly: src/Makefile.inc1,v 1.8 2003/11/09 02:36:35 dillon Exp $
+# $DragonFly: src/Makefile.inc1,v 1.9 2003/12/01 09:59:42 dillon Exp $
 #
 # Make command line options:
 #      -DMAKE_KERBEROS5 to build Kerberos5
@@ -52,6 +52,9 @@ SUBDIR+= include
 .if exists(${.CURDIR}/lib)
 SUBDIR+= lib
 .endif
+.if exists(${.CURDIR}/nrelease)
+SUBDIR+= nrelease
+.endif
 
 .if exists(${.CURDIR}/bin)
 SUBDIR+= bin
diff --git a/nrelease/Makefile b/nrelease/Makefile
new file mode 100644 (file)
index 0000000..3aaf11b
--- /dev/null
@@ -0,0 +1,60 @@
+# $DragonFly: src/nrelease/Makefile,v 1.1 2003/12/01 09:59:43 dillon Exp $
+#
+ISODIR ?= /usr/release
+ISOFILE ?= ${ISODIR}/dfly.iso
+ISOROOT = ${ISODIR}/root
+OBJSYS= ${.OBJDIR}/../sys
+KERNCONF ?= GENERIC
+
+.if !exists(/usr/local/bin/mkisofs)
+.error "You need to install the mkisofs port so I can build the ISO"
+.endif
+.if !exists(/usr/local/bin/cvsup)
+.error "You need to install the cvsup port so I can put cvsup in the ISO"
+.endif
+
+release:       clean buildworld1 buildkernel1 buildiso mkiso
+
+quickrel:      clean buildworld2 buildkernel2 buildiso mkiso
+
+realquickrel:  clean buildiso mkiso
+
+buildworld1:
+       ( cd ${.CURDIR}/..; make buildworld )
+
+buildworld2:
+       ( cd ${.CURDIR}/..; make -DNOTOOLS -DNOCLEAN buildworld )
+
+buildkernel1:
+       ( cd ${.CURDIR}/..; make buildkernel KERNCONF=${KERNCONF} )
+
+buildkernel2:
+       ( cd ${.CURDIR}/..; make -DNOCLEAN buildkernel KERNCONF=${KERNCONF} )
+
+buildiso:
+       if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
+       ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
+       ( cd ${.CURDIR}/../etc; make DESTDIR=${ISOROOT} distribution )
+       cpdup -X cpignore -o ${.CURDIR}/root ${ISOROOT} -vv
+       ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
+               installkernel KERNCONF=${KERNCONF} )
+       mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
+       mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
+       dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
+       cp /usr/local/bin/mkisofs ${ISOROOT}
+       cp /usr/local/man/man8/mkisofs.8.gz ${ISOROOT}/usr/local/man/man8
+       cp /usr/local/bin/cvsup ${ISOROOT}
+       cp /usr/local/man/man1/cvsup.1.gz ${ISOROOT}/usr/local/man/man1
+
+mkiso:
+       ( cd ${ISOROOT}; mkisofs -b boot/cdboot -no-emul-boot \
+               -r -J -V DragonFly -o ${ISOFILE} . )
+
+clean:
+       if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
+       if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}; fi
+
+realclean:     clean
+       rm -rf ${OBJSYS}/GENERIC
+
+.include <bsd.prog.mk>
diff --git a/nrelease/root/boot/loader.conf b/nrelease/root/boot/loader.conf
new file mode 100644 (file)
index 0000000..662cdcf
--- /dev/null
@@ -0,0 +1,2 @@
+# $DragonFly: src/nrelease/root/boot/loader.conf,v 1.1 2003/12/01 09:59:45 dillon Exp $
+kernel_options="-C"
diff --git a/nrelease/root/cpignore b/nrelease/root/cpignore
new file mode 100644 (file)
index 0000000..5556b90
--- /dev/null
@@ -0,0 +1,3 @@
+# $DragonFly: src/nrelease/root/cpignore,v 1.1 2003/12/01 09:59:44 dillon Exp $
+cpignore
+CVS
diff --git a/nrelease/root/etc/fstab b/nrelease/root/etc/fstab
new file mode 100644 (file)
index 0000000..e2d36a5
--- /dev/null
@@ -0,0 +1,9 @@
+# $DragonFly: src/nrelease/root/etc/fstab,v 1.1 2003/12/01 09:59:46 dillon Exp $
+#
+# Device               Mountpoint      FStype  Options         Dump    Pass#
+/dev/acd0a             /               cd9660  ro,noauto       0       0
+swap                   /var            mfs     rw,-C,-s=8192   0       0
+swap                   /tmp            mfs     rw,-C,-s=8192   0       0
+swap                   /etc            mfs     rw,-C,-s=8192   0       0
+swap                   /dev            mfs     rw,-C,-s=8192,-i=512 0  0
+proc                   /proc           procfs  rw              0       0