LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   custom bootable iso with my own kernel? (https://www.linuxquestions.org/questions/slackware-14/custom-bootable-iso-with-my-own-kernel-98361/)

sneakerski 09-29-2003 04:31 PM

custom bootable iso with my own kernel?
 
how would i go about making a slackware 9.1 (or any version) install disk, with my own compiled kernel on it? I'd like my kernel to be booted instead of the default bare.i kernel.
does the kernel need to be uncompressed?
do i need to do anything else to get the boot-loader to recognize it?
how do i build the revised iso? (and make it bootable)

thanks.

-- i want a 2.6.0-test6 kernel so that i can install to a SATA drive on my VIA 8237 southbridge controller...test5 was the first to even recognize the controller.

clacour 09-30-2003 04:33 AM

I am not even going to attempt to cover everything on this subject. It's way too big for one post.

I'm going to mention a couple of places that do that kind of thing (build bootable CDs), and give a rough outline of how you'd do what you're talking about. I'd much rather answer questions about specific steps that try to write one massive "how-to" on the subject in a post here.

First, the two places to check out: www.knopper.net/knoppix and www.lnx-bbc.org . Those aren't the only two, by any means, just the ones I'm familiar with. They make a good starting point. Prowling around their sites (especially Knoppix's forum) should be helpful.

Things you're going to need to know about to do bootable CDs:

syslinux/isolinux -- there are other ways to make a bootable CD, but this is by far the easiest.

mount -o loop -- This will be your workhorse when working with this stuff. If you had an ISO image of your Slackware disk on the harddrive, called /myswr/slackware91.iso you could mount it by "mount -o loop -t iso9660 /myswr/slackware91.iso /loop1" and then see all the files on the CD by cd'ing into /loop1.

If you have the actual CD, this probably seems kind of pointless, but it has two important uses. One, if you've downloaded a CD image, it lets you look at the innards of it before you burn a copy.

Second, it's on disk, NOT on CD, which means you can change it.

Revamping the Slackware 9.1 iso image might be as simple as[list=a][*]Mounting it this way[*]Copying your kernel over their kernel[*]Unmounting it, and[*]Burning the ISO image[/list=a]

If they're using isolinux (or syslinux, two slightly different versions of the same idea, from the same author) there will be a configuration file. It's an ordinary text file, and the layout is pretty simple. That will tell you (if it's not already obvious) what the kernel is.

Continuing on with the list of things it's good to know (the first two were isolinux and mount -o loop, in case I veered too much ;)), the next one is mkisofs.

This takes a tree and makes an ISO image out of it. You'll definitely need this if you make any extensive changes, because every change you make uses up more space. If you open up that /loop1 file I described earlier and copy a file (like the kernel) into it, when you unmount the file, it's going to be bigger. A fresh ISO image is about as compact as its possible to get. Every new file (whether completely new or a replacement) takes up more space.

The downside to this is you have to have twice as much space.

By the way, I recommend using somebody else's mkisofs command as a model, and work your way through the options, keeping what you want for yours. The option list for mkisofs is pretty ugly (very, very long).

If you do try to play around with either Knoppix or LNX-BBC, you'll need cloop. I recommend avoiding that for starters.

Here's how most bootable CDs are laid out (the ones that don't use cloop):

Isolinux is used to boot with. It has a configuration file which is pretty easy to figure out. It will specify the kernel (all paths are from the root of the CD, if applicable) and probably an initrd file.

The initrd file contains a compressed image of a filesystem, which is loaded into RAM. To see what's in it, copy to someplace (I usually use /tmp), gunzip it, and do another mount -o loop command. This time, the filesystem type (the -t option) is not iso9660, it's (usually) ext2.

The initrd filesystem gets loaded into RAM, and a command/script called /linuxrc is run. This usually finds the real root filesystem, mounts it, does a few other setup activities and turns control over to it.

On an installation CD, the linuxrc script is probably either what does the install, or it calls whatever does after doing some setup.

A couple of gotchas to watch out for:

Until you have your real root filesystem loaded, you can't load modules, so anything you want the kernel to talk to has to be permanently compiled in. Most especially, this includes the iso9660 filesystem and whatever filesystem your root fs is (ext2, ext3, reiserfs, whatever).

I'd add your kernel and a stanza for it to the standard isolinux stuff. That way, you've still got the standard kernel to boot from, if needed. (Hopefully, space is not so tight that an extra meg or meg and a half is going to be a problem.)

Good luck,

CHL


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