Package: live-installer
Severity: normal
Version: 5
Tags: patch

If there was an error locating a live image, live-installer continues and
eventually fails somewhere inside the live-installer post-installation
hooks with a rather meaningless error message.

The attached patch halts the installation at a more suitable point and emits
an more descriptive error message to syslog.


Regards,

-- 
Chris Lamb, UK                                       [EMAIL PROTECTED]
                                                            GPG: 0x634F9A20
From 05e383928293649ac542abae10cfd060be67418f Mon Sep 17 00:00:00 2001
From: Chris Lamb <[EMAIL PROTECTED]>
Date: Sat, 14 Jun 2008 07:04:50 +0100
Subject: [PATCH] Bail-out much earlier if a filesystem image cannot be found

If there was an error locating a live image, live-installer continues and
eventually fails somewhere inside the live-installer post-installation
hooks with no sensible error message.

Although this patch does not display a debconf warning, it at least halts
the installation and emits something to syslog.

Signed-off-by: Chris Lamb <[EMAIL PROTECTED]>
---
 packages/live-installer/debian/postinst |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/packages/live-installer/debian/postinst 
b/packages/live-installer/debian/postinst
index cd3313d..c9817f9 100755
--- a/packages/live-installer/debian/postinst
+++ b/packages/live-installer/debian/postinst
@@ -17,6 +17,7 @@ mode="$RET"
 install_live_system () {
        # Look at
        PLACES=""
+       PLACE_FOUND=0
 
        # Load filesystem support
        for script in $(ls /lib/live-installer/*); do
@@ -29,6 +30,8 @@ install_live_system () {
                SUPPORT=$(echo $place | sed 's,.*\.\(.*\)$,\1,g')
                info "Using $SUPPORT support for $place"
 
+               PLACE_FOUND=1
+
                eval ${SUPPORT}_prepare
                STEPS=$(eval ${SUPPORT}_count)
 
@@ -59,6 +62,11 @@ install_live_system () {
                IFS=$OLD_IFS
        done
 
+       if [ ${PLACE_FOUND} -eq 0 ]; then
+               error "Could not find any live images"
+               exit 1
+       fi
+
        # if we're dumping it, we need to set boot=live
        if [ "$mode" = live ]; then
                # set the init script to use
-- 
1.5.5.4

Attachment: signature.asc
Description: PGP signature

Reply via email to