skceb wrote:
when booting i get this error:
Code: Select all
VFS: Cannot open root device "sda3:reiserfs" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel Panic - not syncing: VFS Unable to mount root fs on unknown-block(0,0)
skceb wrote:
ok, now i realised that when building the kernel the cpio.gz file is being replaced by some default file. i edited the initramfs option via menuconfig so it takes the cpio image from a path outside the kernel dir. (/root/initramfs_data.cpio.gz)
after building the kernel, the initramfs_data.cpio.gz file is seems to have been copied to usr/src/linux/usr/ (according to the file size).
now i get a different error when trying to boot:
Code:
Kernel panic - not syncing: no cpio magic
I've no idea why so many people have problems with this step, it's pretty simple, anyway, there're several ways to build an initramfs into the kernel, out of which I believe the simpler is to place your gzipped cpio archive in /usr/src/linux/usr , touch it, and compile the kernel, it will get build directly.
The above means that there is no need to edit CONFIG_INITRAMFS_SOURCE kernel option, it also means that since it will get built directly, you better keep a backup of your gzipped cpio archive somewhere in your encrypted system since you will need it when you recompile/upgrade the kernel.
That is the way the guide recommends because that was how I did it(many times).
Code: Select all
# from the guide
# copy your cpio archive, it'll be built directly.
# Important: filename must be "initramfs_data.cpio.gz"
cp -i /path/to/initramfs_data.cpio.gz /usr/src/linux/usr/
touch /usr/src/linux/usr/initramfs_data.cpio.gz
That's it, just configure and compile your kernel, again leave CONFIG_INITRAMFS_SOURCE empty.
If you're sure it ignores the initramfs_data.cpio.gz you created and uses the default one instead(take a look at /usr/src/linux/usr/initramfs_data.cpio.gz after you compile your kernel, it should be the same file(have the same contents)), then I'd be really confused, you could send me your kernel .config by email and I'll try to have a look at it.
In the event that the above fails(it shouldn't) then you can try letting the kernel build it for you, one way is to edit the CONFIG_INITRAMFS_SOURCE option and point it to a directory containing all the files that the initramfs should have, you can decompress your previously generated initramfs_data.cpio.gz with gen_initramfs and pass the temp directory to CONFIG_INITRAMFS_SOURCE, then take a look at /usr/src/linux/usr/initramfs_data.cpio.gz and you will see the contents of the initramfs image.
There're more ways to handle the initramfs creation, just read the early-userspace documentation the comes with the kernel plus the 2 documents links that are in the guide(at the "Creating the initramfs image" section")
skceb wrote:
content of initramfs_data.cpio.gz (created with gen_initramfs) looks like this:
Code: Select all
img # du -hs *
545K bin
0 dev
4.0K etc
4.0K init
0 new-root
0 proc
821K sbin
0 sys
du -hs bin/*
0 bin/[
0 bin/[[
0 bin/ash
545K bin/busybox
0 bin/cat
0 bin/clear
0 bin/cut
0 bin/dmesg
0 bin/dumpkmap
0 bin/echo
0 bin/false
0 bin/loadfont
0 bin/mesg
0 bin/mkdir
0 bin/mount
0 bin/mountpoint
0 bin/test
0 bin/true
0 bin/umount
init file is marked executable (-rwxr-xr-x 1 root root 3736 Jun 4 14:47 init)
femtotech wrote:
I can't get the initramfs to work - I get "Failed to execute /init" when I try to boot. I've made the init executable before making the image, and tried using both install.sh and gen_initramfs.
any help/hint would be highly appreciated :=)
skceb, Why don't you have bin/sh ? you need it, otherwise it will fail with a "Failed to execute /init" message.
Do "grep /bin/sh /path/to/busybox/busybox.links" if it outputs nothing then you have a problem in your busybox configuration, if you figure out what was missing please post it here, or if you still have problems please send me your busybox .config by email.
femtotech, see ^^
Well, that's it for now, bye and good luck, let me know if you encounter more problems.