Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-disks.service
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ After=systemd-udevd.service
[Service]
Type=oneshot
EnvironmentFile=/run/ignition.env
ExecStart=/usr/bin/ignition --root=/sysroot --oem=${OEM_ID} --stage=disks
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=disks
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-files.service
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ After=ignition-disks.service
[Service]
Type=oneshot
EnvironmentFile=/run/ignition.env
ExecStart=/usr/bin/ignition --root=/sysroot --oem=${OEM_ID} --stage=files --log-to-stdout
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=files --log-to-stdout
11 changes: 7 additions & 4 deletions dracut/30ignition/ignition-generator
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ cmdline_arg() {
echo "${value}"
}

# check *both* old and new keys for now
platform_id=$(cmdline_arg ignition.platform.id "$(cmdline_arg coreos.oem.id)")

cmdline_bool() {
local value=$(cmdline_arg "$@")
case "$value" in
Expand All @@ -39,13 +42,13 @@ if $(cmdline_bool 'ignition.firstboot' 0); then
add_requires ignition-disks.service
add_requires ignition-files.service
add_requires ignition-ask-var-mount.service
#if [[ $(cmdline_arg coreos.oem.id) == "packet" ]]; then
#if [[ $platform_id == "packet" ]]; then
# add_requires coreos-static-network.service
#fi

# On EC2, shut down systemd-networkd if ignition fails so that the instance
# fails EC2 instance checks.
#if [[ $(cmdline_arg coreos.oem.id) == "ec2" ]]; then
#if [[ $platform_id == "ec2" ]]; then
# mkdir -p ${UNIT_DIR}/systemd-networkd.service.d
# cat > ${UNIT_DIR}/systemd-networkd.service.d/10-conflict-emergency.conf <<EOF
#[Unit]
Expand Down Expand Up @@ -86,7 +89,7 @@ if [ -n "$RANDOMIZE_DISK_GUID" ]; then
add_requires "disk-uuid@${escaped_guid}.service"
fi

if [[ $(cmdline_arg coreos.oem.id) == "digitalocean" ]]; then
if [[ $platform_id == "digitalocean" ]]; then
add_requires coreos-digitalocean-network.service
fi

Expand All @@ -95,4 +98,4 @@ if [[ $(systemd-detect-virt || true) =~ ^(kvm|qemu)$ ]]; then
oem_id=qemu
fi

echo "OEM_ID=$(cmdline_arg coreos.oem.id ${oem_id})" > /run/ignition.env
echo "PLATFORM_ID=$platform_id" > /run/ignition.env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the oem_id logic in the previous stanza.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Added a fix for this in #46.

4 changes: 2 additions & 2 deletions dracut/30ignition/ignition-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ destination=/usr/lib/ignition/
mkdir -p $destination

# We will support grabbing a platform specific base.ign config
# from the initrd at /usr/lib/ignition/platform/${OEM_ID}/base.ign
copy_file_if_exists "/usr/lib/ignition/platform/${OEM_ID}/base.ign" "${destination}/base.ign"
# from the initrd at /usr/lib/ignition/platform/${PLATFORM_ID}/base.ign
copy_file_if_exists "/usr/lib/ignition/platform/${PLATFORM_ID}/base.ign" "${destination}/base.ign"

# We will support a user embedded config in the boot partition
# under $bootmnt/ignition/config.ign. Note that we mount /boot
Expand Down