From 13a2fffda8d729a5c09272dd6f2bcbf0a8251575 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 8 Jan 2013 14:22:24 +0100 Subject: g-i: fail if no bootable image was created --- bin/g-i-installation.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index 837ce0eb..5bbc0dfb 100755 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -191,8 +191,11 @@ boot_system() { QEMU_OPTS="-display vnc=$DISPLAY -no-shutdown" QEMU_OPTS="$QEMU_OPTS -drive file=$NAME.raw,index=0,media=disk,cache=writeback -m $RAMSIZE" echo "Checking $NAME.raw:" - file $NAME.raw - # FIXME: exit here if image is not bootable + FILE=$(file $NAME.raw) + if [ $(echo $FILE | grep "x86 boot sector" | wc -l) -eq 0 ] ; then + echo "ERROR: no x86 boot sector found in $NAME.raw - it's filetype is $FILE." + exit 1 + fi case $NAME in debian-edu*_combi-server) QEMU_OPTS="$QEMU_OPTS -net nic -net user -net nic,model=e1000" -- cgit v1.2.3-70-g09d2