diff options
author | Kroy <kroy@kroy.io> | 2018-12-01 17:36:42 -0600 |
---|---|---|
committer | Kroy <kroy@kroy.io> | 2018-12-01 17:36:42 -0600 |
commit | a4e55e633137e558ce02da48b4ad16acffbcf1a7 (patch) | |
tree | 57432b2404294969e2fd9b6d3f5b2b41dd946e06 | |
parent | 0ebc3def62c13a19bcfb8d25ae479235ed376268 (diff) | |
download | vyatta-cfg-system-a4e55e633137e558ce02da48b4ad16acffbcf1a7.tar.gz vyatta-cfg-system-a4e55e633137e558ce02da48b4ad16acffbcf1a7.zip |
EFI Cleanup. Adding removable option to grub-install
-rwxr-xr-x | scripts/install/install-get-partition | 11 | ||||
-rwxr-xr-x | scripts/install/install-postinst-new | 7 | ||||
-rwxr-xr-x | scripts/vyatta-grub-setup | 3 |
3 files changed, 6 insertions, 15 deletions
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index a8ccb821..b517c460 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -34,11 +34,6 @@ PARTITION='' # default file system type ROOT_FSTYPE='ext4' -EFI_PARTITION=0 -if [ -d /sys/firmware/efi ]; then - EFI_PARTITION=1 -fi - warn_of_dire_consequences () { # Give the user a requisite warning that we are about to nuke their drive response='' @@ -281,7 +276,7 @@ check_for_new_raid () { for drive in $drives; do create_partitions "$drive" $root_size "no" - if [ "$EFI_PARTITION" -eq "1" ]; then + if [ -d /sys/firmware/efi ]; then #EFI moves the data parition on RAID to 3 data_dev=3 echo "Create data partition: /dev/${drive}${data_dev}" @@ -679,7 +674,7 @@ create_partitions() { echo "Error: $ldrive is only $size"MB" large. Desired root is $root_part_size" exit 1 fi - if [ "$EFI_PARTITION" -eq "1" ]; then + if [ -d /sys/firmware/efi ]; then #Need room for the EFI partition. 512 is standard, but 256 is probably okay here root_part_size=$((root_part_size - 256)) @@ -880,7 +875,7 @@ setup_method_auto () { # now take the data and create the partitions create_partitions "$INSTALL_DRIVE" "$root_part_size" "yes" - if ! [ "$EFI_PARTITION" -eq "1" ]; then + if ! [ -d /sys/firmware/efi ]; then # mark data partition as bootable lecho "Marking /dev/$INSTALL_DRIVE partition 1 as bootable" output=$(parted -s /dev/$INSTALL_DRIVE set 1 boot on 2>&1) diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index 0ed6441d..4e387c0d 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -20,8 +20,6 @@ INSTALL_DRIVE=$1 ROOT_PARTITION=$2 # install type: "union" or "old" INSTALL_TYPE=$3 -# For passing into vyatta-grub-setup -EFI_PARTITION=0 # Default user DEFAULT_USER=vyos @@ -130,7 +128,6 @@ install_grub () { dpkg -r grub-pc grub2 >&/dev/null # Install grub-efi packages dpkg -i /usr/share/vyos/packages/grub-efi*.deb >&/dev/null - EFI_PARTITION=1 mkdir -p $grub_root/boot/efi readarray parts < /tmp/efiparts.tmp part_length=${#parts[@]} @@ -145,7 +142,7 @@ install_grub () { fi mkdosfs -F 32 -n EFI /dev/$part >&/dev/null mount /dev/$part $grub_root/boot/efi - output=$(grub-install --no-floppy --recheck --target=x86_64-efi --root-directory=$grub_root --efi-directory=$grub_root/boot/efi --bootloader-id="$bootloader_name" 2>&1) + output=$(grub-install --no-floppy --recheck --target=x86_64-efi --force-extra-removable --root-directory=$grub_root --efi-directory=$grub_root/boot/efi --bootloader-id="$bootloader_name" 2>&1) umount $grub_root/boot/efi ##TODO DO we need these to be in fstab?? # @@ -174,7 +171,7 @@ install_grub () { progress_indicator stop output=$(/opt/vyatta/sbin/vyatta-grub-setup $grub_setup_args \ - "$ROOT_PARTITION" '' $grub_root "$EFI_PARTITION" 2>&1) + "$ROOT_PARTITION" '' $grub_root 2>&1) ret=$? lecho "$output" if [ $ret == 0 ]; then diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index beea8e65..2b7197c1 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -54,7 +54,6 @@ shift `expr $OPTIND - 1` ROOT_PARTITION="$1" GRUB_OPTIONS="$2" ROOTFSDIR="$3" -EFI_PARTITION="$4" [ "$ROOT_PARTITION" ] || exit 1 @@ -157,7 +156,7 @@ fi echo "terminal_output --append serial" # EFI needs a few extra modules - if [ "$EFI_PARTITION" -eq "1" ]; then + if [ -d /sys/firmware/efi ]; then echo -e "insmod efi_gop" echo -e "insmod efi_uga" fi |