25 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
26 |
# |
# |
27 |
|
|
28 |
|
read_os_release() |
29 |
|
{ |
30 |
|
local NAME |
31 |
|
local ID |
32 |
|
local Version |
33 |
|
local Version_ID |
34 |
|
local PRETTY_NAME |
35 |
|
local ANSI_COLOR |
36 |
|
local CPE_NAME |
37 |
|
|
38 |
|
if [[ -f /etc/os-release ]] |
39 |
|
then |
40 |
|
source /etc/os-release |
41 |
|
|
42 |
|
case $1 in |
43 |
|
name) echo "${NAME}" ;; |
44 |
|
id) echo "${ID}" ;; |
45 |
|
version) echo "${Version}" ;; |
46 |
|
version_id) echo "${Version_ID}" ;; |
47 |
|
pretty_name) echo "${PRETTY_NAME}" ;; |
48 |
|
ansi_color) echo "${ANSI_COLOR}" ;; |
49 |
|
cpe_name) echo "${CPE_NAME}" ;; |
50 |
|
esac |
51 |
|
fi |
52 |
|
} |
53 |
|
|
54 |
PATH=/sbin:/bin:$PATH |
PATH=/sbin:/bin:$PATH |
55 |
|
|
56 |
lilo=/sbin/lilo |
lilo=/sbin/lilo |
65 |
grubby=/sbin/grubby |
grubby=/sbin/grubby |
66 |
fi |
fi |
67 |
|
|
68 |
[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel |
[ -f /etc/conf.d/grubby ] && . /etc/conf.d/grubby |
69 |
|
[ -f /etc/conf.d/grubby-uboot ] && . /etc/conf.d/grubby-uboot |
70 |
|
|
71 |
|
cfgGrub2="" |
72 |
|
cfgGrub2Efi="" |
73 |
cfgGrub="" |
cfgGrub="" |
74 |
cfgLilo="" |
cfgLilo="" |
75 |
|
cfgExtlinux="" |
76 |
|
cfguBoot="" |
77 |
runLilo="" |
runLilo="" |
78 |
grubConfig="" |
grubConfig="" |
79 |
|
grub2Config="" |
80 |
|
grub2EfiConfig="" |
81 |
|
extlinuxConfig="" |
82 |
|
ubootScript="/boot/boot.scr" |
83 |
|
|
84 |
ARCH=$(uname -m) |
ARCH=$(uname -m) |
85 |
|
|
92 |
elif [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
elif [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
93 |
then |
then |
94 |
liloConfig=/etc/yaboot.conf |
liloConfig=/etc/yaboot.conf |
95 |
|
grub2Config=/boot/grub/grub.cfg |
96 |
bootPrefix=/boot |
bootPrefix=/boot |
97 |
lilo=/sbin/ybin |
lilo=/sbin/ybin |
98 |
liloFlag=yaboot |
liloFlag=yaboot |
113 |
lilo=/sbin/zipl |
lilo=/sbin/zipl |
114 |
runLilo="yes" |
runLilo="yes" |
115 |
isx86="" |
isx86="" |
116 |
|
elif [[ ${ARCH} =~ armv[5|7].*l ]] |
117 |
|
then |
118 |
|
liloConfig="" |
119 |
|
bootPrefix=/boot |
120 |
|
extlinuxConfig=$(readlink -f /etc/extlinux.conf 2>/dev/null) |
121 |
|
ubootDir=${UBOOT_DIR:-"/boot"} |
122 |
|
ubootScript=$ubootDir/${UBOOT_SCR:-"boot.scr"} |
123 |
|
ubootKList=${UBOOT_KLIST:-"klist.txt"} |
124 |
|
ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"} |
125 |
|
ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"} |
126 |
|
ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"} |
127 |
|
ubootAddress=${UBOOT_IMGADDR:-"0x00008000"} |
128 |
|
mounted="" |
129 |
|
liloFlag="" |
130 |
|
isx86="" |
131 |
else |
else |
132 |
# this leaves i?86 and x86_64 |
# this leaves i?86 and x86_64 |
133 |
liloConfig=/etc/lilo.conf |
liloConfig=/etc/lilo.conf |
134 |
grubConfig=/boot/grub/grub.conf |
grubConfig=/boot/grub/grub.conf |
135 |
|
grub2Config=/boot/grub/grub.cfg |
136 |
|
grub2EfiConfig=/boot/grub/grub-efi.cfg |
137 |
|
extlinuxConfig=/boot/extlinux/extlinux.conf |
138 |
bootPrefix=/boot |
bootPrefix=/boot |
139 |
liloFlag=lilo |
liloFlag=lilo |
140 |
isx86="yes" |
isx86="yes" |
143 |
mode="" |
mode="" |
144 |
version="" |
version="" |
145 |
initrd="" |
initrd="" |
146 |
|
dracut="" |
147 |
|
dracuthostonly="" |
148 |
initrdfile="" |
initrdfile="" |
149 |
|
devtreefile="" |
150 |
moddep="" |
moddep="" |
151 |
verbose="" |
verbose="" |
152 |
makedefault="" |
makedefault="" |
153 |
package="" |
package="" |
154 |
mbkernel="" |
mbkernel="${HYPERVISOR}" |
155 |
mbargs="" |
mbargs="${HYPERVISOR_ARGS}" |
156 |
|
adddracutargs="" |
157 |
|
addplymouthinitrd="" |
158 |
|
DEBUGARG="systemd.debug" |
159 |
|
|
160 |
usage() |
usage() |
161 |
{ |
{ |
162 |
echo "Usage: $(basename $0) [-v] [--mkinitrd] [--rminitrd]" >&2 |
echo "Usage: $(basename $0) [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2 |
163 |
echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 |
echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 |
164 |
echo " [--kernel-args=<args>] [--remove-args=<args>]" >&2 |
echo " [--kernel-args=<args>] [--remove-args=<args>]" >&2 |
165 |
echo " [--banner=<banner>] [--multiboot=multiboot]" >&2 |
echo " [--banner=<banner>] [--multiboot=multiboot]" >&2 |
166 |
echo " [--mbargs=mbargs] [--make-default]" >&2 |
echo " [--mbargs=mbargs] [--make-default] [--add-dracut-args]" >&2 |
167 |
|
echo " [--add-plymouth-initrd]" >&2 |
168 |
|
echo " [--host-only] [--devtree=<devicetree.dtb>]" >&2 |
169 |
echo " <--install | --remove | --update> <kernel-version>" >&2 |
echo " <--install | --remove | --update> <kernel-version>" >&2 |
170 |
echo " (ex: $(basename $0) --mkinitrd --depmod --install 2.4.7-2)" >&2 |
echo " (ex: $(basename $0) --mkinitrd --depmod --install 2.4.7-2)" >&2 |
171 |
exit 1 |
exit 1 |
172 |
} |
} |
173 |
|
|
174 |
|
rungrubby() |
175 |
|
{ |
176 |
|
if [[ $1 == --debug ]] |
177 |
|
then |
178 |
|
[[ ${MAKEDEBUG} != yes ]] && return 0 |
179 |
|
[[ -n ${verbose} ]] && echo "- First, making a debug entry." |
180 |
|
declare -x debugtitle=" with debugging" |
181 |
|
declare -x debugargs="${DEBUGARG}" |
182 |
|
shift |
183 |
|
else |
184 |
|
[[ -n ${verbose} ] && echo "- Making a normal entry." |
185 |
|
fi |
186 |
|
$(eval $grubby $@) |
187 |
|
export -n debugargs |
188 |
|
export -n debugtitle |
189 |
|
unset debugargs |
190 |
|
unset debugtitle |
191 |
|
} |
192 |
|
|
193 |
|
set_title() |
194 |
|
{ |
195 |
|
if [[ -n ${banner} ]] |
196 |
|
then |
197 |
|
if [[ ${ARCH} = s390 ]] || [[ ${ARCH} = s390x ]] |
198 |
|
then |
199 |
|
title=$(echo ${banner} | sed 's/ /_/g') |
200 |
|
else |
201 |
|
title="${banner} [ ${version} ]" |
202 |
|
fi |
203 |
|
elif [[ ${ARCH} = s390 ]] || [[ ${ARCH} = s390x ]] |
204 |
|
then |
205 |
|
title=$(echo ${version} | sed 's/ /_/g') |
206 |
|
elif [ -f /etc/os-release ] |
207 |
|
then |
208 |
|
title="$(read_os_release name) $(read_os_release version_id) [ ${version} ]" |
209 |
|
elif [ -f /etc/mageversion ] |
210 |
|
then |
211 |
|
title="Magellan Linux $(< /etc/mageversion) [ ${version} ]" |
212 |
|
else |
213 |
|
title="Magellan Linux [ ${version} ]" |
214 |
|
fi |
215 |
|
} |
216 |
|
|
217 |
install() |
install() |
218 |
{ |
{ |
219 |
# XXX kernel should be able to be specified also (or work right on ia64) |
# XXX kernel should be able to be specified also (or work right on ia64) |
220 |
if [ ! -f ${bootPrefix}/${kernelName}-${version} ] |
if [ ! -f ${kernelImage} ] |
221 |
then |
then |
222 |
[[ -n ${verbose} ]] && echo "kernel for ${version} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "kernel for ${version} does not exist, not running grubby" |
223 |
return |
return |
228 |
then |
then |
229 |
[[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" |
[[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" |
230 |
INITRD="--initrd ${initrdfile}" |
INITRD="--initrd ${initrdfile}" |
231 |
|
|
232 |
|
if [[ -n ${addplymouthinitrd} ]] |
233 |
|
then |
234 |
|
INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" |
235 |
|
fi |
236 |
|
fi |
237 |
|
|
238 |
|
DEVTREE="" |
239 |
|
if [[ x${devtreefile} != x ]] && [ -f "${devtreefile}" ] |
240 |
|
then |
241 |
|
[[ -n ${verbose} ]] && echo "found ${devtreefile} and using it with grubby" |
242 |
|
DEVTREE="--devtree ${devtreefile}" |
243 |
fi |
fi |
244 |
|
|
245 |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
249 |
if [[ -z ${initrdfile} ]] |
if [[ -z ${initrdfile} ]] |
250 |
then |
then |
251 |
[[ -n ${verbose} ]] && echo "No initrd, just adding system map" |
[[ -n ${verbose} ]] && echo "No initrd, just adding system map" |
252 |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${bootPrefix}/${kernelName}-${version} ${bootPrefix}/vmlinitrd-${version} |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${kernelImage} ${bootPrefix}/vmlinitrd-${version} |
253 |
else |
else |
254 |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${bootPrefix}/${kernelName}-${version} ${bootPrefix}/vmlinux.sm-${version} |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${kernelImage} ${bootPrefix}/vmlinux.sm-${version} |
255 |
/sbin/addRamDisk ${initrdfile} ${bootPrefix}/System.map-${version} ${bootPrefix}/vmlinux.sm-${version} ${bootPrefix}/vmlinitrd-${version} 2>/dev/null |
/sbin/addRamDisk ${initrdfile} ${bootPrefix}/System.map-${version} ${bootPrefix}/vmlinux.sm-${version} ${bootPrefix}/vmlinitrd-${version} 2>/dev/null |
256 |
rm ${bootPrefix}/vmlinux.sm-${version} |
rm ${bootPrefix}/vmlinux.sm-${version} |
257 |
fi |
fi |
259 |
fi |
fi |
260 |
|
|
261 |
# get the root filesystem to use |
# get the root filesystem to use |
262 |
rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab) |
rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab 2>/dev/null) |
263 |
|
if [[ -z $rootdevice ]] |
264 |
|
then |
265 |
|
rootdevice=$(grep -o -P "(?<=root=)\S+" /proc/cmdline) |
266 |
|
fi |
267 |
|
|
268 |
if [[ -n ${mbkernel} ]] && [[ -n ${cfgLilo} ]] && [[ ${liloFlag} != elilo ]] |
if [[ -n ${mbkernel} ]] && [[ -n ${cfgLilo} ]] && [[ ${liloFlag} != elilo ]] |
269 |
then |
then |
271 |
cfgLilo="" |
cfgLilo="" |
272 |
fi |
fi |
273 |
|
|
274 |
|
set_title |
275 |
|
|
276 |
if [[ -n ${cfgGrub} ]] |
if [[ -n ${cfgGrub} ]] |
277 |
then |
then |
278 |
[[ -n ${verbose} ]] && echo "adding ${version} to ${grubConfig}" |
[[ -n ${verbose} ]] && echo "adding ${version} to ${grubConfig}" |
279 |
|
|
280 |
if [[ -n ${banner} ]] |
ARGS="--grub -c ${grubConfig} --add-kernel=${kernelImage} ${INITRD} \ |
281 |
then |
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
282 |
title="${banner} (${version})" |
${mbargs:+--mbargs=\"${mbargs}\"} \ |
283 |
elif [ -f /etc/mageversion ] |
--title=\"${title}\${debugtitle}\" --copy-default \ |
284 |
then |
--args=\"root=${rootdevice} ${kernargs} \${debugargs}\" \ |
285 |
title="Magellan Linux $(< /etc/mageversion) (${version})" |
--remove-kernel=\"TITLE=${title}\${debugtitle}\"" |
286 |
else |
rungrubby --debug ${ARGS} |
287 |
title="Magellan Linux (${version})" |
rungrubby ${ARGS} ${makedefault} |
|
fi |
|
|
${grubby} --add-kernel=${bootPrefix}/${kernelName}-${version} \ |
|
|
${INITRD} --copy-default ${makedefault} --title "${title}" \ |
|
|
${mbkernel:+--add-multiboot="${mbkernel}"} ${mbargs:+--mbargs="${mbargs}"} \ |
|
|
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${title}" |
|
288 |
else |
else |
289 |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby for grub 0.97" |
290 |
|
fi |
291 |
|
if [[ -n ${cfgGrub2} ]] |
292 |
|
then |
293 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${grub2Config}" |
294 |
|
|
295 |
|
ARGS="--grub2 -c ${grub2Config} --add-kernel=${kernelImage} ${INITRD} \ |
296 |
|
--copy-default --title \"${title}\${debugtitle}\" \ |
297 |
|
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
298 |
|
${mbargs:+--mbargs=\"${mbargs}\"} \ |
299 |
|
--args=\"root=${rootdevice} ${kernargs} \${debugargs}\" \ |
300 |
|
--remove-kernel=\"TITLE=${title}\${debugtitle}\"" |
301 |
|
rungrubby --debug ${ARGS} |
302 |
|
rungrubby ${ARGS} ${makedefault} |
303 |
|
else |
304 |
|
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby for grub 2" |
305 |
|
fi |
306 |
|
if [[ -n ${cfgGrub2Efi} ]] |
307 |
|
then |
308 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${grub2EfiConfig}" |
309 |
|
|
310 |
|
ARGS="--grub2 -c ${grub2EfiConfig} --efi \ |
311 |
|
--add-kernel=${kernelImage} ${DEVTREE} ${INITRD} \ |
312 |
|
--copy-default --title \"${title}\${debugtitle}\" \ |
313 |
|
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
314 |
|
${mbargs:+--mbargs=\"${mbargs}\"} \ |
315 |
|
--args=\"root=${rootdevice} ${kernargs} \${debugargs}\" \ |
316 |
|
--remove-kernel=\"TITLE=${title}\${debugtitle}\"" |
317 |
|
rungrubby --debug ${ARGS} |
318 |
|
rungrubby ${ARGS} ${makedefault} |
319 |
|
else |
320 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby for grub 2 with UEFI" |
321 |
fi |
fi |
322 |
|
|
323 |
if [[ -n ${cfgLilo} ]] |
if [[ -n ${cfgLilo} ]] |
324 |
then |
then |
325 |
[[ -n ${verbose} ]] && echo "adding ${version} to ${liloConfig}" |
[[ -n ${verbose} ]] && echo "adding ${version} to ${liloConfig}" |
326 |
|
|
327 |
${grubby} --add-kernel=${bootPrefix}/${kernelName}-${version} ${INITRD} \ |
ARGS="--${liloFlag} --add-kernel=${kernelImage} ${INITRD} \ |
328 |
--copy-default ${makedefault} --title ${version} \ |
--copy-default --title \"${title}\${debugtitle}\" \ |
329 |
${mbkernel:+--add-multiboot="${mbkernel}"} ${mbargs:+--mbargs="${mbargs}"} \ |
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
330 |
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${version}" \ |
${mbargs:+--mbargs=\"${mbargs}\"} \ |
331 |
--${liloFlag} |
--args=\"root=${rootdevice} ${kernargs} \${debugargs}\" \ |
332 |
|
--remove-kernel=\"TITLE=${version}\"" |
333 |
|
rungrubby --debug ${ARGS} |
334 |
|
rungrubby ${ARGS} ${makedefault} |
335 |
|
|
336 |
if [[ -n ${runLilo} ]] |
if [[ -n ${runLilo} ]] |
337 |
then |
then |
338 |
[[ -n ${verbose} ]] && echo "running ${lilo}" |
[[ -n ${verbose} ]] && echo "running ${lilo}" |
339 |
if [ ! -x $lilo ] |
if [ ! -x ${lilo} ] |
340 |
then |
then |
341 |
[[ -n ${verbose} ]] && echo "${lilo} does not exist" |
[[ -n ${verbose} ]] && echo "${lilo} does not exist" |
342 |
else |
else |
346 |
else |
else |
347 |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
348 |
fi |
fi |
349 |
|
|
350 |
|
if [[ -n ${cfgExtlinux} ]] |
351 |
|
then |
352 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${extlinuxConfig}" |
353 |
|
|
354 |
|
ARGS="--extlinux -c ${extlinuxConfig} --add-kernel=${kernelImage} \ |
355 |
|
${INITRD} --copy-default --title \"${title}\${debugtitle}\" \ |
356 |
|
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
357 |
|
${mbargs:+--mbargs=\"${mbargs}\"} \ |
358 |
|
--args=\"root=${rootdevice} ${kernargs} \${debugargs}\" \ |
359 |
|
--remove-kernel=\"TITLE=${title}\${debugtitle}\"" |
360 |
|
rungrubby --debug ${ARGS} |
361 |
|
rungrubby ${ARGS} ${makedefault} |
362 |
|
else |
363 |
|
[[ -n ${verbose} ]] && echo "${extlinuxConfig} does not exist, not running grubby for extlinux" |
364 |
|
fi |
365 |
} |
} |
366 |
|
|
367 |
remove() |
remove() |
370 |
if [ -d /proc/iSeries ] |
if [ -d /proc/iSeries ] |
371 |
then |
then |
372 |
[[ -n ${verbose} ]] && echo "On an iSeries, remove img file" |
[[ -n ${verbose} ]] && echo "On an iSeries, remove img file" |
373 |
rm -f ${bootPrefix}/${kernelName}-${version}.img 2>/dev/null |
rm -f ${kernelImage}.img 2>/dev/null |
374 |
return |
return |
375 |
fi |
fi |
376 |
|
|
377 |
if [[ -n ${cfgGrub} ]] |
if [[ -n ${cfgGrub} ]] |
378 |
then |
then |
379 |
[[ -n ${verbose} ]] && echo "removing ${version} from ${grubConfig}" |
[[ -n ${verbose} ]] && echo "removing ${version} from ${grubConfig}" |
380 |
${grubby} --remove-kernel=${bootPrefix}/${kernelName}-${version} |
${grubby} --grub -c ${grubConfig} \ |
381 |
|
--remove-kernel=${kernelImage} |
382 |
else |
else |
383 |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby for grub 0.97" |
384 |
|
fi |
385 |
|
if [[ -n ${cfgGrub2} ]] |
386 |
|
then |
387 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${grub2Config}" |
388 |
|
${grubby} --grub2 -c ${grub2Config} \ |
389 |
|
--remove-kernel=${kernelImage} |
390 |
|
else |
391 |
|
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby for grub 2" |
392 |
|
fi |
393 |
|
if [[ -n ${cfgGrub2Efi} ]] |
394 |
|
then |
395 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${grub2EfiConfig}" |
396 |
|
${grubby} --grub2 -c ${grub2EfiConfig} --efi \ |
397 |
|
--remove-kernel=${kernelImage} |
398 |
|
else |
399 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby grub 2 with UEFI" |
400 |
fi |
fi |
401 |
|
|
402 |
if [[ -n ${cfgLilo} ]] |
if [[ -n ${cfgLilo} ]] |
403 |
then |
then |
404 |
[[ -n ${verbose} ]] && echo "removing ${version} from ${liloConfig}" |
[[ -n ${verbose} ]] && echo "removing ${version} from ${liloConfig}" |
405 |
${grubby} --remove-kernel=${bootPrefix}/${kernelName}-${version} \ |
${grubby} --remove-kernel=${kernelImage} --${liloFlag} |
|
--${liloFlag} |
|
406 |
|
|
407 |
if [[ -n ${runLilo} ]] |
if [[ -n ${runLilo} ]] |
408 |
then |
then |
417 |
else |
else |
418 |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
419 |
fi |
fi |
420 |
|
|
421 |
|
if [[ -n ${cfguBoot} ]] |
422 |
|
then |
423 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${ubootDir}..." |
424 |
|
|
425 |
|
if [ -f ${ubootDir}/${ubootKList} ] |
426 |
|
then |
427 |
|
tmpKList=$(mktemp ${ubootDir}/${ubootKList}.XXXX) |
428 |
|
curversion=$(tail -n1 ${ubootDir}/${ubootKList}) |
429 |
|
sed "/$version$/d" ${ubootDir}/${ubootKList} > ${tmpKList} |
430 |
|
newversion=$(tail -n1 ${tmpKList}) |
431 |
|
if [ -f ${ubootDir}/uImage-${newversion} ] && [ -f ${ubootDir}/uInitrd-${newversion} ] |
432 |
|
then |
433 |
|
if [[ ${curversion} != ${newversion} ]] |
434 |
|
then |
435 |
|
cp -fp ${ubootDir}/uImage-${newversion} ${ubootDir}/${ubootDefaultImage} |
436 |
|
if [ $? -ne 0 ] |
437 |
|
then |
438 |
|
[[ -n ${verbose} ]] && echo "copy uImage-${newversion} error, default kernel not replaced!" && exit |
439 |
|
fi |
440 |
|
cp -fp ${ubootDir}/uInitrd-${newversion} ${ubootDir}/${ubootDefaultInitrd} |
441 |
|
if [ $? -ne 0 ] |
442 |
|
then |
443 |
|
[[ -n ${verbose} ]] && echo "copy uInitrd-${newversion} error, default Initrd not replaced!" && exit |
444 |
|
fi |
445 |
|
fi |
446 |
|
|
447 |
|
[[ -n ${verbose} ]] && echo "removing uImage-${version}" |
448 |
|
if [ -f ${ubootDir}/uImage-${version} ] |
449 |
|
then |
450 |
|
rm -f ${ubootDir}/uImage-${version} |
451 |
|
else |
452 |
|
[[ -n ${verbose} ]] && echo "uImage-${version} did not exist!" |
453 |
|
fi |
454 |
|
|
455 |
|
[[ -n ${verbose} ]] && echo "removing uInitrd-${version}" |
456 |
|
if [ -f ${ubootDir}/uInitrd-${version} ] |
457 |
|
then |
458 |
|
rm -f ${ubootDir}/uInitrd-${version} |
459 |
|
else |
460 |
|
[[ -n ${verbose} ]] && echo "uInitrd-${version} did not exist!" |
461 |
|
fi |
462 |
|
|
463 |
|
mv ${tmpKList} ${ubootDir}/${ubootKList} |
464 |
|
[ -x /sbin/a-b-c ] && /sbin/a-b-c |
465 |
|
else |
466 |
|
[[ -n ${verbose} ]] && echo "uImage ${newversion} does not exist!" |
467 |
|
[ -f ${tmpKList} ] && rm -f ${tmpKList} |
468 |
|
fi |
469 |
|
else |
470 |
|
[[ -n ${verbose} ]] && echo "No previous kernel version. U-Boot images not removed!" |
471 |
|
fi |
472 |
|
else |
473 |
|
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not modifying ${ubootDir}" |
474 |
|
fi |
475 |
|
|
476 |
|
if [[ -n ${cfgExtlinux} ]] |
477 |
|
then |
478 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${extlinuxConfig}" |
479 |
|
${grubby} --extlinux -c ${extlinuxConfig} \ |
480 |
|
--remove-kernel=${kernelImage} |
481 |
|
else |
482 |
|
[[ -n ${verbose} ]] && echo "${extlinuxConfig} does not exist, not running grubby for extlinux" |
483 |
|
fi |
484 |
} |
} |
485 |
|
|
486 |
update() |
update() |
487 |
{ |
{ |
488 |
|
if [ ! -f ${kernelImage} ] |
489 |
|
then |
490 |
|
[[ -n ${verbose} ]] && echo "kernel for ${version} does not exist, not running grubby" |
491 |
|
return |
492 |
|
fi |
493 |
|
|
494 |
|
set_title |
495 |
|
|
496 |
|
INITRD="" |
497 |
|
if [ -f ${initrdfile} ] |
498 |
|
then |
499 |
|
[[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" |
500 |
|
INITRD="--initrd ${initrdfile}" |
501 |
|
|
502 |
|
if [[ -n ${addplymouthinitrd} ]] |
503 |
|
then |
504 |
|
INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" |
505 |
|
fi |
506 |
|
fi |
507 |
|
|
508 |
if [[ -n ${cfgGrub} ]] |
if [[ -n ${cfgGrub} ]] |
509 |
then |
then |
510 |
[[ -n ${verbose} ]] && echo "updating ${version} from ${grubConfig}" |
[[ -n ${verbose} ]] && echo "updating ${version} from ${grubConfig}" |
511 |
${grubby} --update-kernel=${bootPrefix}/${kernelName}-${version} \ |
ARGS="--grub -c ${grubConfig} --update-kernel=${kernelImage} ${INITRD} \ |
512 |
${kernargs:+--args="${kernargs}"} \ |
${kernargs:+--args=\"${kernargs}\"} \ |
513 |
${removeargs:+--remove-args="${removeargs}"} |
${removeargs:+--remove-args=\"${removeargs}\"} \ |
514 |
|
${mbkernel:+--add-multiboot=\"${mbkernel}\"} \ |
515 |
|
--title=\"${title}\${debugtitle}\"" |
516 |
|
rungrubby --debug ${ARGS} |
517 |
|
rungrubby ${ARGS} |
518 |
else |
else |
519 |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby" |
520 |
fi |
fi |
521 |
|
|
522 |
|
if [[ -n ${cfgGrub2} ]] |
523 |
|
then |
524 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${grub2Config}" |
525 |
|
ARGS="--grub2 -c ${grub2Config} --update-kernel=${kernelImage} ${INITRD} \ |
526 |
|
${kernargs:+--args=\"${kernargs}\"} \ |
527 |
|
${removeargs:+--remove-args=\"${removeargs}\"} \ |
528 |
|
--title=\"${title}\${debugtitle}\"" |
529 |
|
rungrubby --debug ${ARGS} |
530 |
|
rungrubby ${ARGS} |
531 |
|
else |
532 |
|
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby" |
533 |
|
fi |
534 |
|
|
535 |
|
if [[ -n ${cfgGrub2Efi} ]] |
536 |
|
then |
537 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${grub2EfiConfig}" |
538 |
|
ARGS="--grub2 -c ${grub2EfiConfig} --efi --update-kernel=${kernelImage} \ |
539 |
|
${INITRD} ${kernargs:+--args=\"${kernargs}\"} \ |
540 |
|
${removeargs:+--remove-args=\"${removeargs}\"} \ |
541 |
|
--title=\"${title}\${debugtitle}\"" |
542 |
|
rungrubby --debug ${ARGS} |
543 |
|
rungrubby ${ARGS} |
544 |
|
else |
545 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby" |
546 |
|
fi |
547 |
|
|
548 |
if [[ -n ${cfgLilo} ]] |
if [[ -n ${cfgLilo} ]] |
549 |
then |
then |
550 |
[[ -n ${verbose} ]] && echo "updating ${version} from ${liloConfig}" |
[[ -n ${verbose} ]] && echo "updating ${version} from ${liloConfig}" |
551 |
${grubby} --update-kernel=${bootPrefix}/${kernelName}-${version} \ |
ARGS="--${liloFlag} --update-kernel=${kernelImage} ${INITRD} \ |
552 |
${kernargs:+--args="${kernargs}"} \ |
${kernargs:+--args=\"${kernargs}\"} \ |
553 |
${removeargs:+--remove-args="${removeargs}"} \ |
${removeargs:+--remove-args=\"${removeargs}\"} \ |
554 |
--${liloFlag} |
--title=\"${title}\${debugtitle}\"" |
555 |
|
rungrubby --debug ${ARGS} |
556 |
|
rungrubby ${ARGS} |
557 |
|
|
558 |
if [[ -n ${runLilo} ]] |
if [[ -n ${runLilo} ]] |
559 |
then |
then |
568 |
else |
else |
569 |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
570 |
fi |
fi |
571 |
|
|
572 |
|
if [[ -n ${cfguBoot} ]] |
573 |
|
then |
574 |
|
[[ -n ${verbose} ]] && echo "adding $version to ${ubootDir}..." |
575 |
|
|
576 |
|
[[ -n ${verbose} ]] && echo "creating uImage-${version}" |
577 |
|
mkimage -A arm -O linux -T kernel -C none -a ${ubootAddress} \ |
578 |
|
-e ${ubootAddress} -n ${version} \ |
579 |
|
-d ${kernelImage} ${ubootDir}/uImage-${version} |
580 |
|
|
581 |
|
[[ -n ${verbose} ]] && echo "creating uInitrd-${version}" |
582 |
|
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 \ |
583 |
|
-n initramfs -d ${initrdfile} ${ubootDir}/uInitrd-${version} |
584 |
|
|
585 |
|
if [ -f ${ubootDir}/uImage-${version} ] && [ -f ${ubootDir}/uInitrd-${version} ] |
586 |
|
then |
587 |
|
cp -fp ${ubootDir}/uImage-${version} ${ubootDir}/${ubootDefaultImage} |
588 |
|
if [ $? -ne 0 ] |
589 |
|
then |
590 |
|
[[ -n ${verbose} ]] && echo "copy uImage-${version} error, kernel not installed!" && exit |
591 |
|
fi |
592 |
|
cp -fp ${ubootDir}/uInitrd-${version} ${ubootDir}/${ubootDefaultInitrd} |
593 |
|
if [ $? -ne 0 ] |
594 |
|
then |
595 |
|
[[ -n ${verbose} ]] && echo "copy uInitrd-${version} error, kernel not installed!" && exit |
596 |
|
fi |
597 |
|
echo ${version} >> ${ubootDir}/${ubootKList} |
598 |
|
[ -x /sbin/a-b-c ] && /sbin/a-b-c |
599 |
|
else |
600 |
|
[[ -n ${verbose} ]] && echo "cannot make ${version} the default" |
601 |
|
fi |
602 |
|
else |
603 |
|
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not setting up ${ubootDir}" |
604 |
|
fi |
605 |
|
|
606 |
|
if [[ -n ${cfgExtlinux} ]] |
607 |
|
then |
608 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${extlinuxConfig}" |
609 |
|
ARGS="--extlinux -c ${extlinuxConfig} --update-kernel=${kernelImage} \ |
610 |
|
${INITRD} ${kernargs:+--args=\"${kernargs}\"} \ |
611 |
|
${removeargs:+--remove-args=\"${removeargs}\"} \ |
612 |
|
--title=\"${title}\${debugtitle}\"" |
613 |
|
rungrubby --debug ${ARGS} |
614 |
|
rungrubby ${ARGS} |
615 |
|
else |
616 |
|
[[ -n ${verbose} ]] && echo "${extlinuxConfig} does not exist, not running grubby" |
617 |
|
fi |
618 |
} |
} |
619 |
|
|
620 |
mkinitrd() |
makeinitrd() |
621 |
{ |
{ |
622 |
|
if [[ -n ${dracut} ]] |
623 |
|
then |
624 |
|
tool="dracut ${dracuthostonly} -f ${initrdfile} ${version}" |
625 |
|
else |
626 |
|
tool="mkinitrd --allow-missing -f ${initrdfile} ${version}" |
627 |
|
fi |
628 |
[[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" |
[[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" |
629 |
/sbin/mkinitrd --allow-missing -f ${initrdfile} ${version} |
${tool} |
630 |
rc=$? |
rc=$? |
631 |
if [ ${rc} != 0 ] |
if [ ${rc} != 0 ] |
632 |
then |
then |
650 |
doRmmoddep() |
doRmmoddep() |
651 |
{ |
{ |
652 |
[[ -n ${verbose} ]] && echo "removing modules.dep info for ${version}" |
[[ -n ${verbose} ]] && echo "removing modules.dep info for ${version}" |
653 |
[ -d /lib/modules/${version} ] && rm -f /lib/modules/${version}/modules.* |
if [ -d /lib/modules/${version} ] |
654 |
|
then |
655 |
|
rm -f /lib/modules/${version}/modules.*.bin \ |
656 |
|
/lib/modules/${version}/modules.{alias,dep,devname,symbols,softdep} |
657 |
|
fi |
658 |
} |
} |
659 |
|
|
660 |
|
|
669 |
initrd="remove" |
initrd="remove" |
670 |
;; |
;; |
671 |
|
|
672 |
|
--devtree*) |
673 |
|
if [[ $1 == --devtree\=* ]] |
674 |
|
then |
675 |
|
devtreefile="${1#--devtreefile=}" |
676 |
|
else |
677 |
|
devtreefile="$2" |
678 |
|
shift |
679 |
|
fi |
680 |
|
;; |
681 |
|
|
682 |
|
--dracut) |
683 |
|
dracut=--dracut |
684 |
|
;; |
685 |
|
|
686 |
|
--host-only) |
687 |
|
dracuthostonly=-H |
688 |
|
;; |
689 |
|
|
690 |
--initrdfile*) |
--initrdfile*) |
691 |
if echo $1 | grep '=' >/dev/null |
if [[ $1 == --initrdfile\=* ]] |
692 |
then |
then |
693 |
initrdfile=$(echo $1 | sed 's/^--initrdfile=//') |
initrdfile=${1#--initrdfile=} |
694 |
else |
else |
695 |
initrdfile=$2 |
initrdfile=$2 |
696 |
shift |
shift |
698 |
;; |
;; |
699 |
|
|
700 |
--kernel-args*) |
--kernel-args*) |
701 |
if echo $1 | grep '=' >/dev/null |
if [[ $1 == --kernel-args\=* ]] |
702 |
then |
then |
703 |
kernargs=$(echo $1 | sed 's/^--kernel-args=//') |
kernargs=${1#--kernel-args=} |
704 |
else |
else |
705 |
kernargs=$2 |
kernargs=$2 |
706 |
shift |
shift |
708 |
;; |
;; |
709 |
|
|
710 |
--remove-args*) |
--remove-args*) |
711 |
if echo $1 | grep '=' >/dev/null |
if [[ $1 == --remove-args\=* ]] |
712 |
then |
then |
713 |
removeargs=$(echo $1 | sed 's/^--remove-args=//') |
removeargs=${1#--remove-args=} |
714 |
else |
else |
715 |
removeargs=$2 |
removeargs=$2 |
716 |
shift |
shift |
718 |
;; |
;; |
719 |
|
|
720 |
--banner*) |
--banner*) |
721 |
if echo $1 | grep '=' >/dev/null |
if [[ $1 == --banner\=* ]] |
722 |
then |
then |
723 |
banner=$(echo $1 | sed 's/^--banner=//') |
banner=${1#--banner=} |
724 |
else |
else |
725 |
banner=$2 |
banner=$2 |
726 |
shift |
shift |
728 |
;; |
;; |
729 |
|
|
730 |
--multiboot*) |
--multiboot*) |
731 |
if echo $1 |grep '=' >/dev/null |
if [[ $1 == --multiboot\=* ]] |
732 |
then |
then |
733 |
mbkernel=$(echo $1 | sed 's/^--multiboot=//') |
mbkernel=${1#--multiboot=} |
734 |
else |
else |
735 |
# can't really support having an optional second arg here |
# can't really support having an optional second arg here |
736 |
# sorry! |
# sorry! |
739 |
;; |
;; |
740 |
|
|
741 |
--mbargs*) |
--mbargs*) |
742 |
if echo $1 |grep '=' >/dev/null |
if [[ $1 == --mbargs\=* ]] |
743 |
then |
then |
744 |
mbargs=$(echo $1 | sed 's/^--mbargs=//') |
mbargs=${1#--mbargs=} |
745 |
else |
else |
746 |
mbargs="$2" |
mbargs="$2" |
747 |
shift |
shift |
760 |
makedefault="--make-default" |
makedefault="--make-default" |
761 |
;; |
;; |
762 |
|
|
763 |
--package) |
--package*) |
764 |
if echo $1 | grep '=' >/dev/null |
if [[ $1 == --package\=* ]] |
765 |
then |
then |
766 |
package=$(echo $1 | sed 's/^--package=//') |
package=${1#--package=} |
767 |
else |
else |
768 |
package=$2 |
package=$2 |
769 |
shift |
shift |
770 |
fi |
fi |
771 |
;; |
;; |
772 |
|
|
773 |
|
--add-dracut-args) |
774 |
|
adddracutargs=--add-dracut-args |
775 |
|
;; |
776 |
|
|
777 |
|
--add-plymouth-initrd) |
778 |
|
addplymouthinitrd=--add-plymouth-initrd |
779 |
|
;; |
780 |
|
|
781 |
|
--kernel-image*) |
782 |
|
if [[ $1 == --kernel-image\=* ]] |
783 |
|
then |
784 |
|
kernelImage=${1#--kernel-image=} |
785 |
|
else |
786 |
|
kernelImage="$2" |
787 |
|
shift |
788 |
|
fi |
789 |
|
if ! [[ -f ${kernelImage} ]] |
790 |
|
then |
791 |
|
echo "Can't find kernel image '${kernelImage}'" >&2 |
792 |
|
usage |
793 |
|
exit 1 |
794 |
|
fi |
795 |
|
;; |
796 |
|
|
797 |
-v) |
-v) |
798 |
verbose=-v |
verbose=-v |
799 |
;; |
;; |
832 |
|
|
833 |
kernelmajor=$(echo ${kernel} | cut -d . -f 1,2) |
kernelmajor=$(echo ${kernel} | cut -d . -f 1,2) |
834 |
|
|
835 |
# kernel image for 2.4 is vmlinux |
# kernel image for 2.4 is kernel |
836 |
if [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
if [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
837 |
then |
then |
838 |
if [[ ${kernelmajor} = 2.4 ]] |
if [[ ${kernelmajor} = 2.4 ]] |
841 |
fi |
fi |
842 |
fi |
fi |
843 |
|
|
844 |
|
[[ ${kernelImage} ]] || kernelImage="${bootPrefix}/${kernelName}-${version}" |
845 |
|
|
846 |
# set the initrd file based on arch; ia64 is the only currently known oddball |
# set the initrd file based on arch; ia64 is the only currently known oddball |
847 |
if [[ -z ${initrdfile} ]] |
if [[ -z ${initrdfile} ]] |
848 |
then |
then |
849 |
INITRD_NAME_PREFIX="initrd" |
INITRD_NAME_PREFIX="initrd" |
850 |
|
if [[ -n ${dracut} ]] |
851 |
|
then |
852 |
|
INITRD_NAME_PREFIX="initramfs" |
853 |
|
fi |
854 |
|
|
855 |
if [[ $(uname -m) = ia64 ]] |
if [[ $(uname -m) = ia64 ]] |
856 |
then |
then |
861 |
fi |
fi |
862 |
[[ -n ${verbose} ]] && echo "initrdfile is ${initrdfile}" |
[[ -n ${verbose} ]] && echo "initrdfile is ${initrdfile}" |
863 |
|
|
864 |
|
# add dracut i18n, keyboard and plymouth kernel args if requested |
865 |
|
if [[ -n ${dracut} ]] || [[ -n ${adddracutargs} ]] |
866 |
|
then |
867 |
|
if [ -r /etc/vconsole.conf ] |
868 |
|
then |
869 |
|
. /etc/vconsole.conf |
870 |
|
|
871 |
|
for i in SYSFONT SYSFONTACM UNIMAP KEYTABLE |
872 |
|
do |
873 |
|
val=$(eval echo \$$i) |
874 |
|
[[ -n ${val} ]] && kernargs="${kernargs} ${i}=${val}" |
875 |
|
done |
876 |
|
else |
877 |
|
if [ -r /etc/conf.d/consolefont ] |
878 |
|
then |
879 |
|
. /etc/conf.d/consolefont |
880 |
|
|
881 |
|
if [[ -n ${CONSOLEFONT} ]] |
882 |
|
then |
883 |
|
kernargs="${kernargs} SYSFONT=${CONSOLEFONT}" |
884 |
|
fi |
885 |
|
fi |
886 |
|
|
887 |
|
if [ -r /etc/conf.d/keymap ] |
888 |
|
then |
889 |
|
. /etc/conf.d/keymap |
890 |
|
|
891 |
|
if [[ -n ${KEYMAP} ]] |
892 |
|
then |
893 |
|
kernargs="${kernargs} KEYTABLE=${KEYMAP}" |
894 |
|
fi |
895 |
|
fi |
896 |
|
fi |
897 |
|
|
898 |
|
if [ -r /etc/locale.conf ] |
899 |
|
then |
900 |
|
. /etc/locale.conf |
901 |
|
|
902 |
|
if [[ -n ${LANG} ]] |
903 |
|
then |
904 |
|
kernargs="${kernargs} LANG=${LANG}" |
905 |
|
fi |
906 |
|
fi |
907 |
|
fi |
908 |
|
|
909 |
# set this as the default if we have the package and it matches |
# set this as the default if we have the package and it matches |
910 |
if [[ ${mode} = --install ]] && [[ ${UPDATEDEFAULT} = yes ]] && [[ -n ${package} ]] && |
if [[ ${mode} = --install ]] && [[ ${UPDATEDEFAULT} = yes ]] && [[ -n ${package} ]] && |
911 |
[[ -n ${DEFAULTKERNEL} ]] && [[ ${package} = ${DEFAULTKERNEL} ]] |
[[ -n ${DEFAULTKERNEL} ]] && [[ ${package} = ${DEFAULTKERNEL} ]] |
924 |
|
|
925 |
if [[ ${initrd} = make ]] |
if [[ ${initrd} = make ]] |
926 |
then |
then |
927 |
mkinitrd |
makeinitrd |
928 |
elif [[ ${initrd} = remove ]] |
elif [[ ${initrd} = remove ]] |
929 |
then |
then |
930 |
rminitrd |
rminitrd |
937 |
fi |
fi |
938 |
|
|
939 |
[[ -n ${grubConfig} ]] && [ -f ${grubConfig} ] && cfgGrub=1 |
[[ -n ${grubConfig} ]] && [ -f ${grubConfig} ] && cfgGrub=1 |
940 |
|
[[ -n ${grub2Config} ]] && [ -f ${grub2Config} ] && cfgGrub2=1 |
941 |
|
[[ -n ${grub2EfiConfig} ]] && [ -f ${grub2EfiConfig} ] && cfgGrub2Efi=1 |
942 |
[[ -n ${liloConfig} ]] && [ -f ${liloConfig} ] && cfgLilo=1 |
[[ -n ${liloConfig} ]] && [ -f ${liloConfig} ] && cfgLilo=1 |
943 |
|
[[ -n ${extlinuxConfig} ]] && [ -f ${extlinuxConfig} ] && cfgExtlinux=1 |
944 |
|
|
945 |
|
# if we have a U-Boot directory, but no boot script, check if the directory |
946 |
|
# is mounted. If not, mount it, and then check if a boot script exists. |
947 |
|
if [[ -n ${ubootDir} ]] |
948 |
|
then |
949 |
|
if [ -f ${ubootScript} ] |
950 |
|
then |
951 |
|
cfguBoot=1 |
952 |
|
else |
953 |
|
mountEntry=$(mount | grep ${ubootDir}) |
954 |
|
if [[ -z ${mountEntry} ]] |
955 |
|
then |
956 |
|
mount ${ubootDevice} ${ubootDir} |
957 |
|
mounted=1 |
958 |
|
fi |
959 |
|
[ -f ${ubootScript} ] && cfguBoot=1 |
960 |
|
fi |
961 |
|
fi |
962 |
|
|
963 |
|
# if we're using U-Boot, check if the default load address should change |
964 |
|
if [[ -n ${cfguBoot} ]] && [[ -z ${UBOOT_IMGADDR} ]] |
965 |
|
then |
966 |
|
[[ ${version} =~ .([^.]*)$ ]] |
967 |
|
platform=${BASH_REMATCH[1]} |
968 |
|
# A few platforms use an alternate kernel load address |
969 |
|
if [[ ${platform} = omap ]] |
970 |
|
then |
971 |
|
ubootAddress=0x80008000 |
972 |
|
elif [[ ${platform} = imx ]] |
973 |
|
then |
974 |
|
ubootAddress=0x90008000 |
975 |
|
fi |
976 |
|
fi |
977 |
|
|
978 |
# 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 |
979 |
# is lilo to determine if it should be run |
# is lilo to determine if it should be run |
993 |
update |
update |
994 |
fi |
fi |
995 |
|
|
996 |
|
# if we mounted the U-Boot directory, unmount it. |
997 |
|
[[ -n ${mounted} ]] && umount ${ubootDir} |
998 |
|
|
999 |
exit 0 |
exit 0 |