Code: Select all
# Modify do_root to use lvm:
shell_checkpoint 4
echo "Partition: root"
exec_cryptsetup "${gv_root_device}" "${uv_root_mapping}"
# Add the LVM stuff in here after the 'root' partition is decrypted:
echo "Scanning LVM Volume Groups..."
lvm vgscan --ignorelockingfailure --mknodes 2>/dev/null || true
echo "Activating LVM Volume Groups..."
lvm vgchange -a y --ignorelockingfailure 2>/dev/null
# Some check here to see which to use
if [ test LVM= true ]; then # Need to modify so this works :D
mount -o "${gv_root_mode}" "/dev/$gv_vg_name/$gv_lv_root" /new-root
else
mount -o "${gv_root_mode}" "/dev/mapper/${uv_root_mapping}" /new-root
fi
if [ "$?" -ne 0 ]; then
cryptsetup luksClose "${uv_root_mapping}" 2>/dev/null || cryptsetup remove "${uv_root_mapping}"
die "Error: mount root failed, dm-crypt mapping closed."
fi
shell_checkpoint 5
# Add following to get the proper parameters for lvm:
for param in $CMDLINE; do
case "${param}" in
rescue)
gv_shell_checkpoint=1
;;
root=*)
gv_root_device="`echo "${param}" | cut -d'=' -f2`"
;;
lv_root=*)
gv_lv_root="`echo "${param}" | cut -d'=' -f2`"
;;
vg_name=*)
gv_vg_name="`echo "${param}" | cut -d'=' -f2`"
;;

Code: Select all
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo s2 2.6.16-suspend2-r8 resume
kernel /boot/kernel-2.6.16-suspend2-r8 is2 iswap=/dev/sda2 \
resume2=swap:/dev/mapper/swap \
vga=0x318 video=vesafb:ywrap,mtrr:3 splash=verbose,theme:emergence \
quiet CONSOLE=/dev/tty1
initrd /boot/initramfs-gentoo-crypt
title=Gentoo s2 2.6.16-suspend2-r8 noresume
kernel /boot/kernel-2.6.16-suspend2-r8 is2 root=/dev/sda3 iswap=/dev/sda2 \
noresume2 resume2=swap:/dev/mapper/swap \
vga=0x318 video=vesafb:ywrap,mtrr:3 splash=verbose,theme:emergence \
quiet CONSOLE=/dev/tty1
initrd /boot/initramfs-gentoo-cryptSo I tired removing the Suspend2 stuff just to see if I could get it to boot fully and I got this error "Error: root missing."hadees wrote:I am trying to get Suspend2 to work with the init script but I keep getting the error "Error: suspend2 requires iswap argument." even though the iswap argument is there. I am not sure what is wrong, I basicly copied the example grub entries. This happens when I try to boot with either entry in my grub.conf file.
Here is my grub.conf
Code: Select all
default 0 timeout 30 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title=Gentoo s2 2.6.16-suspend2-r8 resume kernel /boot/kernel-2.6.16-suspend2-r8 is2 iswap=/dev/sda2 \ resume2=swap:/dev/mapper/swap \ vga=0x318 video=vesafb:ywrap,mtrr:3 splash=verbose,theme:emergence \ quiet CONSOLE=/dev/tty1 initrd /boot/initramfs-gentoo-crypt title=Gentoo s2 2.6.16-suspend2-r8 noresume kernel /boot/kernel-2.6.16-suspend2-r8 is2 root=/dev/sda3 iswap=/dev/sda2 \ noresume2 resume2=swap:/dev/mapper/swap \ vga=0x318 video=vesafb:ywrap,mtrr:3 splash=verbose,theme:emergence \ quiet CONSOLE=/dev/tty1 initrd /boot/initramfs-gentoo-crypt
Code: Select all
title=Gentoo 2.6.16-suspend2-r8
kernel /boot/kernel-2.6.16-suspend2-r8 root=/dev/sda3 \
vga=0x318 video=vesafb:ywrap,mtrr:3 splash=verbose,theme:emergence \
quiet CONSOLE=/dev/tty1
initrd /boot/initramfs-gentoo-cryptCode: Select all
Error: root missing
Dropping you into a minimal shell
/bin/ash: can't access tty; job control turned off
/$

Code: Select all
Partition: root
Command failed: Error opening device: No such file or directory
Error: e2 failed to decrypt /dev/hdb1.Code: Select all
gv_key_swap_mode="gpg"
gv_key_swap_device="/dev/hda1"
gv_key_swap_filepath="swapkey.gpg"
gv_key_root_mode="gpg"
gv_key_root_device="/dev/hda1"
gv_key_root_filepath="rootkey.gpg"
gv_root_device="/dev/hda5"
gv_swap_device="/dev/hda2"


