Remove .bak initrd files
authorMichael Prokop <devnull@localhost>
Thu, 15 Nov 2007 21:47:31 +0000 (22:47 +0100)
committerMichael Prokop <devnull@localhost>
Thu, 15 Nov 2007 21:47:31 +0000 (22:47 +0100)
debian/changelog
grml-live

index 8826aa1..595d797 100644 (file)
@@ -7,8 +7,8 @@ grml-live (0.0.9) unstable; urgency=low
   * Support kernel upgrades via according /etc/kernel-img.conf configuration.
   * Set hostname in instsoft-hook already.
   * Add user (grml) to all relevant groups.
-  * Improve initrd+kernel copy process (ignore .bak files and
-    copy always exactly one image).
+  * Improve initrd+kernel copy process: ignore .bak files (and get rid
+    of them) and copy always exactly one image.
   * Add new packages to GRML_FULL:
     - etckeeper
     - hdapsd
index 877bb1e..9c55ab6 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -391,6 +391,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
       INITRD="$(ls $CHROOT_OUTPUT/boot/initrd* 2>/dev/null| grep -v '.bak$' | sort -r | head -1)"
       if [ -n "$INITRD" ] ; then
          cp $INITRD "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
+         find $CHROOT_OUTPUT/boot/ -name initrd\*.bak -exec rm {} \;
       else
          log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting"
          eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
@@ -398,7 +399,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
       fi
 
       KERNEL_IMAGE="$(ls $CHROOT_OUTPUT/boot/vmlinuz* 2>/dev/null | sort -r | head -1)"
-      if [ -n "$INITRD" ] ; then
+      if [ -n "$KERNEL_IMAGE" ] ; then
          cp "$KERNEL_IMAGE" "$BUILD_OUTPUT"/boot/isolinux/linux26
       else
          log "No kernel found inside $CHROOT_OUTPUT/boot/ - Exiting"