Break apart cryptsetup stuff into separate append_luks() and make append_auxillary() dependent on ${BUSYBOX} for gentoo bug #247052

cleanup-cruft
Andrew Gaffney 16 years ago
parent a4d6260dd0
commit 967899176d

@ -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

@ -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

Loading…
Cancel
Save