From 91b2ac41fb5b811983b9c733b64a7be946c84680 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 21 Aug 2007 17:31:54 +0000 Subject: [PATCH] Added another patch from John R. Graham for bug #180161. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@525 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- ChangeLog | 5 +++++ gen_funcs.sh | 28 +++++++++++++--------------- genkernel.8 | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 149fe9d..31e8df6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ # Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 21 Aug 2007; Chris Gianelloni gen_funcs.sh, + genkernel.8: + Added another patch from John R. Graham for + bug #180161. + 26 Jul 2007; Robin H. Johnson gen_initramfs.sh: Clean up a cosmetic error introduced by the symlink patch: ${GK_SHARE}/gen_funcs.sh: line 431: popd: diff --git a/gen_funcs.sh b/gen_funcs.sh index 480cc15..8ade7e5 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -372,39 +372,37 @@ copy_image_with_preserve() { rm -f "${BOOTDIR}/${symlinkName}.old" fi - # We only erase the old image when it is the exact same version as the - # current and new images. Different version old images are left behind. - # This is consistent with how "make install" of the manual kernel build - # works. - if [ "${currDestImage}" == "${fullDestName}" -a \ - "${prevDestImage}" == "${currDestImage}.old" ] + # We only erase the .old image when it is the exact same version as the + # current and new images. Different version .old (and current) images are + # left behind. This is consistent with how "make install" of the manual + # kernel build works. + if [ "${currDestImage}" == "${fullDestName}" ] then # - # Case for new, currrent, and old of the same base version. + # Case for new and currrent of the same base version. # print_info 5 " Same base version. May have to delete old image to make room." if [ "${currDestImageExists}" -eq '1' ] then - if [ "${prevDestImageExists}" -eq '1' ] + if [ -e "${BOOTDIR}/${currDestImage}.old" ] then print_info 5 " Deleting old identical version ${symlinkName}." - rm -f "${BOOTDIR}/${prevDestImage}" + rm -f "${BOOTDIR}/${currDestImage}.old" fi print_info 5 " Moving ${BOOTDIR}/${currDestImage}" print_info 5 " to ${BOOTDIR}/${currDestImage}.old" mv "${BOOTDIR}/${currDestImage}" "${BOOTDIR}/${currDestImage}.old" || gen_die "Could not rename the old ${symlinkName} image!" + prevDestImage="${currDestImage}.old" + prevDestImageExists=1 fi else # - # Case for current / old not of the same base version. + # Case for new / current not of the same base version. # print_info 5 " Different base version. Do not delete old images." - if [ "${currDestImageExists}" -eq 1 ] - then - prevDestImage="${currDestImage}" - fi + prevDestImage="${currDestImage}" currDestImage="${fullDestName}" fi @@ -420,7 +418,7 @@ copy_image_with_preserve() { pushd ${BOOTDIR} >/dev/null ln -s "${currDestImage}" "${symlinkName}" || gen_die "Could not create the ${symlinkName} symlink!" - if [ "${currDestImageExists}" -eq '1' ] + if [ "${prevDestImageExists}" -eq '1' ] then print_info 5 " ${symlinkName}.old -> ${prevDestImage}" ln -s "${prevDestImage}" "${symlinkName}.old" || diff --git a/genkernel.8 b/genkernel.8 index 2d83bb4..b301a2a 100644 --- a/genkernel.8 +++ b/genkernel.8 @@ -93,7 +93,7 @@ configuration. \fB\-\-\fR[no\-]\fBinstall\fR Installs, or does not install the kernel to .I /boot -after building. If MOUNTBOOT is set in +after building. The default is --install. If MOUNTBOOT is set in .I /etc/genkernel.conf then .I /boot -- 2.26.2