summaryrefslogtreecommitdiff
path: root/scripts/vyos/grub-serial.sh
diff options
context:
space:
mode:
authorRoberto Berto <463349+robertoberto@users.noreply.github.com>2024-05-15 03:31:01 +0000
committerRoberto Berto <463349+robertoberto@users.noreply.github.com>2024-05-15 03:31:01 +0000
commitb1b9151865275b52647e784c9a8f201e3f090a30 (patch)
tree3561c1523eb6dec0b2a6104a66451adec0a1fc8c /scripts/vyos/grub-serial.sh
parent769d3a05284392068a3ae56542af64e786fda74e (diff)
downloadpacker-vyos-b1b9151865275b52647e784c9a8f201e3f090a30.tar.gz
packer-vyos-b1b9151865275b52647e784c9a8f201e3f090a30.zip
Improvements for v0.1
- Makefile now clone build1 to build2 to stop break build1 image if build2 fail - Fix README.md github md syntax - grub-serial.sh: bool should be integer and fixed grub default sed - Improved build workflow between build1 to build2 - qmeuargs not create sparse files +detect-zeroes=on -discard=ignore
Diffstat (limited to 'scripts/vyos/grub-serial.sh')
-rw-r--r--scripts/vyos/grub-serial.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/vyos/grub-serial.sh b/scripts/vyos/grub-serial.sh
index b72b1a8..5beb889 100644
--- a/scripts/vyos/grub-serial.sh
+++ b/scripts/vyos/grub-serial.sh
@@ -3,6 +3,7 @@
set -e
set -x
+#GRUB_SERIAL=1
if [[ "${GRUB_SERIAL}" -ne 1 ]]; then
echo "$0 - info: grub will keep default=0 (kvm). to use serial add to .env: GRUB_SERIAL=1"
exit 0
@@ -12,4 +13,13 @@ GRUB_CFG="/boot/grub/grub.cfg"
GRUB_DEFAULT="/etc/default/grub"
sed -i 's/^set default=.*/set default=1/' $GRUB_CFG
-sed -i 's/^set default=.*/set default=1/' $GRUB_DEFAULT
+
+if grep -q "^GRUB_DEFAULT=" $GRUB_DEFAULT; then
+ sed -i 's/^GRUB_DEFAULT=.*/GRUB_DEFAULT=1/' $GRUB_DEFAULT
+else
+ echo "GRUB_DEFAULT=1" >> $GRUB_DEFAULT
+fi
+
+# update-grub
+
+