commit 160af417d3806e686b438b00150587252d3629d6 parent 65b25825ef92a8d70fde89eaf068ae4642a08c1d Author: Jan Pobrislo <ccx@webprojekty.cz> Date: Tue, 21 Apr 2015 01:00:43 +0200 support MBR options, including boot flag Diffstat:
| M | zsh-functions/confz_fs_init | | | 21 | ++++++++++++++++++++- |
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/zsh-functions/confz_fs_init b/zsh-functions/confz_fs_init @@ -69,13 +69,13 @@ confz_disklabel_dos_check() { # check for primary partition confz_primary_partition_check() { + local prev option checkvars device number defvar fs ext2 require disklabel_dos :device fs_parted_list $vars[device] (( $+vars[size] || $+vars[end] )) || die "$0: requires either size or end" if [[ $vars[number] != 1 ]]; then - local prev prev=$[ $vars[number] - 1 ] (( $+fs_parted_start[$prev] )) || die "$0: missing preceding partition" : ${vars[start]:=${fs_parted_start[$prev]}} @@ -97,6 +97,25 @@ confz_primary_partition_check() { (($+vars[align])) && do_command+=( align-check $vars[align] $vars[number] ) + (($+vars[options])) && for option in ${(z)vars[options]}; do + do_command+=( set $vars[number] option ) + done + return 1 + fi +} + + +# check for bootable flag on primary partition +confz_bootable_partition_check() { + checkvars device number + require disklabel_dos :device + fs_parted_list $vars[device] + (( $+fs_parted_other[$vars[number]] )) || \ + die "$0: device ${(q)vars[device]} partition ${(q)vars[number]} not found" + if [[ $fs_parted_other[$vars[number]] = *boot* ]]; then + return 0 + else + do_command=( parted --script $vars[device] -- set $vars[number] boot ) return 1 fi }