LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2005, 01:38 PM   #1
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Rep: Reputation: 15
Question 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.
 
Old 10-21-2005, 02:50 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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!!!


Last edited by win32sux; 10-21-2005 at 02:53 PM.
 
Old 10-21-2005, 07:07 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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 .
 
Old 10-22-2005, 08:11 PM   #4
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
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.
 
Old 10-22-2005, 08:40 PM   #5
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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
 
Old 10-22-2005, 08:53 PM   #6
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
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.
 
Old 10-22-2005, 09:06 PM   #7
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
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

Last edited by Yerp; 10-22-2005 at 09:14 PM.
 
Old 10-22-2005, 09:55 PM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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!

Last edited by homey; 10-22-2005 at 10:34 PM.
 
Old 10-23-2005, 12:59 AM   #9
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
much appreciated.
 
Old 10-23-2005, 05:33 AM   #10
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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
 
Old 10-23-2005, 07:51 AM   #11
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i fix my linux to make it auto mount for cdrom. when i boot the machine saw a pink1dog Linux - Software 11 04-13-2005 01:59 PM
Can't boot to another Linux kernel from boot loader Okie2003 Linux - General 6 02-01-2005 08:21 AM
9.1 install, boot from cdrom, select source as cdrom, Can't find disk jake555 Slackware 1 10-30-2003 10:34 AM
boot kernel issue with raid controller and scsi cdrom mrtwice Slackware 3 08-31-2003 09:43 PM
I need to use a windows 98 cdrom to boot my linux system... why? blacky Linux - Hardware 2 06-01-2003 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration