Booted nanobsd image has /etc schg flag set

Michael Reifenberger mike at reifenberger.com
Mon Mar 28 06:54:48 UTC 2011


Hi,

I've tracked this down:

- Because on the building host /var/empty (comes from BSD.var.dist) has schg set
   it gets copied to the cfg slice during populate_slice() in nanobsd.sh
- During boot /cfg gets copied over to /etc and the schg flag too
- After that neither /cfg nor /etc are fully functional...

I'll commit the following fix:
...
Index: nanobsd.sh
===================================================================
--- nanobsd.sh  (Revision 219862)
+++ nanobsd.sh  (Arbeitskopie)
@@ -413,8 +413,8 @@
         dir=$2
         mnt=$3
         lbl=$4
-       test -z $2 && dir=/var/empty
-       test -d $dir || dir=/var/empty
+       test -z $2 && dir=${NANO_WORLDDIR}/var/empty
+       test -d $dir || dir=${NANO_WORLDDIR}/var/empty
         echo "Creating ${dev} with ${dir} (mounting on ${mnt})"
         newfs_part $dev $mnt $lbl
         cd ${dir}
...

On Sat, 26 Mar 2011, Michael Reifenberger wrote:

> Date: Sat, 26 Mar 2011 18:25:40 +0100 (CET)
> From: Michael Reifenberger <mike at reifenberger.com>
> To: FreeBSD-Current <current at freebsd.org>
> Subject: Booted nanobsd image has /etc schg flag set
> 
> Hi,
> I can't find the place where the schg flag is set for /etc
> during boot.
> (Must be during boot since the FS inside the image doesn't contain a schg 
> flagged file)
> /var which is also a MFS FS hasn't schg set.
>
> This prevents the creation of new files like resolv.conf or host.conf
> after startup...
>
> Bye/2
> ---
> Michael Reifenberger
> Michael at Reifenberger.com
> http://www.Reifenberger.com
>
>

Bye/2
---
Michael Reifenberger
Michael at Reifenberger.com
http://www.Reifenberger.com



More information about the freebsd-current mailing list