Package: partman-partitioning Version: 60 Severity: wishlist Tags: patch This adds support for BIOS Boot Partition flag in partman, which will allow GRUB to install on GPT drives without use of blocklists. It requires the user to manually setup a partition for embedding GRUB in it.
Although blocklists are unreliable, the reason they're currently used is that GPT doesn't have an implicit post-MBR area that can be used by BIOS-based bootloaders like it's done on DOS labels (in sector 1 you have the GPT primary header). Adding a BIOS Boot Partition provides a functional equivalent to this area, which GRUB 2 already knows to identify and take advantage of. -- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-6-amd64 Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Index: debian/partman-partitioning.templates =================================================================== --- debian/partman-partitioning.templates (revision 53798) +++ debian/partman-partitioning.templates (working copy) @@ -221,6 +221,11 @@ # :sl2: _Description: Name: +Template: partman-partitioning/text/biosable +Type: text +# :sl2: +_Description: BIOS boot area: + Template: partman-partitioning/text/bootable Type: text # :sl2: Index: active_partition/_numbers =================================================================== --- active_partition/_numbers (revision 53798) +++ active_partition/_numbers (working copy) @@ -1,6 +1,7 @@ 10 change_name 65 toggle_bootable 66 change_flags +67 toggle_bios 80 resize 83 copy 87 delete Index: active_partition/toggle_bios/do_option =================================================================== --- active_partition/toggle_bios/do_option (revision 53798) +++ active_partition/toggle_bios/do_option (working copy) @@ -8,22 +8,16 @@ cd $dev -if [ "$task" = bootable ]; then +if [ "$task" = biosable ]; then open_dialog PARTITION_INFO $id read_line x1 x2 x3 type x5 x6 x7 close_dialog - if [ "$type" = logical ]; then - db_input high partman-partitioning/bootable_logical || true - db_go || exit 0 - db_get partman-partitioning/bootable_logical - [ "$RET" = true ] || exit 0 - fi fi new_flags='' open_dialog GET_FLAGS $id while { read_line flag; [ "$flag" ]; }; do - if [ "$flag" != boot ]; then + if [ "$flag" != bios_grub ]; then if [ "$new_flags" ]; then new_flags="$new_flags $flag" @@ -34,9 +28,9 @@ done close_dialog -if [ $task = bootable ]; then +if [ $task = biosable ]; then new_flags="$new_flags -boot" +bios_grub" fi open_dialog SET_FLAGS $id Index: active_partition/toggle_bios/choices =================================================================== --- active_partition/toggle_bios/choices (revision 53798) +++ active_partition/toggle_bios/choices (working copy) @@ -7,33 +7,33 @@ cd $dev -valid_boot=no +valid_bios=no open_dialog VALID_FLAGS $id while { read_line flag; [ "$flag" ]; }; do - if [ "$flag" = boot ]; then - valid_boot=yes + if [ "$flag" = bios_grub ]; then + valid_bios=yes fi done close_dialog -[ $valid_boot = yes ] || exit 0 +[ $valid_bios = yes ] || exit 0 -bootable=no +biosable=no open_dialog GET_FLAGS $id while { read_line flag; [ "$flag" ]; }; do - if [ "$flag" = boot ]; then - bootable=yes + if [ "$flag" = bios_grub ]; then + biosable=yes fi done close_dialog -db_metaget partman-partitioning/text/bootable description +db_metaget partman-partitioning/text/biosable description description=$(stralign -25 "$RET") -if [ $bootable = yes ]; then +if [ $biosable = yes ]; then db_metaget partman-partitioning/text/on description - printf "unbootable\t%s%s\n" "$description" "${RET}" + printf "unbiosable\t%s%s\n" "$description" "${RET}" else db_metaget partman-partitioning/text/off description - printf "bootable\t%s%s\n" "$description" "${RET}" + printf "biosable\t%s%s\n" "$description" "${RET}" fi