base-files: force remount ext4 rootfs

This commit is contained in:
Miles Poupart 2023-11-13 09:13:36 +08:00 committed by GitHub
parent ba50d0a481
commit c5e3380c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,10 @@ do_mount_root() {
mount_root
boot_run_hook preinit_mount_root
[ ! -f /etc/bench.log ] && touch /etc/bench.log
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