--- /sbin/mkinitrd 2007-05-12 00:19:56.000000000 +0200 +++ mkinitrd 2007-05-26 23:07:06.000000000 +0200 @@ -45,6 +45,7 @@ -o Output image (default /boot/initrd.gz) -r Root partition device (must be used with -f) -s Initrd source tree (default /boot/initrd-tree/) + -C Add support for crypted partitions -V Display version number A simple example: Build an initrd for a reiserfs root partition: @@ -179,6 +180,9 @@ SOURCE_TREE="$2" shift 2 ;; + -C) + CRYPT=1 + shift *) # unknown, prevent infinite loop shift ;; @@ -206,6 +210,19 @@ INITRD_NAME=$(basename $OUTPUT_IMAGE) echo $INITRD_NAME > $SOURCE_TREE/initrd-name +# Include cryptsetup (LUKS) support in initrd +if [ ! -z "$CRYPT" ]; then + if [ -e /sbin/cryptsetup.static ]; then + mkdir -p $SOURCE_TREE/sbin + cp /sbin/cryptsetup.static $SOURCE_TREE/sbin/cryptsetup.static + ( cd $SOURCE_TREE/sbin + ln -s cryptsetup.static cryptsetup + ) + else + echo "Cryptsetup static binary is missing, CRYPT support isn't installed" + fi +fi + # Make module directory: if [ ! -d $SOURCE_TREE/lib/modules/$KERNEL_VERSION ]; then mkdir -p $SOURCE_TREE/lib/modules/$KERNEL_VERSION