base-files: force remount ext4 rootfs when power-off by accident last time

This commit is contained in:
coolsnowwolf 2023-03-29 18:32:18 +08:00
parent 5969d62e82
commit 0747f72a7f
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,10 @@ missing_lines() {
do_mount_root() {
mount_root
boot_run_hook preinit_mount_root
have_ro_ext4=$(/bin/cat /proc/mounts |/bin/grep ' / ext4'|/bin/grep 'ro'|/usr/bin/wc -l)
if [ "$have_ro_ext4" != "0" ]; then
/usr/bin/mount -o remount,rw,noatime /
fi
[ -f /sysupgrade.tgz -o -f /tmp/sysupgrade.tar ] && {
echo "- config restore -"
cp /etc/passwd /etc/group /etc/shadow /tmp