[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#262182: Patch for elilo-installer to call apt-install elilo



Please apply the following patch and close this bug.

Changes:
1. Calls apt-install elilo per request in the bug report.

2. Adds error handling for elilo failures.

Notes:
* There are template changes (added messages) that
  require translation.

* A bug report (Bug#264947: Acknowledgement (Busybox chroot
  crash/errors on Sarge 08/06 for ia64.)) was filed because of 
  failures in this code.  That bug has not been fixed and the
  failure case cannot be tested until that bug is resolved.


Jim
-- 
*************
Jim Lieb			Wild Open Source Inc.
lieb@wildopensource.com		Cell: 831.295.9317
Office: 831.421.0883            Fax:  831.421.0885
Index: elilo-installer/debian/elilo-installer.postinst
===================================================================
--- elilo-installer/debian/elilo-installer.postinst	(revision 18778)
+++ elilo-installer/debian/elilo-installer.postinst	(working copy)
@@ -3,6 +3,22 @@
 
 . /usr/share/debconf/confmodule
 
+db_capb backup
+
+log=/var/log/messages
+
+log() {
+	logger -t elilo-installer "$@"
+}
+
+error() {
+	log "error: $@"
+}
+
+info() {
+    log "info: $@"
+}
+
 if [ -f /etc/mtab ]; then
     MTAB=/etc/mtab
 else
@@ -52,6 +68,7 @@
 	db_go
 	exit 1
 fi
+rm -f /tmp/efi_boot.list
 db_subst elilo-installer/bootpart BOOTPARTS $BOOTPARTS
 
 db_fset elilo-installer/bootpart seen false
@@ -66,5 +83,45 @@
 
 # Write out elilo.conf
 
-chroot /target /usr/sbin/elilo --autoconf --boot $bootpart --root $rootfs --efiboot
+db_progress START 0 2 elilo-installer/title
 
+db_progress INFO elilo-installer/progress_installing
+
+if ! apt-install elilo ; then
+	info "Calling 'apt-install elilo' failed"
+	# Hm, unable to install elilo into /target/, what should we do?
+	db_input critical elilo-installer/apt-install-failed || [ $? -eq 30 ]
+	if ! db_go; then
+		db_progress STOP
+		exit 10 # back up to menu
+	fi
+	db_get elilo-installer/apt-install-failed
+	if [ true != "$RET" ] ; then
+		db_progress STOP
+		exit 1
+	fi
+fi
+
+db_progress STEP 1
+
+db_subst elilo-installer/progress_running bootdev "$bootpart"
+db_progress INFO elilo-installer/progress_running
+
+chroot /target /usr/sbin/elilo --autoconf --boot $bootpart \
+      --root $rootfs --efiboot
+errcode=$?
+if [ "$errcode" = 0 ] ; then
+	info "Boot loader successfully installed into EFI partition"
+else
+	db_subst elilo-installer/failed ERRCODE "$errcode"
+	db_input critical elilo-installer/failed || [ $? -eq 30 ]
+	db_progress STOP
+	db_go || exit 10 # back up
+	exit 1
+fi
+
+db_progress STEP 1
+
+db_progress STOP
+
+exit 0
Index: elilo-installer/debian/changelog
===================================================================
--- elilo-installer/debian/changelog	(revision 18778)
+++ elilo-installer/debian/changelog	(working copy)
@@ -1,3 +1,12 @@
+elilo-installer (0.0.6) unstable; urgency=low
+
+  * Jim Lieb
+    - add apt-install to fix dependency on debootstrap to
+    -  install bootloader.
+    - Closes: #262182
+
+ -- Jim Lieb <lieb@wildopensource.com>  Sat, 31 Jun 2004 14:55:00 -0700
+
 elilo-installer (0.0.5) unstable; urgency=low
 
   * Colin Watson
Index: elilo-installer/debian/elilo-installer.templates
===================================================================
--- elilo-installer/debian/elilo-installer.templates	(revision 18778)
+++ elilo-installer/debian/elilo-installer.templates	(working copy)
@@ -11,7 +11,30 @@
  There were no suitable partitions found for elilo to use.  Elilo needs
  a partition with a FAT filesystem, and the boot flag set.
 
-Template: debian-installer/elilo-installer/title
+Template: elilo-installer/title
 Type: text
 #  Main menu item
 _Description: Install the elilo boot loader on a hard disk
+
+Template: elilo-installer/progress_installing
+Type: text
+_Description: Installing the ELILO package
+
+Template: elilo-installer/progress_running
+Type: text
+_Description: Running ELILO for ${bootdev}
+
+Template: elilo-installer/apt-install-failed
+Type: boolean
+Default: yes
+_Description: ELILO installation failed.  Continue anyway?
+ The elilo package failed to install into /target/.  Installing ELILO
+ as a boot loader is a required step.  The install problem might however be
+ unrelated to ELILO, so continuing the installation may be possible.
+
+Template: elilo-installer/failed
+Text: error
+_Description: ELILO installation failed
+ Running "/usr/sbin/elilo" failed with error code "${ERRCODE}".
+
+

Reply to: