summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-12 11:15:03 -0400
committerScott Moser <smoser@brickies.net>2017-04-12 11:27:20 -0400
commite4169135e8fa6b9bce5dc25ab08c163588e32015 (patch)
tree76c27b31704595fa8a5eb729268d3e4a31f65a65 /debian
parentddb56d94fdc06a0a4f49f213e0f01bfc5cb42598 (diff)
downloadvyos-cloud-init-e4169135e8fa6b9bce5dc25ab08c163588e32015.tar.gz
vyos-cloud-init-e4169135e8fa6b9bce5dc25ab08c163588e32015.zip
update-grub-legacy-ec2: fix early exit failure no /etc/fstab file.
If /etc/fstab did not exist, then update-grub-legacy-ec2 would fail. That can cause upgrade or install of any kernel package to fail. LP: #1682160
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/update-grub-legacy-ec25
1 files changed, 4 insertions, 1 deletions
diff --git a/debian/update-grub-legacy-ec2 b/debian/update-grub-legacy-ec2
index fc2e4e41..c1c9dc79 100755
--- a/debian/update-grub-legacy-ec2
+++ b/debian/update-grub-legacy-ec2
@@ -370,7 +370,10 @@ boot_device=$(find_device "/boot")
device_map=$grub_dir/device.map
# Default kernel options, overidden by the kopt statement in the menufile.
-loop_file=$(awk '$2=="/" && $4~"loop" {print $1}' /etc/fstab)
+loop_file=""
+if [ -f /etc/fstab ]; then
+ loop_file=$(awk '$2=="/" && $4~"loop" {print $1}' /etc/fstab)
+fi
if [ -n "$loop_file" ]; then
dev_mountpoint=$(awk '"'${loop_file}'"~"^"$2 && $2!="/" {print $1";"$2}' /proc/mounts|tail -n 1)
host_device="${dev_mountpoint%;*}"