From 8d2a6d25f34bce7302b489002cc94cfd756765cc Mon Sep 17 00:00:00 2001 From: Jo Zzsi Date: Sat, 6 Sep 2025 21:36:34 -0400 Subject: [PATCH] chore(rootfs-block, usrmount): align systemd and non-systemd initramfs `rootfs-block/mount-root.sh` and `srmount/mount-usr.sh ` are only included in the initramfs if systemd is _not_ included. `systemd` does not poke into `NEWROOT` to determine fsck options, which seems like a good idea. Let's do the same for non-systemd initramfs. Lot of the related path - e.g. `/etc/sysconfig/autofsck` are distribution specific anyways. --- modules.d/74rootfs-block/mount-root.sh | 32 +------------------------- modules.d/77usrmount/mount-usr.sh | 19 +-------------- 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/modules.d/74rootfs-block/mount-root.sh b/modules.d/74rootfs-block/mount-root.sh index 48687f66f..97c0c7f5d 100755 --- a/modules.d/74rootfs-block/mount-root.sh +++ b/modules.d/74rootfs-block/mount-root.sh @@ -27,36 +27,11 @@ mount_root() { done fsckoptions= - if [ -f "$NEWROOT"/etc/sysconfig/readonly-root ]; then - # shellcheck disable=SC1090 - . "$NEWROOT"/etc/sysconfig/readonly-root - fi - - if [ -f "$NEWROOT"/fastboot ]; then - fastboot=yes - fi if ! getargbool 0 rd.skipfsck; then - if [ -f "$NEWROOT"/fsckoptions ]; then - read -r fsckoptions < "$NEWROOT"/fsckoptions - fi - if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck; then + if getargbool 0 forcefsck; then fsckoptions="-f $fsckoptions" - elif [ -f "$NEWROOT"/.autofsck ]; then - # shellcheck disable=SC1090 - [ -f "$NEWROOT"/etc/sysconfig/autofsck ] \ - && . "$NEWROOT"/etc/sysconfig/autofsck - if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then - AUTOFSCK_OPT="$AUTOFSCK_OPT -f" - fi - if [ -n "$AUTOFSCK_SINGLEUSER" ]; then - warn "*** Warning -- the system did not shut down cleanly. " - warn "*** Dropping you to a shell; the system will continue" - warn "*** when you leave the shell." - emergency_shell - fi - fsckoptions="$AUTOFSCK_OPT $fsckoptions" fi fi @@ -110,11 +85,6 @@ mount_root() { info "Remounting ${root#block:} with -o ${rflags}" mount -o remount "$NEWROOT" 2>&1 | vinfo fi - - if ! getargbool 0 rd.skipfsck; then - [ -f "$NEWROOT"/forcefsck ] && rm -f -- "$NEWROOT"/forcefsck 2> /dev/null - [ -f "$NEWROOT"/.autofsck ] && rm -f -- "$NEWROOT"/.autofsck 2> /dev/null - fi } if [ -n "$root" ] && [ -z "${root%%block:*}" ]; then diff --git a/modules.d/77usrmount/mount-usr.sh b/modules.d/77usrmount/mount-usr.sh index 1de51bef3..ff9f13a3d 100755 --- a/modules.d/77usrmount/mount-usr.sh +++ b/modules.d/77usrmount/mount-usr.sh @@ -25,25 +25,8 @@ fsck_usr() { local _fsopts="$3" local _fsckoptions - if [ -f "$NEWROOT"/fsckoptions ]; then - read -r _fsckoptions < "$NEWROOT"/fsckoptions - fi - - if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck; then + if getargbool 0 forcefsck; then _fsckoptions="-f $_fsckoptions" - elif [ -f "$NEWROOT"/.autofsck ]; then - # shellcheck disable=SC1090 - [ -f "$NEWROOT"/etc/sysconfig/autofsck ] && . "$NEWROOT"/etc/sysconfig/autofsck - if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then - AUTOFSCK_OPT="$AUTOFSCK_OPT -f" - fi - if [ -n "$AUTOFSCK_SINGLEUSER" ]; then - warn "*** Warning -- the system did not shut down cleanly. " - warn "*** Dropping you to a shell; the system will continue" - warn "*** when you leave the shell." - emergency_shell - fi - _fsckoptions="$AUTOFSCK_OPT $_fsckoptions" fi fsck_single "$_dev" "$_fs" "$_fsopts" "$_fsckoptions" -- 2.47.3