From 488f20468ef41abacecd3baca937098d8fce5c41 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 11 Aug 2021 14:23:24 -0300 Subject: [PATCH] rc: Fix firstboot fs mount logic This change was introduced in 40adda8665bbcda1bad7e3a6a3c1031027faf39a, and partially fixed in 1ce07411fae8986f3acc293c9fb9ebee5211056a. Restore the ability to remove the firstboot_sentinel file on read-only mounted file systems. Pull Request: https://github.com/freebsd/freebsd-src/pull/524 --- libexec/rc/rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 35db4a85051626..f021251bbd81ae 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -137,16 +137,16 @@ done # Note: this assumes firstboot_sentinel is on / when we have # a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then - checkyesno root_rw_mount && mount -uw / + checkyesno root_rw_mount || mount -uw / chflags -R 0 ${firstboot_sentinel} rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - checkyesno root_rw_mount || mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - checkyesno root_rw_mount || mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo ''