2007-05-13 Robert Millan <rmh@aybabtu.com>

* util/update-grub.in: Fix a few assumptions about the devices holding
	/, /boot and /boot/grub being the same.
	* util/grub.d/00_header.in: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/grub.d/10_linux.in: Likewise.

	* util/grub.d/10_linux.in: Implement Linux image sorting with arbitrary
	patterns.  Use that to define the `.old' suffix as older than `'.

	* util/grub.d/00_header.in: Set default gfxmode to `800x600x16'.

	* util/update-grub.in: Add a reference to ${sysconfdir}/default/grub in
	the grub.cfg header message.
This commit is contained in:
robertmh 2007-05-13 19:28:54 +00:00
parent 2e610d6273
commit 57f9639766
5 changed files with 134 additions and 27 deletions

View file

@ -65,13 +65,44 @@ if test -e ${grub_prefix}/device.map ; then : ; else
grub-mkdevicemap
fi
exec > ${grub_cfg}.new
chmod 444 ${grub_cfg}.new
# Device containing our userland. Typicaly used for root= parameter.
GRUB_DEVICE="`grub-probe --target=device /`"
# Filesystem for the device containing our userland. Used for stuff like
# choosing Hurd filesystem module.
GRUB_FS="`grub-probe --target=fs /`"
# GRUB path to /
GRUB_DRIVE="`grub-probe --target=drive /`"
# GRUB path to /boot
if [ "x`stat -c %d /`" = "x`stat -c %d /boot/`" ] ; then
GRUB_DRIVE_BOOT="${GRUB_DRIVE}/boot"
else
GRUB_DRIVE_BOOT="`grub-probe --target=drive /boot`"
fi
# GRUB path to /boot/grub
if [ "x`stat -c %d /boot`" = "x`stat -c %d /boot/grub`" ] ; then
GRUB_DRIVE_BOOT_GRUB="${GRUB_DRIVE_BOOT}/grub"
else
GRUB_DRIVE_BOOT_GRUB="`grub-probe --target=drive /boot/grub`"
fi
if test -f ${sysconfdir}/default/grub ; then
. ${sysconfdir}/default/grub
fi
# These are defined in this script, export them here so that user can
# override them.
export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB
# These are optional, user-defined variables.
export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR
exec > ${grub_cfg}.new
chmod 444 ${grub_cfg}.new
echo "Updating ${grub_cfg} ..." >&2
cat << EOF
@ -79,13 +110,11 @@ cat << EOF
# DO NOT EDIT THIS FILE
#
# It is automaticaly generated by $0 using templates from ${update_grub_dir}
# It is automaticaly generated by $0 using templates from ${update_grub_dir}
# and settings from ${sysconfdir}/default/grub
#
EOF
export GRUB_DEVICE="`grub-probe --target=device ${grub_prefix}`"
export GRUB_DRIVE="`grub-probe --target=drive ${grub_prefix}`"
export GRUB_FS="`grub-probe --target=fs ${grub_prefix}`"
for i in ${update_grub_dir}/* ; do
case $i in
# emacsen backup files. FIXME: support other editors