etcupdate -p vs. root on zfs (and bectl use and such): no /usr/src/etc/master.passwd (for example)

Mark Millard marklmi at
Fri Apr 23 07:39:23 UTC 2021

FYI: The default bsdinstall result for auto ZFS that I tried
has a separate zroot/usr/src dataset, which zfs mounts at
/usr/src .

UPDATING and such places indicate sequences like:
(think etcupdate where it lists mergemaster and ignore
-F and -Fi)

	<make sure you have good level 0 dumps>
	make buildworld
	make installkernel KERNCONF=YOUR_KERNEL_HERE
	<reboot in single user>				[3]
	mergemaster -Fp					[5]
NOTE: What /usr/src/etc/master.passwd here? (for example)
	make installworld
	mergemaster -Fi					[4]
	make delete-old					[6]

etcupdate has the logic for handling -p:

        if [ -n "$preworld" ]; then
                # Build a limited tree that only contains files that are
                # crucial to installworld.
                for file in $PREWORLD_FILES; do
                        name=$(basename $file)
                        mkdir -p $1/etc >&3 2>&1 || return 1
                        cp -p $SRCDIR/$file $1/etc/$name || return 1

Note the "$SRCDIR/$file". But for a boot -s after
installing the kernel there is only zroot/ROOT/NAME
and no zroot/usr/src zfs mount so /usr/src/ is empty.

This leads to needing an additional step:

zfs mount zroot/usr/src

(The instructions do not deal with making / writable at this
stage either.)

Mark Millard
marklmi at
( went
away in early 2018-Mar)

More information about the freebsd-current mailing list