summaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authorKim Hagen <kim@sentrium.io>2021-08-08 10:31:10 -0500
committerKim Hagen <kim@sentrium.io>2021-08-08 10:31:51 -0500
commit0237fe7be4b4ff3777b14335faf748186e102e55 (patch)
treed3de47b3b47929ac31519d028422c43dfb74fbbd /scripts/install
parent1eaaa75a1e8e7358de83c0021e4d3ff1d3bbf063 (diff)
downloadvyatta-cfg-system-0237fe7be4b4ff3777b14335faf748186e102e55.tar.gz
vyatta-cfg-system-0237fe7be4b4ff3777b14335faf748186e102e55.zip
T169: Image install should put correct serial console device in created grub menuentry
Diffstat (limited to 'scripts/install')
-rwxr-xr-xscripts/install/install-image-existing12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index 0acfcb1f..d00d7735 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -257,6 +257,18 @@ if [ -e "$DEF_GRUB" ]; then
cat $def_grub_vers >> $new_grub_cfg
sed -n '/^menuentry/,${p}' $old_grub_cfg >>$new_grub_cfg
sed -i "s/^set default=[0-9]\+$/set default=$new_index/" $new_grub_cfg
+ for tty in ttyS ttyUSB; do
+ x=1
+ declare -i x
+ for line in $(cat $old_grub_cfg); do
+ oldtty=$(echo -e $line | egrep -o "console=${tty}.*," | sed 's/,$//')
+ if [ -n "$oldtty" ]; then
+ awk -i inplace "/console=${tty}/{count++;if(count==$x){sub(\"console=${tty}0\",\"$(echo -e ${oldtty})\")}}; { print }" $new_grub_cfg
+ sync
+ x+=1
+ fi
+ done
+ done
mv $new_grub_cfg $old_grub_cfg
# Update the default image symlink used by Xen