LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I get the linux kernel onto cdrom so that I can boot to it.. (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-get-the-linux-kernel-onto-cdrom-so-that-i-can-boot-to-it-375493/)

Yerp 10-21-2005 01:38 PM

How do I get the linux kernel onto cdrom so that I can boot to it..
 
Here is what I am looking for:

1) CD-ROM Boot -> Grub
2) Grub -> Find kernel on CD-ROM
3) Grub -> Boot kernel

Everything else after this is almost painfully easy.

My problems are:
1) Cannot find anything that explains how to make a bootable cd that can access the cd! (unless there is some grub patch I am unaware of)
2) What I can find is the annoying el-torrito, which is by all means useless. a 2.4 megabyte kernel does not fit on a floppy, which is the entire reason why I want cd-rom boot. El-Torrito is not going to cut it.
3) I can boot to an el-torrito made disk using grub, but grub cannot find the cdrom using this method. So..I cannot access the cdrom to access the kernel.

Notes:
1) The kernel is exactly, and I mean exactly, built how I need it to be. Making it smaller is NOT an option.
2) Putting the kernel or grub on any other kind of medium is exactly what I do not want to do. Pointing me to other medium will only waste my time. I specifically need CD-ROM boot and only CD-ROM boot.
3) If any of this seems offensive; sorry, but I intend to make myself clear.
4) There are many .... MANY .. cdroms that seem to boot and go to the kernel, so there is clearly something I am not seeing or understanding. If you can help clear this up, by all means tell me!
5) Final note: I do not ever intend to use Windows, using syslinux is bad practice as it requires vfat. syslinux cannot ever be a fix for my situation. (Unless I misread what syslinux says about using dos filesystems.

win32sux 10-21-2005 02:50 PM

what you need is ISOLINUX... it's part of the syslinux package...

here's the instructions on how to make the bootable ISO:

http://syslinux.zytor.com/iso.php#how

have fun!!! ;)


homey 10-21-2005 07:07 PM

Quote:

(unless there is some grub patch I am unaware of)
There is, iso9660_stage1_5 can be used to boot your cdrom with a grub menu.
On FC4, it's in the /boot/grub and /usr/share/grub/i386-redhat .
After I get the cdrom setup, I make the iso like this.....
mkisofs -J -R -b boot/grub/iso9660_stage1_5 -c boot/boot.catalog -o \
/home/bootcd.iso -no-emul-boot -boot-load-size 32 -boot-info-table .

Yerp 10-22-2005 08:11 PM

Quote:

Originally posted by homey
There is, iso9660_stage1_5 can be used to boot your cdrom with a grub menu.
On FC4, it's in the /boot/grub and /usr/share/grub/i386-redhat .
After I get the cdrom setup, I make the iso like this.....
mkisofs -J -R -b boot/grub/iso9660_stage1_5 -c boot/boot.catalog -o \
/home/bootcd.iso -no-emul-boot -boot-load-size 32 -boot-info-table .

Thanks for clearing that up. I do not understand how the stage1_5's work.

However, with the above command (inside the directory containing the kernel & grub files), booting to the cd generating the following error:

Code:

Loading stage1.5 .

GRUB loading, please wait...
Error 15

I am uncertain what error 15 means, I will be looking it up as soon as I can.

homey 10-22-2005 08:40 PM

Sorry, guess I should have included more instructions.

cd /home
mkdir -p iso/boot/grub
cp /boot/grub/menu.lst /home/iso/boot/grub
cp /boot/grub/stage* /home/iso/boot/grub
cp /boot/grub/iso9660_stage1_5 /home/iso/boot/grub
mkisofs -R -b boot/grub/iso9660_stage1_5 -no-emul-boot \
-boot-load-size 4 -boot-info-table -o grub.iso iso

Change the menu.lst from ro root=LABEL=/ rhgb quiet to root=/dev/hdb2 rhgb quiet

Here is a sample menu.lst for the cdrom
Code:

        color light-gray/blue black/light-gray
title *=*=*=*=*=*=*=*=*=*=*=*=* CDROM BOOT MENU *=*=*=*=*=*=*=*=*=*=*=*=*=*
root (hd0)
title Windows
        rootnoverify (hd0,0)
        chainloader +1
title Fedora Core
        root (hd1,1)
        kernel /boot/vmlinuz ro root=/dev/hdb2 rhgb quiet
        initrd /boot/initrd.img

