[2.4] initrd + linuxrc woes

Hello!

I'm trying to boot up a loop-aes encrypted root disk and created an initrd using cramfs based on the sample linuxrc-program of the loop-aes package (it's using dietlibc).

Using the kernel options "root=100 init=/linuxrc" the kernel unpacks the initrd and executes the linuxrc program.

However, this happens only if the linuxrc is the *only* executable within the initrd. As soon as i pack one more executable or library into the initrd, the kernel doesn't execute the linuxrc anymore!

If i put the additional libs and executables (glibc, ifconfig, losetup, etc.) onto the unencrypted boot partition i can execute them with fork & exec from within my linuxrc.

However, i *really* like to have glibc, ifconfig and losetup

*within* my initrd.

I'm puzzled.

Any clues?

Best regards, Pete

Reply to
Pete Shepard
Loading thread data ...

Reply to
krishna

The initrd itself is not encrypted, of course. It's just used to mount an encrypted partition.

Basically i have

/dev/sda1 -> /boot (plain ext2) /dev/sda2 -> / (aes128 encrypted, ext2)

So, the linuxrc program within the initrd basically has to execute this command sequence:

losetup -p5 -e AES128 /dev/loop0 /dev/sda2 5< pwd.txt mount /dev/loop0 /new_root cd /new_root pivot_root . old_root exec chroot . sh -c 'umount /old_root; exec /sbin/init' \ dev/console 2>&1

As said, my initrd doesn't use a shell script. I'm using a simple c program based on the sample in the loop-aes source distribution.

However, this is moot now. Today i discovered that if i'm using EXT2 instead CRAMFS the initrd executes perfectly.

For the CRAMFS version to work i need to put any helper programs and libraries (losetup, mount, etc.) onto the /boot partition that i have to mount within the linuxrc. Adding them to the initrd-image doesn't work (and i checked permissions more than once!).

Seems that i tripped over some obscure CRAMFS bug in this old kernel (2.4.25).

Best regards, Pete

Reply to
Pete Shepard

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.