[Fai-commit] r6014 - in branches/stable/3.4: bin debian

Michael Prokop mika at alioth.debian.org
Tue Aug 17 12:56:35 UTC 2010


Author: mika
Date: 2010-08-17 12:56:31 +0000 (Tue, 17 Aug 2010)
New Revision: 6014

Modified:
   branches/stable/3.4/bin/fai-cd
   branches/stable/3.4/debian/changelog
Log:
fai-cd: add checks if package download succeeded


Signed-off-by: Michael Prokop <mika at grml.org>

Modified: branches/stable/3.4/bin/fai-cd
===================================================================
--- branches/stable/3.4/bin/fai-cd	2010-08-17 12:56:28 UTC (rev 6013)
+++ branches/stable/3.4/bin/fai-cd	2010-08-17 12:56:31 UTC (rev 6014)
@@ -33,7 +33,7 @@
 
 set -e 
 
-# last die exit code 20
+# last die exit code 22
 
 grub_version=2
 boot_image="boot/grub/eltorito.img"
@@ -80,8 +80,13 @@
     else
 	# if grub1 is not available in NFSROOT, we download the package based on the current
 	# sources.list, unpack and use these files for further processing
+	# this does not work if file: URI's are used in sources.lst
 	apt-get -d install --reinstall grub >/dev/null
 	grubPackage=`ls -rt /var/cache/apt/archives/grub_*|tail -1`
+	if [ -z "$grubPackage" ]; then
+	    die 21 "Downloading grub failed."
+	fi
+
 	GRUBDIR=$tmp/grubPackage
 	echo "no grub1 installation found in NFSROOT, using downloaded $grubPackage"
 	mkdir -p $GRUBDIR
@@ -122,9 +127,12 @@
 	cp $NFSROOT/boot/grub/core.img $tmp/boot/grub
 	MODULEBASE=$NFSROOT/usr/lib/grub/
     else
-	apt-get -d install --reinstall grub-pc >/dev/null
+	echo "no grub2 installation found in NFSROOT, using downloaded $grubPackage"
+	apt-get -y -d install --reinstall grub-pc >/dev/null
 	grubPackage=`ls -rt /var/cache/apt/archives/grub-pc*|tail -1`
-	echo "no grub2 installation fount in NFSROOT, using downloaded $grubPackage"
+	if [ -z "$grubPackage" ]; then
+	    die 22 "Downloading grub2 failed."
+	fi
 	GRUBDIR=$tmp/grubPackage
 	mkdir -p $GRUBDIR
 	dpkg -x $grubPackage $GRUBDIR

Modified: branches/stable/3.4/debian/changelog
===================================================================
--- branches/stable/3.4/debian/changelog	2010-08-17 12:56:28 UTC (rev 6013)
+++ branches/stable/3.4/debian/changelog	2010-08-17 12:56:31 UTC (rev 6014)
@@ -90,8 +90,9 @@
     inside $FAI_ROOT but are still registered in /etc/mtab outside of
     $FAI_ROOT, so let's get rid of them outside the chroot as well iff
     they are present
+  * fai-cd: add checks if package download succeeded
 
- -- Thomas Lange <lange at debian.org>  Fri, 09 Jul 2010 16:11:07 +0200
+ -- Thomas Lange <lange at debian.org>  Wed, 28 Jul 2010 16:28:51 -0400
 
 fai (3.3.5) unstable; urgency=high
 




More information about the Fai-commit mailing list