I created a fresh gentoo install. I am creating the initramfs because i made my root partition a encrypted luks partition. I did the usual and placed busybox on the initramfs so far. I have two questions:
1) doesn't there need to be a /dev/mapper in the initramfs so when the root partition is unlocked it has a /dev/mapper/file name?
2) when the exec_switch is preformed how is the /dev/mapper/file name going to transfer over?
and
3) how do i get the initramfs to take the key from a usb key device given from the grub command line?
Still having trouble though getting the initramfs.
1) I built the initramfs into the kernel...using /usr/src/initramfs. I did not choose any compression for it.
2) I created:
Code:
mkdir /usr/src/initramfs
cd /usr/src/initramfs
mkdir /usr/src/initramfs/bin
mkdir /usr/src/initramfs/lib
mkdir /usr/src/initramfs/dev
mkdir /usr/src/initramfs/etc
mkdir -p /usr/src/initramfs/mnt/root
mkdir /usr/src/initramfs/proc
mkdir /usr/src/initramfs/root
mkdir /usr/src/initramfs/sbin
mkdir /usr/src/initramfs/sys
2)I used the cryptsetup binary from the live dvd for the initramfs. For the busybox, I compiled it statically on my chroot system and copied over that binary to the initramfs.
3) I copied my luks key into /usr/src/initramfs/key
4) my init script is:
Code:
#!/bin/busybox sh
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev
cryptsetup -d /key luksOpen /dev/sda5 root
mount -o ro /dev/mapper/root /mnt/root || rescue_shell
umount /proc
umount /sys
umount /dev
exec switch_root /mnt/root /sbin/init
rescue_shell() {
echo "Something went wrong. Dropping you to a shell."
busybox --install -s
exec /bin/sh
}
but upon boot up I get:
http://img.photobucket.com/albums/v6...517_100756.jpg
I spent so many hours...if you could help please i'd really appreciate it.
Note: I tried this kernel on a non encrypted partition on the same laptop(just copied the partition) and it booted successfully(with no initramfs).
Pax and Grsecurity are turned off.