Skip to content

Commit

Permalink
Merge pull request #47 from kinvolk/kai/btrfs-oem-install
Browse files Browse the repository at this point in the history
bin/flatcar-install: randomize OEM filesystem UUID if mounting fails
  • Loading branch information
pothos committed Aug 31, 2021
2 parents 101e6c7 + 6371236 commit 36c9ebb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/flatcar-install
Expand Up @@ -70,6 +70,9 @@ for f in /usr/share/oem/oem-release /etc/oem-release; do
eval "$(sed -e 's/^/OEM_/' $f)"
fi
done
if [[ "${OEM_ID}" = "qemu" ]] || [[ "${OEM_ID}" = "qemu_uefi" ]]; then
OEM_ID=""
fi
USAGE="Usage: $0 {{-d <device>}|-s} [options]
Options:
Expand All @@ -85,7 +88,7 @@ Options:
-C CHANNEL Release channel to use (e.g. beta) [default: ${CHANNEL_ID}].
-I|e <M,..> EXPERIMENTAL (used with -s): List of major device numbers to in-/exclude
when finding the smallest disk.
-o OEM OEM type to install (e.g. ami), using flatcar_production_<OEM>_image.bin.bz2 [default: ${OEM_ID:-(none)}].
-o OEM OEM type to install (e.g. 'ami' or '' to force none), using flatcar_production_<OEM>_image.bin.bz2 [default: ${OEM_ID:-(none, i.e., the empty string)}].
-c CLOUD Insert a cloud-init config to be executed on boot.
-i IGNITION Insert an Ignition config to be executed on boot.
-b BASEURL URL to the image mirror (overrides BOARD and CHANNEL).
Expand Down Expand Up @@ -653,7 +656,7 @@ function write_ignition() if [[ -n "${IGNITION}" ]]; then
local OEM_DEV=$(blkid -t "LABEL=OEM" -o device "${DEVICE}"*)
mkdir -p "${WORKDIR}/oemfs"
mount "${OEM_DEV}" "${WORKDIR}/oemfs"
mount "${OEM_DEV}" "${WORKDIR}/oemfs" || { btrfstune -f -u "${OEM_DEV}" ; mount "${OEM_DEV}" "${WORKDIR}/oemfs" ; }
trap 'umount "${WORKDIR}/oemfs"' RETURN
echo "Installing Ignition config ${IGNITION}..."
Expand Down

0 comments on commit 36c9ebb

Please sign in to comment.