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

Bug#502446: Patch for Bug#502446: grub-installer is not updated for grub-pc introduction



tags 502446 patch
thanks

Just get my point clear, I am submitting untested patch as reference.

Once tested to be good, it is technically trivial (but time consuming)
to add po files for most European languages and CJK as long as po files
are in UTF-8.  So this will not make much regression.

My work on rescue scripts are pure guessing work (but simple one.)

Osamu

diff -Nru grub-installer-1.35/debian/changelog grub-installer-1.35+nmu1/debian/changelog
--- grub-installer-1.35/debian/changelog	2008-09-30 03:31:13.000000000 +0900
+++ grub-installer-1.35+nmu1/debian/changelog	2008-10-19 12:01:59.000000000 +0900
@@ -1,3 +1,10 @@
+grub-installer (1.35+nmu1) experimental; urgency=low
+
+  * Non-maintainer upload. (I will not do it)
+  * support grub2 with correct message on device name convention
+
+ -- Osamu Aoki <osamu@debian.org>  Sun, 19 Oct 2008 12:00:26 +0900
+
 grub-installer (1.35) unstable; urgency=low
 
   * Add support for MMC/SD card devices (mmcblkX).
diff -Nru grub-installer-1.35/debian/grub-installer.templates grub-installer-1.35+nmu1/debian/grub-installer.templates
--- grub-installer-1.35/debian/grub-installer.templates	2008-04-28 17:38:06.000000000 +0900
+++ grub-installer-1.35+nmu1/debian/grub-installer.templates	2008-10-19 10:52:13.000000000 +0900
@@ -95,6 +95,26 @@
     your third drive (SCSI here);
   - "(fd0)" or "/dev/fd0" will install GRUB to a floppy.
 
+Template: grub-installer/bootdev2
+Type: string
+# :sl2:
+_Description: Device for boot loader installation:
+ You need to make the newly installed system bootable, by installing
+ the GRUB boot loader on a bootable device. The usual way to do this is to
+ install GRUB on the master boot record of your first hard drive. If you
+ prefer, you can install GRUB elsewhere on the drive, or to another drive,
+ or even to a floppy.
+ .
+ The device can be specified using GRUB's "(hdn,m)" notation, or as a device
+ in /dev. Below are some examples:
+  - "(hd0)" or "/dev/hda" will install GRUB to the master boot record
+    of your first hard drive (IDE);
+  - "(hd0,2)" or "/dev/hda2" will use the second partition of your
+    first IDE drive;
+  - "(hd2,5)" or "/dev/sdc5" will use the first extended partition of
+    your third drive (SCSI here);
+  - "(fd0)" or "/dev/fd0" will install GRUB to a floppy.
+
 Template: grub-installer/password
 Type: password
 # :sl2:
diff -Nru grub-installer-1.35/grub-installer grub-installer-1.35+nmu1/grub-installer
--- grub-installer-1.35/grub-installer	2008-09-30 03:24:48.000000000 +0900
+++ grub-installer-1.35+nmu1/grub-installer	2008-10-19 11:27:42.000000000 +0900
@@ -512,7 +512,11 @@
 			state=2
 		fi
 	else
-		db_input critical grub-installer/bootdev || true
+		if [ "$grub_version" = "grub" ]; then
+			db_input critical grub-installer/bootdev || true
+		else
+			db_input critical grub-installer/bootdev2 || true
+		fi
 		if ! db_go; then
 			if [ "$q" ]; then
 				state=1
@@ -522,6 +526,11 @@
 				exit 10
 			fi
 		else
+			if [ "$grub_version" = "grub" ]; then
+				db_get grub-installer/bootdev
+			else
+				db_get grub-installer/bootdev2
+			fi
 			db_get grub-installer/bootdev
 			bootdev=$RET
 			if echo "$bootdev" | grep -qv '('; then
diff -Nru grub-installer-1.35/rescue.d/80grub-reinstall grub-installer-1.35+nmu1/rescue.d/80grub-reinstall
--- grub-installer-1.35/rescue.d/80grub-reinstall	2006-09-23 22:23:38.000000000 +0900
+++ grub-installer-1.35+nmu1/rescue.d/80grub-reinstall	2008-10-19 11:57:34.000000000 +0900
@@ -7,14 +7,22 @@
 db_progress START 0 2 grub-installer/progress/title
 db_progress INFO grub-installer/progress/step_bootdev
 
-db_input critical grub-installer/bootdev
+if [ -f /target/boot/grub/menu.lst ]; then
+	db_input critical grub-installer/bootdev
+else
+	db_input critical grub-installer/bootdev2
+fi
 if ! db_go; then
 	# back up to menu
 	db_progress STOP
 	exit 10
 fi
 
-db_get grub-installer/bootdev
+if [ -f /target/boot/grub/menu.lst ]; then
+	db_get grub-installer/bootdev
+else
+	db_get grub-installer/bootdev2
+fi
 bootdev="$RET"
 if echo "$bootdev" | grep -qv '('; then
 	mappedbootdev="$(mapdevfs "$bootdev")" || true
diff -Nru grub-installer-1.35/rescue.d/80grub-reinstall.tst grub-installer-1.35+nmu1/rescue.d/80grub-reinstall.tst
--- grub-installer-1.35/rescue.d/80grub-reinstall.tst	2006-07-26 07:50:27.000000000 +0900
+++ grub-installer-1.35+nmu1/rescue.d/80grub-reinstall.tst	2008-10-19 11:52:18.000000000 +0900
@@ -1,2 +1,2 @@
 #! /bin/sh -e
-[ -f /target/boot/grub/menu.lst ]
+[ -f /target/boot/grub/menu.lst ] || [ -f /target/boot/grub/grub.cfg ]

Reply to: