Am 08.04.2013 21:56, schrieb Bruce Hill:
> On Mon, Apr 08, 2013 at 09:46:28PM +0200, Michael Hampicke wrote:
>>
>> I have something similar with grub (with grub set default, savedefault,
>> fallback). Also most machines have some sort of rescue access with like
>> ipmi serial over lan or a eric card (kvm). But some remote machines
>> don't and rebooting them is always a thrill :) I mean, there are rescue
>> systems that can be invoked via bootp, but you are blind while rebooting.
> 
> Hi Michael,
> 
> If you have the time, maybe you can post your GrUB setup and a short HOW-TO do
> this somewhere. I've often mentioned doing it with LiLO in #gentoo on Freenode
> and always get flamed by GrUB fanbois, but to date none has been able to
> produce how to actually do it with GrUB. Since Gentoo now recommends GrUB
> rather by default, it might be nice for folks to know how to use this.
> 
> Thanks,
> Bruce
> 

This actually is pretty straight forward :) Here's a small sample config
for grub 0.97. But I'm pretty sure that this will work with grub2 too.

### grub.conf ###

# set default boot entry to prev. saved state:
default saved

# seq. order of boot entries
fallback 1 2 3

# here are the kernels
title gentoo 0
kernel /kernel panic=15
savedefault fallback

title gentoo 1
kernel /kernel panic=15
savedefault fallback

title gentoo 2
kernel /kernel panic=15
savedefault fallback

title gentoo 3
kernel /kernel panic=15
savedefault fallback

### end grub.conf ###

what I now do is this: set the default boot entry to zero with
% grub-set-default 0

On the next reboot this happens:

grub reads the default: 0

grub boots entry 0 and sets the default entry to 1 (or 2.... according
to the fallback line in grub.conf)

If the systems panics, it reboots. But this time grub will load entry 1
as it is the default now (and so on, and so on).

If the systems booted successfully and you verified that it actually
booted the new kernel, you now have to set grub default to 0 with
grub-set-default.
You can to this with a small script in /etc/local.d/local.start
Maybe send the admin a warning that the system has not booted with the
default kernel. That's up to you :)

HTH

Reply via email to