Check for presence of the initrd
authorMichael Prokop <devnull@localhost>
Sat, 6 Oct 2007 16:29:23 +0000 (18:29 +0200)
committerMichael Prokop <devnull@localhost>
Sat, 6 Oct 2007 16:29:23 +0000 (18:29 +0200)
debian/changelog
grml-live

index 063956f..6526721 100644 (file)
@@ -28,6 +28,7 @@ grml-live (0.0.4) unstable; urgency=low
   * Use iceweasel/firefox as x-www-browser and w3m as www-browser (if
     available). 
   * Make sure the initrd does not start mdadm automatically.
+  * Check for presence of the initrd.
 
  -- Michael Prokop <mika@grml.org>  Thu, 04 Oct 2007 22:16:34 +0200
 
index dd5e838..e5d432b 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -4,7 +4,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Thu Oct 04 22:16:28 CEST 2007 [mika]
+# Latest change: Sat Oct 06 18:28:57 CEST 2007 [mika]
 ################################################################################
 
 # read configuration files, set some misc variables {{{
@@ -300,9 +300,19 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
    else
       # booting stuff:
       mkdir -p "$BUILD_OUTPUT"/boot/isolinux
-      cp /boot/memtest86+.bin                              "$BUILD_OUTPUT"/boot/isolinux/memtest
-      # do not keep the initrd inside the chroot, let's save space instead:
-      mv "$CHROOT_OUTPUT"/boot/initrd*                     "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
+      cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest
+
+      # if we don't have an initrd we a) can't boot and b) there was an error
+      # during build, so check for the file:
+      if [ -f "$CHROOT_OUTPUT"/boot/initrd* ] ; then
+         # do not keep the initrd inside the chroot, let's save space instead:
+         mv "$CHROOT_OUTPUT"/boot/initrd*                     "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
+      else
+         log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting"
+         eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
+         bailout 10
+      fi
+
       cp "$CHROOT_OUTPUT"/boot/vmlinuz*                    "$BUILD_OUTPUT"/boot/isolinux/linux26
       cp /usr/lib/syslinux/chain.c32                       "$BUILD_OUTPUT"/boot/isolinux/
       cp /usr/lib/syslinux/isolinux.bin                    "$BUILD_OUTPUT"/boot/isolinux/