Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 227359 - sys-kernel/genkernel-3.4.10-r1 fails to luksOpen crypt_root with root_keydev
Summary: sys-kernel/genkernel-3.4.10-r1 fails to luksOpen crypt_root with root_keydev
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-16 03:19 UTC by Timothy Stotts
Modified: 2008-06-16 03:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,4.70 KB, text/plain)
2008-06-16 03:25 UTC, Timothy Stotts
Details
cat /proc/crypto (proc-crypto.txt,8.19 KB, text/plain)
2008-06-16 03:25 UTC, Timothy Stotts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Stotts 2008-06-16 03:19:00 UTC
When using dolvm and crypt_root to point to an LVM managed, LUKS-encrypted root ext3 filesystem, the initramfs fails to unlock the encrypted root.

The exact same settings work with the scripts provided by 3.4.9, but not 3.4.10.


Reproducible: Always

Steps to Reproduce:
1. Use genkernel 3.4.10 to create kernel for encrypted LVM2 root filesystem.
2. Setup GRUB to boot the kernel with proper options.
3. LUKS fails to find a key on any partition.
4. Repeat same steps with 3.4.9, and it succeeds.

Actual Results:  
Gentoo/x86 2008.0 profile laptop.
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          12       96358+  83  Linux
/dev/sda2              13         292     2249100   82  Linux swap / Solaris
/dev/sda3             293       14593   114872782+  8e  Linux LVM

  LV        VG   Attr   LSize  Origin Snap%  Move Log Copy% 
  home      pvg1 -wi-ao 30.00G                              
  root      pvg1 -wi-ao  1.50G                              
  temp      pvg1 -wi-ao 12.00G                              
  usr       pvg1 -wi-ao 30.00G                              
  var       pvg1 -wi-ao 26.00G                              

All partitions other than /dev/sda1 /boot were created with:
    cryptsetup luksFormat

GRUB lines:

kernel /kernel-genkernel-x86-2.6.25-tuxonice-r4 crypt_root=/dev/pvg1/root root_key=root.key root_keydev=/dev/sdb1 crypt_swap=/dev/sda2 swap_key=swap.key swap_keydev=/dev/sdb1 resume=/dev/mapper/swap resume2=swap:/dev/mapper/swap key_timeout=30 dolvm combined_mode=libata libata.atapi_enabled=1 video=uvesafb:1280x800-32,mtrr:3,ywrap CONSOLE=/dev/tty1
    initrd /initramfs-genkernel-x86-2.6.25-tuxonice-r4

With genkernel 3.4.9, the setup boots properly.
With genkernel 3.4.10, the succeeds at all stages, except the:
   cryptsetup luksOpen
command fails with:
No key available with this passphrase.

Using the 'shell' option, an lsmod reveals that the output of lsmod are identical with both genkernel 3.4.9 and 3.4.10.
Also /proc/crypto are identical with both versions.
Also, both properly mount the ext2 root_keydev to /mnt/key.
I am able to 'cat' the contents of /mnt/key/root.key with 3.4.9 and 3.4.10.


Expected Results:  
Expected boot-up to be identical with both genkernel versions.
Instead, 3.4.10 cannot perform luksOpen.
Using 'shell', tried:
    # cryptsetup luksOpen -d /mnt/key/root.key /dev/pvg1/root root
Command failed: No key available with this passphrase.


sys-fs/cryptsetup 1.0.6 with USE='nls -dynamic'
sys-fs/e2fsprogs-1.40.9 with USE='nls static'

After booting into 2008.0 beta2 LiveDVD, it is able to manually open /dev/pvg1/root with:
    # mkdir -p /mnt/key
    # mount /dev/sdb1 /mnt/key
    # cryptsetup luksOpen -d /mnt/key/root.key /dev/pvg1/root root

/dev/sdb1 is first partition of a USB flash stick with ext2 filesytem.
Comment 1 Timothy Stotts 2008-06-16 03:22:14 UTC
By "shell" option, I am refering to:

The root block device is unspecified or not detected. Please specify a device to boot, or "shell" for a shell..
Comment 2 Timothy Stotts 2008-06-16 03:25:10 UTC
Created attachment 157029 [details]
emerge --info
Comment 3 Timothy Stotts 2008-06-16 03:25:58 UTC
Created attachment 157031 [details]
cat /proc/crypto
Comment 4 Timothy Stotts 2008-06-16 03:38:51 UTC
INVALID and SOLVED.

There was a difference between the two genkernel configurations.
One was loading module dm-crypt and the other was not.

Loading / compiling-in dm-crypt solved the issue.