Commit aa6fe91e authored by Nikos Skalkotos's avatar Nikos Skalkotos

helper: Check if fstab contains any useful entries

Prior to this commit, snf-image would fail with "fstab contains
non-persistent block device names" if no useful entries where found
in /etc/fstab which is a bug.
parent 16189db8
......@@ -702,9 +702,20 @@ mount_all() {
;;
esac
if [ ! -f "${target}/etc/fstab" ]; then
warn "No \`/etc/fstab' found under \`${target}'!"
return 0
fi
fstab="$(grep -v ^\# "${target}/etc/fstab" \
| gawk "{ if (match(\$3, \"$fs\")) { print \$2,\$1,\$3 } }" \
| sort -bd)"
if [ -z "$fstab" ]; then
warn "No useful entries where found in \`/etc/fstab'."
return 0
fi
# <mpoint> <device> <fs>
while read -ra entry; do
# Skip root. It is already mounted
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment