# HG changeset patch # User Dirk Olmes # Date 1578407272 -3600 # Node ID 4500455b237562dae6cf7487bf1714086cd5dc00 # Parent c35d56590441fafdb21969fc950c4ba386bd9b97 Adjust filenames to the old pattern diff -r c35d56590441 -r 4500455b2375 removeKernel --- a/removeKernel Mon Dec 23 11:41:35 2019 +0100 +++ b/removeKernel Tue Jan 07 15:27:52 2020 +0100 @@ -62,21 +62,53 @@ ARCH="x86" fi -SUFFIX=genkernel-${ARCH}-${MAJOR}.${MINOR}.${MICRO}-gentoo -if [ "$REVISION" != "" ]; then - SUFFIX="$SUFFIX-${REVISION}" +SUFFIX_V3="genkernel-${ARCH}-${MAJOR}.${MINOR}.${MICRO}" +if [[ "${REVISION}" != "" ]]; then + SUFFIX_V3="${SUFFIX_V3}-${REVISION}" +fi +SUFFIX_V3="${SUFFIX_V3}-gentoo" + +SUFFIX_V4="${MAJOR}.${MINOR}.${MICRO}" +if [ "${REVISION}" != "" ]; then + SUFFIX_V4="${SUFFIX_V4}-${REVISION}" +fi +SUFFIX_V4="${SUFFIX_V4}-gentoo-${ARCH}" + +SYSTEM_MAP="System.map-${SUFFIX_V3}" +if [[ -f $SYSTEM_MAP ]]; then + rm ${SYSTEM_MAP} >> $LOGFILE 2>&1 fi -rm System.map-${SUFFIX} >> $LOGFILE 2>&1 -rm initramfs-${SUFFIX} >> $LOGFILE 2>&1 +SYSTEM_MAP="System.map-${SUFFIX_V4}" +if [[ -f ${SYSTEM_MAP} ]]; then + rm ${SYSTEM_MAP} >> $LOGFILE 2>&1 +fi +if [[ -f ${SYSTEM_MAP}.old ]]; then + rm ${SYSTEM_MAP}.old >> $LOGFILE 2>&1 +fi -KERNEL="kernel-${SUFFIX}" +INITRAMFS="initramfs-${SUFFIX_V3}" +if [[ -f ${INITRAMFS} ]]; then + rm ${INITRAMFS} >> $LOGFILE 2>&1 +fi +INITRAMFS="initramfs-${SUFFIX_V4}" +if [[ -f ${INITRAMFS} ]]; then + rm ${INITRAMFS} >> $LOGFILE 2>&1 +fi +if [[ -f ${INITRAMFS}.old ]]; then + rm ${INITRAMFS}.old >> $LOGFILE 2>&1 +fi + +KERNEL="kernel-${SUFFIX_V3}" if [[ -f $KERNEL ]]; then rm $KERNEL >> $LOGFILE 2>&1 fi -KERNEL="vmlinuz-${MAJOR}.${MINOR}.${MICRO}-gentoo-${ARCH}" +KERNEL="vmlinuz-${SUFFIX_V4}" if [[ -f $KERNEL ]]; then rm $KERNEL >> $LOGFILE 2>&1 fi +if [[ -f $KERNEL.old ]]; then + rm $KERNEL.old >> $LOGFILE 2>&1 +fi # if we got until here, just remove the logfile again rm $LOGFILE