LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Requiremenets for a minimal Linux system (https://www.linuxquestions.org/questions/linux-newbie-8/requiremenets-for-a-minimal-linux-system-774811/)

Couling 12-10-2009 05:50 PM

Requiremenets for a minimal Linux system
 
Hi. As a learning exercise I'm trying to piece together a very minimal Linux system. At the moment I keep getting a kernel panic suggesting that it can't load the root file system. I've been trying various different suggestions on which drivers I need and no joy.

It's occurred to me that some of the supporting system may be to blame and I was hoping someone might run their eyes over the following and let me know if there is anything missing or wrong with it:
(I know I will need to add more to make a useful system, I'm just after one that boots for now)


I'm using grub as the boot loader, installed in /boot/grub on the root file system. This is my menu.lst
Code:

default                0
timeout                10

title                Test Kernel build
UUID                21d65db5-00a1-4b97-1e4c-665f20a0887e
kernel                /boot/bzImage root=UUID=21d65db5-00a1-4b97-1e4c-665f20a0887e noinitrd


The Root file system itself contains very little:
Code:

/boot ... containing the kernel (bzImage)
/boot/grub ... containg the grub files
/sbin ... containing "init" (a static build of bash)
/dev ... containing the device files "null" and "console"

... and nothing else.

Any advice welcome.
Thanks

smeezekitty 12-10-2009 06:19 PM

Quote:

Code:

root=UUID=21d65db5-00a1-4b97-1e4c-665f20a0887e

WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?

Couling 12-11-2009 02:04 AM

Quote:

Originally Posted by smeezekitty (Post 3787162)
WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?

Yup tried that, the UUID thing was copied from Ubuntu. I switched to it in an attempt to fix this problem. But given your response it's most likely specific to the Ubuntu kernel.

For my understanding, am I right to think that "root=/dev/hda1" doesn't need me to actually have "/dev/hda1" created on my system?

btmiller 12-11-2009 02:31 AM

Yes, you'll need to have the hard drive devices available or you're not going to get very far (I think even if you specify the patitions by their UUID, you still need the device files). You'll probably need a few more like mem and kmem too...

the trooper 12-11-2009 09:02 AM

Is there a reason you are not using an initrd?.

malekmustaq 12-11-2009 09:28 AM

Quote:

At the moment I keep getting a kernel panic suggesting that it can't load the root file system.
-- Is the hardware supported by the kernel?
-- Is the memory capable enough without initrd?
-- grub>
root (hd0,0)
kernel /boot/name-of-bzImage root=/dev/sda
initrd /boot/"if-you-have".gz

Hope this helps.

Couling 12-11-2009 06:24 PM

Quote:

Originally Posted by btmiller (Post 3787511)
Yes, you'll need to have the hard drive devices available or you're not going to get very far ... You'll probably need a few more like mem and kmem too

Right will give that a shot then.

How does the kernel use them since the device files won't be available unti the root file system has been loaded ... wont it?

Thanks for all your help

~sHyLoCk~ 12-11-2009 06:53 PM

Quote:

Originally Posted by smeezekitty (Post 3787162)
WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?

Not necessarily. This is called persistent device naming. Type blkid to find out yours ;)

Couling 12-13-2009 04:45 AM

Thanks that's really helpful.
Quote:

Originally Posted by ~sHyLoCk~ (Post 3788403)
Not necessarily. This is called persistent device naming. Type blkid to find out yours ;)

That page states that you need to be using initrd for persistent device naming to work so...

As suggested I've created some extra devices and used root=/dev/sda1.
This has got me one step closer but still not there. I'm now getting a panic "Attempt to kill init" but with no message from bash about why...

I replaced bash(sbin/init) with a program which simply prints out numbers starting at 0 and counting up (statically compiled). This doesn't die but doesn't print anything either.



Before I dive into kernel config again, does anyone have any suggestions about what else I've missed to cause this.

My new grub menu.lst is
Code:

default                0
timeout                10

title                Test Kernel build
root                (hd0,0)
kernel                /boot/bzImage root=/dev/sda1 ro noinitrd

My new /dev/ now contains:
Code:

brwxrwxrwx root 5, 1 console
crwxrwxrwx root 1, 2 kmem
crwxrwxrwx root 1, 1 mem
brwxrwxrwx root 1, 3 null
brwxrwxrwx root 1, 1 ram
brwxrwxrwx root 8, 0 sda
brwxrwxrwx root 8, 1 sda1
crwxrwxrwx root 5, 0 tty
crwxrwxrwx root 4, 1 tty1
crwxrwxrwx root 4, 2 tty2
crwxrwxrwx root 4, 3 tty3
crwxrwxrwx root 4, 4 tty4
crwxrwxrwx root 1, 5 zero

Thanks a lot for your time


All times are GMT -5. The time now is 04:30 PM.