2020-08-10 11:28:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
|
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Call upstream generator
|
|
|
|
. /usr/lib/systemd/system-generators/ignition-generator
|
|
|
|
. /run/ignition.env
|
|
|
|
|
|
|
|
add_requires ignition-mount-initrd-fstab.service ignition-files.service
|
2022-04-06 19:10:21 +02:00
|
|
|
add_requires ignition-umount-initrd-fstab.service ignition-files.service
|
2020-08-10 11:28:19 +02:00
|
|
|
add_requires ignition-enable-network.service ignition-fetch.service
|
|
|
|
|
|
|
|
if [ -z "${PLATFORM_ID}" ]; then
|
2021-07-21 16:33:30 +02:00
|
|
|
platform="$(systemd-detect-virt || true)"
|
2020-08-10 11:28:19 +02:00
|
|
|
case "${platform}" in
|
|
|
|
*vmware*) platform="vmware" ;;
|
2020-09-04 09:44:25 +02:00
|
|
|
*oracle*) platform="virtualbox" ;;
|
2020-08-10 11:28:19 +02:00
|
|
|
*kvm*|*qemu*) platform="qemu" ;;
|
|
|
|
*) platform="metal" ;;
|
|
|
|
esac
|
|
|
|
echo "PLATFORM_ID=${platform}" > /run/ignition.env
|
|
|
|
fi
|