fai-cd grub menu...

Russel Hill russh347 at gmail.com
Wed Nov 15 23:29:39 CET 2006


On 11/15/06, Thomas Lange <lange at informatik.uni-koeln.de> wrote:
> >>>>> On Tue, 14 Nov 2006 14:23:19 -0800, "Russel Hill" <russh347 at gmail.com> said:
>
>     > support. We can now flatline install on either IDE or SATA hard drives
>     > as long as the operator has a keyboard & display connected to choose
>     > the proper grub entry.  It will also do unattended reboots on systems
>
>     > with SATA drives. However, with IDE drives, it requires a
>     > display/keyboard and operator intervention.
> Why do you need a keyboard when using an IDE drive? Maybe you are
> using an old FAI version.
>
> Newer FAI versions support a disk_config configuration using
> the disk name disk1 instead of hda or sda. Then the FAI installation
> will choose the correct device name. Maybe this solves your problems.
>
>     > entries) IDE drives. But not with the same CD.
> Should be possible using a newer setup_harddisks version.

Our legacy systems were installed using a 2.3'ish version of FAI.
Currently, we're using FAI 3.1.

The problem isn't in disk_config, that works just fine. It is a grub issue.

We (and all or our field service folk) are used to the earlier
fai-bootcd menu.lst that used 'kernel /vmlinuz root=/dev/...'. The
earlier approach had the advantage that if vmlinuz was not present on
the boot partition, it could (and would) fallback to installation.
Thus, we could do the following:

1) Put a FAI CD into a machine with a fresh hard drive and it would
install our software unattended.

2) Leave the FAI CD in an installed machine and it would boot the installed OS.

3) Put a FAI CD into an installed machine, rm /boot/vmlinuz, reboot
and it would install our software (unattended).

The stock FAI 3.1 /boot/grub/menu.lst on the CD uses "chainloader +1"
to boot from the hard drive.  Using chainloader, if vmlinuz is not
present the boot fails but control has already passed from the CD's
grub. Thus, there is no opportunity to fallback to installation. I can
make something like this work:

#########################################
timeout 10
default 0
fallback 1

title boot from hard drive
root (hd0,0)
kernel /vmlinuz root=/dev/hda2
boot

title Boot from CD
root (cd)
kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc ...
initrd /boot/initrd.img
boot
#########################################

By changing the /dev/hda2 to a /dev/sda2 I can make this work with
SATA drives. However, I cannot make this work:

#########################################
timeout 10

color light-gray/black light-gray/red
default 0
fallback 1 2

title boot from SATA disk
root (hd0,0)
kernel /vmlinuz root=/dev/sda2 panic=5
boot

title boot from IDE disk
root (hd0,0)
kernel /vmlinuz root=/dev/hda2 panic=5
boot

title Install G6 Software
root (cd)
kernel /boot/vmlinuz root=/dev/ram0 init=/linuxrc ...
initrd /boot/initrd.img
boot
#########################################

Actually, this works fine with SATA drives. It doesn't work for IDE
drives because on a boot with the CD inserted it attempts to boot
entry 0 which kernel panics when it cannot mount /dev/sda2. When the
panic times out, grub loses its fallback context and it attempts to
boot using entry 0 again, and again, ...

The only way I can boot to an installed system with an IDE drive using
this menu.lst is with a keyboard to choose the proper grub entry.

There is a grub pattern using 'default saved' and 'savedefault
fallback' that would work if grub was running from writable media
(USB, HD, floppy, ...).

FWIW: In a perfect world I'd like to use chainloader in this way. This
would allow the fai-cd to be safely inserted into a windows machine
without accidentally flatlining it. One of our guys was burning a FAI
CD  when his windows laptop spontaneously rebooted. By the time he got
back with his cup of coffee, his windows laptop had been repartitioned
and was running linux. We found this somewhat amusing. He did not.

Thanks,
Russ



More information about the linux-fai mailing list