|
|
@ -492,7 +492,7 @@ startVolumes() {
|
|
|
|
|
|
|
|
|
|
|
|
# Here, we check for /dev/device-mapper, and if it exists, we setup a
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
then
|
|
|
|
mkdir -p /dev/mapper
|
|
|
|
mkdir -p /dev/mapper
|
|
|
|
ln -sf /dev/device-mapper /dev/mapper/control
|
|
|
|
ln -sf /dev/device-mapper /dev/mapper/control
|
|
|
@ -549,6 +549,37 @@ startVolumes() {
|
|
|
|
fi
|
|
|
|
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() {
|
|
|
|
sdelay() {
|
|
|
|
# Sleep a specific number of seconds if SDELAY is set otherwise only sleep
|
|
|
|
# Sleep a specific number of seconds if SDELAY is set otherwise only sleep
|
|
|
|
# 1 second
|
|
|
|
# 1 second
|
|
|
|