LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Tool for building net booted kernel and ramdisk? (https://www.linuxquestions.org/questions/linux-server-73/tool-for-building-net-booted-kernel-and-ramdisk-552730/)

wsanders 05-09-2007 07:01 PM

Tool for building net booted kernel and ramdisk?
 
I am exploring further options for net booting and kickstart.

The process I want to use is:

1) Boot via PXE, got it working using pxelinux and grub.

2) Load the Magic Mother Of All Kernels and Initrd's

3) Kickstart - got it working sort of, booting from CDROM. Seems straightforward.

Steps 1 and 3 seem to be covered. But step 2 is a mystery. I've located no real documentation or tools.

I'm not a terribly experienced kernel builder and completely INexperienced at coming up with initrd's. I suppose after days of trial and error that I could come up with something that would work. So far, all the kernels I've tried panic.

I'm using Fedora but I'm not OS-centric. If it's 10 times easier with some other distro I'm open to suggestions. Theoretically, I should even be able to boot distro X and use it to kickstart distro Y ....

TIA, just a quick pointer in the wilderness will be appreciated.

-W Sanders

manwichmakesameal 05-11-2007 10:50 AM

Does this help?

wsanders 05-11-2007 01:35 PM

in the right direction (a plug for Solaris 10)
 
although I would replace the phrase "surprising amount of fiddling" with "appalling amount of fiddling".

The Sun blueprint he links to describes setting up a Jumpstart server to install Solaris x86 via PXE. I've actually done that, it's *easy*, and actually a big reason to run Solaris 10 rather than Linux on X86; the net boot / disaster recovery capabilities of Sol 10 are MUCH more rebust than (the freely available) Linux. (at least I know, HP, and IBM have their own proprietary tools, for blades etc. HP's actually require a windows server.:confused:

The variation on the Sun doc is I used the ISC DHCP server, which is much easier to figure out than Solaris's. Basically the steps are:

1) Create a bog-standard Solaris Jumpstart server, "setup_install_server", yadda yadda yadda. (This is in that Sun Blueprint.)

2) Build and install the ISC DHCPD with conf file lines something like this:

Code:

ddns-update-style none;
allow bootp;
allow booting;
subnet 10.10.20.0 netmask 255.255.255.0 {
        option routers 10.10.20.1;
        option domain-name-servers 10.10.0.34;
        }
group {
# THIS IS THE GROUP THAT JUMPSTART WILL MAKE FOR YOU
# It uses Grub
      next-server 10.10.20.41;
      filename "pxegrub.I86PC.Solaris_10-1";
      host foo {
              hardware ethernet 00:d0:b7:c7:67:d8;
              fixed-address 10.10.20.200;
              }
}
# OR (Comment the other group out)
group {
# THIS GROUP USES PXELINUX
        next-server 10.10.20.41;
        filename "pxelinux.0";
        host foo {
                hardware ethernet 00:d0:b7:c7:67:d8;
                fixed-address 10.10.20.200;
                }
}

/tftpboot/boot/grub/menu.lst:

default=0
timeout=10
title Solaris_10 Jumpstart
        kernel /I86PC.Solaris_10-1/multiboot kernel/unix -B
install_config=10.10.20.41:/js/jumpstart/yipes,sysid_config=10.10.20.41:/js/jump
start/yipes/Sysidcfg/Solaris_10_.nm24,install_media=10.10.20.41:/js/os/sol-10-u1
-ga-x86,install_boot=10.10.20.41:/js/os/sol-10-u1-ga-x86/boot -m install
      module /I86PC.Solaris_10-1/x86.miniroot
title I AM A JELLY DONUT
        kernel /FC4/vmlinuz-2.6.11-1.1369_FC4
        append  load_ramdisk=1 initrd=initrd-2.6.11-1.1369_FC4.img

/tftpboot/0A0A14C8: (host's MAC addr in HEX)

default linux
label linux
        kernel FC4/<<some magic kernel>>
        append ksdevice=eth0 console=tty0 load_ramdisk=1
initrd=<<some magic initrd>> network

Of course you could boot Solaris with pxelinux and FC4 with Grub, yadda, yadda, yadda.

Where I am hung up is creating the <<some magic kernel>> and <<some magic initrd>>.

wsanders 05-11-2007 06:19 PM

Giving up on netbooting Fedora for now
 
Code:


[root@blah kernels]# cd  2.6.17-1.2142_FC4-i686
[root@blah 2.6.17-1.2142_FC4-i686]# make
.....
# using defaults found in .config
#
 ....
make[1]: *** No rule to make target `init/main.o', needed by `init/built-in.o'.  Stop.
make: *** [init] Error 2

Giving up on FC4 - sigh.


See below for better answer.

manwichmakesameal 05-12-2007 10:42 AM

You have to configure the kernel before you make it. Try reading something like this. I think that doc is missing some stuff though. If you're using a 2.6 series, you don't have to have the symlink to /usr/src. You can build it pretty much anywhere. I have a ~/src directory that I use to build all my kernels. Also, I have found it's easier to use make xconfig instead of make menuconfig if you are running X.
I could probably write a short book on building a kernel, but I'll try to keep it somewhat short. Basically, you can either use the kernel source included in your distro or just get it from kernel.org. When you do make xconfig (if that is what you use), you can actually load up your .config from your running kernel so you don't have to go through and pick all the modules you want. The nice thing about make xconfig is that it tells a little about each option, so if you aren't sure about something, it explains it a bit.

wsanders 05-14-2007 12:35 PM

Yep, no trouble bulding a kernel.org kernel, it's the FC4 kernel src package that's broken. You can do make menuconfigs until you are blue in the face but they will all fail with the same make error deep in the morass of the nested Makefiles. I'm not enough of a make expert anymore to debug this or even tell if I'm just missing something obvious. Plus, all the RedHat releases and variants are supposed to come with a .config file that was used to build the distro's kernel, and installing the kernel src USED to rebuild the kernel at rpm install time using those parameters.

Just a headsup that the FC4 kernel seems broken. Last year's news to everyone, probably. I only used FC4 because I had the CDs around and FC6 has bloated up to 6 CDs.


See below for better answer.

wsanders 06-06-2007 06:06 PM

The question I was asking had so glaringly obvious an answer that everyone overlooked it because the kernel and initrd I needed were lying out in plain sight: On the release CDROM! In either <CD>/images/pxeboot and in <CD>/isolinux. D'oh!

Now I'm net-installing away, and the install server is running Solaris, even. Let the boring, endless kickstart tweaking commence.


All times are GMT -5. The time now is 01:41 AM.