From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 21 19:00:38 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A619D16A4CF for ; Sat, 21 Aug 2004 19:00:38 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88E4D43D39 for ; Sat, 21 Aug 2004 19:00:38 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7LJ0bE1069700 for ; Sat, 21 Aug 2004 19:00:37 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7LJ0btG069695; Sat, 21 Aug 2004 19:00:37 GMT (envelope-from gnats) Resent-Date: Sat, 21 Aug 2004 19:00:37 GMT Resent-Message-Id: <200408211900.i7LJ0btG069695@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrea Campi Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9479E16A4CE for ; Sat, 21 Aug 2004 18:54:50 +0000 (GMT) Received: from sardine.webcom.it (gen053.n002.c03.escapebox.net [213.73.82.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F44043D39 for ; Sat, 21 Aug 2004 18:54:49 +0000 (GMT) (envelope-from andrea+freebsd@webcom.it) Received: from [213.140.17.96] (helo=brian) by webcom.it with asmtp (Exim 3.36 #1) id 1Byb0q-0007RR-00 for FreeBSD-gnats-submit@freebsd.org; Sat, 21 Aug 2004 18:54:48 +0000 Received: from andrea by webcom.it with asmtp (Exim 3.36 #1) id 1Byb0q-0007RR-00; Sat, 21 Aug 2004 18:54:48 +0000 Message-Id: <1093114488.0@brian> Date: Sat, 21 Aug 2004 20:54:48 +0200 From: Andrea Campi To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/70795: [PATCH] misc nanobsd fixes and improvements X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrea Campi List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2004 19:00:38 -0000 >Number: 70795 >Category: bin >Synopsis: [PATCH] misc nanobsd fixes and improvements >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 21 19:00:36 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Andrea Campi >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD brian 5.2-CURRENT FreeBSD 5.2-CURRENT #4: Thu Aug 19 08:28:23 CEST 2004 andrea@brian:/usr/obj/usr/src/sys/THINKPAD i386 >Description: There are a few minor issues with src/tools/tools/nanobsd: - Makefile: we remove ${WD}/var and recreate it empty from mtree. This gets in the way in multiple ways; even worse, it deletes any work done in the Customize stage. I propose to just copy it the way we do for ${WD}/etc. - customize.sh: I propose to create a /boot/loader.conf file to make the boot shorter. - i386.diskimage: CFGMASTER is assigned the $10 variable, but that is interpreted by the shell as ${1}0; fix it by properly quoting. make_fstab() creates an /etc/fstab file in the wrong place. > ow-To-Repeat: >How-To-Repeat: >Fix: Apply following patch: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -ur ./Makefile good/Makefile --- ./Makefile Mon Aug 16 22:41:58 2004 +++ good/Makefile Sat Aug 21 18:35:43 2004 @@ -144,11 +144,11 @@ _.md: _.cs -umount ${WD}/dev > /dev/null 2>&1 chflags -R noschg ${WD} > /dev/null 2>&1 - rm -rf ${WD}/var/* ${WD}/dev/* ${WD}/tmp + rm -rf ${WD}/dev/* ${WD}/tmp # create trigger file for etc/rc.d/initdiskless touch ${WD}/etc/diskless mkdir -p ${WD}/conf/base/var - mtree -deU -f ${WD}/etc/mtree/BSD.var.dist -p ${WD}/conf/base/var + ( cd ${WD}/var && find . -print | cpio -dumpl ../conf/base/var ) mkdir -p ${WD}/conf/base/etc ( cd ${WD}/etc && find . -print | cpio -dumpl ../conf/base/etc ) mkdir -p ${WD}/conf/default/etc diff -ur ./customize.sh good/customize.sh --- ./customize.sh Mon Aug 16 22:46:58 2004 +++ good/customize.sh Sat Aug 21 18:32:45 2004 @@ -25,6 +25,7 @@ sed -i "" -e /beastie/d ${WD}/boot/loader.rc sed -i "" -e /ttyd0/s/off/on/ ${WD}/etc/ttys echo " -h" > ${WD}/boot.config + echo 'autoboot_delay="1"' > ${WD}/boot/loader.conf } add_CURDIR() { diff -ur ./i386.diskimage good/i386.diskimage --- ./i386.diskimage Mon Aug 16 22:41:58 2004 +++ good/i386.diskimage Sat Aug 21 18:42:40 2004 @@ -25,14 +25,14 @@ CFGSLICE=$7 WD=$8 IMG=$9 -CFGMASTER=$10 +CFGMASTER=${10} TMPFILE0=`mktemp -t nanobsd` TMPFILE1=`mktemp -t nanobsd` TMPMNT=`mktemp -d -t nanobsd` make_fstab () { - echo "/dev/$1 / ufs ro 1 1" > ${WD}/etc/fstab + echo "/dev/$1 / ufs ro 1 1" > $2/etc/fstab } get_label () { @@ -75,7 +75,7 @@ newfs ${PRIROOTLABEL} -O1 -U ${MD}s1a mount /dev/${MD}s1a ${TMPMNT} (cd ${WD} && find . -print | cpio -dump ${TMPMNT}) || true -make_fstab ${PRIROOTSLICE} +make_fstab ${PRIROOTSLICE} ${TMPMNT} df ${TMPMNT} umount ${TMPMNT} @@ -86,7 +86,7 @@ tunefs ${ALTROOTLABEL} /dev/${MD}s2a fi mount /dev/${MD}s2a ${TMPMNT} -make_fstab ${ALTROOTSLICE} +make_fstab ${ALTROOTSLICE} ${TMPMNT} umount ${TMPMNT} # Prepare configuration slice diff -ur ./localfiles good/localfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bye, Andrea >Release-Note: >Audit-Trail: >Unformatted: