Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions dracut/53ignition/flatcar-metadata-hostname.service
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ConditionKernelCommandLine=|coreos.oem.id=ibmcloud
ConditionKernelCommandLine=|flatcar.oem.id=ibmcloud
ConditionKernelCommandLine=|coreos.oem.id=vultr
ConditionKernelCommandLine=|flatcar.oem.id=vultr
# Addition:
ConditionKernelCommandLine=|coreos.oem.id=packet
ConditionKernelCommandLine=|flatcar.oem.id=packet

ConditionKernelCommandLine=|flatcar.oem.id=hetzner
ConditionKernelCommandLine=|flatcar.oem.id=kubevirt
Expand Down
3 changes: 0 additions & 3 deletions dracut/53ignition/ignition-generator
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ if $(cmdline_bool flatcar.first_boot 0) || $(cmdline_bool coreos.first_boot 0);
if [[ $(cmdline_arg flatcar.first_boot) = "detected" ]] || [[ $(cmdline_arg coreos.first_boot) = "detected" ]]; then
add_requires ignition-quench.service initrd.target
fi
if [[ $(cmdline_arg flatcar.oem.id) == "packet" ]] || [[ $(cmdline_arg coreos.oem.id) == "packet" ]]; then
add_requires flatcar-static-network.service initrd.target
fi

# On EC2, shut down systemd-networkd if ignition fails so that the instance
# fails EC2 instance checks.
Expand Down
44 changes: 22 additions & 22 deletions dracut/53ignition/ignition-setup-pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -e

cmdline=( $(</proc/cmdline) )
read -r -a cmdline < /proc/cmdline
cmdline_arg() {
local name="$1" value="$2"
for arg in "${cmdline[@]}"; do
Expand All @@ -15,28 +15,28 @@ cmdline_arg() {
}

oem_id=metal
if [[ $(systemd-detect-virt || true) =~ ^(kvm|qemu)$ ]]; then
oem_id=qemu
fi

oem_cmdline="$(cmdline_arg flatcar.oem.id ${oem_id})"
if [[ "${oem_id}" = "${oem_cmdline}" ]]; then
oem_cmdline="$(cmdline_arg coreos.oem.id ${oem_id})"
fi

# Ignition changed the platform name to "aws"
if [ "${oem_cmdline}" = "ec2" ]; then
oem_cmdline="aws"
fi

# Ignition changed the platform name to "gcp"
if [ "${oem_cmdline}" = "gce" ]; then
oem_cmdline="gcp"
fi
case $(systemd-detect-virt) in
kvm|qemu) oem_id=qemu ;;
oracle) oem_id=virtualbox ;;
vmware) oem_id=vmware ;;
esac

# To maintain compatibility with eventual legacy 'flatcar.oem.id=pxe'
if [ "${oem_cmdline}" = "pxe" ]; then
oem_cmdline="metal"
oem_cmdline=$(cmdline_arg flatcar.oem.id ${oem_id})
if [[ ${oem_id} == "${oem_cmdline}" ]]; then
oem_cmdline=$(cmdline_arg coreos.oem.id ${oem_id})
fi

{ echo "OEM_ID=${oem_cmdline}" ; echo "PLATFORM_ID=${oem_cmdline}" ; } > /run/ignition.env
case ${oem_cmdline} in
# Ignition changed the platform name to "aws"
ec2) oem_cmdline=aws ;;
# Ignition changed the platform name to "gcp"
gce) oem_cmdline=gcp ;;
# Fall back to detection for cases unsupported by Ignition
cloudsigma|pxe|vagrant) oem_cmdline=${oem_id} ;;
esac

cat > /run/ignition.env <<EOF
OEM_ID=${oem_cmdline}
PLATFORM_ID=${oem_cmdline}
EOF
2 changes: 1 addition & 1 deletion update-bootengine
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DRACUT_ARGS=(
--no-compress
--omit "fido2 lvm multipath network pkcs11 tpm2-tss zfs"
--add "i18n iscsi"
--add-drivers "loop brd drbd nbd rbd mmc_block xen-blkfront zram libarc4 lru_cache zsmalloc"
--add-drivers "loop brd drbd nbd rbd mmc_block xen-blkfront zram libarc4 lru_cache zsmalloc vboxguest"
--kernel-cmdline "SYSTEMD_SULOGIN_FORCE=1"
)

Expand Down