Package: grub-pc Version: 1.99-12 Severity: wishlist Dear Maintainer,
I provide some patches based on top of debian/patches from debian bzr
repository, adding them at the end of debian/patches/series just works.
The purpose of this patches is to allow storing multiple system grub
installations on one device and let the automatic configuration updating
tools works.
My use case is the following:
I use usb keys to boot several full luks encrypted systems, one key
per system for now and I want to store all the grub installations on
one device only.
I first try to install into several partitions but on #grub channel
Jordan_U tell me about using the configfile, here is a working example
of my new setup:
- ${usb_key}/grub: master grub with hand written configuration to load
system specific configurations with "configfile" directives.
This configuration is managed on one particular system which does
the grub-setup calls on upgrade.
I added a script '/etc/grub.d/15_my_systems'
#+begin_src conf
# [...]
menuentry 'Svartalfheim' --class debian --class gnu-linux --class gnu
--class os {
insmod gzio
insmod part_msdos
insmod btrfs
set root='(/dev/sdb,msdos1)'
search --no-floppy --fs-uuid --set=root
3102b6ea-ee28-44d4-82ba-21ec98631f1e
echo 'Chargement de la configuration de svartalfheim... '
configfile /svartalfheim/grub/grub.cfg
}
menuentry 'Nidhogg' --class debian --class gnu-linux --class gnu --class os
{
insmod gzio
insmod part_msdos
insmod btrfs
set root='(/dev/sdb,msdos1)'
search --no-floppy --fs-uuid --set=root
3102b6ea-ee28-44d4-82ba-21ec98631f1e
echo 'Chargement de la configuration de nidhogg... '
configfile /nidhogg/grub/grub.cfg
}
# [...]
#+end_src
- ${usb_key}/$(hostname -s)/grub: grub installation for each host.
I use 'GRUB_SETUP=/bin/true' in '/etc/default/grub' to avoid MBR
overwrite by grub-install, only the master host manage the MBR.
I set 'GRUB_PREFIX=/boot/$(hostname -s)/grub' to update grub files by
grub-install and grub configuration by update-grub.
Regards.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (90, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-rc5+hati.1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages grub-pc depends on:
ii debconf [debconf-2.0] 1.5.41
ii grub-common 1.99-12
ii grub-pc-bin 1.99-12
ii grub2-common 1.99-12
ii ucf 3.0025+nmu2
grub-pc recommends no packages.
grub-pc suggests no packages.
-- Configuration Files:
/etc/default/grub changed:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="video=radeonfb:1600x1200-32@85 quiet"
GRUB_CMDLINE_LINUX=""
GRUB_GFXMODE=1600x1200
GRUB_DISABLE_LINUX_UUID=false
GRUB_DISABLE_LINUX_RECOVERY="true"
/etc/kernel/postinst.d/zz-update-grub [Errno 2] Aucun fichier ou dossier de ce
type: u'/etc/kernel/postinst.d/zz-update-grub'
/etc/kernel/postrm.d/zz-update-grub [Errno 2] Aucun fichier ou dossier de ce
type: u'/etc/kernel/postrm.d/zz-update-grub'
-- debconf information:
grub2/kfreebsd_cmdline:
* grub2/device_map_regenerated:
* grub-pc/linux_cmdline:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub-pc/install_devices_failed: false
* grub-pc/chainload_from_menu.lst: false
grub-pc/kopt_extracted: false
* grub-pc/install_devices: /dev/disk/by-id/ata-ST3320620AS_9QF5ZCHE
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
grub2/kfreebsd_cmdline_default: quiet
grub-pc/partition_description:
grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: video=radeonfb:1600x1200-32@85 quiet
grub-pc/mixed_legacy_and_grub2: true
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
commit aca7ee471d4270731f061df057722a58a7165d03 Author: Daniel Dehennin <[email protected]> Date: Sat Nov 5 17:50:04 2011 +0100 Add support to configurable boot directory to the Debian update-grub tool. * debian/update-grub (GRUB_BOOTDIR): Default to '/boot'. (GRUB_DIRNAME): Default to 'grub'. (GRUB_PREFIX): Default to '${GRUB_BOOTDIR}/${GRUB_DIRNAME}'. (GRUB_DEFAULT): Source the default parameter file to permit user to overwrite previous variables. Generate grub.cfg under '${GRUB_PREFIX}'. diff --git a/debian/update-grub b/debian/update-grub index 0c43327..57458df 100644 --- a/debian/update-grub +++ b/debian/update-grub @@ -1,3 +1,13 @@ #!/bin/sh set -e -exec grub-mkconfig -o /boot/grub/grub.cfg "$@" +GRUB_DEFAULT=/etc/default/grub + +if test -f ${GRUB_DEFAULT} ; then + . ${GRUB_DEFAULT} +fi + +test -z "${GRUB_BOOTDIR}" && GRUB_BOOTDIR=/boot +test -z "${GRUB_DIRNAME}" && GRUB_DIRNAME=grub +test -z "${GRUB_PREFIX}" && GRUB_PREFIX=${GRUB_BOOTDIR}/${GRUB_DIRNAME} + +exec grub-mkconfig -o ${GRUB_PREFIX}/grub.cfg "$@"
commit 54f4b453ddcb65119b4b58279d60701d8c5f150b Author: Daniel Dehennin <[email protected]> Date: Sat Nov 5 17:04:39 2011 +0100 Add support to configurable boot directory and grub path to grub-mkconfig. * util/grub-mkconfig.in: Source default parameter file before command line arguments processing. (GRUB_BOOTDIR): New variable, default to "/@bootdirname@" without double '/'. (GRUB_DIRNAME): New variable, default to "@grubdirname@" without double and leading '/'. (GRUB_PREFIX): Set it to "${GRUB_BOOTDIR}/${GRUB_DIRNAME}", this makes it user configurable. (grub_cfg): Set default value before command line processing. (GRUB_DEVICE_BOOT): Do not hard code boot directory path, use "${GRUB_BOOTDIR}". Export the new variables. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 4dac632..23d8c84 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -31,7 +31,6 @@ host_os=@host_os@ datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` -grub_cfg="" grub_mkconfig_dir=${sysconfdir}/grub.d self=`basename $0` @@ -40,7 +39,20 @@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed "${transform}"` grub_probe=${sbindir}/`echo grub-probe | sed "${transform}"` grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`" -GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"` +if test -f ${sysconfdir}/default/grub ; then + . ${sysconfdir}/default/grub +fi + +if test -n ${GRUB_BOOTDIR} ; then + GRUB_BOOTDIR=`echo '/@bootdirname@' | sed "s,//*,/,g"` +fi + +if test -n ${GRUB_DIRNAME} ; then + GRUB_DIRNAME=`echo '@grubdirname@' | sed "s,//*,/,g ; s,^/,,"` +fi + +GRUB_PREFIX="${GRUB_BOOTDIR}/${GRUB_DIRNAME}" +grub_cfg="${GRUB_PREFIX}/grub.cfg" # Usage: usage # Print the usage. @@ -145,17 +157,13 @@ GRUB_DEVICE="`${grub_probe} --target=device /`" GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true # Device containing our /boot partition. Usually the same as GRUB_DEVICE. -GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" +GRUB_DEVICE_BOOT="`${grub_probe} --target=device ${GRUB_BOOTDIR}`" GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`" -if test -f ${sysconfdir}/default/grub ; then - . ${sysconfdir}/default/grub -fi - # XXX: should this be deprecated at some point? if [ "x${GRUB_TERMINAL}" != "x" ] ; then GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" @@ -222,7 +230,9 @@ export GRUB_DEVICE \ GRUB_FS \ GRUB_FONT_PATH \ GRUB_PRELOAD_MODULES \ - GRUB_PREFIX + GRUB_PREFIX \ + GRUB_BOOTDIR \ + GRUB_DIRNAME # These are optional, user-defined variables. export GRUB_DEFAULT \ @@ -299,6 +309,10 @@ if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new ; then chmod 444 ${grub_cfg}.new || true fi +if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new ; then + chmod 444 ${grub_cfg}.new || true +fi + if test "x${grub_cfg}" != "x" ; then if ! ${grub_script_check} ${grub_cfg}.new; then echo "Syntax errors are detected in generated GRUB config file." >&2
commit 7e9c602220acb38423506dc45f252f3695deabff Author: Daniel Dehennin <[email protected]> Date: Sat Nov 5 17:05:17 2011 +0100 Add support to configurable boot directory and grub path to grub-install. Change some variable naming to me more coherent with grub-mkconfig. * util/grub-install.in (GRUB_PREFIX): New name of ${grubdir}, like in grub-mkconfig. (grub_setup): Permit to overwrite this variable with ${GRUB_SETUP} from user default variable file. (Usage): New argument "--grub-directory" to specify the name of the grub directory under /boot. (GRUB_BOOTDIR): New name of "$bootdir". (GRUB_DIRNAME): New variable to make "@grubdirname@" user configurable, can be set in user default variable file or with --grub-directory command line argument. diff --git a/util/grub-install.in b/util/grub-install.in index b17fb45..8f6dff2 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -43,8 +43,7 @@ grub_probe="${sbindir}/`echo grub-probe | sed ${transform}`" grub_editenv="${bindir}/`echo grub-editenv | sed ${transform}`" grub_mkrelpath="${bindir}/`echo grub-mkrelpath | sed ${transform}`" rootdir= -bootdir= -grubdir="`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`" +GRUB_PREFIX="`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`" modules= install_device= @@ -64,6 +63,10 @@ if test -f "${sysconfdir}/default/grub" ; then . "${sysconfdir}/default/grub" fi +if test -n ${GRUB_SETUP} ; then + grub_setup=${GRUB_SETUP} +fi + bootloader_id="$(echo "$GRUB_DISTRIBUTOR" | tr 'A-Z' 'a-z' | cut -d' ' -f1)" if test -z "$bootloader_id"; then bootloader_id=grub @@ -97,7 +100,11 @@ Install GRUB on your drive. -v, --version print the version information and exit --modules=MODULES pre-load specified modules MODULES --boot-directory=DIR install GRUB images under the directory DIR/@grubdirname@ - instead of the $grubdir directory + instead of the $GRUB_PREFIX directory + can be combined with --grub-directory + --grub-directory=DIR install GRUB images under the directory @bootdirname@/DIR + instead of the $GRUB_PREFIX directory + can be combined with --boot-directory --grub-setup=FILE use FILE as grub-setup --grub-mkimage=FILE use FILE as grub-mkimage --grub-mkrelpath=FILE use FILE as grub-mkrelpath @@ -129,7 +136,7 @@ fi INSTALL_DEVICE can be a GRUB device name or a system device filename. -$self copies GRUB images into $grubdir, and uses grub-setup +$self copies GRUB images into $GRUB_PREFIX, and uses grub-setup to install grub into the boot sector. Report bugs to <[email protected]>. @@ -181,9 +188,14 @@ do rootdir="`echo "$option" | sed 's/--root-directory=//'`" ;; --boot-directory) - bootdir="`argument $option "$@"`"; shift;; + GRUB_BOOTDIR="`argument $option "$@"`"; shift;; --boot-directory=*) - bootdir="`echo "$option" | sed 's/--boot-directory=//'`" ;; + GRUB_BOOTDIR="`echo "$option" | sed 's/--boot-directory=//'`" ;; + + --grub-directory) + GRUB_DIRNAME="`argument $option "$@"`"; shift;; + --grub-directory=*) + GRUB_DIRNAME="`echo "$option" | sed 's/--grub-directory=//'`" ;; --grub-setup) grub_setup="`argument "$option" "$@"`"; shift;; @@ -283,18 +295,23 @@ if test x"$debug" = xyes; then efi_quiet=-q fi -if [ -z "$bootdir" ]; then +if [ -z "$GRUB_BOOTDIR" ]; then # Default bootdir if bootdir not initialized. - bootdir="/@bootdirname@" + GRUB_BOOTDIR=`echo '/@bootdirname@' | sed "s,//*,/,g"` if [ -n "$rootdir" ] ; then # Initialize bootdir if rootdir was initialized. - bootdir="${rootdir}/@bootdirname@" + GRUB_BOOTDIR=`echo "/${rootdir}/@bootdirname@" | sed "s,//*,/,g"` fi fi -grubdir="`echo "${bootdir}/@grubdirname@" | sed 's,//*,/,g'`" -device_map="${grubdir}/device.map" +if test -n ${GRUB_DIRNAME} ; then + GRUB_DIRNAME=`echo '@grubdirname@' | sed "s,//*,/,g ; s,^/,,"` +fi + +GRUB_PREFIX="${GRUB_BOOTDIR}/${GRUB_DIRNAME}" + +device_map="${GRUB_PREFIX}/device.map" # Check if GRUB is installed. @@ -327,11 +344,11 @@ fi if [ x"$platform" = xefi ]; then # Find the EFI System Partition. efidir= - if test -d "${bootdir}/efi"; then - install_device="`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}/efi"`" + if test -d "${GRUB_BOOTDIR}/efi"; then + install_device="`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${GRUB_BOOTDIR}/efi"`" # Is it a mount point? - if test "x$install_device" != "x`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}"`"; then - efidir="${bootdir}/efi" + if test "x$install_device" != "x`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${GRUB_BOOTDIR}"`"; then + efidir="${GRUB_BOOTDIR}/efi" fi elif test -n "$rootdir" && test "x$rootdir" != "x/"; then # The EFI System Partition may have been given directly using @@ -432,35 +449,35 @@ if test -n "$tmp"; then fi # Copy the GRUB images to the GRUB directory. -for file in "${grubdir}"/*.mod "${grubdir}"/*.lst "${grubdir}"/*.img "${grubdir}"/efiemu??.o; do +for file in "${GRUB_PREFIX}"/*.mod "${GRUB_PREFIX}"/*.lst "${GRUB_PREFIX}"/*.img "${GRUB_PREFIX}"/efiemu??.o; do if test -f "$file" && [ "`basename $file`" != menu.lst ]; then rm -f "$file" || exit 1 fi done for file in "${pkglibdir}"/*.mod "${pkglibdir}"/*.lst; do - cp -f "$file" "${grubdir}" || exit 1 + cp -f "$file" "${GRUB_PREFIX}" || exit 1 done if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then for file in "${pkglibdir}"/*.img "${pkglibdir}"/efiemu??.o; do if test -f "$file"; then - cp -f "$file" "${grubdir}" || exit 1 + cp -f "$file" "${GRUB_PREFIX}" || exit 1 fi done fi # Copy gettext files -mkdir -p "${grubdir}"/locale/ +mkdir -p "${GRUB_PREFIX}"/locale/ for dir in "${localedir}"/*; do if test -f "$dir/LC_MESSAGES/grub.mo"; then - cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo" + cp -f "$dir/LC_MESSAGES/grub.mo" "${GRUB_PREFIX}/locale/${dir##*/}.mo" fi done # Write device to a variable so we don't have to traverse /dev every time. -grub_device="`"$grub_probe" --device-map="${device_map}" --target=device "${grubdir}"`" || exit 1 +grub_device="`"$grub_probe" --device-map="${device_map}" --target=device "${GRUB_PREFIX}"`" || exit 1 -if ! test -f "${grubdir}"/grubenv; then - "$grub_editenv" "${grubdir}"/grubenv create +if ! test -f "${GRUB_PREFIX}"/grubenv; then + "$grub_editenv" "${GRUB_PREFIX}"/grubenv create fi # Create the core image. First, auto-detect the filesystem module. @@ -468,7 +485,7 @@ fs_module="`"$grub_probe" --device-map="${device_map}" --target=fs --device "${g if test "x$fs_module" = x ; then echo "Auto-detection of a filesystem of ${grub_device} failed." 1>&2 echo "Try with --recheck." 1>&2 - echo "If the problem persists please report this together with the output of \"$grub_probe --device-map=\"${device_map}\" --target=fs -v ${grubdir}\" to <[email protected]>" 1>&2 + echo "If the problem persists please report this together with the output of \"$grub_probe --device-map=\"${device_map}\" --target=fs -v ${GRUB_PREFIX}\" to <[email protected]>" 1>&2 exit 1 fi @@ -493,7 +510,7 @@ devabstraction_module="`"$grub_probe" --device-map="${device_map}" --target=abst modules="$modules $disk_module" modules="$modules $fs_module $partmap_module $devabstraction_module" -relative_grubdir="`"$grub_mkrelpath" "${grubdir}"`" || exit 1 +relative_grubdir="`"$grub_mkrelpath" "${GRUB_PREFIX}"`" || exit 1 if [ "x${relative_grubdir}" = "x" ] ; then relative_grubdir=/ fi @@ -501,11 +518,11 @@ fi prefix_drive= config_opt= -rm -f "${grubdir}/load.cfg" +rm -f "${GRUB_PREFIX}/load.cfg" if [ "x${debug_image}" != x ]; then - echo "set debug='${debug_image}'" >> "${grubdir}/load.cfg" - config_opt="-c ${grubdir}/load.cfg " + echo "set debug='${debug_image}'" >> "${GRUB_PREFIX}/load.cfg" + config_opt="-c ${GRUB_PREFIX}/load.cfg " fi if [ "x${devabstraction_module}" = "x" ] ; then @@ -527,18 +544,18 @@ if [ "x${devabstraction_module}" = "x" ] ; then uuid="`"$grub_probe" --device-map="${device_map}" --target=fs_uuid --device "${grub_device}"`" if [ "x${uuid}" = "x" ] ; then if [ "x$platform" != xefi ] && [ "x$platform" != xpc ] && [ x"${target_cpu}-${platform}" != x"sparc64-ieee1275" ]; then - echo "UUID needed with $platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + echo "UUID needed with $platform, but the filesystem containing ${GRUB_PREFIX} does not support UUIDs." 1>&2 elif [ "$disk_module" = ata ]; then - echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + echo "UUID needed with ata mod, but the filesystem containing ${GRUB_PREFIX} does not support UUIDs." 1>&2 else - echo "UUID needed with cross-disk installs, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + echo "UUID needed with cross-disk installs, but the filesystem containing ${GRUB_PREFIX} does not support UUIDs." 1>&2 fi exit 1 fi - echo "search.fs_uuid ${uuid} root " >> "${grubdir}/load.cfg" - echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg" - config_opt="-c ${grubdir}/load.cfg " + echo "search.fs_uuid ${uuid} root " >> "${GRUB_PREFIX}/load.cfg" + echo 'set prefix=($root)'"${relative_grubdir}" >> "${GRUB_PREFIX}/load.cfg" + config_opt="-c ${GRUB_PREFIX}/load.cfg " modules="$modules search_fs_uuid" elif [ "x$platform" = xefi ] || [ "x$platform" = xpc ]; then # we need to hardcode the partition number in the core image's prefix. @@ -566,22 +583,22 @@ case "${target_cpu}-${platform}" in esac -"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1 +"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${GRUB_PREFIX}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1 # Backward-compatibility kludges if [ "${target_cpu}-${platform}" = "mips-yeeloong" ]; then - cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf + cp "${GRUB_PREFIX}/core.${imgext}" "${GRUB_BOOTDIR}"/grub.elf elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then - cp "${grubdir}/core.${imgext}" "${grubdir}/grub" + cp "${GRUB_PREFIX}/core.${imgext}" "${GRUB_PREFIX}/grub" elif [ "${target_cpu}-${platform}" = "i386-efi" ] || [ "${target_cpu}-${platform}" = "x86_64-efi" ]; then - "$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/grub.efi" --prefix="" $modules || exit 1 + "$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${GRUB_PREFIX}/grub.efi" --prefix="" $modules || exit 1 fi # Perform the platform-dependent install if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then # Now perform the installation. - "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} --directory="${grubdir}" \ + "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} --directory="${GRUB_PREFIX}" \ --device-map="${device_map}" "${install_device}" || exit 1 elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then if [ x"$update_nvram" = xyes ]; then @@ -611,7 +628,7 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla } # Point boot-device at the new grub install - boot_device="$ofpath:$partno,"`"$grub_mkrelpath" "${grubdir}/core.${imgext}" | sed 's,/,\\\\,g'` + boot_device="$ofpath:$partno,"`"$grub_mkrelpath" "${GRUB_PREFIX}/core.${imgext}" | sed 's,/,\\\\,g'` "$nvsetenv" boot-device "$boot_device" || { echo "$nvsetenv failed." echo "You will have to set boot-device manually. At the Open Firmware prompt, type:" @@ -620,10 +637,10 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla } fi elif [ x"$platform" = xefi ]; then - cp "${grubdir}/core.${imgext}" "${efidir}/${efi_file}" + cp "${GRUB_PREFIX}/core.${imgext}" "${efidir}/${efi_file}" # For old macs. Suggested by Peter Jones. if [ x$target_cpu = xi386 ]; then - cp "${grubdir}/core.${imgext}" "${efidir}/boot.efi" + cp "${GRUB_PREFIX}/core.${imgext}" "${efidir}/boot.efi" fi # Try to make this image bootable using the EFI Boot Manager, if available. @@ -667,6 +684,13 @@ if test -z "$rootdir" && \ touch /boot/grub/grub2-installed fi +# If vestiges of GRUB Legacy still exist, tell the Debian packaging that +# they can ignore them. +if test -z "$rootdir" && \ + test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst; then + touch /boot/grub/grub2-installed +fi + echo "Installation finished. No error reported." # Bye.
commit b52150bba3c219d2516f56dc95dee4081b7b5644 Author: Daniel Dehennin <[email protected]> Date: Sat Nov 5 17:06:31 2011 +0100 Use configurable boot directory when generating grub configuration. * util/grub.d/10_kfreebsd.in (list): Replace hard coded "/boot" by "${GRUB_BOOTDIR}". * util/grub.d/10_linux.in (list): Ditoo. * util/grub.d/20_linux_xen.in (linux_list): Ditoo. (xen_list): Ditoo. diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 06cc115..b9a5c15 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -115,6 +115,23 @@ EOF ;; esac + for abstraction in dummy $(grub-probe -t abstraction --device ${GRUB_DEVICE}) ; do + case $abstraction in + lvm) load_kfreebsd_module geom_linux_lvm false ;; + esac + done + + case "$(grub-probe -t abstraction --device ${GRUB_DEVICE})" in + lvm) + test -e "${module_dir}/geom_linux_lvm.ko" + + printf '%s\n' "${prepare_module_dir_cache}" + cat << EOF + kfreebsd_module_elf ${module_dir_rel}/geom_linux_lvm.ko +EOF + ;; + esac + case "${kfreebsd_fs}" in zfs) load_kfreebsd_module opensolaris false @@ -140,7 +157,7 @@ EOF EOF } -list=`for i in /boot/kfreebsd-* /boot/kernel/kernel ; do +list=`for i in ${GRUB_BOOTDIR}/kfreebsd-* ${GRUB_BOOTDIR}/kernel/kernel ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` prepare_boot_cache= diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 65508ad..8084fb1 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -128,11 +128,11 @@ EOF case x`uname -m` in xi?86 | xx86_64) - list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do + list=`for i in ${GRUB_BOOTDIR}/vmlinuz-* /vmlinuz-* ${GRUB_BOOTDIR}/kernel-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` ;; *) - list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do + list=`for i in ${GRUB_BOOTDIR}/vmlinuz-* ${GRUB_BOOTDIR}/vmlinux-* /vmlinuz-* /vmlinux-* ${GRUB_BOOTDIR}/kernel-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` ;; esac diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 00a8f87..a51e35e 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -115,7 +115,7 @@ EOF EOF } -linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do +linux_list=`for i in ${GRUB_BOOTDIR}/vmlinu[xz]-* /vmlinu[xz]-* ${GRUB_BOOTDIR}/kernel-*; do if grub_file_is_not_garbage "$i"; then basename=$(basename $i) version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") @@ -133,7 +133,7 @@ linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do if [ "x${linux_list}" = "x" ] ; then exit 0 fi -xen_list=`for i in /boot/xen*; do +xen_list=`for i in ${GRUB_BOOTDIR}/xen*; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` prepare_boot_cache=
pgpr7BAAefIWy.pgp
Description: PGP signature

