Break apart cryptsetup stuff into separate append_luks() and make append_auxillary...
authorAndrew Gaffney <agaffney@gentoo.org>
Mon, 17 Nov 2008 16:25:04 +0000 (10:25 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Mon, 17 Nov 2008 16:25:04 +0000 (10:25 -0600)
ChangeLog
gen_initramfs.sh

index 5c93c1c4915b650bc813340e39efdc209b27f3d4..5caa35bb2e79417941c4c4a71f3b8e211c7e452c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney
 # Distributed under the GPL v2
 
+  17 Nov 2008; Andrew Gaffney <agaffney@gentoo.org> gen_initramfs.sh:
+  Break apart cryptsetup stuff into separate append_luks() and make
+  append_auxillary() dependent on ${BUSYBOX} for gentoo bug #247052
+
   15 Nov 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/linuxrc:
   Applied patch for UUID support for real_resume= from gentoo bug #239687
 
index 8558ff91212500aefbdc7d62f7816b654ff8eb14..73e30e68a537d154f57340a993dca558fbe838a2 100644 (file)
@@ -280,6 +280,39 @@ append_overlay(){
        find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
 }
 
+append_luks() {
+       if [ -d "${TEMP}/initramfs-luks-temp" ]
+       then
+               rm -r "${TEMP}/initramfs-luks-temp/"
+       fi
+       mkdir -p "${TEMP}/initramfs-luks-temp/lib/luks"
+       cd "${TEMP}/initramfs-luks-temp"
+       if isTrue ${LUKS}
+       then
+               if is_static /bin/cryptsetup
+               then
+                       print_info 1 "Including LUKS support"
+                       rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
+                       cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
+                       chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
+               elif is_static /sbin/cryptsetup
+               then
+                       print_info 1 "Including LUKS support"
+                       rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
+                       cp /sbin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
+               chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
+
+               else
+                       print_info 1 "LUKS support requires static cryptsetup at /bin/cryptsetup or /sbin/cryptsetup"
+                       print_info 1 "Not including LUKS support"
+               fi
+       fi
+       find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+               || gen_die "appending cryptsetup to cpio"
+       cd "${TEMP}"
+       rm -r "${TEMP}/initramfs-luks-temp/"
+}
+
 append_firmware() {
        if [ -z "${FIRMWARE_FILES}" -a ! -d "${FIRMWARE_DIR}" ]
        then
@@ -436,26 +469,6 @@ append_auxilary() {
        then
                echo 'MY_HWOPTS="${MY_HWOPTS} slowusb"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
        fi
-       if isTrue ${LUKS}
-       then
-               if is_static /bin/cryptsetup
-               then
-                       print_info 1 "Including LUKS support"
-                       rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
-                       cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
-                       chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
-               elif is_static /sbin/cryptsetup
-               then
-                       print_info 1 "Including LUKS support"
-                       rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
-                       cp /sbin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
-               chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
-
-               else
-                       print_info 1 "LUKS support requires static cryptsetup at /bin/cryptsetup or /sbin/cryptsetup"
-                       print_info 1 "Not including LUKS support"
-               fi
-       fi
 
        cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
        cd ${TEMP}
@@ -489,12 +502,13 @@ create_initramfs() {
                || gen_die "Could not create empty cpio at ${CPIO}"
 
        append_data 'base_layout'
-       append_data 'auxilary'
+       append_data 'auxilary' "${BUSYBOX}"
        append_data 'busybox' "${BUSYBOX}"
        append_data 'lvm' "${LVM}"
        append_data 'dmraid' "${DMRAID}"
        append_data 'evms' "${EVMS}"
        append_data 'mdadm' "${MDADM}"
+       append_data 'luks' "${LUKS}"
        
        if [ "${NORAMDISKMODULES}" -eq '0' ]
        then