From owner-freebsd-current@FreeBSD.ORG Tue Nov 30 08:38:25 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47D2616A4CE for ; Tue, 30 Nov 2004 08:38:25 +0000 (GMT) Received: from protov.plain.co.nz (protov.plain.co.nz [202.36.174.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50EB143D67 for ; Tue, 30 Nov 2004 08:38:24 +0000 (GMT) (envelope-from andrew@fubar.geek.nz) Received: from localhost (localhost [127.0.0.1]) by protov.plain.co.nz (Postfix) with ESMTP id BEE93904CC for ; Tue, 30 Nov 2004 21:38:22 +1300 (NZDT) Received: from protov.plain.co.nz ([127.0.0.1]) by localhost (protov [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19870-01-62 for ; Tue, 30 Nov 2004 21:38:22 +1300 (NZDT) Received: from serv.int.fubar.geek.nz (ppp65196.cyberxpress.co.nz [202.49.65.196]) by protov.plain.co.nz (Postfix) with ESMTP id B969690F6F for ; Tue, 30 Nov 2004 21:38:17 +1300 (NZDT) Received: from [192.168.1.99] (unknown [192.168.1.99]) by serv.int.fubar.geek.nz (Postfix) with ESMTP id A077C6124 for ; Tue, 30 Nov 2004 21:38:34 +1300 (NZDT) Message-ID: <41AC315D.4040409@fubar.geek.nz> Date: Tue, 30 Nov 2004 21:37:49 +1300 From: Andrew Turner User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD Current Content-Type: multipart/mixed; boundary="------------050000090203090406070004" X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cyberxpress.co.nz Subject: Live FreeBSD CD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2004 08:38:25 -0000 This is a multi-part message in MIME format. --------------050000090203090406070004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Using nanobsd as a starting point I have created a live CD system I've named liveFreeBSD. It requires syutils/cdrtools to create liveFreeBSD.iso. Unlike FreeBSIE it only uses files from the tree with 3 exceptions. To use run the shell archive and set WORLDDIR to an appropriate value ie. /usr/src. It works in a similar way to nanobsd with the exception of the way it is customised. To customise liveFreeBSD create a new directory then have CUSTOMIZE point to it. If there is a make.conf file in it liveFreeBSD will pick it up and use it in the came way as an /etc/make.conf. Any directories will have their contents copied. eg. $ find /home/andrew/FreeBSD -type f /home/andrew/FreeBSD/etc/test1.txt /home/andrew/FreeBSD/make.conf $ make obj $ make CUSTOMIZE=/home/andrew/FreeBSD Will build the bootable CD with the file /etc/test1.txt. It will bring in any Makefile options from /home/andrew/FreeBSD/make.conf I have tested this on HEAD and RELENG_5. KNOWN BUGS: * Customize will only copy files 1 level deep, ie. ${CUSTOMIZE}/etc/ but not ${CUSTOMIZE}/usr/share/ Andrew -- 437742420 --------------050000090203090406070004 Content-Type: text/plain; name="livefreebsd.shar" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="livefreebsd.shar" # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # Makefile # etc # make.conf # echo x - Makefile sed 's/^X//' >Makefile << 'END-of-Makefile' X# Copyright (c) 2003-2004 Poul-Henning Kamp. X# Copyright (c) 2004 Thomas Quinot. X# Copyright (c) 2004 Andrew Turner. X# X# See /usr/share/examples/etc/bsd-style-copyright for license terms. X# X# $FreeBSD: src/tools/tools/nanobsd/Makefile,v 1.8 2004/08/16 22:41:58 thomas Exp $ X X#.include "${.CURDIR}/make.conf" X X# parallism flag for make. XMAKEJ?= X X# You probably do not need to change these. XWORLDDIR?= ${.CURDIR}/../../.. XWD?= ${.OBJDIR}/_.w X X# Keep overides for custom builds in the ${.CURDIR}/${CUSTOMIZE} directory X#CUSTOMIZE?=test X X.if defined(CUSTOMIZE) && !empty(CUSTOMIZE) X.if ${CUSTOMIZE:C/^\/.*$/\//} == "/" XCUSTOMIZE_PATH=${CUSTOMIZE} X.elif exists(${.CURDIR}/${CUSTOMIZE}) XCUSTOMIZE_PATH=${.CURDIR}/${CUSTOMIZE} X.endif X.endif X X.if exists(${CUSTOMIZE_PATH}/make.conf) XMAKE_CONF_INCLUDE=${CUSTOMIZE_PATH}/make.conf X.include "${MAKE_CONF_INCLUDE}" X.endif X X# X# The final resulting image is in ${.OBJDIR}/_.i and the single slice X# image in ${.OBJDIR}/_.i.s1 X# X X# Main target Xall: buildworld installworld buildimage X X# X# This is where you customizations to the image can be performed X# Please make sure to do everything relative to ${WD} here. X# X.if defined(CUSTOMIZE_PATH) XPATHS!= find ${CUSTOMIZE_PATH} -type d -depth 1 X.endif X XCustomize: _.cs X_.cs: _.iw _.di _.ik _.di X.if defined(CUSTOMIZE_PATH) X.for __DIR in ${PATHS} X @echo ${WD}${__DIR:S/${CUSTOMIZE_PATH}//} X mkdir -p ${WD}${__DIR:S/${CUSTOMIZE_PATH}//} X -cp ${__DIR}/* ${WD}/${__DIR:S/${CUSTOMIZE_PATH}//} X.endfor X.endif X touch _.cs X X########################################################################### X# X# The rest is pretty (or ugly if you prefer) magic, and should generally X# not need to be fiddled with. Good luck if you need to venture past this X# point. X# X X# Run a buildworld with our private make.conf Xbuildworld: _.bw X_.bw: X (cd ${WORLDDIR} && \ X make ${MAKEJ} -s buildworld __MAKE_CONF=${.CURDIR}/make.conf \ X MAKE_CONF_INCLUDE=${MAKE_CONF_INCLUDE} ) > _.bw.tmp 2>&1 X mv _.bw.tmp _.bw X X# Run installworld and install into our object directory Xinstallworld: _.iw X_.iw: _.bw X -rm -rf ${WD} > /dev/null 2>&1 X -chflags -R noschg ${WD} > /dev/null 2>&1 X rm -rf ${WD} X mkdir -p ${WD} X (cd ${WORLDDIR} && \ X make ${MAKEJ} -s installworld \ X DESTDIR=${WD} \ X __MAKE_CONF=${.CURDIR}/make.conf \ X MAKE_CONF_INCLUDE=${MAKE_CONF_INCLUDE} \ X ) > _.iw.tmp 2>&1 X mv _.iw.tmp _.iw X X# Run distribution target in /etc. X_.di: _.iw X mkdir -p ${WD} X (cd ${WORLDDIR}/etc && \ X make ${MAKEJ} -s distribution \ X DESTDIR=${WD} \ X __MAKE_CONF=${.CURDIR}/make.conf \ X MAKE_CONF_INCLUDE=${MAKE_CONF_INCLUDE} \ X ) > _.di.tmp 2>&1 X mv _.di.tmp _.di X X# Build kernel X_.bk: X (cd ${WORLDDIR} && \ X make ${MAKEJ} -s buildkernel \ X __MAKE_CONF=${.CURDIR}/make.conf \ X MAKE_CONF_INCLUDE=${MAKE_CONF_INCLUDE} \ X ) > _.bk.tmp 2>&1 X mv _.bk.tmp _.bk X X# Install kernel and hints file X_.ik: _.bk _.di X cp ${WORLDDIR}/sys/i386/conf/GENERIC.hints ${WD}/boot/device.hints X (cd ${WORLDDIR} && \ X make ${MAKEJ} installkernel \ X DESTDIR=${WD} \ X __MAKE_CONF=${.CURDIR}/make.conf \ X MAKE_CONF_INCLUDE=${MAKE_CONF_INCLUDE} \ X ) > _.ik.tmp 2>&1 X mv _.ik.tmp _.ik X X X# Create a disk image from the installed image Xbuildimage: _.md X_.md: _.cs X -umount ${WD}/dev > /dev/null 2>&1 X chflags -R noschg ${WD} > /dev/null 2>&1 X rm -rf ${WD}/var/* ${WD}/dev/* ${WD}/tmp X ln -s var/tmp ${WD}/tmp X cp ${.CURDIR}/etc/* ${WD}/etc X mkisofs -R -U -b boot/cdboot -no-emul-boot \ X -o liveFreeBSD.iso ${WD} X touch _.md X Xclean: X -rm -rf _.* > /dev/null 2>&1 X -chflags -R noschg _.* > /dev/null 2>&1 X rm -rf _.* liveFreeBSD.iso X X.include END-of-Makefile echo c - etc mkdir -p etc > /dev/null 2>&1 echo x - make.conf sed 's/^X//' >make.conf << 'END-of-make.conf' X# X# Copyright (c) 2003-2004 Poul-Henning Kamp. X# Copyright (c) 2004 Thomas Quinot. X# Copyright (c) 2004 Andrew Turner. X# X# See /usr/share/examples/etc/bsd-style-copyright for license terms. X# X# $FreeBSD: src/tools/tools/nanobsd/make.conf,v 1.3 2004/08/16 22:52:40 thomas Exp $ X# XKERNCONF?=GENERIC X X.if defined (MAKE_CONF_INCLUDE) && !empty(MAKE_CONF_INCLUDE) && exists(${MAKE_CONF_INCLUDE}) X.include "${MAKE_CONF_INCLUDE}" X.endif X END-of-make.conf # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # etc/fstab # etc/host.conf # etc/nsswitch.conf # echo x - etc/fstab sed 's/^X//' >etc/fstab << 'END-of-etc/fstab' X/dev/acd0 / cd9660 ro 0 0 X END-of-etc/fstab echo x - etc/host.conf sed 's/^X//' >etc/host.conf << 'END-of-etc/host.conf' X# Auto-generated from nsswitch.conf, do not edit Xhosts Xbind END-of-etc/host.conf echo x - etc/nsswitch.conf sed 's/^X//' >etc/nsswitch.conf << 'END-of-etc/nsswitch.conf' Xgroup: compat Xgroup_compat: nis Xhosts: files dns Xnetworks: files Xpasswd: compat Xpasswd_compat: nis Xshells: files END-of-etc/nsswitch.conf exit --------------050000090203090406070004--