Bump version to 3.4.28
[genkernel.git] / gen_bootloader.sh
index ee13ae6e827754f8c751dc18000fc58f76c67e66..79531d46b798796f5ecf8244db49db89a88d432c 100755 (executable)
@@ -1,3 +1,5 @@
+# $Id$
+
 set_bootloader() {
        case "${BOOTLOADER}" in
                grub)
@@ -58,10 +60,10 @@ set_bootloader_grub() {
                        echo "root (${GRUB_BOOT_DISK},${GRUB_BOOT_PARTITION})" >> ${GRUB_CONF}
                        echo >> ${GRUB_CONF}
 
-                       # Add grub configuration to grub.conf   
+                       # Add grub configuration to grub.conf
                        echo "# Genkernel generated entry, see GRUB documentation for details" >> ${GRUB_CONF}
                        echo "title=Gentoo Linux ($KV)" >> ${GRUB_CONF}
-                       if [ "${BUILD_INITRD}" -eq '0' ]
+                       if [ "${BUILD_INITRD}" = '0' ]
                        then
                                echo -e "\tkernel /kernel-${KNAME}-${ARCH}-${KV} root=${GRUB_ROOTFS}" >> ${GRUB_CONF}
                        else
@@ -96,8 +98,8 @@ set_bootloader_grub_duplicate_default_replace_kernel_initrd() {
 
 set_bootloader_grub_check_for_existing_entry() {
        local GRUB_CONF=$1
-       if grep -q "^[[:space:]]*kernel[[:space:]=]*.*/kernel-${KNAME}-${ARCH}-${KV}\>" "${GRUB_CONF}" &&
-               grep -q "^[[:space:]]*initrd[[:space:]=]*.*/initramfs-${KNAME}-${ARCH}-${KV}\>" "${GRUB_CONF}"
+       if grep -q "^[[:space:]]*kernel[[:space:]=]*.*/kernel-${KNAME}-${ARCH}-${KV}\([[:space:]]\|$\)" "${GRUB_CONF}" &&
+               grep -q "^[[:space:]]*initrd[[:space:]=]*.*/initramfs-${KNAME}-${ARCH}-${KV}\([[:space:]]\|$\)" "${GRUB_CONF}"
        then
                return 0
        fi
@@ -107,7 +109,7 @@ set_bootloader_grub_check_for_existing_entry() {
 set_bootloader_grub_duplicate_default() {
        local GRUB_CONF=$1
        local GRUB_CONF_TMP="${GRUB_CONF}.tmp"
-       
+
        line_count=$(wc -l < "${GRUB_CONF}")
        line_nums="$(grep -n "^title" "${GRUB_CONF}" | cut -d: -f1)"
        if [ -z "${line_nums}" ]; then