[Pkg-loop-aes-commits] r1319 - in /trunk/loop-aes-utils/debian: README initramfs-tools-conf initramfs-tools-hook loop-aes-utils.dirs rules

xam at users.alioth.debian.org xam at users.alioth.debian.org
Fri Nov 10 22:41:52 CET 2006


Author: xam
Date: Fri Nov 10 22:41:52 2006
New Revision: 1319

URL: http://svn.debian.org/wsvn/pkg-loop-aes/?sc=1&rev=1319
Log:
Apply v5 patch of initramfs integration by Lionel

Modified:
    trunk/loop-aes-utils/debian/README
    trunk/loop-aes-utils/debian/initramfs-tools-conf
    trunk/loop-aes-utils/debian/initramfs-tools-hook
    trunk/loop-aes-utils/debian/loop-aes-utils.dirs
    trunk/loop-aes-utils/debian/rules

Modified: trunk/loop-aes-utils/debian/README
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/README?rev=1319&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/README (original)
+++ trunk/loop-aes-utils/debian/README Fri Nov 10 22:41:52 2006
@@ -28,7 +28,8 @@
 
   This package integrates with initramfs-tools so that an initramfs
   created with initramfs-tools will be able to handle a root fs on an
-  encrypted (or not) loop device.
+  encrypted (or not) loop device. This needs initramfs-tools version
+  0.81 or later.
 
   This support is automatically enabled at initramfs creation time
   when your root device in /etc/fstab has a "loop=/dev/loopN"

Modified: trunk/loop-aes-utils/debian/initramfs-tools-conf
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/initramfs-tools-conf?rev=1319&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/initramfs-tools-conf (original)
+++ trunk/loop-aes-utils/debian/initramfs-tools-conf Fri Nov 10 22:41:52 2006
@@ -1,3 +1,54 @@
-# When the root is on loop-aes, cryptographic keys are in the
-# initramfs; hence restrict the umask.
-UMASK=0077
+get_rootoptions() {
+    [ -r /etc/fstab ] || return
+
+    grep '^[^#]' /etc/fstab | ( \
+	while read dev mount type options dump pass; do
+	    if [ "${mount}" = "/" ]; then
+		echo "rootoptions=\"${options}\""
+		return
+	    fi
+	done )
+}
+
+set_UMASK_p() {
+
+    case "${INITRAMFS_LOOPAES}" in
+	0|no|off)
+	    exit 1
+	    ;;
+	1|yes|on)
+	    ;;
+	auto|)
+	    ;;
+	*)
+	    echo "WARNING! (loop-aes) ignoring invalid INITRAMFS_LOOPAES value: '${INITRAMFS_LOOPAES}'" 1>&2
+    esac
+
+    local rootoptions
+    eval $(get_rootoptions)
+    [ -n "${rootoptions}" ] || return 1
+
+    local opt
+    local IFS=", "
+    for opt in $rootoptions; do
+	case "$opt" in
+	    gpgkey=*)
+		return 0
+		;;
+	    gpghome=*)
+		return 0
+		;;
+	esac
+    done
+    return 1
+}
+
+
+if set_UMASK_p; then
+    # When the root is on loop-aes with gnupg use, cryptographic keys
+    # may be in the initramfs; hence restrict the umask.
+    UMASK=0077
+fi
+
+unset set_UMASK_p get_rootoptions
+

Modified: trunk/loop-aes-utils/debian/initramfs-tools-hook
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/initramfs-tools-hook?rev=1319&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/initramfs-tools-hook (original)
+++ trunk/loop-aes-utils/debian/initramfs-tools-hook Fri Nov 10 22:41:52 2006
@@ -27,7 +27,7 @@
     auto|)
 	;;
     *)
-	echo "WARNING! (loop-aes) ignoring invalid INITRAMFS_LOOPAES value ${INITRAMFS_LOOPAES}" 1>&2
+	echo "WARNING! (loop-aes) ignoring invalid INITRAMFS_LOOPAES value: '${INITRAMFS_LOOPAES}'" 1>&2
 esac
 
 . /usr/share/initramfs-tools/hook-functions
@@ -43,7 +43,7 @@
 
     grep '^[^#]' /etc/fstab | ( \
 	while read dev mount type options dump pass; do
-	    if [ "$mount" = "/" ]; then
+	    if [ "${mount}" = "/" ]; then
 		echo "rootdev=\"${dev}\" rootoptions=\"${options}\""
 		return
 	    fi

Modified: trunk/loop-aes-utils/debian/loop-aes-utils.dirs
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/loop-aes-utils.dirs?rev=1319&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/loop-aes-utils.dirs (original)
+++ trunk/loop-aes-utils/debian/loop-aes-utils.dirs Fri Nov 10 22:41:52 2006
@@ -7,4 +7,4 @@
 /usr/share/lintian/overrides
 /usr/share/initramfs-tools/scripts/local-top
 /usr/share/initramfs-tools/hooks
-/etc/initramfs-tools/conf.d/
+/usr/share/initramfs-tools/conf.d

Modified: trunk/loop-aes-utils/debian/rules
URL: http://svn.debian.org/wsvn/pkg-loop-aes/trunk/loop-aes-utils/debian/rules?rev=1319&op=diff
==============================================================================
--- trunk/loop-aes-utils/debian/rules (original)
+++ trunk/loop-aes-utils/debian/rules Fri Nov 10 22:41:52 2006
@@ -67,7 +67,7 @@
 	# initramsfs-tools integration
 	install -m 755 debian/initramfs-tools-script $(DIR)/usr/share/initramfs-tools/scripts/local-top/loopaes
 	install -m 755 debian/initramfs-tools-hook $(DIR)/usr/share/initramfs-tools/hooks/loopaes
-	install -m 755 debian/initramfs-tools-conf $(DIR)/etc/initramfs-tools/conf.d/loopaes
+	install -m 755 debian/initramfs-tools-conf $(DIR)/usr/share/initramfs-tools/conf.d/loopaes
 
 binary-indep: build install
 




More information about the Pkg-loop-aes-commits mailing list