On 01/20/2014 01:03 PM, Steffen Grunewald wrote:
For some - yet unknown - reason, grub-pc installed itself, but was
unable to load the (also properly created) initrd (the kernel loaded
fine, but complained about "bad format" of /sbin/init).

Not exactly what you're asking, but I've ditched the FAI-provided grub
scripts and instead rely solely on debconf. I find it much more clean,
and it works great on my wheezy FAI server, which is able to install
squeeze, wheezy and jessie without issue.

Assuming you set the GRUB_PC class (based on things like uname -m, or
dpkg --print-architecture or something), here is my
hooks/debconf.GRUB_PC.source:

"""
#!/bin/sh

# Add grub-pc debconf settings to simplify the installation. The
# $BOOT_DEVICE variable is set in setup-storage/Fstab.pm, called by
# the setup-storage script, called by the "partition" task in the main
# FAI subroutines script.
#
# NOTE: These cannot be set in the FAI debconf task, since we're unable
# to use the global $BOOT_DEVICE variable in the debconf files (they
# are not scripts).
#
# NOTE: It's a good idea to override grub2/linux_cmdline_default, since
# Ubuntu sets it to "quiet splash" by default, which is silly.

test -n "$SERIAL_DEVICE" && test -n "$SERIAL_SPEED" &&
  serial="console=tty0 console=$SERIAL_DEVICE,$SERIAL_SPEED"

cat << EOF | $ROOTCMD debconf-set-selections
grub-pc grub-pc/install_devices multiselect $BOOT_DEVICE
grub-pc grub-pc/install_devices_disks_changed multiselect $BOOT_DEVICE
grub-pc grub2/linux_cmdline string $serial crashkernel=128M consoleblank=0 reboot=f
grub-pc grub2/linux_cmdline_default string
EOF
"""

When the grub-pc package is installed, it'll use these values and
install and configure grub correctly, including setting up
/etc/default/grub.

sven

Antwort per Email an