Updated with the latest version of the LUKS patches from bug #152441.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@455 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Chris Gianelloni 18 years ago
parent d4b9f8ec8c
commit 908e45924c

@ -2,6 +2,10 @@
# Copyright 2006-2006 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
25 Oct 2006; Chris Gianelloni <wolf31o2@gentoo.org>
generic/initrd.scripts, generic/linuxrc:
Updated with the latest version of the LUKS patches from bug #152441.
25 Oct 2006; Chris Gianelloni <wolf31o2@gentoo.org> ChangeLog:
Changed mime-type to application/x-gzip for generic/keymaps.tar.gz for bug
#151500.

@ -492,7 +492,7 @@ startVolumes() {
# Here, we check for /dev/device-mapper, and if it exists, we setup a
# a symlink, which should hopefully fix bug #142775 and bug #147015
if [ -e /dev/device-mapper ]
if [ -e /dev/device-mapper ] && [ ! -e /dev/mapper/control ]
then
mkdir -p /dev/mapper
ln -sf /dev/device-mapper /dev/mapper/control
@ -549,6 +549,37 @@ startVolumes() {
fi
}
startLUKS() {
if [ -n "${LUKS_ROOT}" ]
then
if [ -e /sbin/cryptsetup ]
then
if cryptsetup isLuks ${LUKS_ROOT}
then
good_msg "Opening LUKS device ${LUKS_ROOT}"
cryptsetup luksOpen ${LUKS_ROOT} root
if [ ! "$?" -eq '0' ]
then
bad_msg "Failed open LUKS device ${LUKS_ROOT}"
fi
if [ -n "${REAL_ROOT}" ]
then
# Rescan volumes
startVolumes
else
REAL_ROOT="/dev/mapper/root"
fi
else
bad_msg "The LUKS device ${LUKS_ROOT} does not contain a LUKS hearder"
fi
else
bad_msg "The initrd does not support LUKS"
fi
fi
}
sdelay() {
# Sleep a specific number of seconds if SDELAY is set otherwise only sleep
# 1 second

@ -173,7 +173,7 @@ do
NFSROOT=`parse_opt "${x}"`
;;
crypt_root\=*)
CRYPT_ROOT=`parse_opt "${x}"`
LUKS_ROOT=`parse_opt "${x}"`
;;
esac
done
@ -226,19 +226,8 @@ setup_md_device
# Scan volumes
startVolumes
# Iinitialize encrypted root device
if [ -n "${CRYPT_ROOT}" ]
then
cryptsetup luksOpen ${CRYPT_ROOT} root || exit -1
if [ -n "${REAL_ROOT}" ]
then
# Rescan volumes
startVolumes
else
REAL_ROOT="/dev/mapper/root"
fi
fi
# Iinitialize LUKS root device
startLUKS
# Set up unionfs
mkdir -p ${NEW_ROOT}

Loading…
Cancel
Save