diff -U 20 -r genkernel-3.3.10/gen_cmdline.sh genkernel-3.3.10-patched/gen_cmdline.sh --- genkernel-3.3.10/gen_cmdline.sh 2005-12-18 15:29:26.000000000 +0000 +++ genkernel-3.3.10-patched/gen_cmdline.sh 2006-02-12 18:42:12.354311500 +0000 @@ -56,40 +56,42 @@ echo " --utils-as= Assembler to use for utils" echo " --utils-ld= Linker to use for utils" echo " --utils-make= GNU Make to use for utils" echo " --makeopts= Make options such as -j2, etc..." echo " --mountboot Mount /boot automatically" echo " --no-mountboot Don't mount /boot automatically" echo " Initialization" echo " --bootsplash= Force bootsplash using " echo " --gensplash= Force gensplash using " echo " --gensplash-res= Select gensplash resolutions" echo " --do-keymap-auto Forces keymap selection at boot" echo " --evms2 Include EVMS2 support" echo " --> 'emerge evms' in the host operating system first" echo " --lvm2 Include LVM2 support" # echo " --unionfs Include UNIONFS support" echo " --dmraid Include DMRAID support" echo " --bladecenter Enables extra pauses for IBM Bladecenter CD boots" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc= Specifies a user created linuxrc" echo " --disklabel Include disk label and uuid support in your initrd" + echo " --luks Include LUKS support" + echo " --> 'emerge cryptsetup-luks with -dynamic first" echo " Internals" echo " --arch-override= Force to arch instead of autodetect" echo " --cachedir= Override the default cache location" echo " --tempdir= Location of Genkernel's temporary directory" echo " --postclear Clear all tmp files and caches after genkernel has run" echo " Output Settings" echo " --kernname=<...> Tag the kernel and initrd with a name:" echo " If not defined the option defaults to 'genkernel'" echo " --minkernpackage= File to output a .tar.bz2'd kernel and initrd:" echo " No modules outside of the initrd will be" echo " included..." echo " --modulespackage= File to output a .tar.bz2'd modules after the callbacks have run" echo " --kerncache= File to output a .tar.bz2'd kernel," echo " contents of /lib/modules/ and the kernel config" echo " NOTE: This is created before the callbacks are run!" echo " --no-kernel-sources This option is only valid if kerncache is defined" echo " If there is a valid kerncache no checks will be made" echo " against a kernel source tree" echo " --initramfs-overlay=" echo " Directory structure to include in the initramfs," @@ -421,40 +423,44 @@ print_info 2 "CMD_NO_KERNEL_SOURCES: $CMD_NO_KERNEL_SOURCES" ;; --initramfs-overlay=*) CMD_INITRAMFS_OVERLAY=`parse_opt "$*"` print_info 2 "CMD_INITRAMFS_OVERLAY: $CMD_INITRAMFS_OVERLAY" ;; --linuxrc=*) CMD_LINUXRC=`parse_opt "$*"` print_info 2 "CMD_LINUXRC: $CMD_LINUXRC" ;; --genzimage) KERNEL_MAKE_DIRECTIVE_2='zImage.initrd' KERNEL_BINARY_2='arch/ppc/boot/images/zImage.initrd.chrp' GENERATE_Z_IMAGE=1 print_info 2 "GENERATE_Z_IMAGE: $GENERATE_Z_IMAGE" ;; --disklabel) CMD_DISKLABEL=1 print_info 2 "CMD_DISKLABEL: $CMD_DISKLABEL" ;; + --luks) + CMD_LUKS=1 + print_info 2 "CMD_LUKS: $CMD_LUKS" + ;; all) BUILD_KERNEL=1 BUILD_MODULES=1 BUILD_INITRD=1 ;; initrd) BUILD_INITRD=1 ;; kernel) BUILD_KERNEL=1 BUILD_MODULES=1 BUILD_INITRD=0 ;; bzImage) BUILD_KERNEL=1 BUILD_MODULES=0 BUILD_INITRD=1 CMD_NOINITRDMODULES=1 print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES" ;; diff -U 20 -r genkernel-3.3.10/gen_determineargs.sh genkernel-3.3.10-patched/gen_determineargs.sh --- genkernel-3.3.10/gen_determineargs.sh 2005-12-18 15:29:26.000000000 +0000 +++ genkernel-3.3.10-patched/gen_determineargs.sh 2006-02-12 18:51:39.005725000 +0000 @@ -43,40 +43,45 @@ UTS_RELEASE=`grep UTS_RELEASE ${KERNEL_DIR}/include/linux/version.h | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'` LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"` KV=${VER}.${PAT}.${SUB}${EXV}${LOV} else LCV=`grep ^CONFIG_LOCALVERSION= ${KERNEL_DIR}/.config | sed -r -e "s/.*=\"(.*)\"/\1/"` KV=${VER}.${PAT}.${SUB}${EXV}${LCV} fi else KERN_24=1 KV=${VER}.${PAT}.${SUB}${EXV} fi fi if isTrue "${CMD_DISKLABEL}" then DISKLABEL=1 else DISKLABEL=0 fi + + if isTrue "${CMD_LUKS}" + then + LUKS=1 + fi } determine_real_args() { if [ "${CMD_DEBUGFILE}" != '' ] then DEBUGFILE="${CMD_DEBUGFILE}" fi if [ "${CMD_MAKEOPTS}" != '' ] then MAKEOPTS="${CMD_MAKEOPTS}" fi if [ "${CMD_KERNELDIR}" != '' ] then KERNEL_DIR=${CMD_KERNELDIR} else KERNEL_DIR=${DEFAULT_KERNEL_SOURCE} fi diff -U 20 -r genkernel-3.3.10/gen_initramfs.sh genkernel-3.3.10-patched/gen_initramfs.sh --- genkernel-3.3.10/gen_initramfs.sh 2005-12-18 15:29:28.000000000 +0000 +++ genkernel-3.3.10-patched/gen_initramfs.sh 2006-02-12 18:52:37.725394750 +0000 @@ -406,40 +406,52 @@ echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" done echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" if [ -f "${GK_SHARE}/${ARCH}/modprobe" ] then cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" else cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" fi if isTrue $CMD_DOKEYMAPAUTO then echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults fi mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps" /bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz" if isTrue $CMD_BLADECENTER then echo 'MY_HWOPTS="${MY_HWOPTS} bladecenter"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults fi + + #LUKS support by cvalente + if isTrue ${LUKS} + then + print_info "Including LUKS support" + [ -e /bin/cryptsetup ] || gen_die "LUKS support requires static cryptsetup at /bin/cryptsetup" + 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" + else + print_info "Not including LUKS support" + fi cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init cd ${TEMP} chmod +x "${TEMP}/initramfs-aux-temp/init" chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" cd "${TEMP}/initramfs-aux-temp/" find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz rm -r "${TEMP}/initramfs-aux-temp/" } merge_initramfs_cpio_archives(){ cd "${CACHE_CPIO_DIR}" MERGE_LIST="initramfs-base-layout.cpio.gz initramfs-aux.cpio.gz" if [ ! -e "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz" ] then gen_die "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz is missing." fi if [ ! -e "${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz" ] diff -U 20 -r genkernel-3.3.10/gen_initrd.sh genkernel-3.3.10-patched/gen_initrd.sh --- genkernel-3.3.10/gen_initrd.sh 2005-12-18 15:29:28.000000000 +0000 +++ genkernel-3.3.10-patched/gen_initrd.sh 2006-02-12 18:05:17.243875750 +0000 @@ -195,40 +195,52 @@ cp -a /lib/evms/* "${TEMP}/initrd-temp/lib/evms" || gen_die 'Could not copy files for EVMS2!' cp -a /etc/evms.conf "${TEMP}/initrd-temp/etc" || gen_die 'Could not copy files for EVMS2!' cp /sbin/evms_activate "${TEMP}/initrd-temp/sbin/evms_activate" || gen_die 'Could not copy over evms_activate!' # Fix EVMS2 complaining that it cant find the swap utilities. # These are not required in the initrd for swap_libs in "${TEMP}/initrd-temp/lib/evms/*/swap*.so" do rm ${swap_libs} done fi fi for i in '[' ash basename cat chroot clear cp dirname echo env false find \ grep gunzip gzip ln ls loadkmap losetup lsmod mkdir mknod more mount mv \ pivot_root ps awk pwd rm rmdir rmmod sed sh sleep tar test touch true umount uname \ xargs yes zcat chmod chown cut kill killall; do rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null ln ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i || gen_die "Busybox error: could not link ${i}!" done + + if [ isTrue "${LUKS}" ] + then + print_info "Including LUKS support" + local luks_file="/bin/cryptsetup" + local luks_ifile="sbin/cryptsetup" + [ -e $luks_file ] || gen_die "LUKS support requires static cryptsetup at $luks_file" + rm -f ${TEMP}/initrd-temp/$luks_ifile + cp $luks_file ${TEMP}/initrd-temp/$luks_ifile + else + print_info "Not including LUKS support" + fi } print_list() { local x for x in ${*} do echo ${x} done } create_initrd_modules() { local group local group_modules if [ "${PAT}" -gt "4" ] then MOD_EXT=".ko" else MOD_EXT=".o" diff -U 20 -r genkernel-3.3.10/generic/linuxrc genkernel-3.3.10-patched/generic/linuxrc --- genkernel-3.3.10/generic/linuxrc 2005-12-18 15:29:28.000000000 +0000 +++ genkernel-3.3.10-patched/generic/linuxrc 2006-02-13 16:57:33.288364000 +0000 @@ -1,22 +1,24 @@ #!/bin/sh # Daniel Robbins +# Clemens Fruhwirth +# Cláudio Valente # Copyright 2003 Gentoo Technologies, Inc. # Distributed under the GPL . /etc/initrd.defaults . /etc/initrd.scripts splash() { return 0 } [ -e /etc/initrd.splash ] && . /etc/initrd.splash # Clean input/output exec >${CONSOLE} <${CONSOLE} 2>&1 if [ "$$" != '1' ] then echo '/linuxrc has to be run as the init process as the one' echo 'with a PID of 1. Try adding init="/linuxrc" to the' echo 'kernel command line or running "exec /linuxrc".' exit 1 @@ -368,40 +370,61 @@ then run_shell REAL_ROOT='' got_good_root=0 continue elif [ "${REAL_ROOT}" = '' ] then # No REAL_ROOT determined/specified. Prompt user for root block device. bad_msg "The root block device is unspecified or not detected." echo ' Please specify a device to boot, or "shell" for a shell...' echo -n 'boot() :: ' read REAL_ROOT got_good_root=0 # Check for a block device or /dev/nfs elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ] then got_good_root=1 + + #check if LUKS setup is needed + elif [ `echo ${REAL_ROOT} | sed -e "s/\([^:]*\):.*/\1/"` = "luks" ] + then + LUKSdev=`echo ${REAL_ROOT} | sed -e "s/luks:\(.*\)/\1/"` + if [ -e /sbin/cryptsetup ] + then + if cryptsetup isLuks ${LUKSdev} + then + good_msg "LUKS partition - opening $LUKSdev" + cryptsetup luksOpen ${LUKSdev} root && + REAL_ROOT=/dev/mapper/root && + got_good_root=1 + else + bad_msg "${LUKSDEV} is not a LUKS partition" + REAL_ROOT="" + fi + else + bad_msg "This initrd does not support LUKS" + REAL_ROOT="" + fi else bad_msg "Block device ${REAL_ROOT} is not a valid root device..." REAL_ROOT="" got_good_root=0 fi done if [ "${CDROOT}" -eq '1' -a "${got_good_root}" = '1' -a "${REAL_ROOT}" != "/dev/nfs" ] then # CD already mounted; no further checks necessary break elif [ "${LOOPTYPE}" = "sgimips" ] then # sgimips mounts the livecd root partition directly # there is no isofs filesystem to worry about break else good_msg "Mounting root..." Only in genkernel-3.3.10: genkernel.conf Only in genkernel-3.3.10-patched/pkg: %%ARCH%% Only in genkernel-3.3.10-patched/pkg: LVM2.2.00.25.tgz Only in genkernel-3.3.10-patched/pkg: busybox-1.00-rt-mdstart.plasmaroo.tar.bz2 Only in genkernel-3.3.10-patched/pkg: devfsd-1.3.25-dietlibc-kernel25.tar.bz2 Only in genkernel-3.3.10-patched/pkg: devfsd-1.3.25-dietlibc.patch Only in genkernel-3.3.10-patched/pkg: device-mapper.1.00.17.tgz Only in genkernel-3.3.10-patched/pkg: dmraid-1.0.0.rc9.tar.bz2 Only in genkernel-3.3.10-patched/pkg: e2fsprogs-1.38.tar.gz Only in genkernel-3.3.10-patched/pkg: klibc-1.1.1.tar.gz Only in genkernel-3.3.10-patched/pkg: module-init-tools-0.9.15-pre4.tar.bz2 Only in genkernel-3.3.10-patched/pkg: modutils-2.4.26.tar.bz2 Only in genkernel-3.3.10-patched/pkg: udev-077.tar.bz2 Only in genkernel-3.3.10-patched/pkg: unionfs-1.1.1.tar.gz Only in genkernel-3.3.10-patched/pkg/x86: busybox-1.00-pre7-losetup-crypto-alpha-x86.bz2 Only in genkernel-3.3.10-patched/pkg/x86: busybox-1.00-rt-mdstart.plasmaroo-x86.bz2 Only in genkernel-3.3.10-patched/pkg/x86: cpio Only in genkernel-3.3.10-patched/pkg/x86: devfsd-1.3.25-dietlibc-kernel25-x86.bz2 Only in genkernel-3.3.10-patched/pkg/x86: dietlibc-0.27-x86-tempdir Only in genkernel-3.3.10-patched/pkg/x86: dietlibc-0.27-x86.tar.bz2 Only in genkernel-3.3.10-patched/pkg/x86: insmod-x86-static-2.6.bz2 Only in genkernel-3.3.10-patched/pkg/x86: udev-077-x86.tar.bz2 Only in genkernel-3.3.10-patched/ppc64: kernel-2.6