I'm looking for help in getting a basic initrd environment up and running. My goal is to enhance my knowledge on how to create a basic Linux environment. Ideally, I would like to move into Embedded Linux systems later on and this seems the best starting point.

I've yet to find a good basic how-to on this subject, as such I've mostly ended up following a number of half finished or incomplete tutorials on the subject.

Below are links to the how-to's for your reference on what I've done so far.

At the moment, when I boot the environment I get a GRUB prompt, I've tried adding a grub.cfg file to it, but it just gets ignored when the system boots and goes straight to the grub prompt.

To boot the initrd environment presently, I have to provide it with the following commands:

set root=(hd0,msdos1)
linux /boot/bzImage
initrd /boot/rootfs.cpio.gz

This boots the mini OS, but gives an error about not being able to locate an init file (which is part of my rootfs.cpio.gz file in the root of its structure)

.bootup errors

How I can go about fixing the problems with this initrd environment?

  • Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
    – ivanivan
    Sep 8 '18 at 14:35

When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.

UPDATE: I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before

  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.