From: Andrew Gaffney Date: Mon, 17 Nov 2008 16:25:04 +0000 (-0600) Subject: Break apart cryptsetup stuff into separate append_luks() and make append_auxillary... X-Git-Tag: v3.4.10.902~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=967899176d53e797adb17b1b3dc8c7575b4bba8b;p=genkernel.git Break apart cryptsetup stuff into separate append_luks() and make append_auxillary() dependent on ${BUSYBOX} for gentoo bug #247052 --- diff --git a/ChangeLog b/ChangeLog index 5c93c1c..5caa35b 100644 --- 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 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 defaults/linuxrc: Applied patch for UUID support for real_resume= from gentoo bug #239687 diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 8558ff9..73e30e6 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -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