Bug#241177: Corrected patch for arcboot-installer nag screen
> So, is there any way this could be done automatically? ie. can we
> get/set PROM variables ourselves from within Linux? If not, I'll
> add this patch.
Unfortunately, there's no other way I'm aware of - the kernel has calls
to edit the PROM variables, but it seems that no one's written a tool
(or /proc interface, or whatever) that actually uses them. Debconf
notes still appear to be the best available solution....
As I'd mentioned, my earlier patch was broken - I'd misunderstood some
of debconf's workings. The following patch works properly when tested
as a standalone, though I haven't yet tested a full installation run
with it in place.
--
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'`
+
+db_subst arcboot/prom_variables abootbus `grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f3 | sed 's/^bus//'`
+db_subst arcboot/prom_variables abootid `grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f4 | sed 's/^target//'`
+db_subst arcboot/prom_variables abootlun `grep "^\ \+$abootmajor\ \+$abootminor\ \+" /proc/partitions | cut -d/ -f5 | sed 's/^lun//'`
+db_subst arcboot/prom_variables arootbus `grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f3 | sed 's/^bus//'`
+db_subst arcboot/prom_variables arootid `grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f4 | sed 's/^target//'`
+db_subst arcboot/prom_variables arootlun `grep "^\ \+$arootmajor\ \+$arootminor\ \+" /proc/partitions | cut -d/ -f5 | sed 's/^lun//'`
+db_subst arcboot/prom_variables arootpart $((`echo $rootfs | sed 's/^[a-z\/]\+//'` - 1))
+
+db_input high arcboot/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, select "Stop for Maintenance", then press "5" to enter the command
+ monitor. There, 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: