From 3199a409fade444b1aecc2c6e3a87b8bd54429e0 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 29 Jul 2008 00:48:31 +0100 Subject: [PATCH] Don't duplicate gtk and non-gtk kernels if they are identical. Signed-off-by: Chris Lamb --- helpers/lh_binary_grub | 7 +++++++ helpers/lh_binary_syslinux | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub index 408b48de4..4b99b260e 100755 --- a/helpers/lh_binary_grub +++ b/helpers/lh_binary_grub @@ -226,6 +226,13 @@ then INITRD_GI="install/gtk/initrd.gz" APPEND_GI="video=vesa:ywrap,mtrr vga=788" + if cmp -s ${VMLINUZ_DI} ${VMLINUZ_GI} + then + # Kernels are identical; we can save space by removing one of them. + rm ${VMLINUZ_GI} + VMLINUZ_GI="${VMLINUZ_DI}" + fi + 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}" diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index f0338ae5f..a6e318322 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -522,6 +522,13 @@ then INITRD_GI="gtk/initrd.gz" APPEND_GI="video=vesa:ywrap,mtrr vga=788" + if cmp -s ${VMLINUZ_DI} ${VMLINUZ_GI} + then + # Kernels are identical; we can save space by removing one of them. + rm ${VMLINUZ_GI} + VMLINUZ_GI="${VMLINUZ_DI}" + fi + Syslinux_install_entry "Text" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}" Syslinux_install_entry "GUI" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}" fi