diff options
author | Cody A.W. Somerville <cody.somerville@canonical.com> | 2009-09-11 09:44:40 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:09:46 +0100 |
commit | c082430348b65d2c2497c3f8c37ded7b101e537c (patch) | |
tree | 85ab89aeeef7cc095301549ec8680c84aa8f72f6 /helpers | |
parent | ec83843d6e5e7b1ca8473cf7f9b05fdfe10d220f (diff) | |
download | live-build-c082430348b65d2c2497c3f8c37ded7b101e537c.zip live-build-c082430348b65d2c2497c3f8c37ded7b101e537c.tar.gz |
Unify bootloader helpers.
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/lh_binary_grub | 52 | ||||
-rwxr-xr-x | helpers/lh_binary_yaboot | 55 |
2 files changed, 78 insertions, 29 deletions
diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub index 6ddf843..6d031e9 100755 --- a/helpers/lh_binary_grub +++ b/helpers/lh_binary_grub @@ -78,14 +78,46 @@ Grub_install_entry () INITRD="${3}" APPEND="${4}" - if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] + # Boot in quiet mode where appropriate + if [ "${LH_DISTRIBUTION}" != "etch" ] then - APPEND="${APPEND} quiet" + QAPPEND="quiet" fi - LINUX_INSTALL="${LINUX_INSTALL}\ntitle\t\tDebian GNU/Linux - ${LABEL}" - LINUX_INSTALL="${LINUX_INSTALL}\nkernel\t\t/${KERNEL} ${APPEND} LH_BOOTAPPEND_INSTALL" - LINUX_INSTALL="${LINUX_INSTALL}\ninitrd\t\t/${INITRD}" + for TYPE in Install Expert Rescue Auto + do + case "${TYPE}" in + Install) + TAPPEND="${APPEND} ${QAPPEND}" + ;; + + Expert) + TAPPEND="priority=low ${APPEND}" + ;; + + Rescue) + TAPPEND="rescue/enable=true ${APPEND} ${QAPPEND}" + ;; + + Auto) + TAPPEND="auto=true priority=critical ${APPEND} ${QAPPEND}" + ;; + esac + + case "${LABEL}" in + Text) + TYPE_SUFFIX="" + ;; + GUI) + TYPE_SUFFIX="gui" + ;; + esac + + + LINUX_INSTALL="${LINUX_INSTALL}\ntitle\t\t${LABEL} ${TYPE}" + LINUX_INSTALL="${LINUX_INSTALL}\nkernel\t\t/${KERNEL} ${TAPPEND} ${LH_BOOTAPPEND_INSTALL}" + LINUX_INSTALL="${LINUX_INSTALL}\ninitrd\t\t/${INITRD}" + done } case "${LH_INITRAMFS}" in @@ -222,14 +254,8 @@ then INITRD_GI="install/gtk/initrd.gz" APPEND_GI="video=vesa:ywrap,mtrr vga=788" - Grub_install_entry "install" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" - Grub_install_entry "installgui" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}" - Grub_install_entry "expert" "${VMLINUZ_DI}" "${INITRD_DI}" "priority=low ${APPEND_DI}" - Grub_install_entry "expertgui" "${VMLINUZ_GI}" "${INITRD_GI}" "priority=low ${APPEND_GI}" - Grub_install_entry "rescue" "${VMLINUZ_DI}" "${INITRD_DI}" "rescue/enable=true ${APPEND_DI}" - Grub_install_entry "rescuegui" "${VMLINUZ_GI}" "${INITRD_GI}" "rescue/enable=true ${APPEND_GI}" - Grub_install_entry "auto" "${VMLINUZ_DI}" "${INITRD_DI}" "auto=true priority=critical ${APPEND_DI}" - Grub_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}" + Grub_install_entry "Text" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" + Grub_install_entry "GUI" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}" fi LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot index 3babece..57e7b88 100755 --- a/helpers/lh_binary_yaboot +++ b/helpers/lh_binary_yaboot @@ -84,16 +84,46 @@ Yaboot_install_entry () DIRECTORY="/$(basename ${DESTDIR_INSTALL})" - if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] + if [ "${LH_DISTRIBUTION}" != "etch" ] then - APPEND="${APPEND} quiet" + QAPPEND="quiet" fi - LINUX_INSTALL="${LINUX_INSTALL}\nimage=${DIRECTORY}/${KERNEL}\n" - LINUX_INSTALL="${LINUX_INSTALL}\tlabel=${LABEL}\n" - LINUX_INSTALL="${LINUX_INSTALL}\tinitrd=${DIRECTORY}/${INITRD}\n" - LINUX_INSTALL="${LINUX_INSTALL}\tappend=\"LH_BOOTAPPEND_LIVE ${APPEND} LH_BOOTAPPEND_INSTALL\"\n" - LINUX_INSTALL="${LINUX_INSTALL}\tinitrd-size=10240\n" + for TYPE in Install Expert Rescue Auto + do + case "${TYPE}" in + Install) + TAPPEND="${APPEND} ${QAPPEND}" + ;; + + Expert) + TAPPEND="priority=low ${APPEND}" + ;; + + Rescue) + TAPPEND="rescue/enable=true ${APPEND} ${QAPPEND}" + ;; + + Auto) + TAPPEND="auto=true priority=critical ${APPEND} ${QAPPEND}" + ;; + esac + + case "${LABEL}" in + Text) + TYPE_SUFFIX="" + ;; + GUI) + TYPE_SUFFIX="gui" + ;; + esac + + LINUX_INSTALL="${LINUX_INSTALL}\nimage=${DIRECTORY}/${KERNEL}\n" + LINUX_INSTALL="${LINUX_INSTALL}\tlabel=${TYPE}${TYPE_SUFFIX}\n" + LINUX_INSTALL="${LINUX_INSTALL}\tinitrd=${DIRECTORY}/${INITRD}\n" + LINUX_INSTALL="${LINUX_INSTALL}\tappend=\"${TAPPEND} ${LH_BOOTAPPEND_INSTALL}\"\n" + LINUX_INSTALL="${LINUX_INSTALL}\tinitrd-size=10240\n" + done } case "${LH_INITRAMFS}" in @@ -231,15 +261,8 @@ then INITRD_GI="gtk/initrd.gz" APPEND_GI="video=vesa:ywrap,mtrr vga=788" - Yaboot_install_entry "linux" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" - Yaboot_install_entry "install" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" - Yaboot_install_entry "installgui" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}" - Yaboot_install_entry "expert" "${VMLINUZ_DI}" "${INITRD_DI}" "priority=low ${APPEND_DI}" - Yaboot_install_entry "expertgui" "${VMLINUZ_GI}" "${INITRD_GI}" "priority=low ${APPEND_GI}" - Yaboot_install_entry "rescue" "${VMLINUZ_DI}" "${INITRD_DI}" "rescue/enable=true ${APPEND_DI}" - Yaboot_install_entry "rescuegui" "${VMLINUZ_GI}" "${INITRD_GI}" "rescue/enable=true ${APPEND_GI}" - Yaboot_install_entry "auto" "${VMLINUZ_DI}" "${INITRD_DI}" "auto=true priority=critical ${APPEND_DI}" - Yaboot_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}" + Yaboot_install_entry "Text" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" + Yaboot_install_entry "GUI" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}" fi LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" |