conf/158127: [patch] remount_optional option in rc.initdiskless
doesn't actually work
brian at maven-group.org
Tue Jun 21 16:00:28 UTC 2011
>Synopsis: [patch] remount_optional option in rc.initdiskless doesn't actually work
>Arrival-Date: Tue Jun 21 16:00:22 UTC 2011
>Originator: Brian Olsen
FreeBSD mail.vagtelhave.dk 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Tue Jun 21 07:23:33 CEST 2011 root at lacuna-dev.maven-group.org:/usr/obj/freakbsd.lacuna/usr/src/sys/GENERIC i386
When trying to use the remount_optional option on a nanobsd like build that was going to run from an iso image with an optional remount of /dev/ufs/cfg onto /conf/default/etc I discovered that it doesn't actually work.
When remount_optional is present it will always print the error message "mount -o ro /dev/ufs/cfg /conf/default/etc failed: ignoring due to remount_optional" even when the mount succeeds. And when the mount fails it still drops into a shell.
A simple fix to the problem is attached.
Patch attached with submission follows:
--- /etc/rc.initdiskless 2011-02-18 02:52:09.000000000 +0100
+++ etc/rc.initdiskless 2011-06-21 17:15:21.000000000 +0200
@@ -166,14 +166,17 @@
lastitem () ( n=$(($# - 1)) ; shift $n ; echo $1 )
- [ -r $mountpoint/remount_optional ] && ( echo "$2 failed: ignoring due to remount_optional" ; return )
case $1 in
- echo "$2 failed: dropping into /bin/sh"
- # RESUME
+ if [ -r $mountpoint/remount_optional ] ; then
+ echo "$2 failed: ignoring due to remount_optional"
+ echo "$2 failed: dropping into /bin/sh"
+ # RESUME
More information about the freebsd-bugs