[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#783410: Please add support for fsck.mode= parameters as known by systemd-fsck



tag 783410 + patch
thanks

On Sun, 26 Apr 2015 21:36:39 +0200 Michael Biebl <biebl@debian.org> wrote:

Hi,

> systemd-fsck [1] knows the following kernel command line parameters
>
> fsck.mode=
>
> One of "auto", "force", "skip". Controls the mode of operation. The default > is "auto", and ensures that file system checks are done when the file system > checker deems them necessary. "force" unconditionally results in full file
> system checks. "skip" skips any file system checks.
>
> fsck.repair=
>
> One of "preen", "yes", "no". Controls the mode of operation. The default is > " preen", and will automatically repair problems that can be safely fixed. "yes
> " will answer yes to all questions by fsck and "no" will answer no to all
> questions.
>
>
> Please consider adding support for those kernel command line parameters
> in initramfs-tools. Otherwise it's pretty confusing for users if the
> documentation as shipped by systemd doesn't really have the effect they
> expect.

Please find a patch that should fix this bug (not tested). The patch also fixes #792557.

Cheers,

Laurent Bigonville
>From a936e4dc397020d2c1db0cd0d70f08a9cf22b7da Mon Sep 17 00:00:00 2001
From: Laurent Bigonville <bigon@bigon.be>
Date: Sun, 15 Nov 2015 09:59:59 +0100
Subject: [PATCH] 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
---
 init              | 11 +++++++----
 scripts/functions |  5 ++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/init b/init
index abf7f25..6f41a7b 100755
--- a/init
+++ b/init
@@ -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
 
diff --git a/scripts/functions b/scripts/functions
index 8c1bb1f..a347264 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -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
-- 
2.6.2


Reply to: