From 32fe9e54889d45938c8ce10cbc4b26415f821762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jake=20Buchholz=20G=C3=B6kt=C3=BCrk?= Date: Sun, 17 Jul 2022 21:23:28 -0700 Subject: [PATCH] * mocloud volume datasource fix --- lib/tiny-cloud/nocloud/imds | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/tiny-cloud/nocloud/imds b/lib/tiny-cloud/nocloud/imds index dec90a3..9d7b7df 100644 --- a/lib/tiny-cloud/nocloud/imds +++ b/lib/tiny-cloud/nocloud/imds @@ -47,11 +47,17 @@ _load_nocloud_cmdline() { _load_nocloud_volume() { local mntdir=$(mktemp /mnt/cidata-XXXXXX) - local data + local data mounted mkdir -p "$mntdir" - # TODO: are lables case insensitive? - if mount LABEL=cidata "$mntdir" || mount LABEL=CIDATA "$mntdir"; then + for fstype in vfat iso9660; do + [ "$mounted" ] && break + for label in cidata CIDATA; do + [ -n "$mounted" ] && break + mount -t "$fstype" LABEL="$label" "$mntdir" && mounted=1 + done + done + if [ -n "$mounted" ]; then for data in $NOCLOUD_FILES; do # lack of source results in empty target cat "$mntdir/$data" > "$TINY_CLOUD_VAR/$data"