LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   Gentoo 3.3.4 with LUKS, initramfs Issues (https://www.linuxquestions.org/questions/gentoo-87/gentoo-3-3-4-with-luks-initramfs-issues-943357/)

unassailable 05-04-2012 11:23 PM

Gentoo 3.3.4 with LUKS, initramfs Issues
 
Trying to get a new install running, have accomplished this before but for some reason the initramfs is giving me issues this time.

I am receiving a kernel panic indicating the system cannot find the init file.

The weird thing is it never prompts me for my password to decrypt the device. This leads me to believe that the issue is in my initramfs file itself.

I have tried both compressing my initramfs into a gzipped cpio and embedding it into the kernel, with neither working.

It has been a long day of troubleshooting this and any outside insight would be appreciated, thank you in advance.

my setup:
Code:

root sda3 (mapper/roo2)
boot sda1
swap sda2
kernel - includes devtmpfs

my initramfs dir:
Code:

├── bin
│** └── busybox
├── dev
│** ├── console
│** ├── null
│** ├── random
│** ├── sda1
│** ├── sda2
│** ├── sda3
│** ├── tty
│** └── urandom
├── etc
├── init
├── lib
├── mnt
│** └── roo2
├── proc
├── root
├── sbin
│** └── cryptsetup
├── sys

10 directories, 11 files

my initramfs:
Code:

#!/bin/sh

rescue_shell() {
        echo "Crap! Rescue Shell Time..."
        exec sh
}

echo "Mounting proc sysfs and dev"
mount -t proc none /proc || rescue_shell
mount -t sysfs none /sys || rescue_shell
mount -t devtmpfs none /dev || rescue_shell

echo "Installing BusyBox"
busybox --install -s

echo "starting CryptSetup"
cryptsetup -T 5 luksOpen /dev/sda3 roo2 || echo "cryptsetup issues" ; rescue_shell

echo "Mounting root"
mount -o ro /dev/mapper/roo2 /mnt/roo2 || echo "mount roo2 issues" ; rescue_shell

echo "Unmounting proc sysfs and dev"
umount /proc || echo "umount /proc issues" ; rescue_shell
umount /sys || echo "umount /sys issues" ; rescue_shell
umount /dev || echo "umount /dev issues" ; rescue_shell

echo "Switching init"
if [[ -x "/mnt/roo2/sbin/init" ]] ; then
        exec /sbin/switch_root /mnt/root /sbin/init
fi

echo "Failed to switch root, shell time..."
exec sh

my grub.conf
Code:

# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Cryp2 3.3.4
root (hd0,0)
kernel /kernel-3.3.4-cryp2

# vim:ft=conf:


unassailable 05-10-2012 09:57 AM

Solved
 
Rookie mistake...

After going through the steps again, I noticed busybox was not emerged with the static option. After re-emerging everything works now.


All times are GMT -5. The time now is 08:36 PM.