Fabian Vogt
54b5c14dc3
- Change virtualization detection from virt-what to systemd-detect-virt; this avoids a dependency to a hardcoded libexec path in module-setup.sh (which broke during the recent migration to /usr/libexec) OBS-URL: https://build.opensuse.org/request/show/832022 OBS-URL: https://build.opensuse.org/package/show/devel:kubic:ignition/ignition?expand=0&rev=60
36 lines
1.0 KiB
Bash
36 lines
1.0 KiB
Bash
#!/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
|
|
add_requires ignition-enable-network.service ignition-fetch.service
|
|
|
|
if [ -e "${UNIT_DIR}/ignition-setup-user.service.d/diskful.conf" ]; then
|
|
cat > "${UNIT_DIR}/ignition-setup-user.service.d/diskful.conf" <<EOF
|
|
[Unit]
|
|
Wants=dev-disk-by\x2dlabel-ignition.device
|
|
After=dev-disk-by\x2dlabel-ignition.device
|
|
|
|
[Service]
|
|
ExecStart=
|
|
ExecStart=/usr/sbin/ignition-setup-user-suse
|
|
EOF
|
|
fi
|
|
|
|
if [ -z "${PLATFORM_ID}" ]; then
|
|
platform="$(systemd-detect-virt)"
|
|
case "${platform}" in
|
|
*vmware*) platform="vmware" ;;
|
|
*oracle*) platform="virtualbox" ;;
|
|
*kvm*|*qemu*) platform="qemu" ;;
|
|
*) platform="metal" ;;
|
|
esac
|
|
echo "PLATFORM_ID=${platform}" > /run/ignition.env
|
|
fi
|