Hello Harri,

Thanks for flagging this issue with cryptmount & chroot.

As per previous correspondence on bug#551533, I don't think this causes
failure of cryptmount's postinst script, but merely leads to modprobe reporting
that is was unable to run successfully.

Based on a recipe within the udev package, I've drafted a patch which should
avoid even this warning message. Perhaps you could try this patch,
and let me know whether it represents an acceptable solution?

        Regards,

                RW Penney

+--   on Sat, Dec 26, 2009 at 10:34:19PM +0100, Harald Dunkel wrote:   ---+
> Package: cryptmount
> Version: 4.0.2-1
> Severity: important
>
>
> Trying to update cryptount within a chroot (on an external
> disk) fails with:
>
> :
> Setting up cryptmount (4.0.2-1) ...
> Installing new version of config file /etc/init.d/cryptmount ...
> FATAL: Could not load /lib/modules/2.6.32.2/modules.dep: No such file or 
> directory
>
>
> Of course there is no kernel 2.6.32.2 in the chroot installed,
> but the official Debian kernel. The postinst script should not
> look at the the output of uname.
>
>
> Regards
>
> Harri
>
>
diff -Nuar cryptmount-4.0.2/debian/postinst cryptmount-patched/debian/postinst
--- cryptmount-4.0.2/debian/postinst	2009-08-07 05:52:53.000000000 +0100
+++ cryptmount-patched/debian/postinst	2010-01-10 14:09:56.000000000 +0000
@@ -19,9 +19,14 @@
 
 case "$1" in
     configure)
-	update-rc.d cryptmount-early start 26 S . stop 59 0 6 . > /dev/null
-	update-rc.d cryptmount defaults 28 > /dev/null
-	modprobe -q -a dm-mod dm-crypt || true
+        update-rc.d cryptmount-early start 26 S . stop 59 0 6 . > /dev/null
+        update-rc.d cryptmount defaults 28 > /dev/null
+
+        if [ -r /proc/1/root -a /proc/1/root/ -ef /proc/self/root/ ]; then
+            modprobe -q -a dm-mod dm-crypt || true
+        else
+            echo "A chroot environment has been detected - not running 'modprobe dm-crypt'"
+        fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Reply via email to