summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-08-08 22:52:05 +0700
committerGitHub <noreply@github.com>2021-08-08 22:52:05 +0700
commitd47d7a2dea8db0adb9ea7fdf60d3032a6bcee5ac (patch)
tree6d9dee96509491fc9bf3d865ad57bfa2731aeeb4
parent3cc31793d57ce05421300ce4e8a1a1352291db85 (diff)
parentbe24f16e88401e9e4aece0a5ccdf2df69a2e38fc (diff)
downloadvyatta-cfg-system-d47d7a2dea8db0adb9ea7fdf60d3032a6bcee5ac.tar.gz
vyatta-cfg-system-d47d7a2dea8db0adb9ea7fdf60d3032a6bcee5ac.zip
Merge pull request #160 from UnicronNL/equuleus
T169: Image install should put correct serial console device in creat…
-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