From 5b93073fdac6098c13c04e06b7d6ca54b03eb721 Mon Sep 17 00:00:00 2001 From: natemaia Date: Sat, 25 Aug 2018 21:23:48 -0700 Subject: [PATCH] Update boot flag setting --- source/archlabs-installer | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source/archlabs-installer b/source/archlabs-installer index 5a8e5c4..ccae31b 100755 --- a/source/archlabs-installer +++ b/source/archlabs-installer @@ -14,7 +14,7 @@ # immutable variables { readonly DIST="Archlabs" # Linux distributor -readonly VER="1.6.45" # Installer version +readonly VER="1.6.46" # Installer version readonly LIVE="liveuser" # Live session user readonly TRN="/usr/share/archlabs-installer" # Translation path readonly MNT="/mnt/install" # Install mountpoint @@ -803,6 +803,8 @@ auto_partition() { check_for_errors "parted -s $device mkpart primary ext4 1MiB 513MiB" mkfs.ext4 -q $BOOT_PART >/dev/null 2>$ERR check_for_errors "mkfs.ext4 -q $BOOT_PART" + parted -s $device set $part_num boot on 2>$ERR + check_for_errors "parted -s $device set $part_num boot on" else parted -s $device mkpart ESP fat32 1MiB 513MiB 2>$ERR check_for_errors "parted -s $device mkpart ESP fat32 1MiB 513MiB" @@ -812,9 +814,6 @@ auto_partition() { check_for_errors "parted -s $device set $part_num esp on" fi - parted -s $device set $part_num boot on 2>$ERR - check_for_errors "parted -s $device set $part_num boot on" - (( part_num++ )) # increment the partition number BOOT_DEVICE="$device" # only grub on BIOS systems uses this ROOT_PART="${device}${nvme}$part_num" # set root partition label to the second partition @@ -1004,17 +1003,22 @@ select_boot_setup() { setup_boot_device() { # set BOOT_DEVICE for syslinux on UEFI and grub on BIOS - BOOT_DEVICE="${BOOT_PART%%([1-9]|(p)[1-9])}" + if [[ $BOOT_PART =~ nvme ]]; then + BOOT_DEVICE="${BOOT_PART%p[1-9]}" + else + BOOT_DEVICE="${BOOT_PART%[1-9]}" + fi + BOOT_PART_NUM="${BOOT_PART: -1}" # setup the needed partition flags for boot on both system types parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on 2>$ERR check_for_errors "parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on" - if [[ $SYS == 'UEFI' ]]; then parted -s $BOOT_DEVICE set $BOOT_PART_NUM esp on 2>$ERR check_for_errors "parted -s $BOOT_DEVICE set $BOOT_PART_NUM boot on" fi + return 0 } @@ -1037,13 +1041,11 @@ select_efi_partition() { if grep -q 'fat' <<< "$(fsck -N "$BOOT_PART")"; then local msg="$_FormUefiBody $BOOT_PART $_FormUefiBody2" - yesno "$_PrepMount" "$msg" "Format $BOOT_PART" "Do Not Format" "no" && format_efi_as_vfat "$BOOT_PART" else format_efi_as_vfat "$BOOT_PART" fi - setup_boot_device return 0 } @@ -1069,8 +1071,6 @@ select_boot_partition() { else format_as_ext4 "$BOOT_PART" fi - - setup_boot_device fi return 0 } @@ -1174,6 +1174,7 @@ select_partitions() { select_boot_setup || { BOOTLOADER=""; return 1; } if [[ $BOOT_PART != "" ]]; then + setup_boot_device mount_partition "$BOOT_PART" "${BOOT_MNTS[$SYS-$BOOTLOADER]}" || return 1 SEPERATE_BOOT=1 fi