Code: Select all
mknod /dev/hdb 64 0Code: Select all
DEFAULT menu.c32
PROMPT 0
TIMEOUT 100
LABEL Gentoo
MENU LABEL Gentoo
MENU DEFAULT
KERNEL bzImage
APPEND root=/dev/hdb1 initrd=initramfs CONSOLE=/dev/tty1Code: Select all
--- init 2006-12-05 12:42:33.000000000 -0600
+++ initramfs/init 2006-12-05 12:29:54.000000000 -0600
@@ -19,6 +19,7 @@
# * ichkpt=<n> Interrupts init and drops to shell.
# * ikey_root=<mode>:<device>:</path/to/file>
# * ikey_swap=<mode>:<device>:</path/to/file>
+# * dolvm2=</dev/[vg]/[lv]> Activate LVM volumes post-decryption and use <device> as the real root
#
#
# == About key files ==
@@ -427,6 +428,14 @@
shell_checkpoint 4
echo "Partition: root"
exec_cryptsetup "${gv_root_device}" "${uv_root_mapping}"
+ if [ -n ${gv_root_lv} ]; then
+ echo "Activating LVM..."
+ /sbin/pvscan
+ /sbin/vgscan
+ /sbin/lvscan
+ /sbin/vgchange -ay
+ uv_root_mapping=$(echo $gv_root_lv | awk -F\/ '{printf "%s-%s", $3, $4}')
+ fi
mount -o "${gv_root_mode}" "/dev/mapper/${uv_root_mapping}" /new-root
if [ "$?" -ne 0 ]; then
cryptsetup luksClose "${uv_root_mapping}" 2>/dev/null || cryptsetup remove "${uv_root_mapping}"
@@ -532,6 +541,9 @@
rescue)
gv_shell_checkpoint=1
;;
+ dolvm2=*)
+ gv_root_lv="`echo "${param}" | cut -d'=' -f2`"
+ ;;
root=*)
gv_root_device="`echo "${param}" | cut -d'=' -f2`"
;;
I tried this a few times, so it's not related to a misstyped password. Any clues about this?device-mapper: table: 254:0: crypt: Error allocating crypto tfm
Failed to setup dm-crypt key mapping.
Check kernel for support for the aes-cbc-plain cipher spec and verify that /dev/hda3 contains at least 258 sectors.
Failed to read from key storage
Code: Select all
mount -o "${gv_root_mode}" "/dev/mapper/${uv_root_mapping}" /new-root
if [ "$?" -ne 0 ]; then
cryptsetup luksClose "${uv_root_mapping}" 2>/dev/null || cryptsetup remove "${uv_root_mapping}"
die "Error: mount root failed, dm-crypt mapping closed."
fiCode: Select all
mount -o "${gv_root_mode}" "/dev/mapper/${uv_root_mapping}" /new-root
if [ "$?" -ne 0 ]; then
cryptsetup luksClose "${uv_root_mapping}" 2>/dev/null || cryptsetup remove "${uv_root_mapping}"
die "Error: mount root failed, dm-crypt mapping closed."
fi
cp -a "/dev/mapper/${uv_root_mapping}" /new-root/dev/mapper/
Same here. In 2.6.17.13 everything worked. In 2.6.19.1:ph030 wrote:Someone already updated to kernel-2.6.19 and still has the system running?
I updated to 2.6.19 today (tried gentoo- and suspend2-sources) and didn't make any changes besides one new feature(support for my cardreader).
Now, when I reboot and want to decrypt my root, it spits the following error:
I tried this a few times, so it's not related to a misstyped password. Any clues about this?device-mapper: table: 254:0: crypt: Error allocating crypto tfm
Failed to setup dm-crypt key mapping.
Check kernel for support for the aes-cbc-plain cipher spec and verify that /dev/hda3 contains at least 258 sectors.
Failed to read from key storage
Code: Select all
$ sudo cryptsetup luksOpen /dev/hda8 crypt
Enter LUKS passphrase:
Failed to setup dm-crypt key mapping.
Check kernel for support for the aes-cbc-plain cipher spec and verify that /dev/hda8 contains at least 261 sectors.
Failed to read from key storageCode: Select all
device-mapper: ioctl: 4.10.0-ioctl (2006-09-14) initialised: dm-devel@redhat.com
device-mapper: table: 254:0: crypt: Error allocating crypto tfm
device-mapper: ioctl: error adding target to table
device-mapper: ioctl: device doesn't appear to be in the dev hash table.

Code: Select all
exec switch_root /new-root "${uv_init}"
Code: Select all
switch_root /new-root "${uv_init}"
Code: Select all
switch_root:not rootfs