Am Montag, 19. Mai 2008 00:51:34 schrieb Jörg Sommer:
> I would like to give the -C and the -y option for the fsck call. And
> maybe you should consider the fsck call is a shell command, i.e. I would
> like to do something like: !on_ac_power || fsck -C -y -p %(FSCKTARGET)
>
> Otherwise the user can't login, if the fsck fails. He can't repair it,
> because he doesn't own the device. Removing the -p option or adding the
> -y option would help.
Here is an experimental patch adding a custom fsck option to mount.crypt. Just 
specify <volume options="exec,nodev,fsck=myfsck" ...> in pam_mount.conf.xml 
to set a custom fsck command.

Regards,
  Bastian
--- /sbin/mount.crypt.orig	2008-05-19 14:34:09.564151545 +0200
+++ /sbin/mount.crypt	2008-05-19 20:18:14.754767519 +0200
@@ -96,6 +96,7 @@
 luks_ro="";
 LOOP=false
 DOFSCK=false;
+FSCK="fsck"
 MOUNTOPTIONS=""
 OLDIFS="$IFS";
 IFS=", ";
@@ -109,7 +110,11 @@
 		(keysize) KEYSIZE="$VAL";;
 		(hash)    HASH="$VAL";;
 		(fstype)  FSTYPE="$VAL";;
-		(fsck)    DOFSCK="true";;
+		(fsck)	DOFSCK="true";
+			if [ -n "$VAL" ]; then
+				FSCK="$VAL";
+			fi
+			;;
 		(keyfile)
 			keyfile="$VAL";;
 		(loop)
@@ -183,7 +188,7 @@
 fi;
 
 if [ "$DOFSCK" == "true" ]; then
-	fsck -p "/dev/mapper/$DMDEVICE";
+	"$FSCK" -p "/dev/mapper/$DMDEVICE";
 	if [ $? -gt 1 ]; then
 		echo "${0##*/}: filesystem $DMDEVICE has errors" >&2;
 		if [ "$LUKS" == true ]; then

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to