Support fsck.mode= and fsck.repair= parameters as known by systemd-fsck

This is also fixing the fact that fsckfix parameter was not honored

Note that -n is apparently not supported by fsck.minix

Closes: #783410, #792557
Signed-off-by: Laurent Bigonville <bigon@bigon.be>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Laurent Bigonville 2015-12-06 09:14:31 +01:00 committed by Ben Hutchings
parent 41eb6ac420
commit 27405fc423
2 changed files with 11 additions and 5 deletions

11
init
View File

@ -61,7 +61,7 @@ export resume_offset=
export drop_caps=
export fastboot=n
export forcefsck=n
export fsckfix=n
export fsckfix=
# Bring in the main config
@ -169,15 +169,18 @@ for x in $(cat /proc/cmdline); do
BOOTIF=*)
BOOTIF=${x#BOOTIF=}
;;
fastboot)
fastboot|fsck.mode=skip)
fastboot=y
;;
forcefsck)
forcefsck|fsck.mode=force)
forcefsck=y
;;
fsckfix)
fsckfix|fsck.repair=yes)
fsckfix=y
;;
fsck.repair=no)
fsckfix=n
;;
esac
done

View File

@ -358,9 +358,12 @@ _checkfs_once()
force=""
fi
if [ "$fsckfix" = yes ]
if [ "$fsckfix" = "y" ]
then
fix="-y"
elif [ "$fsckfix" = "n" ]
then
fix="-n"
else
fix="-a"
fi