LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Get LILO to remember last boot option (https://www.linuxquestions.org/questions/linux-general-1/get-lilo-to-remember-last-boot-option-277810/)

underberg 01-14-2005 02:21 PM

Get LILO to remember last boot option
 
Hi All,

Does anybody know how to get LILO to remember the last boot. I use Slack 10 and Windows, and I want LILO to boot the same OS as last time by default. Thanks in advance.

nilleso 01-14-2005 10:09 PM

I don't think it's possible or have never come across it at least.

great idea though :D

omes 01-15-2005 03:26 AM

Of course it's possible, but it would require some code, as i'm not sure wether it is a feature today. I'm not sure, but maybe you can request this feature to the developers. :)

Good luck, and tell us how it went ;)

- omes

underberg 01-20-2005 06:09 AM

It must be possible but I'm not a programmer so where do I find more easy to understand info on Lilo coding? Btw does anybody know the url to Lilo? Thx in advance.

Underberg

omes 01-20-2005 08:23 AM

I've sent a mail to the developer with a link to this post. I think what you mentioned is a great feature, and i'd love to see it in lilo :)
http://home.san.rr.com/johninsd/pub/linux/lilo for latest release.

- omes

ezra143 01-20-2005 09:25 AM

thats a great idea. like when you remotely reboot a dual boot box and know it wont go back to the os you had been in.... Love it.

Anyhow, I saw a solution to that for grub a few years ago, not sure if anyone has developed it further. At the time it was less than elegant and I didn't trust it enough to use.

omes 01-20-2005 09:38 AM

Quote:

Originally posted by ezra143
thats a great idea. like when you remotely reboot a dual boot box and know it wont go back to the os you had been in.... Love it.
(...)

If you need to do this, you should set the 'default' option in lilo.conf to the image you want it to boot. I guess this is more useful for dual boot users with multiple OS's/boot images.

As I said, I sent a mail to the developer. Here is my mail and the answer:
Quote:

At 06:27 AM 1/20/2005, you wrote:
>Take a look at this thread at the linuxquestions.org forum:
>http://www.linuxquestions.org/questi...0&goto=newpost
>
>Wouldn't it be a great feature that lilo boot the image/OS you chose last
>time
>you booted. I'm not saying that this should be a standard feature, but
>something you can enable if you want it. At least for people with multiple
>OS's at one computer this could be great.
>
>Tell me what you think about it.

Use the "lock" keyword.

--John



PGP KeyID: 6781C9C8 (good until 31-Dec-2008)
PGP KeyID: 178A1C6B (good until 31-Dec-2004)
Keyserver at ldap://keyserver.pgp.com
LILO links at http://freshmeat.net/projects/lilo
and Help link at http://lilo.go.dyndns.org
The lilo manual says this about 'lock':
Quote:

BOOT OPTIONS
The options described here may be specified at on the com_
mand line when a kernel image is booted. These options
are processed by LILO, and are removed from the command
line passed to the kernel, unless otherwise noted.

lock Locks the command line, as though 'lock' had been
specified in 'lilo.conf.'

Wim Sturkenboom 01-20-2005 10:15 AM

It's already possible under lilo using lock. I've tested it using RH8.

Add the following line to the general section of your lilo.conf:
Code:

lock
This will record the lilo commandline.
Activate the new configuration by running lilo and reboot.

When the lilo menu shows, go to the command line (under RH by pressing <ctrl>x). Typing ? will show the different labels as specified in lilo.conf (e.g. linux and windows). Type the name of the OS (read: label) that you want to boot (in the example linux or windows). Wait till booting has finished and reboot.
The usual lilo screen will not show and the system will immediately boot the last selection (so without the usual delay).

To select another OS, hold the <shift> key while the system reboots (just before the usual lilo menu should show); this might be a bit tricky. As a result the lilo menu shows up again; again press <ctrl>x and type the name of the required OS.
If you don't go to the lilo commandline, the 'normal' default OS will be booted after the usual delay. This also seems to clear the recorded commandline, so the next time that the system reboots, it agains shows the lilo menu.

Docs: man lilo.conf

Caution:
- First check how to access the lilo commandline
- Check my info against your lilo version; things might be slightly different
- First check if it works booting into linux; if it does not work, you can still fix lilo.conf
- It's a good idea to have a linux bootflop or rescue disk available in case it does not work so you can boot into linux and fix lilo.conf again.

My lilo.conf:
Code:

prompt
timeout=150
default=linux_8_0
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
map=/boot/message
lba34
lock

image=/boot/vmlinuz-2.4.18-14
label=linux_8_0
...

image=/boot/vmlinuz-2.4.18-3bigmem
label=linux_7_0
...

other=/dev/hda1
label=W2K
...

//edit: have to learn to type faster

underberg 03-12-2005 02:06 PM

Thank you. I've used LOCK in Lilo for a month now without problems. But I miss the Lilo start menu :-(

Wim Sturkenboom 03-30-2005 04:27 AM

As I wrote before, use shift to show the menu again.
Quote:

Originally posted by Wim Sturkenboom
To select another OS, hold the <shift> key while the system reboots (just before the usual lilo menu should show); this might be a bit tricky. As a result the lilo menu shows up again


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