From eugen@kost.svzserv.kemerovo.su  Tue Feb 14 15:26:21 2006
Return-Path: <eugen@kost.svzserv.kemerovo.su>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C8A5C16A420;
	Tue, 14 Feb 2006 15:26:21 +0000 (GMT)
	(envelope-from eugen@kost.svzserv.kemerovo.su)
Received: from kost.svzserv.kemerovo.su (kost.svzserv.kemerovo.su [213.184.65.82])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0A2CC43D46;
	Tue, 14 Feb 2006 15:26:20 +0000 (GMT)
	(envelope-from eugen@kost.svzserv.kemerovo.su)
Received: from kost.svzserv.kemerovo.su (localhost [127.0.0.1])
	by kost.svzserv.kemerovo.su (8.13.4/8.13.4) with ESMTP id k1EFPpLQ050517;
	Tue, 14 Feb 2006 22:25:51 +0700 (KRAT)
	(envelope-from eugen@kost.svzserv.kemerovo.su)
Received: (from eugen@localhost)
	by kost.svzserv.kemerovo.su (8.13.4/8.13.3/Submit) id k1EFPp4l050516;
	Tue, 14 Feb 2006 22:25:51 +0700 (KRAT)
	(envelope-from eugen)
Message-Id: <200602141525.k1EFPp4l050516@kost.svzserv.kemerovo.su>
Date: Tue, 14 Feb 2006 22:25:51 +0700 (KRAT)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: phk@freebsd.org
Subject: make more flexibitily for NanoBSD customization
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93341
>Category:       misc
>Synopsis:       [nanobsd] [patch] make more flexibitily for NanoBSD customization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 14 15:30:04 GMT 2006
>Closed-Date:    Wed Sep 02 19:51:27 UTC 2009
>Last-Modified:  Wed Sep 02 19:51:27 UTC 2009
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
Svyaz-Service JSC
>Environment:
System: FreeBSD kost.svzserv.kemerovo.su 6.0-STABLE FreeBSD 6.0-STABLE #7: Tue Jan 24 06:22:29 KRAT 2006 eugen@ws092.svzserv.kemerovo.su:/usr/obj/usr/src/sys/TEST i386

>Description:

	All I ask for is the following patch:

--- src/tools/tools/nanobsd/nanobsd.sh.orig	Sat Jan 14 14:02:50 2006
+++ src/tools/tools/nanobsd/nanobsd.sh	Tue Feb 14 18:42:38 2006
@@ -546,8 +546,8 @@
 install_etc
 install_kernel
 
-run_customize
 setup_nanobsd
+run_customize
 prune_usr
 create_${NANO_ARCH}_diskimage
 

	It makes it possible for customization commands
	to use/modify files in conf/base/* and conf/default/*
	directories created by setup_nanobsd section.
	And more generally, gives more control over resulting image
	to customizing scripts.

>How-To-Repeat:

	Try to add conf/default/var/remount to the image if needed.
	Try to modify conf/base/etc/fstab during during customization stage.
	It's quite hard with current nanobsd.sh script and trivial
	with the patch suggested.

>Fix:

	Apply the patch above.
>Release-Note:
>Audit-Trail:
Adding to audit trail from misfiled PR misc/93376:

Date: Wed, 15 Feb 2006 08:33:18 +0000
From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
 >
 >	It makes it possible for customization commands
 >	to use/modify files in conf/base/* and conf/default/*
 >	directories created by setup_nanobsd section.
 >	And more generally, gives more control over resulting image
 >	to customizing scripts.
 
 Is this as straightforward as that ?
 
 If in customize you run things that for instance add a user, there
 is a good chance that you will add the user in /etc but in the
 process break the link to /conf/base and thus after all not getting
 the user into the nanobsd image ?
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Wed Feb 15 08:57:59 UTC 2006 
Responsible-Changed-Why:  
To NanoBSD's maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93341 

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc: phk@freebsd.org
Subject: Re: misc/93341: make more flexibitily for NanoBSD customization
Date: Thu, 16 Feb 2006 22:52:38 +0700

 >>      It makes it possible for customization commands
 >>      to use/modify files in conf/base/* and conf/default/*
 >>      directories created by setup_nanobsd section.
 >>      And more generally, gives more control over resulting image
 >>      to customizing scripts.
 
 > Is this as straightforward as that ?
 >
 > If in customize you run things that for instance add a user, there
 > is a good chance that you will add the user in /etc but in the
 > process break the link to /conf/base and thus after all not getting
 > the user into the nanobsd image ?
 
 I prefer to place local overrides to users database to 3rd slice
 after nanobsd.sh has completed an image.
 
 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} -y ${NANO_HEADS}`
 mount /dev/${MD}s3 /mnt/tmp
 rm -rf /mnt/tmp/*
 cp -rp /path/to/local/etc/* /mnt/tmp || true
 umount /mnt/tmp
 
 Also I'd like to create 4th slice to keep arpwatch database
 in /var/arpwatch. With the patch proposed this is as easy as:
 
 #!/bin/sh
 # NANOBSD_CUSTOMIZE script needed when NANO_DATASIZE is not zero
 
 cd "$NANO_WORLDDIR"
 rm -rf data
 mkdir data
 echo "mount -o ro /dev/${NANO_DRIVE}s4" > conf/default/var/remount
 
 cd conf/base/etc
 { fgrep -v /dev/${NANO_DRIVE}s4 fstab
   echo /dev/${NANO_DRIVE}s4 /data ufs rw,noauto 2 2
 } > fstab.new
 mv fstab.new fstab
 # EOF
 
 
 Without the patch one needs to mdconfig/mount and correct
 both images, _.disk.full and _.disk.image.
 With the patch it's quite more easy.
 
 Eugene

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: misc/93341: [nanobsd] [patch] make more flexibitily for NanoBSD customization
Date: Thu, 3 Sep 2009 00:53:48 +0800

 Hi!
 
 This PR is obsoleted more than year ago with revision 1.34 of nanobsd.sh
 that introduced late customize hooks. The feature was MFC'd to RELENG_7 too.
 
 This PR should be closed.
 
 Eugene Grosbein
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Wed Sep 2 19:51:11 UTC 2009 
State-Changed-Why:  
As instructed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93341 
>Unformatted:
