0

I have a really old build of Linux (version 2.4.0). Please don't ask me why I have such an old version since it's for a very specialised bit of old hardware. Anyway, problem is, I get this message when attempting to run the system after successful compilation.

Kernel panic: I have no root and I want to scream

The problem seems to be that I need a 'root filesystem', most likely generated by the initial RAM disk (initrd) generation technique. How can I fix this?

  • 1
    Could you describe the hardware more? – jdwolf Nov 25 '17 at 15:42
  • type ls and check to see if it contains a directory called new_root – jdwolf Nov 25 '17 at 15:54
  • I don't even think the keyboard works at this stage unfortunately. – t0rxe Nov 25 '17 at 16:54
  • Perhaps it uses a special port like UART for the interactive tty. I'd need to know the hardware. Assuming you can run commands in initram then you can get it to do quite a lot. – jdwolf Nov 25 '17 at 22:16
  • If there is a PS/2 port use that for the keyboard. – jdwolf Nov 25 '17 at 22:42
2

You don't need an initrd if your kernel includes all the drivers and filesystem support needed for booting. But you need to tell the kernel where your root filesystem is, using the root= kernel parameter, e.g. root=/dev/sda1.

  • What if I don't have a filesystem at all? IE: No HDD. Is there a way I can tell it to use RAM? – t0rxe Nov 25 '17 at 16:48
  • inmitrd would be a way to tell it to use ram. Many embedded systems use SD cards for their filesystem or EMMC (which is like a solderable SD card) – Jasen Nov 25 '17 at 18:43
  • Ok, an initramfs is the way to go, then. An initramfs is a CPIO archive containing the necessary files to get the system up and running. The archive can be either a separate file that is loaded by the boot loader after the kernel has been loaded, or the archive can be part of the kernel image. The kernel documentation directory contains some information, but asaembling the archive is not a trivial task, I am afraid. – Johan Myréen Nov 25 '17 at 20:41
0

You do not have to "create" a rootfs. If the kernel is booted without an initrd then ist must be compiled with the necessary drivers for accessing the root device. Which device is used (by default) is hard coded in the kernel. You can override that with the kernel command line, e.g. root=/dev/sda2.

If you use an initrd then the initrd becomes the rootfs automatically and the initrd process later chroots to the real rootfs (using the kernel parameter and maybe some default).

  • What if I don't have a filesystem at all? IE: No HDD. Is there a way I can tell it to use RAM? – t0rxe Nov 25 '17 at 16:48
  • @t0rxe The system has to boot from somewhere, doesn't it? It is possible to run Linux in RAM only. I guess you need a modified initrd to do that (like the live distros do). But that is certainly not an approach for someone "not that tech-savvy in regards to Linux". And even worse: It is really bad style not to mention the most difficult part of your problem in the question... – Hauke Laging Nov 25 '17 at 16:58
  • Ah okay, well is there any reference to a guide or manual of some sort where I can learn or figure out how to modify initrd to do such a task since that is what I'm going to have to do in order to get this working. – t0rxe Nov 25 '17 at 17:04
  • @t0rxe I would look for such information on the web sites of live distros. – Hauke Laging Nov 25 '17 at 17:05

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.