aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gaffney <agaffney@gentoo.org>2008-11-17 10:25:04 -0600
committerAndrew Gaffney <agaffney@gentoo.org>2008-11-17 10:25:04 -0600
commit967899176d53e797adb17b1b3dc8c7575b4bba8b (patch)
tree6a625a57548b77a29abfd204d0a08d67527c12a8 /gen_initramfs.sh
parentApplied patch for UUID support for real_resume= from gentoo bug #239687 (diff)
downloadgenkernel-967899176d53e797adb17b1b3dc8c7575b4bba8b.tar.gz
genkernel-967899176d53e797adb17b1b3dc8c7575b4bba8b.tar.bz2
genkernel-967899176d53e797adb17b1b3dc8c7575b4bba8b.zip
Break apart cryptsetup stuff into separate append_luks() and make append_auxillary() dependent on ${BUSYBOX} for gentoo bug #247052
Diffstat (limited to 'gen_initramfs.sh')
-rw-r--r--gen_initramfs.sh56
1 files changed, 35 insertions, 21 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 8558ff91..73e30e68 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