summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2016-01-03 19:18:48 +0000
committerimp <imp@FreeBSD.org>2016-01-03 19:18:48 +0000
commitc6f9988dbb98057e7d99808130848ae301a204fd (patch)
tree6684c9bd993d6f5669dbf03912e6c4bb006764db /etc/rc
parente3d5f3b7b8186a06dfbbe22353568a1d8b8efb85 (diff)
downloadFreeBSD-src-c6f9988dbb98057e7d99808130848ae301a204fd.zip
FreeBSD-src-c6f9988dbb98057e7d99808130848ae301a204fd.tar.gz
Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked
up and can cause issues on boot with the prompts. Fix the read-only root case with horrible kludge of mounting rw removing the files, then mounting ro. But since that's no more horrible than the kludge of using marker files in /. With this change, NanoBSD configs can safely use /firstboot + growfs to produce minimal images that grow to the size of the card.
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/rc b/etc/rc
index 4efc293..2c90f38 100644
--- a/etc/rc
+++ b/etc/rc
@@ -131,11 +131,14 @@ done
# Remove the firstboot sentinel, and reboot if it was requested.
if [ -e ${firstboot_sentinel} ]; then
- rm ${firstboot_sentinel}
+ [ ${root_rw_mount} = "yes" ] || mount -uw /
+ /bin/rm ${firstboot_sentinel}
if [ -e ${firstboot_sentinel}-reboot ]; then
- rm ${firstboot_sentinel}-reboot
+ /bin/rm ${firstboot_sentinel}-reboot
+ [ ${root_rw_mount} = "yes" ] || mount -ur /
kill -INT 1
fi
+ [ ${root_rw_mount} = "yes" ] || mount -ur /
fi
echo ''
OpenPOWER on IntegriCloud