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

Bug#281724: improved patch



Here is improved patch for this bug that also adds different menu for sw
RAID systems (also fixes #265900).

-- 
Eugeniy Meshcheryakov

Kyiv National Taras Shevchenko University
Information and Computing Centre
http://icc.univ.kiev.ua
Index: lilo-installer/debian/postinst
===================================================================
--- lilo-installer/debian/postinst	(revision 28972)
+++ lilo-installer/debian/postinst	(working copy)
@@ -53,10 +53,12 @@
 
 prefix=$(echo "$bootfs_devfs" | sed 's/\(\/dev\/[a-z]\+\).*/\1/')
 
+raid_install=no
 if [ "$prefix" != /dev/md ]; then
 	disc_offered_devfs=$(find $prefix -follow -name disc | head -n 1)
 else
 	disc_offered_devfs="$bootfs_devfs"
+	db_register lilo-installer/bootdev_raid lilo-installer/bootdev
 fi
 disc_offered=$(mapdevfs "$disc_offered_devfs")
 
@@ -71,7 +73,7 @@
 db_get lilo-installer/bootdev
 
 case "$RET" in
-  *Master*) bootdev=$(mapdevfs $disc_offered_devfs)  ;;
+  *Master*|*RAID*) bootdev=$(mapdevfs $disc_offered_devfs)  ;;
   *Debian*)
     bootdev=$(mapdevfs $bootfs_devfs)
     part=$(echo $bootdev | sed 's/.*\([0-9]\)/part\1/')
@@ -110,6 +112,14 @@
   ;;
 esac
 
+if echo "${bootdev}" | grep -q '^/dev/md'; then
+    raid_boot="yes"
+    raid_extra_boot="raid-extra-boot=mbr-only"
+else
+    raid_boot="no"
+    raid_extra_boot="# raid-extra-boot=mbr-only"
+fi
+
 db_subst lilo-installer/progress_active bootdev "$bootdev"
 db_subst lilo-installer/progress_running bootdev "$bootdev"
 
@@ -119,7 +129,7 @@
 
 # If installing to a partition (not MBR), offer to make it active
 # Do not try to make MD device active
-if (echo "${bootdev}" | grep -q '[0-9]$') && !(echo "${bootdev}" | grep -q '^/dev/md'); then
+if (echo "${bootdev}" | grep -q '[0-9]$') && [ "${raid_boot}" = "no" ]; then
     # Installing to a partition, check if it is already marked active
     if ! fdisk -l ${disc_offered_devfs} | grep "^/dev[a-z0-9/]\+${part} " | grep -q '\*'; then
         # partition is not marked active, offer to make it so
@@ -140,7 +150,7 @@
 
 # Make sure that there's *some* active partition; some BIOSes reportedly
 # don't like it otherwise.
-if ! fdisk -l "$disc_offered_devfs" | grep '^/dev/' | grep -q '\*'; then
+if [ "${raid_boot}" = no ] && (! fdisk -l "$disc_offered_devfs" | grep '^/dev/' | grep -q '\*'); then
     # Check whether they already chose not to make their boot partition
     # active. If so, that's their problem ...
     db_get lilo-installer/activate-part
@@ -244,6 +254,10 @@
 #
 root=${rootfs}
 
+# This option may be needed for some software RAID installs.
+#
+${raid_extra_boot}
+
 # Enable map compaction:
 # Tries to merge read requests for adjacent sectors into a single
 # read request. This drastically reduces load time and keeps the
Index: lilo-installer/debian/lilo-installer.templates
===================================================================
--- lilo-installer/debian/lilo-installer.templates	(revision 28972)
+++ lilo-installer/debian/lilo-installer.templates	(working copy)
@@ -12,6 +12,17 @@
  .
  If unsure, install LILO into the Master Boot Record.
 
+Template: lilo-installer/bootdev_raid
+Type: select
+# Note to translators : Please keep your translations of the choices
+# below a 65 columns limit (which means 65 characters 
+# in single-byte languages)
+__Choices: ${disc}: software RAID array, Other choice (Advanced)
+_Description: LILO installation target:
+ The LILO program needs to be installed to make your new Debian system
+ bootable. You may choose to install it onto software RAID array or
+ onto other device.
+
 # Advanced words for advanced people...
 Template: lilo-installer/manual_bootdev
 Type: string

Attachment: signature.asc
Description: Digital signature


Reply to: