85 |
lilo=/sbin/zipl |
lilo=/sbin/zipl |
86 |
runLilo="yes" |
runLilo="yes" |
87 |
isx86="" |
isx86="" |
88 |
elif [[ ${ARCH} = armv7l ]] |
elif [[ ${ARCH} = armv7l ]] || [[ ${ARCH} = armv7hl ]] || [[ ${ARCH} = armv5tel ]] |
89 |
then |
then |
90 |
|
machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//') |
91 |
liloConfig="" |
liloConfig="" |
92 |
bootPrefix=/boot |
bootPrefix=/boot |
93 |
ubootDir=${UBOOT_DIR:-"/boot/uboot"} |
ubootDir=${UBOOT_DIR:-"/boot/uboot"} |
99 |
mounted="" |
mounted="" |
100 |
liloFlag="" |
liloFlag="" |
101 |
isx86="" |
isx86="" |
102 |
|
if [[ ${machine} == "OMAP3 Beagle Board" ]] || [[ ${machine} == "OMAP4 Panda board" ]] |
103 |
|
then |
104 |
|
ubootAddress=0x80008000 |
105 |
|
else |
106 |
|
ubootAddress=0x00008000 |
107 |
|
fi |
108 |
else |
else |
109 |
# this leaves i?86 and x86_64 |
# this leaves i?86 and x86_64 |
110 |
liloConfig=/etc/lilo.conf |
liloConfig=/etc/lilo.conf |
198 |
|
|
199 |
if [[ -n ${banner} ]] |
if [[ -n ${banner} ]] |
200 |
then |
then |
201 |
title="${banner} (${version})" |
title="${banner} [ ${version} ]" |
202 |
elif [ -f /etc/mageversion ] |
elif [ -f /etc/mageversion ] |
203 |
then |
then |
204 |
title="Magellan Linux $(< /etc/mageversion) (${version})" |
title="Magellan Linux $(< /etc/mageversion) [ ${version} ]" |
205 |
else |
else |
206 |
title="Magellan Linux (${version})" |
title="Magellan Linux [ ${version} ]" |
207 |
fi |
fi |
208 |
${grubby} --grub -c ${grubConfig} \ |
${grubby} --grub -c ${grubConfig} \ |
209 |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
219 |
|
|
220 |
if [[ -n ${banner} ]] |
if [[ -n ${banner} ]] |
221 |
then |
then |
222 |
title="${banner} (${version})" |
title="${banner} [ ${version} ]" |
223 |
elif [ -f /etc/mageversion ] |
elif [ -f /etc/mageversion ] |
224 |
then |
then |
225 |
title="Magellan Linux $(< /etc/mageversion) (${version})" |
title="Magellan Linux $(< /etc/mageversion) [ ${version} ]" |
226 |
else |
else |
227 |
title="Magellan Linux (${version})" |
title="Magellan Linux [ ${version} ]" |
228 |
fi |
fi |
229 |
${grubby} --grub2 -c ${grub2Config} \ |
${grubby} --grub2 -c ${grub2Config} \ |
230 |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
241 |
|
|
242 |
if [[ -n ${banner} ]] |
if [[ -n ${banner} ]] |
243 |
then |
then |
244 |
title="${banner} (${version})" |
title="${banner} [ ${version} ]" |
245 |
elif [ -f /etc/mageversion ] |
elif [ -f /etc/mageversion ] |
246 |
then |
then |
247 |
title="Magellan Linux $(< /etc/mageversion) (${version})" |
title="Magellan Linux $(< /etc/mageversion) [ ${version} ]" |
248 |
else |
else |
249 |
title="Magellan Linux (${version})" |
title="Magellan Linux [ ${version} ]" |
250 |
fi |
fi |
251 |
${grubby} --grub2 -c ${grub2EfiConfig} \ |
${grubby} --grub2 -c ${grub2EfiConfig} \ |
252 |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
288 |
|
|
289 |
if [[ -n ${banner} ]] |
if [[ -n ${banner} ]] |
290 |
then |
then |
291 |
title="${banner} (${version})" |
title="${banner} [ ${version} ]" |
292 |
elif [ -f /etc/mageversion ] |
elif [ -f /etc/mageversion ] |
293 |
then |
then |
294 |
title="Magellan Linux $(< /etc/mageversion) (${version})" |
title="Magellan Linux $(< /etc/mageversion) [ ${version} ]" |
295 |
else |
else |
296 |
title="Magellan Linux (${version})" |
title="Magellan Linux [ ${version} ]" |
297 |
fi |
fi |
298 |
${grubby} --extlinux -c ${extlinuxConfig} \ |
${grubby} --extlinux -c ${extlinuxConfig} \ |
299 |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
407 |
[ -f ${tmpKList} ] && rm -f ${tmpKList} |
[ -f ${tmpKList} ] && rm -f ${tmpKList} |
408 |
fi |
fi |
409 |
else |
else |
410 |
[[ -n ${verbose} ]] && echo "No previous kernel version. uBoot images not removed!" |
[[ -n ${verbose} ]] && echo "No previous kernel version. U-Boot images not removed!" |
411 |
fi |
fi |
412 |
else |
else |
413 |
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not modifying ${ubootDir}" |
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not modifying ${ubootDir}" |
507 |
[[ -n ${verbose} ]] && echo "adding $version to ${ubootDir}..." |
[[ -n ${verbose} ]] && echo "adding $version to ${ubootDir}..." |
508 |
|
|
509 |
[[ -n ${verbose} ]] && echo "creating uImage-${version}" |
[[ -n ${verbose} ]] && echo "creating uImage-${version}" |
510 |
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 \ |
mkimage -A arm -O linux -T kernel -C none -a ${ubootAddress} \ |
511 |
-n ${version} -d ${bootPrefix}/${kernelName}-${version} ${ubootDir}/uImage-${version} |
-e ${ubootAddress} -n ${version} \ |
512 |
|
-d ${bootPrefix}/${kernelName}-${version} ${ubootDir}/uImage-${version} |
513 |
|
|
514 |
[[ -n ${verbose} ]] && echo "creating uInitrd-${version}" |
[[ -n ${verbose} ]] && echo "creating uInitrd-${version}" |
515 |
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 \ |
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 \ |
548 |
fi |
fi |
549 |
} |
} |
550 |
|
|
551 |
mkinitrd() |
makeinitrd() |
552 |
{ |
{ |
553 |
if [[ -n ${dracut} ]] |
if [[ -n ${dracut} ]] |
554 |
then |
then |
555 |
tool="/sbin/dracut ${dracuthostonly} -f ${initrdfile} ${version}" |
tool="dracut ${dracuthostonly} -f ${initrdfile} ${version}" |
556 |
else |
else |
557 |
tool="/sbin/mkinitrd --allow-missing -f ${initrdfile} ${version}" |
tool="mkinitrd --allow-missing -f ${initrdfile} ${version}" |
558 |
fi |
fi |
559 |
[[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" |
[[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" |
560 |
${tool} |
${tool} |
795 |
|
|
796 |
if [[ ${initrd} = make ]] |
if [[ ${initrd} = make ]] |
797 |
then |
then |
798 |
mkinitrd |
makeinitrd |
799 |
elif [[ ${initrd} = remove ]] |
elif [[ ${initrd} = remove ]] |
800 |
then |
then |
801 |
rminitrd |
rminitrd |
813 |
[[ -n ${liloConfig} ]] && [ -f ${liloConfig} ] && cfgLilo=1 |
[[ -n ${liloConfig} ]] && [ -f ${liloConfig} ] && cfgLilo=1 |
814 |
[[ -n ${extlinuxConfig} ]] && [ -f ${extlinuxConfig} ] && cfgExtlinux=1 |
[[ -n ${extlinuxConfig} ]] && [ -f ${extlinuxConfig} ] && cfgExtlinux=1 |
815 |
|
|
816 |
# if we have a uBoot directory, check if it is mounted. |
# if we have a U-Boot directory, but no boot script, check if the directory |
817 |
# if not, mount it. Then check if a boot script exists. |
# is mounted. If not, mount it, and then check if a boot script exists. |
818 |
if [[ -n ${ubootDir} ]] |
if [[ -n ${ubootDir} ]] |
819 |
then |
then |
820 |
mountEntry=$(mount | grep ${ubootDir}) |
if [ -f ${ubootScript} ] |
|
if [[ -z ${mountEntry} ]] |
|
821 |
then |
then |
822 |
mount ${ubootDevice} ${ubootDir} |
cfguBoot=1 |
823 |
mounted=1 |
else |
824 |
|
mountEntry=$(mount | grep ${ubootDir}) |
825 |
|
if [[ -z ${mountEntry} ]] |
826 |
|
then |
827 |
|
mount ${ubootDevice} ${ubootDir} |
828 |
|
mounted=1 |
829 |
|
fi |
830 |
|
[ -f ${ubootScript} ] && cfguBoot=1 |
831 |
fi |
fi |
|
[ -f ${ubootScript} ] && cfguBoot=1 |
|
832 |
fi |
fi |
833 |
|
|
834 |
# if we have a lilo config on an x86 box, see if the default boot loader |
# if we have a lilo config on an x86 box, see if the default boot loader |
849 |
update |
update |
850 |
fi |
fi |
851 |
|
|
852 |
|
# if we mounted the U-Boot directory, unmount it. |
853 |
|
[[ -n ${mounted} ]] && umount ${ubootDir} |
854 |
|
|
855 |
exit 0 |
exit 0 |