Note: if you create a link from vmlinuz-2.6.9-1.724_FC3 to vmlinuz and from initrd-2.6.9-1.724 to initrd.img on the hard drive , then you can put an entry like this in the cdrom grub.conf and won't have to reburn the cdrom everytime you upgrade the kernel.
title Fedora Core (cdrom boot)
root (hd1,1)
kernel /boot/vmlinuz ro root=/dev/hdb2 rhgb quiet
initrd /boot/initrd.img

Yerp 10-22-2005 08:53 PM

here is the layout of the Directory that will be the CD:
Code:

boot/
      System.map-2.6.13.4
      bootimage
      grub/
            e2fs_stage1_5
            fat_stage1_5
            ffs_stage1_5
            iso9660_stage1_5
            jfs_stage1_5
            menu.lst
            minix_stage1_5
            reiserfs_stage1_5
            stage1
            stage2
            ufs2_stage1_5
            vstafs_stage1_5
            xfs_stage1_5
      memtest/
            memtest.bin
      vmlinuz-2.6.13.4

This is generated the error 15. (Grub never loaded the menu.lst file..)

However, that response post now says '4' instead of '32' for boot-load size. I will see if that is the problem. (it is also showing 4 on the isolinux instructions..)

also:
Quote:

Change the menu.lst from ro root=LABEL=/ rhgb quiet to root=/dev/hdb2 rhgb quiet
Any idea what kernel patch allows the use of root=LABEL=/ I have tried this on the vanilla kernel I am using (for developmental stability purposes..). If you do, could you point me to the patch. Booting to a lable will be specific to another need of mine.

Yerp 10-22-2005 09:06 PM

PERFECT!
That did it. I needed 4 and not 32. (was that a typo? got fat fingers on an undersized keyboard? :))

Anyway thinks, I can now see the cdrom!! Even root (cd) appears now when it never did before.

The commands I used were (using the layout above minus the floppy image called: bootimage):
Code:

mkisofs -RV "GRUB_BOOT" -b boot/grub/iso9660_stage1_5 -o cdrom.iso -c boot/catalog -no-emul-boot -boot-load-size 4 -boot-info-table . &&
cdrecord -v -eject -dev=/dev/hdc grub.iso

and an overall cost of 7 cd-roms. (had done numerous other attempts including the successfull but useless el-torrito.)

Looks like I had to pass root (hd2) as root (cd) resulted in a disk-read error

homey 10-22-2005 09:55 PM

Edit: You're right, using 4 does work and 32 doesn't. I'm not sure where that 32 came from. :(

I did notice that using grub.conf works better that menu.lst sometimes.
Also, you can just copy the whole /boot/grub over and even use the original grub.conf if you want.
For example:
Code:

cd /home
mkdir -p iso/boot/grub
cp -pa /boot/grub/* /home/iso/boot/grub
mkisofs -R -b boot/grub/iso9660_stage1_5 -no-emul-boot \
-boot-load-size 4 -boot-info-table -o grub.iso iso

Now, If you want to do something really cool with the cdrom, get memdisk and put that into the boot folder. Then, make an image folder in the cdrom root.
I filled that image folder up with a bunch of goodies like freedos.img , ranish.img . hdclone.img and about 60 other images.
I added an entry in the grub.conf looks like this...
Code:

        color light-gray/blue black/light-gray
title *=*=*=*=*=*=*=*=*=*=*=*=* CDROM BOOT MENU *=*=*=*=*=*=*=*=*=*=*=*=*=*
root (hd0)
title Windows
        rootnoverify (hd0,0)
        chainloader +1
title Fedora Core
        root (hd1,1)
        kernel /boot/vmlinuz ro root=/dev/hdb2 rhgb quiet
        initrd /boot/initrd.img
title Freedos V9
        kernel /boot/memdisk
        initrd=/images/freedos.img

Now, instead of puting 60 entries in the grub.conf , if I want to access one of the other images, I just press e at the boot menu and edit the intrd line. ( don't care what the title says )
For example:
title Freedos V9
kernel /boot/memdisk
initrd=/images/ranish.img

Makes for a nice tech cd! :)

Yerp 10-23-2005 12:59 AM

much appreciated.

win32sux 10-23-2005 05:33 AM

Quote:

Originally posted by Yerp
I needed 4 and not 32.
32 is probably the correct size, but using 4 makes the cd boot on more BIOSes...

patrick volkerding mentions something like this in the isolinux readme for slackware:
Quote:

Techincally the --boot-load-size should be a lot bigger, like 20 or so in order to hold the isolinux.bin boot block. However, setting it to 4 causes it to load on more BIOSes.
ftp://ftp.oregonstate.edu/pub/slackw...nux/README.TXT

homey 10-23-2005 07:51 AM

Thanks win32sux,
Guess that explains why it worked on some of my boxes and some didn't. :)


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