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

Bug#241177: Remind users to update PROM variables after installation



Package: arcboot-installer
Version: svn 30/3/2004
Severity: wishlist
Tags: patch

  The installation should remind users to set the appropriate PROM
variables after rebooting.  Otherwise, they could easily get stuck with
an unbootable system.

  The following patch should do the trick.  Since the PROM needs SCSI
bus/ID/LUN identifiers, some /proc parsing is required.  That section
has been tested and works properly, but the debconf call is broken in
some way that I hope is obvious to others.  (My debconf knowledge is,
uh, minimal.)


-- 
Nicholas Breen
nbreen@ofb.net




diff -Nru arcboot-installer.svn/debian/arcboot-installer.postinst arcboot-installer/debian/arcboot-installer.postinst
--- arcboot-installer.svn/debian/arcboot-installer.postinst	2004-03-30 14:10:45.000000000 -0500
+++ arcboot-installer/debian/arcboot-installer.postinst	2004-03-30 15:35:06.000000000 -0500
@@ -75,3 +75,22 @@
 #		exit 1
 #	fi
 #fi
+
+# Suggest the necessary PROM variables that will need to be set before the
+# system can be booted.
+
+abootmajor=`ls -l $defaultbootdev | cut -c34-37 | sed 's/ //g'`
+abootminor=`ls -l $defaultbootdev | cut -c39-42 | sed 's/ //g'`
+arootmajor=`ls -l $rootfs | cut -c34-37 | sed 's/ //g'`
+arootminor=`ls -l $rootfs | cut -c39-42 | sed 's/ //g'`
+
+ABOOTBUS=`grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f3 | sed 's/^bus//'`
+ABOOTID=`grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f4 | sed 's/^target//'`
+ABOOTLUN=`grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f5 | sed 's/^lun//'`
+AROOTBUS=`grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f3 | sed 's/^bus//'`
+AROOTID=`grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f4 | sed 's/^target//'`
+AROOTLUN=`grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f5 | sed 's/^lun//'`
+AROOTPART=$((`echo $rootfs | sed 's/^[a-z\/]\+//'` - 1))
+
+db_input high arcboot-installer/prom-variables || true
+db_go || true
diff -Nru arcboot-installer.svn/debian/arcboot-installer.templates arcboot-installer/debian/arcboot-installer.templates
--- arcboot-installer.svn/debian/arcboot-installer.templates	2004-03-30 14:10:45.000000000 -0500
+++ arcboot-installer/debian/arcboot-installer.templates	2004-03-30 15:29:34.000000000 -0500
@@ -23,3 +23,22 @@
  The arcboot package failed to install into /target/.  Installing Arcboot
  as a boot loader is a required step.  The install problem might however be
  unrelated to Arcboot, so continuing the installation may be possible.
+
+Template: arcboot/prom_variables
+Type: note
+_Description: Setting PROM variables for Arcboot
+ If this is your first Linux installation on this machine, or if you have
+ repartitioned your hard drives, you will need to set certain variables
+ in the PROM before the system will boot normally.
+ .
+ At the end of this installation phase, you will reboot your system.  When
+ you do, enter the command monitor from the "Stop for Maintenance" option,
+ and type the following commands:
+ .
+ setenv SystemPartition scsi(${ABOOTBUS})disk(${ABOOTID})rdisk(${ABOOTLUN})partition(8)
+ setenv OSLoadPartition scsi(${AROOTBUS})disk(${AROOTID})rdisk(${AROOTLUN})partition(${AROOTPART})
+ setenv OSLoader arcboot
+ setenv OSLoadFilename Linux
+ .
+ You will only need to do this once.  Afterwards, type "boot" or reboot the
+ system to proceed.



Reply to: