From 018860f21eb4151df5e0b719ad9b66331786ac4e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 5 Nov 2018 03:03:54 +0100 Subject: T288: normalize IP(v6) addresses before passing them to iproute2. --- scripts/vyatta-address | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vyatta-address b/scripts/vyatta-address index 4491c3f0..c3e57856 100755 --- a/scripts/vyatta-address +++ b/scripts/vyatta-address @@ -32,11 +32,13 @@ case $1 in ip_address=$(sed -n 's/^\s\sfixed-address\s\(.*\);/\1/p' $lease_file | sed -n '$p'); elif [[ "$3" = "dhcpv6" ]]; then lease_file=/var/lib/dhcp/dhclient_v6_"$2".leases; - ip_address=$(sed -n 's/^\s\s\s\siaaddr\s\(.*\)\s{/\1/p' $lease_file | sed -n '$p'); + ip_address=$(sed -n 's/^\s\s\s\siaaddr\s\(.*\)\s{/\1/p' $lease_file | sed -n '$p'); else ip_address=$3; fi - + + ip_address=$(/usr/libexec/vyos/system/normalize-ip $ip_address) + if ! ip address show dev $2 2>/dev/null | grep -q "$ip_address"; then # Address doesn't exist there, nothing to delete exit 0 @@ -50,9 +52,9 @@ case $1 in elif [[ "$3" = "dhcpv6" ]]; then exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --ifname "$2" elif [[ "$3" =~ ":" ]]; then - exec sudo ip -6 addr del "$3" dev "$2" + exec sudo ip -6 addr del "$ip_address" dev "$2" else - exec sudo ip addr del "$3" dev "$2" + exec sudo ip addr del "$ip_address" dev "$2" fi ;; *) echo "Unknown option $1" -- cgit v1.2.3 From a7731785aeb928ace93a176a9c574267a00836e4 Mon Sep 17 00:00:00 2001 From: Kroy Date: Mon, 5 Nov 2018 15:43:19 -0600 Subject: T955: Integrating EFI into the installer --- scripts/install/install-functions | 11 ++-- scripts/install/install-get-partition | 101 ++++++++++++++++++++++------------ scripts/install/install-image | 8 ++- scripts/install/install-postinst-new | 37 ++++++++----- scripts/vyatta-grub-setup | 6 ++ 5 files changed, 108 insertions(+), 55 deletions(-) (limited to 'scripts') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index d241e040..a038686c 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -174,10 +174,13 @@ select_drive () { local drv='' # list the drives in /proc/partitions. Remove partitions and empty lines. # the first grep pattern looks for devices named c0d0, hda, and sda. - drives=$(cat /proc/partitions | \ - awk '{ if ($4!="name") { print $4 } }' | \ - egrep "c[0-9]d[0-9]$|[hsv]d[a-z]$" | \ - egrep -v "^$") + #drives=$(cat /proc/partitions | \ + # awk '{ if ($4!="name") { print $4 } }' | \ + # egrep "c[0-9]d[0-9]$|[hsv]d[a-z]$" | \ + # egrep -v "^$") + + #should be better about finding installable drives + drives=$(lsblk -dn -o name -I8) # take the first drive as the default drv=$(echo $drives | /usr/bin/awk '{ print $1 }') diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index d6bb5524..5f4aee09 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -34,6 +34,8 @@ PARTITION='' # default file system type ROOT_FSTYPE='ext4' +EFI_PARTITION=0 + warn_of_dire_consequences () { # Give the user a requisite warning that we are about to nuke their drive response='' @@ -668,43 +670,72 @@ create_partitions() { echo "Error: $ldrive is only $size"MB" large. Desired root is $root_part_size" exit 1 fi + 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)) + + ##Do GPT/EFI Setup + sgdisk --zap-all /dev/$ldrive + # part1 = BIOS BOOT (backwards compatibility) + # part2 = EFI + # part3 = ROOT + sgdisk -a1 -n1:34:2047 -t1:EF02 \ + -n2:2048:+256M -t2:EF00 \ + -n3:0:0:+$root_part_size -t3:8300 /dev/$ldrive + status=$? + if [ "$status" != 0 ]; then + echo -e "Error creating primary partition on $ldrive.\nPlease see $INSTALL_LOG for more details.\nExiting..." + lecho "Error creating primary partition on $ldrive.\nparted /dev/$ldrive mkpart primary 0% $root_part_size\n$output" + exit 1 + fi + # set the partition number on the device. + if [ -n "$( echo $ldrive | grep -E "cciss|ida" )" ]; then + # if this is a cciss + ROOT_PARTITION=$ldrive"p3" + EFI_PARTITION=$ldrive"p2" + else + # else... the rest of the world + ROOT_PARTITION=$ldrive"3" + EFI_PARTITION=$ldrive"2" + fi + else + # Force FAT label creation + lecho "Creating a new disklabel on $ldrive" + parted -s /dev/$ldrive mklabel msdos + + # Make sure you can print disk info using parted + parted --script /dev/$ldrive p >/dev/null 2>&1 + + # If we still can't, something has gone terribly wrong + if [ "$?" != "0" ]; then + echo "Unable to read disk label. Exiting." + exit 1 + fi - # Force FAT label creation - lecho "Creating a new disklabel on $ldrive" - parted -s /dev/$ldrive mklabel msdos - - # Make sure you can print disk info using parted - parted --script /dev/$ldrive p >/dev/null 2>&1 - - # If we still can't, something has gone terribly wrong - if [ "$?" != "0" ]; then - echo "Unable to read disk label. Exiting." - exit 1 - fi - - lecho "Creating root partition on /dev/$ldrive" + lecho "Creating root partition on /dev/$ldrive" - # Make the root partition - # if optimal_io_size is empty use default of 2048s - if [ $(cat /sys/block/$ldrive/queue/optimal_io_size) -gt 0 ]; then - output=$(parted --script --align optimal /dev/$ldrive mkpart primary 0% $root_part_size) - else - output=$(parted --script --align optimal /dev/$ldrive mkpart primary 2048s $root_part_size) - fi - status=$? - if [ "$status" != 0 ]; then - echo -e "Error creating primary partition on $ldrive.\nPlease see $INSTALL_LOG for more details.\nExiting..." - lecho "Error creating primary partition on $ldrive.\nparted /dev/$ldrive mkpart primary 0% $root_part_size\n$output" - exit 1 - fi + # Make the root partition + # if optimal_io_size is empty use default of 2048s + if [ $(cat /sys/block/$ldrive/queue/optimal_io_size) -gt 0 ]; then + output=$(parted --script --align optimal /dev/$ldrive mkpart primary 0% $root_part_size) + else + output=$(parted --script --align optimal /dev/$ldrive mkpart primary 2048s $root_part_size) + fi + status=$? + if [ "$status" != 0 ]; then + echo -e "Error creating primary partition on $ldrive.\nPlease see $INSTALL_LOG for more details.\nExiting..." + lecho "Error creating primary partition on $ldrive.\nparted /dev/$ldrive mkpart primary 0% $root_part_size\n$output" + exit 1 + fi - # set the partition number on the device. - if [ -n "$( echo $ldrive | grep -E "cciss|ida" )" ]; then - # if this is a cciss - ROOT_PARTITION=$ldrive"p1" - else - # else... the rest of the world - ROOT_PARTITION=$ldrive"1" + # set the partition number on the device. + if [ -n "$( echo $ldrive | grep -E "cciss|ida" )" ]; then + # if this is a cciss + ROOT_PARTITION=$ldrive"p1" + else + # else... the rest of the world + ROOT_PARTITION=$ldrive"1" + fi fi # udev takes time to re-add the device file, so wait for it while [ ! -b "/dev/$ROOT_PARTITION" ]; do @@ -958,7 +989,7 @@ if [ -z "$ROOT_PARTITION" ]; then exit 1 fi -echo "$ROOT_PARTITION_TYPE $ROOT_PARTITION $INSTALL_DRIVE" >$OUTFILE +echo "$ROOT_PARTITION_TYPE $ROOT_PARTITION $INSTALL_DRIVE $EFI_PARTITION" >$OUTFILE becho 'Done!' exit 0 diff --git a/scripts/install/install-image b/scripts/install/install-image index 1b482a19..f99d4ce8 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -202,6 +202,7 @@ install_new () { local root_part=$1 local inst_drv=$2 + local efi_part=$3 if [ ! -e "/dev/$root_part" ] || [ ! -e "/dev/$inst_drv" ]; then fail_exit "Invalid drive/partition ($inst_drv and $root_part)." @@ -214,7 +215,7 @@ install_new () # postinst operations if ! /opt/vyatta/sbin/install-postinst-new \ - "$inst_drv" "$root_part" union; then + "$inst_drv" "$root_part" union "$efi_part"; then exit 1 fi } @@ -291,13 +292,14 @@ fi root_part_type='' root_part='' inst_drv='' -eval "read root_part_type root_part inst_drv <$PART_FILE" >&/dev/null +efi_part='' +eval "read root_part_type root_part inst_drv efi_part <$PART_FILE" >&/dev/null rm -f $PART_FILE >&/dev/null # handle different types case "$root_part_type" in new) - install_new "$root_part" "$inst_drv" + install_new "$root_part" "$inst_drv" "$efi_part" exit 0 ;; union|old) diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index 2457cdd3..187f812b 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -20,6 +20,8 @@ INSTALL_DRIVE=$1 ROOT_PARTITION=$2 # install type: "union" or "old" INSTALL_TYPE=$3 +# EFI partition. 0 or partition +EFI_PARTITION=$4 # Default user DEFAULT_USER=vyos @@ -122,20 +124,29 @@ install_grub () { # members. progress_indicator start - - if [[ $grub_inst_drv == "md raid" ]]; then - for slave in $raid_slaves; do - grub_inst_drv=${slave:0:3} - output=$(grub-install --no-floppy --recheck --root-directory=$grub_root \ - /dev/$grub_inst_drv 2>&1) - lecho "$output" - done - else - output=$(grub-install --no-floppy --recheck --root-directory=$grub_root \ - /dev/$grub_inst_drv 2>&1) - lecho "$output" + + #TODO EFI needs to go on every disk + if [ -b /dev/$EFI_PARTITION ]; then + mkdosfs -F 32 -n EFI /dev/$EFI_PARTITION + mkdir -p $grub_root/boot/efi + mount /dev/$EFI_PARTITION $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="VyOS") + umount $grub_root/boot/efi + else + if [[ $grub_inst_drv == "md raid" ]]; then + for slave in $raid_slaves; do + grub_inst_drv=${slave:0:3} + output=$(grub-install --no-floppy --recheck --root-directory=$grub_root \ + /dev/$grub_inst_drv 2>&1) + lecho "$output" + done + else + output=$(grub-install --no-floppy --recheck --root-directory=$grub_root \ + /dev/$grub_inst_drv 2>&1) + lecho "$output" + fi fi - + progress_indicator stop output=$(/opt/vyatta/sbin/vyatta-grub-setup $grub_setup_args \ diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index ea4dc905..3959547d 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -54,6 +54,7 @@ shift `expr $OPTIND - 1` ROOT_PARTITION="$1" GRUB_OPTIONS="$2" ROOTFSDIR="$3" +EFI_PARTITION="$4" [ "$ROOT_PARTITION" ] || exit 1 @@ -155,6 +156,11 @@ fi echo -e "serial --unit=0 --speed=9600" echo "terminal_output --append serial" + if [ -b /dev/$EFI_PARTITION ]; then + echo -e "insmod efi_gop" + echo -e "insmod efi_uga" + fi + if [ ${ROOT_PARTITION:0:2} = "md" ]; then uuid_root_disk=`/sbin/tune2fs -l /dev/${root_disk}1 | grep UUID | awk '{print $3}'` uuid_root_md=`/sbin/tune2fs -l /dev/md${ROOT_PARTITION#md} | grep UUID | awk '{print $3}'` -- cgit v1.2.3 From 13ef90fa2b51baedf9efa4299eb4d2c128b6f191 Mon Sep 17 00:00:00 2001 From: Kroy Date: Tue, 6 Nov 2018 10:29:42 -0600 Subject: T955: Integrating EFI into the installer --- scripts/install/install-functions | 14 +++++----- scripts/install/install-get-partition | 48 ++++++++++++++++++++++------------- scripts/install/install-image | 8 +++--- scripts/install/install-postinst-new | 38 ++++++++++++++++++++------- scripts/vyatta-grub-setup | 3 ++- 5 files changed, 72 insertions(+), 39 deletions(-) (limited to 'scripts') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index a038686c..c9f3642e 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -151,7 +151,7 @@ get_drive_size () { # Probe hardrives not shown in /proc/partitions by default probe_drives () { # Find drives that may not be in /proc/partitions since not mounted - drive=$(ls /sys/block | grep '[hsv]d.') + drive=$(ls /sys/block | grep '[hsv]d.|nvme.') # now exclude all drives that are read-only for drive in $drive; do @@ -174,13 +174,13 @@ select_drive () { local drv='' # list the drives in /proc/partitions. Remove partitions and empty lines. # the first grep pattern looks for devices named c0d0, hda, and sda. - #drives=$(cat /proc/partitions | \ - # awk '{ if ($4!="name") { print $4 } }' | \ - # egrep "c[0-9]d[0-9]$|[hsv]d[a-z]$" | \ - # egrep -v "^$") + drives=$(cat /proc/partitions | \ + awk '{ if ($4!="name") { print $4 } }' | \ + egrep "c[0-9]d[0-9]$|[hsv]d[a-z]$|nvme[0-9]n[0-9]" | \ + egrep -v "^$") - #should be better about finding installable drives - drives=$(lsblk -dn -o name -I8) + #this needs more testing to decide if better than above + #drives=$(lsblk -dn -o name -I8) # take the first drive as the default drv=$(echo $drives | /usr/bin/awk '{ print $1 }') diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index 5f4aee09..a8ccb821 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -35,6 +35,9 @@ PARTITION='' 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 @@ -277,13 +280,19 @@ check_for_new_raid () { let root_size-=$part_start_offset for drive in $drives; do - echo "Creating data partition: /dev/${drive}${data_dev}" - create_partitions "$drive" $root_size $part_start_offset "no" - sfdisk --change-id /dev/$drive $data_dev 0xfd - # mark data partition as bootable - lecho "Marking /dev/$drive partition $data_dev bootable" - output=$(parted -s /dev/$drive set $data_dev boot on 2>&1) - lecho "$output" + create_partitions "$drive" $root_size "no" + if [ "$EFI_PARTITION" -eq "1" ]; then + #EFI moves the data parition on RAID to 3 + data_dev=3 + echo "Create data partition: /dev/${drive}${data_dev}" + else + echo "Creating data partition: /dev/${drive}${data_dev}" + sfdisk --change-id /dev/$drive $data_dev 0xfd + # mark data partition as bootable + lecho "Marking /dev/$drive partition $data_dev bootable" + output=$(parted -s /dev/$drive set $data_dev boot on 2>&1) + lecho "$output" + fi done # Must give partition device time to settle @@ -670,7 +679,7 @@ create_partitions() { echo "Error: $ldrive is only $size"MB" large. Desired root is $root_part_size" exit 1 fi - if [ -d /sys/firmware/efi ]; then + if [ "$EFI_PARTITION" -eq "1" ]; then #Need room for the EFI partition. 512 is standard, but 256 is probably okay here root_part_size=$((root_part_size - 256)) @@ -689,15 +698,17 @@ create_partitions() { exit 1 fi # set the partition number on the device. - if [ -n "$( echo $ldrive | grep -E "cciss|ida" )" ]; then + if [ -n "$( echo $ldrive | grep -E "cciss|ida|nvme" )" ]; then # if this is a cciss ROOT_PARTITION=$ldrive"p3" - EFI_PARTITION=$ldrive"p2" + efipart=$ldrive"p2" else # else... the rest of the world ROOT_PARTITION=$ldrive"3" - EFI_PARTITION=$ldrive"2" + efipart=$ldrive"2" fi + #Add the drive to the file so grub can install + echo $efipart >> /tmp/efiparts.tmp else # Force FAT label creation lecho "Creating a new disklabel on $ldrive" @@ -729,7 +740,7 @@ create_partitions() { fi # set the partition number on the device. - if [ -n "$( echo $ldrive | grep -E "cciss|ida" )" ]; then + if [ -n "$( echo $ldrive | grep -E "cciss|ida|nvme" )" ]; then # if this is a cciss ROOT_PARTITION=$ldrive"p1" else @@ -855,6 +866,7 @@ setup_method_auto () { echo -n "How big of a root partition should I create? ($ROOT_MIN"MB" - $size"MB") [$size]MB: " response=$(get_response "$size") # TODO: need to have better error checking on this value + # TODO: This should also probably take into account the size of the EFI partition (256MB) root_part_size=$(echo "$response" | sed 's/[^0-9]//g') if [ $root_part_size -lt $ROOT_MIN ] \ || [ $root_part_size -gt $size ]; then @@ -868,10 +880,12 @@ setup_method_auto () { # now take the data and create the partitions create_partitions "$INSTALL_DRIVE" "$root_part_size" "yes" - # 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) - lecho "$output" + if ! [ "$EFI_PARTITION" -eq "1" ]; 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) + lecho "$output" + fi # Must give partition device time to settle sleep 5 } @@ -989,7 +1003,7 @@ if [ -z "$ROOT_PARTITION" ]; then exit 1 fi -echo "$ROOT_PARTITION_TYPE $ROOT_PARTITION $INSTALL_DRIVE $EFI_PARTITION" >$OUTFILE +echo "$ROOT_PARTITION_TYPE $ROOT_PARTITION $INSTALL_DRIVE" >$OUTFILE becho 'Done!' exit 0 diff --git a/scripts/install/install-image b/scripts/install/install-image index f99d4ce8..dbdd5901 100755 --- a/scripts/install/install-image +++ b/scripts/install/install-image @@ -202,7 +202,6 @@ install_new () { local root_part=$1 local inst_drv=$2 - local efi_part=$3 if [ ! -e "/dev/$root_part" ] || [ ! -e "/dev/$inst_drv" ]; then fail_exit "Invalid drive/partition ($inst_drv and $root_part)." @@ -215,7 +214,7 @@ install_new () # postinst operations if ! /opt/vyatta/sbin/install-postinst-new \ - "$inst_drv" "$root_part" union "$efi_part"; then + "$inst_drv" "$root_part" union; then exit 1 fi } @@ -292,14 +291,13 @@ fi root_part_type='' root_part='' inst_drv='' -efi_part='' -eval "read root_part_type root_part inst_drv efi_part <$PART_FILE" >&/dev/null +eval "read root_part_type root_part inst_drv <$PART_FILE" >&/dev/null rm -f $PART_FILE >&/dev/null # handle different types case "$root_part_type" in new) - install_new "$root_part" "$inst_drv" "$efi_part" + install_new "$root_part" "$inst_drv" exit 0 ;; union|old) diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index 187f812b..5e0f42a9 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -20,8 +20,8 @@ INSTALL_DRIVE=$1 ROOT_PARTITION=$2 # install type: "union" or "old" INSTALL_TYPE=$3 -# EFI partition. 0 or partition -EFI_PARTITION=$4 +# For passing into vyatta-grub-setup +EFI_PARTITION=0 # Default user DEFAULT_USER=vyos @@ -125,13 +125,33 @@ install_grub () { progress_indicator start - #TODO EFI needs to go on every disk - if [ -b /dev/$EFI_PARTITION ]; then - mkdosfs -F 32 -n EFI /dev/$EFI_PARTITION + if [ -f "/tmp/efiparts.tmp" ]; then + EFI_PARTITION=1 mkdir -p $grub_root/boot/efi - mount /dev/$EFI_PARTITION $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="VyOS") - umount $grub_root/boot/efi + readarray parts < /tmp/efiparts.tmp + part_length=${#parts[@]} + bootloader_name="VyOS" + I=0 + for part in "${parts[@]}" + do + #Name the bootloaders something different if we have a RAID + if [ "$part_length" -gt "1" ]; then + bootloader_name="VyOS (RAID disk $I)" + ((I++)) + fi + mkdosfs -F 32 -n EFI /dev/$part + 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") + umount $grub_root/boot/efi + ##TODO DO we need these to be in fstab?? + # + #This is what I've used in the past + #if [ $I -gt 0 ]; then + # RAIDPART="#" + #fi + #echo "${RAIDPART}PARTUUID=$(blkid -s PARTUUID -o value $part) /boot/efi vfat defaults 0 1" >> /etc/fstab + done + rm /tmp/efiparts.tmp else if [[ $grub_inst_drv == "md raid" ]]; then for slave in $raid_slaves; do @@ -150,7 +170,7 @@ install_grub () { progress_indicator stop output=$(/opt/vyatta/sbin/vyatta-grub-setup $grub_setup_args \ - "$ROOT_PARTITION" '' $grub_root 2>&1) + "$ROOT_PARTITION" '' $grub_root "$EFI_PARTITION" 2>&1) ret=$? lecho "$output" if [ $ret == 0 ]; then diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 3959547d..beea8e65 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -156,7 +156,8 @@ fi echo -e "serial --unit=0 --speed=9600" echo "terminal_output --append serial" - if [ -b /dev/$EFI_PARTITION ]; then + # EFI needs a few extra modules + if [ "$EFI_PARTITION" -eq "1" ]; then echo -e "insmod efi_gop" echo -e "insmod efi_uga" fi -- cgit v1.2.3 From ad559f4eef05670b590bbc7f69baccbc76cad7f7 Mon Sep 17 00:00:00 2001 From: Kim Date: Wed, 7 Nov 2018 19:38:49 +0100 Subject: Add uefi install option. (#84) * Add grub-efi package dependencies * Install grub-efi if we install on efi partition --- debian/control | 5 +++++ scripts/install/install-postinst-new | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'scripts') diff --git a/debian/control b/debian/control index 12b27b1b..b2ed93d0 100644 --- a/debian/control +++ b/debian/control @@ -47,6 +47,11 @@ Depends: adduser, curl, parted, libpam-cap, + efibootmgr, + libefivar0, + grub-efi-amd64-bin, + dosfstools, + gdisk, ${arch:Depends} Pre-Depends: bash-completion Suggests: util-linux (>= 2.13-5), diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index 5e0f42a9..ee81dd58 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -126,6 +126,10 @@ install_grub () { progress_indicator start if [ -f "/tmp/efiparts.tmp" ]; then + # Remove grub-pc packages + dpkg -r grub-pc grub2 + # Install grub-efi packages + dpkg -i /usr/share/vyos/packages/grub-efi*.deb EFI_PARTITION=1 mkdir -p $grub_root/boot/efi readarray parts < /tmp/efiparts.tmp -- cgit v1.2.3 From a269e78c8a8f411c7ac6090a2b446164fd29580c Mon Sep 17 00:00:00 2001 From: Kim Date: Fri, 9 Nov 2018 08:37:40 +0100 Subject: Cleanup output (#85) --- scripts/install/install-postinst-new | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index ee81dd58..0ed6441d 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -127,9 +127,9 @@ install_grub () { if [ -f "/tmp/efiparts.tmp" ]; then # Remove grub-pc packages - dpkg -r grub-pc grub2 + dpkg -r grub-pc grub2 >&/dev/null # Install grub-efi packages - dpkg -i /usr/share/vyos/packages/grub-efi*.deb + 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 @@ -143,9 +143,9 @@ install_grub () { bootloader_name="VyOS (RAID disk $I)" ((I++)) fi - mkdosfs -F 32 -n EFI /dev/$part + 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") + 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) umount $grub_root/boot/efi ##TODO DO we need these to be in fstab?? # -- cgit v1.2.3