PDA

View Full Version : too lazy to type boot codes



ches
07-25-2007, 11:41 AM
How can I automate my boot codes so I don't have to type them at the boot prompt?
I don't want to "install" knoppix. I have used tohd so it will run off HDD after boot. I also use myconfig. So my boot codes look like this:
knoppix myconfig=/media/hda6 fromhd=/dev/hda6
I'm using knoppix 5.1.
I no longer have the original .iso file.
I'd really like to not have to put the Knoppix boot CD in at all. (I'll live with it. This is secondary)
I do not want to change my XP MBR.

chip.ling
08-15-2007, 07:57 PM
How can I automate my boot codes so I don't have to type them at the boot prompt?
I don't want to "install" knoppix. I have used tohd so it will run off HDD after boot. I also use myconfig. So my boot codes look like this:
knoppix myconfig=/media/hda6 fromhd=/dev/hda6
I'm using knoppix 5.1.
I no longer have the original .iso file.
I'd really like to not have to put the Knoppix boot CD in at all. (I'll live with it. This is secondary)
I do not want to change my XP MBR.

Interesting question. I did some research on this topic and here is my solution to your request:

Remaster your knoppix boot CD so it contains the "myconfig=/media/hda6 fromhd=/dev/hda6" as the default boot option.

Follow the remaster steps on http://www.knoppix.net/wiki/Knoppix_Remastering_Howto

Before you move on to create the ISO image, change the /etc/init.d/knoppix-autoconfig script.

At the beginning of the script, add the following line:


export CMDLINE="${CMDLINE} myconfig=/media/hda6 fromhd=/dev/hda6"

Save the file.

Create the ISO and burn it to the cd.

Here you go, boot from the CD and it should be all automatic now.

Pro: Simple and straight forward
Con: You still need to boot it up with the CD

I did not test it out myself. Just let us know the result when you're done. It's gonna be interesting.

Rgds,
Chip

chip.ling
08-28-2007, 03:38 AM
Sorry folks, I was given wrong info in my last post.

I take a second look on the script /etc/init.d/autoconfig, the default boot setting is stored at the file /proc/cmdline.

So the correct way to do it is:

Method 1: Edit /proc/cmdline file, add the string "myconfig=/media/hda6 fromhd=/dev/hda6" at the end of the file. Save it and remaster the CD.

Method 2: Edit /etc/init.d/autoconfig file, at line 109, you will find the statement


CMDLINE="$(cat /proc/cmdline)"

Right after this statement, add the line


CMDLINE="${CMDLINE} myconfig=/media/hda6 fromhd=/dev/hda6"

Save the file and remaster the CD.

I tried a couple of times trying to remastering the CD but unfortunately the remaster CD ISO image is far larger than the 700MB so I cannot burn it to the CD and try it.

I pretty much sure my idea will work but just not been able to prove my concept.

Rgds,
Chip