1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
# |
# |
4 |
# new-kernel-pkg |
# new-kernel-pkg |
5 |
# Invoked upon installation or removal of a kernel package, the following |
# Invoked upon installation or removal of a kernel package, the following |
32 |
# some defaults that are sane for most arches |
# some defaults that are sane for most arches |
33 |
kernelName=kernel |
kernelName=kernel |
34 |
|
|
35 |
if [ -x ./grubby ]; then |
if [ -x ./grubby ] |
36 |
grubby=./grubby |
then |
37 |
|
grubby=./grubby |
38 |
else |
else |
39 |
grubby=/sbin/grubby |
grubby=/sbin/grubby |
40 |
fi |
fi |
41 |
|
|
42 |
[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel |
[ -f /etc/conf.d/grubby ] && . /etc/conf.d/grubby |
43 |
|
[ -f /etc/conf.d/grubby-uboot ] && . /etc/conf.d/grubby-uboot |
44 |
|
|
45 |
|
cfgGrub2="" |
46 |
|
cfgGrub2Efi="" |
47 |
cfgGrub="" |
cfgGrub="" |
48 |
cfgLilo="" |
cfgLilo="" |
49 |
|
cfguBoot="" |
50 |
runLilo="" |
runLilo="" |
51 |
grubConfig="" |
grubConfig="" |
52 |
|
|
53 |
ARCH=$(uname -m) |
ARCH=$(uname -m) |
54 |
|
|
55 |
if [ $ARCH = 'ia64' ]; then |
if [[ ${ARCH} = ia64 ]] |
56 |
liloConfig=/boot/efi/EFI/redhat/elilo.conf |
then |
57 |
bootPrefix=/boot/efi/EFI/redhat |
liloConfig=/boot/efi/EFI/redhat/elilo.conf |
58 |
liloFlag=elilo |
bootPrefix=/boot/efi/EFI/redhat |
59 |
isx86="" |
liloFlag=elilo |
60 |
elif [ $ARCH = 'ppc64' -o $ARCH = 'ppc' ]; then |
isx86="" |
61 |
liloConfig=/etc/yaboot.conf |
elif [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
62 |
bootPrefix=/boot |
then |
63 |
lilo=/sbin/ybin |
liloConfig=/etc/yaboot.conf |
64 |
liloFlag=yaboot |
bootPrefix=/boot |
65 |
runLilo="yes" |
lilo=/sbin/ybin |
66 |
isx86="" |
liloFlag=yaboot |
67 |
elif [ $ARCH = 'sparc' -o $ARCH = 'sparc64' ]; then |
runLilo="yes" |
68 |
liloConfig=/etc/silo.conf |
isx86="" |
69 |
bootPrefix=/boot |
elif [[ ${ARCH} = sparc ]] || [[ ${ARCH} = sparc64 ]] |
70 |
liloFlag=silo |
then |
71 |
lilo=/sbin/silo |
liloConfig=/etc/silo.conf |
72 |
isx86="" |
bootPrefix=/boot |
73 |
elif [ $ARCH = 's390' -o $ARCH = 's390x' ]; then |
liloFlag=silo |
74 |
liloConfig=/etc/zipl.conf |
lilo=/sbin/silo |
75 |
bootPrefix=/boot |
isx86="" |
76 |
liloFlag=zipl |
elif [[ ${ARCH} = s390 ]] || [[ ${ARCH} = s390x ]] |
77 |
lilo=/sbin/zipl |
then |
78 |
runLilo="yes" |
liloConfig=/etc/zipl.conf |
79 |
isx86="" |
bootPrefix=/boot |
80 |
|
liloFlag=zipl |
81 |
|
lilo=/sbin/zipl |
82 |
|
runLilo="yes" |
83 |
|
isx86="" |
84 |
|
elif [[ ${ARCH} = armv7l ]] |
85 |
|
then |
86 |
|
liloConfig="" |
87 |
|
bootPrefix=/boot |
88 |
|
ubootDir=${UBOOT_DIR:-"/boot/uboot"} |
89 |
|
ubootScript=$ubootDir/${UBOOT_SCR:-"boot.scr"} |
90 |
|
ubootKList=${UBOOT_KLIST:-"klist.txt"} |
91 |
|
ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"} |
92 |
|
ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"} |
93 |
|
ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"} |
94 |
|
mounted="" |
95 |
|
liloFlag="" |
96 |
|
isx86="" |
97 |
else |
else |
98 |
# this leaves i?86 and x86_64 |
# this leaves i?86 and x86_64 |
99 |
liloConfig=/etc/lilo.conf |
liloConfig=/etc/lilo.conf |
100 |
grubConfig=/boot/grub/grub.conf |
grubConfig=/boot/grub/grub.conf |
101 |
bootPrefix=/boot |
grub2Config=/boot/grub/grub.cfg |
102 |
liloFlag=lilo |
grub2EfiConfig=/boot/grub/grub-efi.cfg |
103 |
isx86="yes" |
bootPrefix=/boot |
104 |
|
liloFlag=lilo |
105 |
|
isx86="yes" |
106 |
fi |
fi |
107 |
|
|
108 |
mode="" |
mode="" |
109 |
version="" |
version="" |
110 |
initrd="" |
initrd="" |
111 |
|
dracut="" |
112 |
|
dracuthostonly="" |
113 |
initrdfile="" |
initrdfile="" |
114 |
moddep="" |
moddep="" |
115 |
verbose="" |
verbose="" |
117 |
package="" |
package="" |
118 |
mbkernel="" |
mbkernel="" |
119 |
mbargs="" |
mbargs="" |
120 |
|
adddracutargs="" |
121 |
|
addplymouthinitrd="" |
122 |
|
|
123 |
usage() { |
usage() |
124 |
echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd]" >&2 |
{ |
125 |
echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 |
echo "Usage: $(basename $0) [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2 |
126 |
echo " [--kernel-args=<args>] [--remove-args=<args>]" >&2 |
echo " [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2 |
127 |
echo " [--banner=<banner>] [--multiboot=multiboot]" >&2 |
echo " [--kernel-args=<args>] [--remove-args=<args>]" >&2 |
128 |
echo " [--mbargs=mbargs] [--make-default]" >&2 |
echo " [--banner=<banner>] [--multiboot=multiboot]" >&2 |
129 |
echo " <--install | --remove | --update> <kernel-version>" >&2 |
echo " [--mbargs=mbargs] [--make-default] [--add-dracut-args]" >&2 |
130 |
echo " (ex: `basename $0` --mkinitrd --depmod --install 2.4.7-2)" >&2 |
echo " [--add-plymouth-initrd]" >&2 |
131 |
exit 1 |
echo " [--host-only]" >&2 |
132 |
|
echo " <--install | --remove | --update> <kernel-version>" >&2 |
133 |
|
echo " (ex: $(basename $0) --mkinitrd --depmod --install 2.4.7-2)" >&2 |
134 |
|
exit 1 |
135 |
} |
} |
136 |
|
|
137 |
install() { |
install() |
138 |
# XXX kernel should be able to be specified also (or work right on ia64) |
{ |
139 |
if [ ! -f $bootPrefix/$kernelName-$version ] ; then |
# XXX kernel should be able to be specified also (or work right on ia64) |
140 |
[ -n "$verbose" ] && echo "kernel for $version does not exist, not running grubby" |
if [ ! -f ${bootPrefix}/${kernelName}-${version} ] |
141 |
return |
then |
142 |
fi |
[[ -n ${verbose} ]] && echo "kernel for ${version} does not exist, not running grubby" |
143 |
|
return |
144 |
INITRD="" |
fi |
145 |
if [ -f $initrdfile ]; then |
|
146 |
[ -n "$verbose" ] && echo "found $initrdfile and using it with grubby" |
INITRD="" |
147 |
INITRD="--initrd $initrdfile" |
if [ -f ${initrdfile} ] |
148 |
fi |
then |
149 |
|
[[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" |
150 |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
INITRD="--initrd ${initrdfile}" |
151 |
if [ -d /proc/iSeries ]; then |
|
152 |
[ -n "$verbose" ] && echo "On an iSeries, just making img file" |
if [[ -n ${addplymouthinitrd} ]] |
153 |
if [ -z $initrdfile ]; then |
then |
154 |
[ -n "$verbose" ] && echo "No initrd, just adding system map" |
INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" |
155 |
/sbin/addSystemMap $bootPrefix/System.map-$version $bootPrefix/$kernelName-$version $bootPrefix/vmlinitrd-$version |
fi |
156 |
else |
fi |
157 |
/sbin/addSystemMap $bootPrefix/System.map-$version $bootPrefix/$kernelName-$version $bootPrefix/vmlinux.sm-$version |
|
158 |
/sbin/addRamDisk $initrdfile $bootPrefix/System.map-$version $bootPrefix/vmlinux.sm-$version $bootPrefix/vmlinitrd-$version 2>/dev/null |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
159 |
rm $bootPrefix/vmlinux.sm-$version |
if [ -d /proc/iSeries ] |
160 |
fi |
then |
161 |
return |
[[ -n ${verbose} ]] && echo "On an iSeries, just making img file" |
162 |
fi |
if [[ -z ${initrdfile} ]] |
163 |
|
then |
164 |
# get the root filesystem to use |
[[ -n ${verbose} ]] && echo "No initrd, just adding system map" |
165 |
rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab) |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${bootPrefix}/${kernelName}-${version} ${bootPrefix}/vmlinitrd-${version} |
166 |
|
else |
167 |
if [ -n "$mbkernel" -a -n "$cfgLilo" -a "$liloFlag" != "elilo" ]; then |
/sbin/addSystemMap ${bootPrefix}/System.map-${version} ${bootPrefix}/${kernelName}-${version} ${bootPrefix}/vmlinux.sm-${version} |
168 |
[ -n "$verbose" ] && echo "multiboot specified, not updating lilo.conf" |
/sbin/addRamDisk ${initrdfile} ${bootPrefix}/System.map-${version} ${bootPrefix}/vmlinux.sm-${version} ${bootPrefix}/vmlinitrd-${version} 2>/dev/null |
169 |
cfgLilo="" |
rm ${bootPrefix}/vmlinux.sm-${version} |
170 |
fi |
fi |
171 |
|
return |
172 |
if [ -n "$cfgGrub" ]; then |
fi |
173 |
[ -n "$verbose" ] && echo "adding $version to $grubConfig" |
|
174 |
|
# get the root filesystem to use |
175 |
if [ -n "$banner" ]; then |
rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab) |
176 |
title="$banner ($version)" |
|
177 |
elif [ -f /etc/mageversion ]; then |
if [[ -n ${mbkernel} ]] && [[ -n ${cfgLilo} ]] && [[ ${liloFlag} != elilo ]] |
178 |
title="Magellan Linux $(< /etc/mageversion) ($version)" |
then |
179 |
else |
[[ -n ${verbose} ]] && echo "multiboot specified, not updating lilo.conf" |
180 |
title="Magellan Linux ($version)" |
cfgLilo="" |
181 |
fi |
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" |
|
|
else |
|
|
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby" |
|
|
fi |
|
|
|
|
|
if [ -n "$cfgLilo" ]; then |
|
|
[ -n "$verbose" ] && echo "adding $version to $liloConfig" |
|
|
|
|
|
$grubby --add-kernel=$bootPrefix/$kernelName-$version $INITRD \ |
|
|
--copy-default $makedefault --title $version \ |
|
|
${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \ |
|
|
--args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$version" \ |
|
|
--$liloFlag |
|
|
|
|
|
if [ -n "$runLilo" ]; then |
|
|
[ -n "$verbose" ] && echo "running $lilo" |
|
|
if [ ! -x $lilo ] ; then |
|
|
[ -n "$verbose" ] && echo "$lilo does not exist" |
|
|
else |
|
|
$lilo > /dev/null |
|
|
fi |
|
|
fi |
|
|
else |
|
|
[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby" |
|
|
fi |
|
182 |
|
|
183 |
|
if [[ -n ${cfgGrub} ]] |
184 |
|
then |
185 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${grubConfig}" |
186 |
|
|
187 |
|
if [[ -n ${banner} ]] |
188 |
|
then |
189 |
|
title="${banner} (${version})" |
190 |
|
elif [ -f /etc/mageversion ] |
191 |
|
then |
192 |
|
title="Magellan Linux $(< /etc/mageversion) (${version})" |
193 |
|
else |
194 |
|
title="Magellan Linux (${version})" |
195 |
|
fi |
196 |
|
${grubby} --grub --add-kernel=${bootPrefix}/${kernelName}-${version} \ |
197 |
|
${INITRD} --copy-default ${makedefault} --title "${title}" \ |
198 |
|
${mbkernel:+--add-multiboot="${mbkernel}"} ${mbargs:+--mbargs="${mbargs}"} \ |
199 |
|
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${title}" |
200 |
|
else |
201 |
|
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby for grub 0.97" |
202 |
|
fi |
203 |
|
if [[ -n ${cfgGrub2} ]] |
204 |
|
then |
205 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${grub2Config}" |
206 |
|
|
207 |
|
if [[ -n ${banner} ]] |
208 |
|
then |
209 |
|
title="${banner} (${version})" |
210 |
|
elif [ -f /etc/mageversion ] |
211 |
|
then |
212 |
|
title="Magellan Linux $(< /etc/mageversion) (${version})" |
213 |
|
else |
214 |
|
title="Magellan Linux (${version})" |
215 |
|
fi |
216 |
|
${grubby} --grub2 -c ${grub2Cfg} \ |
217 |
|
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
218 |
|
${INITRD} --copy-default ${makedefault} --title "${title}" \ |
219 |
|
${mbkernel:+--add-multiboot="${mbkernel}"} \ |
220 |
|
${mbargs:+--mbargs="${mbargs}"} \ |
221 |
|
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${title}" |
222 |
|
else |
223 |
|
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby for grub 2" |
224 |
|
fi |
225 |
|
if [[ -n ${cfgGrub2Efi} ]] |
226 |
|
then |
227 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${grub2EfiConfig}" |
228 |
|
|
229 |
|
if [[ -n ${banner} ]] |
230 |
|
then |
231 |
|
title="${banner} (${version})" |
232 |
|
elif [ -f /etc/mageversion ] |
233 |
|
then |
234 |
|
title="Magellan Linux $(< /etc/mageversion) (${version})" |
235 |
|
else |
236 |
|
title="Magellan Linux (${version})" |
237 |
|
fi |
238 |
|
${grubby} --grub2 -c ${grub2EfiCfg} \ |
239 |
|
--add-kernel=${bootPrefix}/${kernelName}-${version} \ |
240 |
|
${INITRD} --copy-default ${makedefault} --title "${title}" \ |
241 |
|
${mbkernel:+--add-multiboot="${mbkernel}"} \ |
242 |
|
${mbargs:+--mbargs="${mbargs}"} \ |
243 |
|
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${title}" |
244 |
|
else |
245 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby for grub 2 with UEFI" |
246 |
|
fi |
247 |
|
|
248 |
|
if [[ -n ${cfgLilo} ]] |
249 |
|
then |
250 |
|
[[ -n ${verbose} ]] && echo "adding ${version} to ${liloConfig}" |
251 |
|
|
252 |
|
${grubby} --add-kernel=${bootPrefix}/${kernelName}-${version} ${INITRD} \ |
253 |
|
--copy-default ${makedefault} --title ${version} \ |
254 |
|
${mbkernel:+--add-multiboot="${mbkernel}"} ${mbargs:+--mbargs="${mbargs}"} \ |
255 |
|
--args="root=${rootdevice} ${kernargs}" --remove-kernel="TITLE=${version}" \ |
256 |
|
--${liloFlag} |
257 |
|
|
258 |
|
if [[ -n ${runLilo} ]] |
259 |
|
then |
260 |
|
[[ -n ${verbose} ]] && echo "running ${lilo}" |
261 |
|
if [ ! -x ${lilo} ] |
262 |
|
then |
263 |
|
[[ -n ${verbose} ]] && echo "${lilo} does not exist" |
264 |
|
else |
265 |
|
${lilo} > /dev/null |
266 |
|
fi |
267 |
|
fi |
268 |
|
else |
269 |
|
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
270 |
|
fi |
271 |
} |
} |
272 |
|
|
273 |
remove() { |
remove() |
274 |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
{ |
275 |
if [ -d /proc/iSeries ]; then |
# FIXME: is this a good heuristic to find out if we're on iSeries? |
276 |
[ -n "$verbose" ] && echo "On an iSeries, remove img file" |
if [ -d /proc/iSeries ] |
277 |
rm -f $bootPrefix/$kernelName-$version.img 2>/dev/null |
then |
278 |
return |
[[ -n ${verbose} ]] && echo "On an iSeries, remove img file" |
279 |
fi |
rm -f ${bootPrefix}/${kernelName}-${version}.img 2>/dev/null |
280 |
|
return |
281 |
if [ -n "$cfgGrub" ]; then |
fi |
282 |
[ -n "$verbose" ] && echo "removing $version from $grubConfig" |
|
283 |
$grubby --remove-kernel=$bootPrefix/$kernelName-$version |
if [[ -n ${cfgGrub} ]] |
284 |
else |
then |
285 |
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby" |
[[ -n ${verbose} ]] && echo "removing ${version} from ${grubConfig}" |
286 |
fi |
${grubby} --grub --remove-kernel=${bootPrefix}/${kernelName}-${version} |
287 |
|
else |
288 |
if [ -n "$cfgLilo" ]; then |
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby for grub 0.97" |
289 |
[ -n "$verbose" ] && echo "removing $version from $liloConfig" |
fi |
290 |
$grubby --remove-kernel=$bootPrefix/$kernelName-$version \ |
if [[ -n ${cfgGrub2} ]] |
291 |
--$liloFlag |
then |
292 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${grub2Config}" |
293 |
if [ -n "$runLilo" ]; then |
${grubby} --grub2 -c ${grub2Config} \ |
294 |
[ -n "$verbose" ] && echo "running $lilo" |
--remove-kernel=${bootPrefix}/${kernelName}-${version} |
295 |
if [ ! -x $lilo ] ; then |
else |
296 |
[ -n "$verbose" ] && echo "$lilo does not exist" |
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby for grub 2" |
297 |
else |
fi |
298 |
$lilo > /dev/null |
if [[ -n ${cfgGrub2Efi} ]] |
299 |
fi |
then |
300 |
fi |
[[ -n ${verbose} ]] && echo "removing ${version} from ${grub2EfiConfig}" |
301 |
else |
${grubby} --grub2 -c ${grub2EfiConfig} \ |
302 |
[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby" |
--remove-kernel=${bootPrefix}/${kernelName}-${version} |
303 |
fi |
else |
304 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby grub 2 with UEFI" |
305 |
|
fi |
306 |
|
|
307 |
|
if [[ -n ${cfgLilo} ]] |
308 |
|
then |
309 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${liloConfig}" |
310 |
|
${grubby} --remove-kernel=${bootPrefix}/${kernelName}-${version} --${liloFlag} |
311 |
|
|
312 |
|
if [[ -n ${runLilo} ]] |
313 |
|
then |
314 |
|
[[ -n ${verbose} ]] && echo "running ${lilo}" |
315 |
|
if [ ! -x ${lilo} ] |
316 |
|
then |
317 |
|
[[ -n ${verbose} ]] && echo "${lilo} does not exist" |
318 |
|
else |
319 |
|
${lilo} > /dev/null |
320 |
|
fi |
321 |
|
fi |
322 |
|
else |
323 |
|
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
324 |
|
fi |
325 |
|
|
326 |
|
if [[ -n ${cfguBoot} ]] |
327 |
|
then |
328 |
|
[[ -n ${verbose} ]] && echo "removing ${version} from ${ubootDir}..." |
329 |
|
|
330 |
|
if [ -f ${ubootDir}/${ubootKList} ] |
331 |
|
then |
332 |
|
tmpKList=$(mktemp ${ubootDir}/${ubootKList}.XXXX) |
333 |
|
curversion=$(tail -n1 ${ubootDir}/${ubootKList}) |
334 |
|
sed "/${version}/d" ${ubootDir}/${ubootKList} > ${tmpKList} |
335 |
|
newversion=$(tail -n1 ${tmpKList}) |
336 |
|
if [ -f ${ubootDir}/uImage-${newversion} ] && [ -f ${ubootDir}/uInitrd-${newversion} ] |
337 |
|
then |
338 |
|
if [[ ${curversion} != ${newversion} ]] |
339 |
|
then |
340 |
|
cp -fp ${ubootDir}/uImage-${newversion} ${ubootDir}/${ubootDefaultImage} |
341 |
|
if [ $? -ne 0 ] |
342 |
|
then |
343 |
|
[[ -n ${verbose} ]] && echo "copy uImage-${newversion} error, default kernel not replaced!" && exit |
344 |
|
fi |
345 |
|
cp -fp ${ubootDir}/uInitrd-${newversion} ${ubootDir}/${ubootDefaultInitrd} |
346 |
|
if [ $? -ne 0 ] |
347 |
|
then |
348 |
|
[[ -n ${verbose} ]] && echo "copy uInitrd-${newversion} error, default Initrd not replaced!" && exit |
349 |
|
fi |
350 |
|
fi |
351 |
|
|
352 |
|
[[ -n ${verbose} ]] && echo "removing uImage-${version}" |
353 |
|
if [ -f ${ubootDir}/uImage-${version} ] |
354 |
|
then |
355 |
|
rm -f ${ubootDir}/uImage-${version} |
356 |
|
else |
357 |
|
[[ -n ${verbose} ]] && echo "uImage-${version} did not exist!" |
358 |
|
fi |
359 |
|
|
360 |
|
[[ -n ${verbose} ]] && echo "removing uInitrd-${version}" |
361 |
|
if [ -f ${ubootDir}/uInitrd-${version} ] |
362 |
|
then |
363 |
|
rm -f ${ubootDir}/uInitrd-${version} |
364 |
|
else |
365 |
|
[[ -n ${verbose} ]] && echo "uInitrd-${version} did not exist!" |
366 |
|
fi |
367 |
|
|
368 |
|
mv ${tmpKList} ${ubootDir}/${ubootKList} |
369 |
|
else |
370 |
|
[[ -n ${verbose} ]] && echo "uImage ${newversion} does not exist!" |
371 |
|
[ -f ${tmpKList} ] && rm -f ${tmpKList} |
372 |
|
fi |
373 |
|
else |
374 |
|
[[ -n ${verbose} ]] && echo "No previous kernel version. uBoot images not removed!" |
375 |
|
fi |
376 |
|
else |
377 |
|
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not modifying ${ubootDir}" |
378 |
|
fi |
379 |
} |
} |
380 |
|
|
381 |
update() { |
update() |
382 |
if [ -n "$cfgGrub" ]; then |
{ |
383 |
[ -n "$verbose" ] && echo "updating $version from $grubConfig" |
if [ ! -f ${bootPrefix}/${kernelName}-${version} ] |
384 |
$grubby --update-kernel=$bootPrefix/$kernelName-$version \ |
then |
385 |
${kernargs:+--args="$kernargs"} \ |
[[ -n ${verbose} ]] && echo "kernel for ${version} does not exist, not running grubby" |
386 |
${removeargs:+--remove-args="$removeargs"} |
return |
387 |
else |
fi |
388 |
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby" |
|
389 |
fi |
INITRD="" |
390 |
|
if [ -f ${initrdfile} ] |
391 |
if [ -n "$cfgLilo" ]; then |
then |
392 |
[ -n "$verbose" ] && echo "updating $version from $liloConfig" |
[[ -n ${verbose} ]] && echo "found ${initrdfile} and using it with grubby" |
393 |
$grubby --update-kernel=$bootPrefix/$kernelName-$version \ |
INITRD="--initrd ${initrdfile}" |
394 |
${kernargs:+--args="$kernargs"} \ |
|
395 |
${removeargs:+--remove-args="$removeargs"} \ |
if [[ -n ${addplymouthinitrd} ]] |
396 |
--$liloFlag |
then |
397 |
|
INITRD="${INITRD} --extra-initrd ${bootPrefix}/initrd-plymouth.img" |
398 |
if [ -n "$runLilo" ]; then |
fi |
399 |
[ -n "$verbose" ] && echo "running $lilo" |
fi |
400 |
if [ ! -x $lilo ] ; then |
|
401 |
[ -n "$verbose" ] && echo "$lilo does not exist" |
if [[ -n ${cfgGrub} ]] |
402 |
else |
then |
403 |
$lilo > /dev/null |
[[ -n ${verbose} ]] && echo "updating ${version} from ${grubConfig}" |
404 |
fi |
${grubby} --update-kernel=${bootPrefix}/${kernelName}-${version} \ |
405 |
fi |
${INITRD} \ |
406 |
else |
${kernargs:+--args="${kernargs}"} \ |
407 |
[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby" |
${removeargs:+--remove-args="${removeargs}"} |
408 |
fi |
else |
409 |
|
[[ -n ${verbose} ]] && echo "${grubConfig} does not exist, not running grubby" |
410 |
|
fi |
411 |
|
|
412 |
|
if [[ -n ${cfgGrub2} ]] |
413 |
|
then |
414 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${grub2Config}" |
415 |
|
${grubby} --grub2 -c ${grub2Config} \ |
416 |
|
--update-kernel=${bootPrefix}/${kernelName}-${version} \ |
417 |
|
${INITRD} \ |
418 |
|
${kernargs:+--args="${kernargs}"} \ |
419 |
|
${removeargs:+--remove-args="${removeargs}"} |
420 |
|
else |
421 |
|
[[ -n ${verbose} ]] && echo "${grub2Config} does not exist, not running grubby" |
422 |
|
fi |
423 |
|
|
424 |
|
if [[ -n ${cfgGrub2Efi} ]] |
425 |
|
then |
426 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${grub2EfiConfig}" |
427 |
|
${grubby} --grub2 -c ${grub2EfiConfig} \ |
428 |
|
--update-kernel=${bootPrefix}/${kernelName}-${version} \ |
429 |
|
${INITRD} \ |
430 |
|
${kernargs:+--args="${kernargs}"} \ |
431 |
|
${removeargs:+--remove-args="${removeargs}"} |
432 |
|
else |
433 |
|
[[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby" |
434 |
|
fi |
435 |
|
|
436 |
|
if [[ -n ${cfgLilo} ]] |
437 |
|
then |
438 |
|
[[ -n ${verbose} ]] && echo "updating ${version} from ${liloConfig}" |
439 |
|
${grubby} --update-kernel=${bootPrefix}/${kernelName}-${version} \ |
440 |
|
${INITRD} \ |
441 |
|
${kernargs:+--args="${kernargs}"} \ |
442 |
|
${removeargs:+--remove-args="${removeargs}"} \ |
443 |
|
--${liloFlag} |
444 |
|
|
445 |
|
if [[ -n ${runLilo} ]] |
446 |
|
then |
447 |
|
[[ -n ${verbose} ]] && echo "running ${lilo}" |
448 |
|
if [ ! -x ${lilo} ] |
449 |
|
then |
450 |
|
[[ -n ${verbose} ]] && echo "${lilo} does not exist" |
451 |
|
else |
452 |
|
${lilo} > /dev/null |
453 |
|
fi |
454 |
|
fi |
455 |
|
else |
456 |
|
[[ -n ${verbose} ]] && echo "${liloConfig} does not exist, not running grubby" |
457 |
|
fi |
458 |
|
|
459 |
|
if [[ -n ${cfguBoot} ]] |
460 |
|
then |
461 |
|
[[ -n ${verbose} ]] && echo "adding $version to ${ubootDir}..." |
462 |
|
|
463 |
|
[[ -n ${verbose} ]] && echo "creating uImage-${version}" |
464 |
|
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 \ |
465 |
|
-n ${version} -d ${bootPrefix}/${kernelName}-${version} ${ubootDir}/uImage-${version} |
466 |
|
|
467 |
|
[[ -n ${verbose} ]] && echo "creating uInitrd-${version}" |
468 |
|
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 \ |
469 |
|
-n initramfs -d ${initrdfile} ${ubootDir}/uInitrd-${version} |
470 |
|
|
471 |
|
if [ -f ${ubootDir}/uImage-${version} ] && [ -f ${ubootDir}/uInitrd-${version} ] |
472 |
|
then |
473 |
|
cp -fp ${ubootDir}/uImage-${version} ${ubootDir}/${ubootDefaultImage} |
474 |
|
if [ $? -ne 0 ] |
475 |
|
then |
476 |
|
[[ -n ${verbose} ]] && echo "copy uImage-${version} error, kernel not installed!" && exit |
477 |
|
fi |
478 |
|
cp -fp ${ubootDir}/uInitrd-${version} ${ubootDir}/${ubootDefaultInitrd} |
479 |
|
if [ $? -ne 0 ] |
480 |
|
then |
481 |
|
[[ -n ${verbose} ]] && echo "copy uInitrd-${version} error, kernel not installed!" && exit |
482 |
|
fi |
483 |
|
echo ${version} >> ${ubootDir}/${ubootKList} |
484 |
|
else |
485 |
|
[[ -n ${verbose} ]] && echo "cannot make ${version} the default" |
486 |
|
fi |
487 |
|
else |
488 |
|
[[ -n ${verbose} ]] && echo "${ubootScript} does not exist, not setting up ${ubootDir}" |
489 |
|
fi |
490 |
} |
} |
491 |
|
|
492 |
mkinitrd() { |
mkinitrd() |
493 |
[ -n "$verbose" ] && echo "creating initrd $initrdfile using $version" |
{ |
494 |
/sbin/mkinitrd --allow-missing -f $initrdfile $version |
if [[ -n ${dracut} ]] |
495 |
rc=$? |
then |
496 |
if [ $rc != 0 ]; then |
tool="/sbin/dracut ${dracuthostonly} -f ${initrdfile} ${version}" |
497 |
echo "mkinitrd failed" >&2 |
else |
498 |
exit 1 |
tool="/sbin/mkinitrd --allow-missing -f ${initrdfile} ${version}" |
499 |
fi |
fi |
500 |
|
[[ -n ${verbose} ]] && echo "creating initrd ${initrdfile} using ${version}" |
501 |
|
${tool} |
502 |
|
rc=$? |
503 |
|
if [ ${rc} != 0 ] |
504 |
|
then |
505 |
|
echo "mkinitrd failed" >&2 |
506 |
|
exit 1 |
507 |
|
fi |
508 |
} |
} |
509 |
|
|
510 |
rminitrd() { |
rminitrd() |
511 |
[ -n "$verbose" ] && echo "removing initrd $initrdfile" |
{ |
512 |
[ -f $initrdfile ] && rm -f $initrdfile |
[[ -n ${verbose} ]] && echo "removing initrd ${initrdfile}" |
513 |
|
[ -f ${initrdfile} ] && rm -f ${initrdfile} |
514 |
} |
} |
515 |
|
|
516 |
doDepmod() { |
doDepmod() |
517 |
[ -n "$verbose" ] && echo "running depmod for $version" |
{ |
518 |
depmod -ae -F /boot/System.map-$version $version |
[[ -n ${verbose} ]] && echo "running depmod for ${version}" |
519 |
|
depmod -ae -F /boot/System.map-${version} ${version} |
520 |
} |
} |
521 |
|
|
522 |
doRmmoddep() { |
doRmmoddep() |
523 |
[ -n "$verbose" ] && echo "removing modules.dep info for $version" |
{ |
524 |
[ -d /lib/modules/$version ] && rm -f /lib/modules/$version/modules.* |
[[ -n ${verbose} ]] && echo "removing modules.dep info for ${version}" |
525 |
|
[ -d /lib/modules/${version} ] && rm -f /lib/modules/${version}/modules.* |
526 |
} |
} |
527 |
|
|
528 |
|
|
529 |
while [ $# -gt 0 ]; do |
while [ $# -gt 0 ] |
530 |
case $1 in |
do |
531 |
--mkinitrd) |
case $1 in |
532 |
initrd="make" |
--mkinitrd) |
533 |
;; |
initrd="make" |
534 |
|
;; |
535 |
--rminitrd) |
|
536 |
initrd="remove" |
--rminitrd) |
537 |
;; |
initrd="remove" |
538 |
|
;; |
539 |
--initrdfile*) |
|
540 |
if echo $1 | grep '=' >/dev/null ; then |
--dracut) |
541 |
initrdfile=`echo $1 | sed 's/^--initrdfile=//'` |
dracut=--dracut |
542 |
else |
;; |
543 |
initrdfile=$2 |
|
544 |
shift |
--host-only) |
545 |
fi |
dracuthostonly=-H |
546 |
;; |
;; |
547 |
|
|
548 |
--kernel-args*) |
--initrdfile*) |
549 |
if echo $1 | grep '=' >/dev/null ; then |
if echo $1 | grep '=' >/dev/null |
550 |
kernargs=`echo $1 | sed 's/^--kernel-args=//'` |
then |
551 |
else |
initrdfile=$(echo $1 | sed 's/^--initrdfile=//') |
552 |
kernargs=$2 |
else |
553 |
shift |
initrdfile=$2 |
554 |
fi |
shift |
555 |
;; |
fi |
556 |
|
;; |
557 |
--remove-args*) |
|
558 |
if echo $1 | grep '=' >/dev/null ; then |
--kernel-args*) |
559 |
removeargs=`echo $1 | sed 's/^--remove-args=//'` |
if echo $1 | grep '=' >/dev/null |
560 |
else |
then |
561 |
removeargs=$2 |
kernargs=$(echo $1 | sed 's/^--kernel-args=//') |
562 |
shift |
else |
563 |
fi |
kernargs=$2 |
564 |
;; |
shift |
565 |
|
fi |
566 |
--banner*) |
;; |
567 |
if echo $1 | grep '=' >/dev/null ; then |
|
568 |
banner=`echo $1 | sed 's/^--banner=//'` |
--remove-args*) |
569 |
else |
if echo $1 | grep '=' >/dev/null |
570 |
banner=$2 |
then |
571 |
shift |
removeargs=$(echo $1 | sed 's/^--remove-args=//') |
572 |
fi |
else |
573 |
;; |
removeargs=$2 |
574 |
|
shift |
575 |
--multiboot*) |
fi |
576 |
if echo $1 |grep '=' >/dev/null; then |
;; |
577 |
mbkernel=`echo $1 | sed 's/^--multiboot=//'` |
|
578 |
else |
--banner*) |
579 |
# can't really support having an optional second arg here |
if echo $1 | grep '=' >/dev/null |
580 |
# sorry! |
then |
581 |
mbkernel="/boot/xen.gz" |
banner=$(echo $1 | sed 's/^--banner=//') |
582 |
fi |
else |
583 |
;; |
banner=$2 |
584 |
|
shift |
585 |
--mbargs*) |
fi |
586 |
if echo $1 |grep '=' >/dev/null; then |
;; |
587 |
mbargs=`echo $1 | sed 's/^--mbargs=//'` |
|
588 |
else |
--multiboot*) |
589 |
mbargs="$2" |
if echo $1 |grep '=' >/dev/null |
590 |
shift |
then |
591 |
fi |
mbkernel=$(echo $1 | sed 's/^--multiboot=//') |
592 |
;; |
else |
593 |
|
# can't really support having an optional second arg here |
594 |
--depmod) |
# sorry! |
595 |
moddep="make" |
mbkernel="/boot/xen.gz" |
596 |
;; |
fi |
597 |
|
;; |
598 |
--rmmoddep) |
|
599 |
moddep="remove" |
--mbargs*) |
600 |
;; |
if echo $1 |grep '=' >/dev/null |
601 |
|
then |
602 |
--make-default) |
mbargs=$(echo $1 | sed 's/^--mbargs=//') |
603 |
makedefault="--make-default" |
else |
604 |
;; |
mbargs="$2" |
605 |
|
shift |
606 |
--package) |
fi |
607 |
if echo $1 | grep '=' >/dev/null ; then |
;; |
608 |
package=`echo $1 | sed 's/^--package=//'` |
|
609 |
else |
--depmod) |
610 |
package=$2 |
moddep="make" |
611 |
shift |
;; |
612 |
fi |
|
613 |
;; |
--rmmoddep) |
614 |
|
moddep="remove" |
615 |
-v) |
;; |
616 |
verbose=-v |
|
617 |
;; |
--make-default) |
618 |
|
makedefault="--make-default" |
619 |
*) |
;; |
620 |
if [ -z "$mode" ]; then |
|
621 |
mode=$1 |
--package) |
622 |
elif [ -z "$version" ]; then |
if echo $1 | grep '=' >/dev/null |
623 |
version=$1 |
then |
624 |
else |
package=$(echo $1 | sed 's/^--package=//') |
625 |
usage |
else |
626 |
fi |
package=$2 |
627 |
;; |
shift |
628 |
esac |
fi |
629 |
|
;; |
630 |
|
|
631 |
|
--add-dracut-args) |
632 |
|
adddracutargs=--add-dracut-args |
633 |
|
;; |
634 |
|
|
635 |
|
--add-plymouth-initrd) |
636 |
|
addplymouthinitrd=--add-plymouth-initrd |
637 |
|
;; |
638 |
|
|
639 |
|
-v) |
640 |
|
verbose=-v |
641 |
|
;; |
642 |
|
|
643 |
|
*) |
644 |
|
if [[ -z ${mode} ]] |
645 |
|
then |
646 |
|
mode=$1 |
647 |
|
elif [[ -z ${version} ]] |
648 |
|
then |
649 |
|
version=$1 |
650 |
|
else |
651 |
|
usage |
652 |
|
fi |
653 |
|
;; |
654 |
|
esac |
655 |
|
|
656 |
shift |
shift |
657 |
done |
done |
658 |
|
|
659 |
# make sure the mode is valid |
# make sure the mode is valid |
660 |
if [ "$mode" != "--install" -a "$mode" != "--remove" -a "$mode" != "--update" ] ; then |
if [[ ${mode} != --install ]] && [[ ${mode} != --remove ]] && [[ ${mode} != --update ]] |
661 |
usage |
then |
662 |
|
usage |
663 |
fi |
fi |
664 |
|
|
665 |
if [ -z "$version" ]; then |
if [[ -z ${version} ]] |
666 |
usage |
then |
667 |
|
usage |
668 |
fi |
fi |
669 |
|
|
670 |
if [ "$mode" != "--install" -a "$makedefault" ]; then |
if [ "${mode}" != "--install" -a "${makedefault}" ] |
671 |
usage |
then |
672 |
|
usage |
673 |
fi |
fi |
674 |
|
|
675 |
kernelmajor=`echo $kernel | cut -d . -f 1,2` |
kernelmajor=$(echo ${kernel} | cut -d . -f 1,2) |
676 |
|
|
677 |
# kernel image for 2.4 is vmlinux |
# kernel image for 2.4 is kernel |
678 |
if [ $ARCH = 'ppc64' -o $ARCH = 'ppc' ]; then |
if [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]] |
679 |
if [ "$kernelmajor" == "2.4" ]; then |
then |
680 |
kernelName=kernel |
if [[ ${kernelmajor} = 2.4 ]] |
681 |
fi |
then |
682 |
|
kernelName=kernel |
683 |
|
fi |
684 |
fi |
fi |
685 |
|
|
|
|
|
686 |
# 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 |
687 |
if [ -z "$initrdfile" ]; then |
if [[ -z ${initrdfile} ]] |
688 |
INITRD_NAME_PREFIX="initrd" |
then |
689 |
|
INITRD_NAME_PREFIX="initrd" |
690 |
if [ `uname -m` = "ia64" ]; then |
if [[ -n ${dracut} ]] |
691 |
initrdfile="/boot/efi/EFI/redhat/$INITRD_NAME_PREFIX-$version.img" |
then |
692 |
else |
INITRD_NAME_PREFIX="initramfs" |
693 |
initrdfile="/boot/$INITRD_NAME_PREFIX-$version.img" |
fi |
|
fi |
|
|
|
|
|
fi |
|
|
[ -n "$verbose" ] && echo "initrdfile is $initrdfile" |
|
694 |
|
|
695 |
# set this as the default if we have the package and it matches |
if [[ $(uname -m) = ia64 ]] |
696 |
if [ "$mode" == "--install" -a "$UPDATEDEFAULT" == "yes" -a -n "$package" -a -n "$DEFAULTKERNEL" -a "$package" == "$DEFAULTKERNEL" ]; then |
then |
697 |
makedefault="--make-default" |
initrdfile="/boot/efi/EFI/redhat/${INITRD_NAME_PREFIX}-${version}.img" |
698 |
[ -n "$verbose" ] && echo "making it the default based on config" |
else |
699 |
|
initrdfile="/boot/${INITRD_NAME_PREFIX}-${version}.img" |
700 |
|
fi |
701 |
fi |
fi |
702 |
|
[[ -n ${verbose} ]] && echo "initrdfile is ${initrdfile}" |
703 |
|
|
704 |
if [ "$moddep" == "make" ]; then |
# add dracut i18n, keyboard and plymouth kernel args if requested |
705 |
doDepmod |
if [[ -n ${dracut} ]] || [[ -n ${adddracutargs} ]] |
706 |
elif [ "$moddep" == "remove" ]; then |
then |
707 |
doRmmoddep |
[ -r /etc/conf.d/keymap ] && . /etc/conf.d/keymap |
708 |
fi |
[ -r /etc/conf.d/consolefont ] && . /etc/conf.d/consolefont |
709 |
|
|
710 |
|
if [[ -n ${KEYMAP} ]] |
711 |
|
then |
712 |
|
kernargs="${kernargs} KEYTABLE=${KEYMAP}" |
713 |
|
fi |
714 |
|
|
715 |
if [ "$initrd" == "make" ]; then |
if [[ -n ${CONSOLEFONT} ]] |
716 |
mkinitrd |
then |
717 |
elif [ "$initrd" == "remove" ]; then |
kernargs="${kernargs} SYSFONT=${CONSOLEFONT}" |
718 |
rminitrd |
fi |
719 |
fi |
fi |
720 |
|
|
721 |
if [ ! -x $grubby ] ; then |
# set this as the default if we have the package and it matches |
722 |
[ -n "$verbose" ] && echo "$grubby does not exist" |
if [[ ${mode} = --install ]] && [[ ${UPDATEDEFAULT} = yes ]] && [[ -n ${package} ]] && |
723 |
exit 0 |
[[ -n ${DEFAULTKERNEL} ]] && [[ ${package} = ${DEFAULTKERNEL} ]] |
724 |
|
then |
725 |
|
makedefault="--make-default" |
726 |
|
[[ -n ${verbose} ]] && echo "making it the default based on config" |
727 |
|
fi |
728 |
|
|
729 |
|
if [[ ${moddep} = make ]] |
730 |
|
then |
731 |
|
doDepmod |
732 |
|
elif [[ ${moddep} = remove ]] |
733 |
|
then |
734 |
|
doRmmoddep |
735 |
|
fi |
736 |
|
|
737 |
|
if [[ ${initrd} = make ]] |
738 |
|
then |
739 |
|
mkinitrd |
740 |
|
elif [[ ${initrd} = remove ]] |
741 |
|
then |
742 |
|
rminitrd |
743 |
|
fi |
744 |
|
|
745 |
|
if [ ! -x ${grubby} ] |
746 |
|
then |
747 |
|
[[ -n ${verbose} ]] && echo "${grubby} does not exist" |
748 |
|
exit 0 |
749 |
|
fi |
750 |
|
|
751 |
|
[[ -n ${grubConfig} ]] && [ -f ${grubConfig} ] && cfgGrub=1 |
752 |
|
[[ -n ${grub2Config} ]] && [ -f ${grub2Config} ] && cfgGrub2=1 |
753 |
|
[[ -n ${grub2EfiConfig} ]] && [ -f ${grub2EfiConfig} ] && cfgGrub2Efi=1 |
754 |
|
[[ -n ${liloConfig} ]] && [ -f ${liloConfig} ] && cfgLilo=1 |
755 |
|
|
756 |
|
# if we have a uBoot directory, check if it is mounted. |
757 |
|
# if not, mount it. Then check if a boot script exists. |
758 |
|
if [[ -n ${ubootDir} ]] |
759 |
|
then |
760 |
|
mountEntry=$(mount | grep ${ubootDir}) |
761 |
|
if [[ -z ${mountEntry} ]] |
762 |
|
then |
763 |
|
mount ${ubootDevice} ${ubootDir} |
764 |
|
mounted=1 |
765 |
|
fi |
766 |
|
[ -f ${ubootScript} ] && cfguBoot=1 |
767 |
fi |
fi |
768 |
|
|
|
[ -n "$grubConfig" ] && [ -f "$grubConfig" ] && cfgGrub=1; |
|
|
[ -n "$liloConfig" ] && [ -f "$liloConfig" ] && cfgLilo=1; |
|
|
|
|
769 |
# 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 |
770 |
# is lilo to determine if it should be run |
# is lilo to determine if it should be run |
771 |
if [ -n "$cfgLilo" -a -n "$isx86" ]; then |
if [[ -n ${cfgLilo} ]] && [[ -n ${isx86} ]] |
772 |
runLilo=$($grubby --bootloader-probe | grep lilo) |
then |
773 |
|
runLilo=$(${grubby} --bootloader-probe | grep lilo) |
774 |
fi |
fi |
775 |
|
|
776 |
if [ "$mode" == "--install" ]; then |
if [[ ${mode} = --install ]] |
777 |
install |
then |
778 |
elif [ "$mode" == "--remove" ]; then |
install |
779 |
remove |
elif [[ ${mode} = --remove ]] |
780 |
elif [ "$mode" == "--update" ]; then |
then |
781 |
update |
remove |
782 |
|
elif [[ ${mode} = --update ]] |
783 |
|
then |
784 |
|
update |
785 |
fi |
fi |
786 |
|
|
787 |
exit 0 |
exit 0 |