From 0d7e6ac3ff336bee96c2a235ae442cb1c8099735 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Feb 2016 11:36:41 -0500 Subject: Renamed vyatta-union to vyos-union. --- scripts/vyatta-grub-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 11e73846..63e3d987 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -103,7 +103,7 @@ else fi if eval "$UNION"; then - GRUB_OPTIONS="boot=live quiet vyatta-union=/boot/$livedir" + GRUB_OPTIONS="boot=live quiet vyos-union=/boot/$livedir" union_xen_kernel_version=$(ls $ROOTFSDIR/boot/$livedir/vmlinuz*-xen* \ 2>/dev/null \ | awk -F/ '{ print $6 }' \ -- cgit v1.2.3 From 38dac1e5bb30ce46d49cb8178f560d4126bd3b7e Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 5 Aug 2016 08:07:04 +0200 Subject: set systemd tasks verbose on installing grub --- scripts/vyatta-grub-setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 63e3d987..9ee42801 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -60,9 +60,9 @@ ROOTFSDIR="$3" # Grub options if [ "$GRUB_OPTIONS" ] then - GRUB_OPTIONS="$GRUB_OPTIONS quiet" + GRUB_OPTIONS="$GRUB_OPTIONS quiet systemd.show_status=1" else - GRUB_OPTIONS=quiet + GRUB_OPTIONS="quiet systemd.show_status=1" fi # Path to standalone root password reset script @@ -103,7 +103,7 @@ else fi if eval "$UNION"; then - GRUB_OPTIONS="boot=live quiet vyos-union=/boot/$livedir" + GRUB_OPTIONS="boot=live quiet systemd.show_status=1 vyos-union=/boot/$livedir" union_xen_kernel_version=$(ls $ROOTFSDIR/boot/$livedir/vmlinuz*-xen* \ 2>/dev/null \ | awk -F/ '{ print $6 }' \ -- cgit v1.2.3 From ba8ec8de446e4b7ba7a5e399f88e698bc6ebf0cf Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 26 Dec 2016 15:27:44 +0000 Subject: remove verbose systemd status setting from grub --- scripts/vyatta-grub-setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 9ee42801..63e3d987 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -60,9 +60,9 @@ ROOTFSDIR="$3" # Grub options if [ "$GRUB_OPTIONS" ] then - GRUB_OPTIONS="$GRUB_OPTIONS quiet systemd.show_status=1" + GRUB_OPTIONS="$GRUB_OPTIONS quiet" else - GRUB_OPTIONS="quiet systemd.show_status=1" + GRUB_OPTIONS=quiet fi # Path to standalone root password reset script @@ -103,7 +103,7 @@ else fi if eval "$UNION"; then - GRUB_OPTIONS="boot=live quiet systemd.show_status=1 vyos-union=/boot/$livedir" + GRUB_OPTIONS="boot=live quiet vyos-union=/boot/$livedir" union_xen_kernel_version=$(ls $ROOTFSDIR/boot/$livedir/vmlinuz*-xen* \ 2>/dev/null \ | awk -F/ '{ print $6 }' \ -- cgit v1.2.3 From fb576450cc8d34ab447fa7c613daf10ed3140ab5 Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 16 Mar 2017 13:09:30 +0100 Subject: update grub raid boot --- scripts/vyatta-grub-setup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 63e3d987..879912ff 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -176,8 +176,9 @@ fi if [ ${ROOT_PARTITION:0:2} = "md" ]; then echo "" - echo -e "insmod raid" - echo -e "root ($ROOT_PARTITION)" + echo -e "insmod mdraid09" + echo -e "insmod mdraid1x" + echo -e "root (md/$ROOT_PARTITION)" fi echo "" -- cgit v1.2.3 From 0aa4d99cfb96b8ca61c0524aefa3a77761a13e86 Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 16 Mar 2017 18:17:56 +0100 Subject: Update the root command for grub2 --- scripts/vyatta-grub-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 879912ff..f4c18f2c 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -178,7 +178,7 @@ fi echo "" echo -e "insmod mdraid09" echo -e "insmod mdraid1x" - echo -e "root (md/$ROOT_PARTITION)" + echo -e "set root=(md/$ROOT_PARTITION)" fi echo "" -- cgit v1.2.3 From a309b03c3a650a5703cd571b3b62e9e2b71d3d69 Mon Sep 17 00:00:00 2001 From: Jose Irigon de Irigon Date: Tue, 4 Jul 2017 16:59:34 +0200 Subject: T331: root should be set to md/X instead of md/mdX --- scripts/vyatta-grub-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index f4c18f2c..7a5d3891 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -178,7 +178,7 @@ fi echo "" echo -e "insmod mdraid09" echo -e "insmod mdraid1x" - echo -e "set root=(md/$ROOT_PARTITION)" + echo -e "set root=(md/${ROOT_PARTITION#md})" fi echo "" -- cgit v1.2.3 From 48b49fe1d7776d3dbf30ad786f8a3fb7dafa07b1 Mon Sep 17 00:00:00 2001 From: Kim Date: Sat, 18 Nov 2017 01:33:32 +0100 Subject: removing first grub timeout --- scripts/vyatta-grub-setup | 7 ------- 1 file changed, 7 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 7a5d3891..cf30cbb3 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -181,13 +181,6 @@ fi echo -e "set root=(md/${ROOT_PARTITION#md})" fi - echo "" - echo "echo -n Press ESC to enter the Grub menu..." - echo "if sleep --verbose --interruptible 5 ; then" - echo -e "\tterminal_input console serial" - echo "fi" - echo "" - # create xen kernels if they exist XEN_OPTS='dom0_mem=512M xenheap_megabytes=128' if [ -n "$xen_kernel_version" ]; then -- cgit v1.2.3 From 9499b3e5f88ce72054046ac8a6c0da305f1b5fa4 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 26 Dec 2017 16:53:01 +0100 Subject: T488: GRUB can't boot from software RAID --- debian/changelog | 6 ++++++ scripts/vyatta-grub-setup | 37 +++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/debian/changelog b/debian/changelog index 8d4ebc05..e69f9e04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vyatta-cfg-system (0.20.44+vyos2+current5) unstable; urgency=medium + + * T488: GRUB can't boot from software RAID + + -- Christian Poessinger Tue, 26 Dec 2017 14:40:54 +0100 + vyatta-cfg-system (0.20.44+vyos2+current4) unstable; urgency=medium * T414: Remove telnetd service diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index cf30cbb3..d263eff3 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -1,7 +1,7 @@ #!/bin/sh # # Module: grup-setup -# +# # **** License **** # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -15,11 +15,11 @@ # This code was originally developed by Vyatta, Inc. # Portions created by Vyatta are Copyright (C) 2006, 2007 Vyatta, Inc. # All Rights Reserved. -# +# # Author: Robert Bays # Date: 2006 # Description: -# +# # **** End License **** # # Vyatta grub customization setup script. @@ -55,7 +55,7 @@ ROOT_PARTITION="$1" GRUB_OPTIONS="$2" ROOTFSDIR="$3" -[ "$ROOT_PARTITION" ] || exit 1 +[ "$ROOT_PARTITION" ] || exit 1 # Grub options if [ "$GRUB_OPTIONS" ] @@ -114,7 +114,7 @@ if eval "$UNION"; then 2> /dev/null | grep -v xen \ | awk -F/ '{ print $6 }' | sed 's/vmlinuz//g' \ | sort -r) -else +else # Read UUID off of filesystem and use it to tell GRUB where to mount drive # This allows device to move around and grub will still find it uuid=$(dumpe2fs -h /dev/${ROOT_PARTITION} 2>/dev/null | awk '/^Filesystem UUID/ {print $3}') @@ -133,7 +133,7 @@ if [ -n "$xen_kernel_version" ] || [ -n "$union_xen_kernel_version" ]; then default_console=0 fi -# Check for diagnostic partition residing in first partition of drive +# Check for diagnostic partition residing in first partition of drive # holding the root partition. diag_drive_number="" @@ -175,10 +175,15 @@ fi echo "terminal_output --append serial" 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}'` echo "" - echo -e "insmod mdraid09" + echo -e "insmod part_msdos" + echo -e "insmod diskfilter" + echo -e "insmod ext2" echo -e "insmod mdraid1x" - echo -e "set root=(md/${ROOT_PARTITION#md})" + echo -e "set root='mduuid/${uuid_root_disk}'" + echo -e "search --no-floppy --fs-uuid --set=root ${uuid_root_md}" fi # create xen kernels if they exist @@ -226,7 +231,7 @@ fi echo -e "\tlinux /boot/$livedir/vmlinuz $GRUB_OPTIONS $usb_console" echo -e "\tinitrd /boot/$livedir/initrd.img" echo -e "}" - + elif [ -n "$union_kernel_versions" ]; then for kversion in $union_kernel_versions; do echo @@ -254,8 +259,8 @@ fi echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $VGA_LOGO $vty_console" echo -e "\tinitrd /boot/initrd.img" echo -e "}" - - # Set the second system boot option. + + # Set the second system boot option. # Make the serial port be the default console in this one. echo echo -e "menuentry \"VyOS $version (Serial console)\" {" @@ -288,19 +293,19 @@ fi fi fi - # Set options for root password reset. Offer + # Set options for root password reset. Offer # options for both serial and KVM console. reset_boot_path=/boot if eval "$UNION"; then reset_boot_path=/boot/$livedir fi - + echo echo -e "menuentry \"Lost password change $version (KVM console)\" {" echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $NOSELINUX $vty_console init=$pass_reset" echo -e "\tinitrd $reset_boot_path/initrd.img" echo -e "}" - + echo echo -e "menuentry \"Lost password change $version (Serial console)\" {" echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $NOSELINUX $serial_console init=$pass_reset" @@ -314,12 +319,12 @@ fi echo -e "}" if [ -n "$diag_drive_number" ]; then - echo + echo echo -e "menuentry \"Diagnostics\" {" echo -e "\tchainloader (hd$diag_drive_number,1)+1" echo -e "}" fi - + ) >"$ROOTFSDIR"/boot/grub/grub.cfg -- cgit v1.2.3 From 28ab553cfbe8d682314d61d0bac520deacfa14c7 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 27 Dec 2017 22:29:53 +0100 Subject: T496: remove diagnostic partition for RAID1 installs --- debian/changelog | 6 ++++++ scripts/install-system | 21 +-------------------- scripts/install/install-get-partition | 22 ++-------------------- scripts/vyatta-grub-setup | 27 --------------------------- 4 files changed, 9 insertions(+), 67 deletions(-) (limited to 'scripts/vyatta-grub-setup') diff --git a/debian/changelog b/debian/changelog index e69f9e04..d1169cde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vyatta-cfg-system (0.20.44+vyos2+current6) unstable; urgency=medium + + * T496: remove diagnostic partition for RAID1 installs + + -- Christian Poessinger Wed, 27 Dec 2017 23:32:44 +0100 + vyatta-cfg-system (0.20.44+vyos2+current5) unstable; urgency=medium * T488: GRUB can't boot from software RAID diff --git a/scripts/install-system b/scripts/install-system index 108153da..e8464951 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -399,7 +399,7 @@ check_for_new_raid () { # # Partition creation variables are in units of megabytes. part_start_offset=2 - part_diag_size=60 + data_dev=1 if [ $drivesize1 -lt $drivesize2 ]; then root_size=$drivesize1 @@ -407,25 +407,6 @@ check_for_new_raid () { root_size=$drivesize2 fi - let min_size_with_diag=${MIN_ROOT}+${part_diag_size} - if [ $root_size -ge $min_size_with_diag ]; then - echo "Would you like me to create a $part_diag_size MB partition for diagnostics?" - echo -n "(Yes/No) [No]: " - diag_response=$(get_response "No" "Yes No Y N") - if [ "$diag_response" == "yes" ] || [ "$diag_response" == "y" ]; then - for drive in $drives - do - echo "Creating diag partition on drive $drive" - create_partitions "$drive" $part_diag_size $part_start_offset "no" - sfdisk --change-id /dev/$drive 1 0x6 - done - data_dev=2 - let part_start_offset+=$part_diag_size - else - data_dev=1 - fi - fi - let root_size-=$part_start_offset for drive in $drives diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index 0ddbd443..f1b373ae 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -259,12 +259,12 @@ check_for_new_raid () { done # Need to leave space on both disks between the MBR and the start - # of the first partition for grub. Grub needs to embed a large + # of the first partition for grub. Grub needs to embed a large # boot image there when booting off RAID devices. # # Partition creation variables are in units of megabytes. part_start_offset=2 - part_diag_size=60 + data_dev=1 if [ $drivesize1 -lt $drivesize2 ]; then root_size=$drivesize1 @@ -272,24 +272,6 @@ check_for_new_raid () { root_size=$drivesize2 fi - let min_size_with_diag=${MIN_ROOT}+${part_diag_size} - if [ $root_size -ge $min_size_with_diag ]; then - echo "Would you like me to create a $part_diag_size MB partition for diagnostics?" - echo -n "(Yes/No) [No]: " - diag_response=$(get_response "No" "Yes No Y N") - if [ "$diag_response" == "yes" ] || [ "$diag_response" == "y" ]; then - for drive in $drives; do - echo "Creating diag partition on drive $drive" - create_partitions "$drive" $part_diag_size $part_start_offset "no" - sfdisk --change-id /dev/$drive 1 0x6 - done - data_dev=2 - let part_start_offset+=$part_diag_size - else - data_dev=1 - fi - fi - let root_size-=$part_start_offset for drive in $drives; do diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index d263eff3..ea4dc905 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -133,11 +133,6 @@ if [ -n "$xen_kernel_version" ] || [ -n "$union_xen_kernel_version" ]; then default_console=0 fi -# Check for diagnostic partition residing in first partition of drive -# holding the root partition. - -diag_drive_number="" - if [ ${ROOT_PARTITION:0:2} = "md" ]; then # Select the first disk in the RAID group to look for diag partition on root_disks=`echo /sys/block/$ROOT_PARTITION/slaves/*` @@ -149,20 +144,6 @@ else root_disk=${ROOT_PARTITION:0:${#ROOT_PARTITION}-1} fi -# If the root partition is not occupying the first partition, then we -# can look for a diag partition there. -if [ "$ROOT_PARTITION" != "${root_disk}1" ]; then - first_part_fstype=`fdisk -l /dev/$root_disk | grep ^/dev/${root_disk}1 | awk '{ print $6 }'` - - if [ "$first_part_fstype" = "FAT16" -o "$first_part_fstype" = "Dell" ]; then - # Translate the Linux drive letter (e.g. the "a" in "/dev/sda") into - # a drive number that grub uses. i.e. "a" = 0, "b" = 1, etc. - diag_drive_letter=${root_disk:2:1} - diag_drive_number=`echo $diag_drive_letter | od -t u1 -N 1 | awk '{ print $2 }'` - let diag_drive_number-=97 - fi -fi - ( # create the grub.cfg file for grub # The "default=" line selects which boot option will be used by default. @@ -318,14 +299,6 @@ fi echo -e "\tinitrd $reset_boot_path/initrd.img" echo -e "}" - if [ -n "$diag_drive_number" ]; then - echo - echo -e "menuentry \"Diagnostics\" {" - echo -e "\tchainloader (hd$diag_drive_number,1)+1" - echo -e "}" - fi - - ) >"$ROOTFSDIR"/boot/grub/grub.cfg ( [ -s /boot/grub/menu.lst ] && -- cgit v1.2.3