[2.4] initrd + linuxrc woes

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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 "root10%0 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

Re: [2.4] initrd + linuxrc woes
Hi Pete,
            Just a guess,is it like u first pack the executables and
then ask a program to encrypt it?or simply copy an executable into an
encrypted partition?
If it is the second case ,check it the command for creation of such
partion or the program for  encryption know the size of the
partition..ie. in a way the number of executables to be encrypted.Can
you post the commands for cornering the point?
cheers,
Kaushal.
Pete Shepard wrote:
Quoted text here. Click to load it


Re: [2.4] initrd + linuxrc woes

Quoted text here. Click to load it


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 >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

Site Timeline