--- trunk/grubby/new-kernel-pkg 2012/07/02 13:04:02 1847 +++ trunk/grubby/new-kernel-pkg 2013/02/20 13:57:53 2051 @@ -112,7 +112,7 @@ lilo=/sbin/zipl runLilo="yes" isx86="" -elif [[ ${ARCH} = armv7l ]] || [[ ${ARCH} = armv7hl ]] || [[ ${ARCH} = armv5tel ]] +elif [[ ${ARCH} =~ armv[5|7].*l ]] then liloConfig="" bootPrefix=/boot @@ -122,21 +122,10 @@ ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"} ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"} ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"} + ubootAddress=${UBOOT_IMGADDR:-"0x00008000"} mounted="" liloFlag="" isx86="" - if [[ -z ${UBOOT_IMGADDR} ]] - then - machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//') - if [ "${machine}" == "OMAP3 Beagle Board" ] || [ "${machine}" == "OMAP4 Panda board" ] - then - ubootAddress=0x80008000 - else - ubootAddress=0x00008000 - fi - else - ubootAddress="${UBOOT_IMGADDR}" - fi else # this leaves i?86 and x86_64 liloConfig=/etc/lilo.conf @@ -289,7 +278,7 @@ else title="Magellan Linux [ ${version} ]" fi - ${grubby} --grub2 -c ${grub2EfiConfig} \ + ${grubby} --grub2 -c ${grub2EfiConfig} --efi \ --add-kernel=${bootPrefix}/${kernelName}-${version} \ ${INITRD} --copy-default ${makedefault} --title "${title}" \ ${mbkernel:+--add-multiboot="${mbkernel}"} \ @@ -378,7 +367,7 @@ if [[ -n ${cfgGrub2Efi} ]] then [[ -n ${verbose} ]] && echo "removing ${version} from ${grub2EfiConfig}" - ${grubby} --grub2 -c ${grub2EfiConfig} \ + ${grubby} --grub2 -c ${grub2EfiConfig} --efi \ --remove-kernel=${bootPrefix}/${kernelName}-${version} else [[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby grub 2 with UEFI" @@ -514,7 +503,7 @@ if [[ -n ${cfgGrub2Efi} ]] then [[ -n ${verbose} ]] && echo "updating ${version} from ${grub2EfiConfig}" - ${grubby} --grub2 -c ${grub2EfiConfig} \ + ${grubby} --grub2 -c ${grub2EfiConfig} --efi \ --update-kernel=${bootPrefix}/${kernelName}-${version} \ ${INITRD} \ ${kernargs:+--args="${kernargs}"} \ @@ -875,6 +864,21 @@ fi fi +# if we're using U-Boot, check if the default load address should change +if [[ -n ${cfguBoot} ]] && [[ -z ${UBOOT_IMGADDR} ]] +then + [[ ${version} =~ .([^.]*)$ ]] + platform=${BASH_REMATCH[1]} + # A few platforms use an alternate kernel load address + if [[ ${platform} = omap ]] + then + ubootAddress=0x80008000 + elif [[ ${platform} = imx ]] + then + ubootAddress=0x90008000 + fi +fi + # if we have a lilo config on an x86 box, see if the default boot loader # is lilo to determine if it should be run if [[ -n ${cfgLilo} ]] && [[ -n ${isx86} ]]