Lines 372-410
Link Here
|
372 |
rm -f "${BOOTDIR}/${symlinkName}.old" |
372 |
rm -f "${BOOTDIR}/${symlinkName}.old" |
373 |
fi |
373 |
fi |
374 |
|
374 |
|
375 |
# We only erase the old image when it is the exact same version as the |
375 |
# We only erase the .old image when it is the exact same version as the |
376 |
# current and new images. Different version old images are left behind. |
376 |
# current and new images. Different version .old (and current) images are |
377 |
# This is consistent with how "make install" of the manual kernel build |
377 |
# left behind. This is consistent with how "make install" of the manual |
378 |
# works. |
378 |
# kernel build works. |
379 |
if [ "${currDestImage}" == "${fullDestName}" -a \ |
379 |
if [ "${currDestImage}" == "${fullDestName}" ] |
380 |
"${prevDestImage}" == "${currDestImage}.old" ] |
|
|
381 |
then |
380 |
then |
382 |
# |
381 |
# |
383 |
# Case for new, currrent, and old of the same base version. |
382 |
# Case for new and currrent of the same base version. |
384 |
# |
383 |
# |
385 |
print_info 5 " Same base version. May have to delete old image to make room." |
384 |
print_info 5 " Same base version. May have to delete old image to make room." |
386 |
|
385 |
|
387 |
if [ "${currDestImageExists}" -eq '1' ] |
386 |
if [ "${currDestImageExists}" -eq '1' ] |
388 |
then |
387 |
then |
389 |
if [ "${prevDestImageExists}" -eq '1' ] |
388 |
if [ -e "${BOOTDIR}/${currDestImage}.old" ] |
390 |
then |
389 |
then |
391 |
print_info 5 " Deleting old identical version ${symlinkName}." |
390 |
print_info 5 " Deleting old identical version ${symlinkName}." |
392 |
rm -f "${BOOTDIR}/${prevDestImage}" |
391 |
rm -f "${BOOTDIR}/${currDestImage}.old" |
393 |
fi |
392 |
fi |
394 |
print_info 5 " Moving ${BOOTDIR}/${currDestImage}" |
393 |
print_info 5 " Moving ${BOOTDIR}/${currDestImage}" |
395 |
print_info 5 " to ${BOOTDIR}/${currDestImage}.old" |
394 |
print_info 5 " to ${BOOTDIR}/${currDestImage}.old" |
396 |
mv "${BOOTDIR}/${currDestImage}" "${BOOTDIR}/${currDestImage}.old" || |
395 |
mv "${BOOTDIR}/${currDestImage}" "${BOOTDIR}/${currDestImage}.old" || |
397 |
gen_die "Could not rename the old ${symlinkName} image!" |
396 |
gen_die "Could not rename the old ${symlinkName} image!" |
|
|
397 |
prevDestImage="${currDestImage}.old" |
398 |
prevDestImageExists=1 |
398 |
fi |
399 |
fi |
399 |
else |
400 |
else |
400 |
# |
401 |
# |
401 |
# Case for current / old not of the same base version. |
402 |
# Case for new / current not of the same base version. |
402 |
# |
403 |
# |
403 |
print_info 5 " Different base version. Do not delete old images." |
404 |
print_info 5 " Different base version. Do not delete old images." |
404 |
if [ "${currDestImageExists}" -eq 1 ] |
405 |
prevDestImage="${currDestImage}" |
405 |
then |
|
|
406 |
prevDestImage="${currDestImage}" |
407 |
fi |
408 |
currDestImage="${fullDestName}" |
406 |
currDestImage="${fullDestName}" |
409 |
fi |
407 |
fi |
410 |
|
408 |
|
Lines 420-426
Link Here
|
420 |
pushd ${BOOTDIR} >/dev/null |
418 |
pushd ${BOOTDIR} >/dev/null |
421 |
ln -s "${currDestImage}" "${symlinkName}" || |
419 |
ln -s "${currDestImage}" "${symlinkName}" || |
422 |
gen_die "Could not create the ${symlinkName} symlink!" |
420 |
gen_die "Could not create the ${symlinkName} symlink!" |
423 |
if [ "${currDestImageExists}" -eq '1' ] |
421 |
if [ "${prevDestImageExists}" -eq '1' ] |
424 |
then |
422 |
then |
425 |
print_info 5 " ${symlinkName}.old -> ${prevDestImage}" |
423 |
print_info 5 " ${symlinkName}.old -> ${prevDestImage}" |
426 |
ln -s "${prevDestImage}" "${symlinkName}.old" || |
424 |
ln -s "${prevDestImage}" "${symlinkName}.old" || |