View previous topic :: View next topic |
Author |
Message |
ManDay Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 22 Jan 2008 Posts: 247
|
Posted: Sun Nov 02, 2008 1:31 pm Post subject: The PXE-Hell: Initramfs not (properly) executed |
|
|
Hello people,
it's been over a week now since my first attempt getting Gentoo installed on a diskless machine, the network-device of which is not supported out-of-the-box by anything (Atheros 81xx wired). Eventually, I found PXE-Linux to be my last chance to fetch the kernel over Ethernet through UNDI. One huge struggle having made it so far, I'M ALMOST THERE - can feel the finish behind the next turn.
The last painful thing that prevents me from booting up - so I hope - that I have to surmount is getting the initrd/initramfs to work with the kernel. I compiled (meaning: CPIO & GZIP) the following into [chroot]/initramfs.cpio.gz:
./init -> ./sbin/init
./sbin/init
./bin/sh -> ./bin/busybox
./bin/busybox
Where init is:
#!/bin/sh
/bin/busybox --install -s
/bin/busybox mount -t proc proc /proc
exec /bin/sh
I specify "APPEND initrd=initramfs.cpio.gz" in [chroot]/pxelinux.cfg/default. When I boot, PXELinux boots properly and hands over to [chroot]/boot/bzImage as expected. Then, however I get a PANIC! and the Kernel claims that it's not able to locate /init and I should specify as init= in the PXE-Bootloader (doing so doesnt help it).
I see that PXELinux loads initramfs.cpio.gz, however I'm not sure whether it actually passes it to the kernel and whether latter makes use of it.
I implore you: Help me get this going. I'll otherwise loose all my hairs about it!
Kindest regards, M/D. Thanks also to all the fellows on #IRC (too many to name) who don't spare any efforts trying to help me! :D
P.S: Kernel is compiled with initramfs support. No initramfs compiled-in. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Nov 02, 2008 3:07 pm Post subject: |
|
|
I've also had a hard time trying to use an initrd for booting a couple of servers. I've still had no time to fully check the final solution but I can tell you there is a couple of required files missing from your initrd. Your missing nodes are essentially under /dev:
Code: | dev/null
dev/tty1
dev/console |
Code: | crw------- 1 root root 5, 1 nov 2 16:05 console
crw-r--r-- 1 root root 1, 3 nov 2 16:05 null
crw------- 1 root root 4, 1 nov 2 16:05 tty1 |
You might try to build an initrd using genkernel, which can also build just that file instead of compiling the kernel and so on. This is how I could create a valid initrd. Tweak it afterwards and it should run normally without panicing. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23088
|
Posted: Sun Nov 02, 2008 5:33 pm Post subject: |
|
|
Have you verified that the initrd is fetched from the server? Can you post the last 20 lines of output before the panic? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54827 Location: 56N 3W
|
Posted: Sun Nov 02, 2008 5:43 pm Post subject: |
|
|
ManDay,
Why do you need an intrd at all ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54827 Location: 56N 3W
|
Posted: Sun Nov 02, 2008 9:33 pm Post subject: |
|
|
ManDay,
Heres your static busybox, as we discussed on IRC yesterday.
Its built for a P3 so should be ok on an Atom _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ManDay Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 22 Jan 2008 Posts: 247
|
Posted: Mon Nov 03, 2008 6:44 am Post subject: |
|
|
Thanks mate :D
I do need an initrd/initramfs because I'm PXE netbooting my computer and therefore need the kernel to be able to use the ethernet hardware, after it has been fetched from TFTP (e.g.: mount a NFS-root, establish the eventual ssystem, etc.). Since my network device is not available from the kernel's source (actually, for some reason, I think there is at least one compatible driver kernel-given, but I can't figure out which), I'll have to ship my driver to the kernel, in one slide with PXE.
It, in fact, would suffice if the bootloader could fetch the driver through UNDI in parallel with the kernel, and provide it afterwards. Only thing that the bootloader can be configured to fetch (the kernel accepts from the bootloader in turn), in addition to the kernel, is an initramfs-image, thouh.
So I ship my network driver with my initramfs, as it is common practice. First, I thought that I just write a little C-Program to exec modprobe on the ath81.ko, but because this is the first time I get on to something like this, I think the chance of suceeding in time will be better, when I do it manually with busybox.
I hope that explains it :) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54827 Location: 56N 3W
|
Posted: Mon Nov 03, 2008 8:08 pm Post subject: |
|
|
ManDay,
Yep. You need hardware support thats not yet in the kernel. That gives you two choices. Patch the kernel or use an initrd.
There is no need to mess with busybox though. You can put whatever you like in the initrd, as long as it fits in RAM.
e.g. the entire stage3.
Its not relevant just now but there is a distro (Tin Hat Linux) that loads everything into RAM from CD/DVD. No hard drives required. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Nov 04, 2008 12:04 pm Post subject: |
|
|
Hi NeddySeagoon. Tell me if I'm wrong but you still need a simplistic shell at least to load modules, right? I guess Busybox is the tool of choice in that case because it's an all-purpose shell/tool that's indeed lighter than bash and the like, am I right? (just wanted to make sure I've understood.) _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54827 Location: 56N 3W
|
Posted: Tue Nov 04, 2008 9:17 pm Post subject: |
|
|
VinzC,
It all depends ...
There are several module loading mechanisms. udev can load kernel modules, the kernel can do it for itself, if that feature is enabled.
If you want to run scripts (other than init) you need a shell. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|