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

Bug#509799: Patch



Here's a patch, and then we just need a new debconf template
partman-ext3/boot_not_bootable

Index: ext2_or_ext3_boot
===================================================================
--- ext2_or_ext3_boot	(revision 55526)
+++ ext2_or_ext3_boot	(working copy)
@@ -1,6 +1,6 @@
 #!/bin/sh
-# Check that the boot partition is the 1st (primary) partition and that
-# it is of type ext2 or ext3.
+# Check that the boot partition is the 1st (primary) partition, that
+# it is of type ext2 or ext3, and that it is marked as bootable.
 
 machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//') || true
 case "$machine" in
@@ -32,10 +32,16 @@
 			root_fs=$filesystem
 			root_type=$type
 			root_path=$path
+			if [ -f $id/bootable ]; then
+				root_bootable=yes
+			fi
 		elif [ "$mountpoint" = /boot ]; then
 			boot_fs=$filesystem
 			boot_type=$type
 			boot_path=$path
+			if [ -f $id/bootable ]; then
+				boot_bootable=yes
+			fi
 		fi
 	done
 	close_dialog
@@ -46,6 +52,7 @@
 	boot_fs=$root_fs
 	boot_type=$root_type
 	boot_path=$root_path
+	boot_bootable=$root_bootable
 fi
 
 # We need an ext2 r ext3 filesystem to boot
@@ -71,3 +78,14 @@
 	fi
 fi
 
+# Make sure that the boot partition is marked as bootable
+if [ "$boot_bootable" != "yes" ]; then
+	db_set partman-ext3/boot_not_bootable true
+	db_input critical partman-ext3/boot_not_bootable || true
+	db_go || true
+	db_get partman-ext3/boot_not_bootable
+	if [ "$RET" = true ]; then
+		exit 1
+	fi
+fi
+

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: