diff --git a/ChangeLog b/ChangeLog index 0e6d697..025d286 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ # Distributed under the GPL v2 # $Id$ + 08 Apr 2012; Mike Auty gen_bootloader.sh: + Support for Grub 2, adjustements by Tomasz Wasiak + 08 Apr 2012; Sebastian Pipping gen_initramfs.sh, genkernel.conf: Add "fastest" to supported initrd compressions diff --git a/gen_bootloader.sh b/gen_bootloader.sh index 79531d4..5c05e64 100755 --- a/gen_bootloader.sh +++ b/gen_bootloader.sh @@ -5,6 +5,9 @@ set_bootloader() { grub) set_bootloader_grub ;; + grub2) + set_bootloader_grub2 + ;; *) print_warning "Bootloader ${BOOTLOADER} is not currently supported" ;; @@ -28,6 +31,28 @@ set_bootloader_grub_read_device_map() { echo "${TEMP}/grub.map" } +set_bootloader_grub2() { + local GRUB_CONF + for candidate in \ + "${BOOTDIR}/grub2/grub.cfg" \ + "${BOOTDIR}/grub/grub.cfg" \ + ; do + if [[ -e "${candidate}" ]]; then + GRUB_CONF=${candidate} + break + fi + done + + if [[ -z "${GRUB_CONF}" ]]; then + print_error 1 "Error! Grub2 configuration file does not exist, please ensure grub2 is correctly setup first." + return 0 + fi + + print_info 1 "You can customize Grub2 parameters in /etc/default/grub." + print_info 1 "Running grub2-mkconfig to create ${GRUB_CONF}..." + grub2-mkconfig -o "${GRUB_CONF}" +} + set_bootloader_grub() { local GRUB_CONF="${BOOTDIR}/grub/grub.conf"