Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #45 from jlebon/pr/oem-platform
Browse files Browse the repository at this point in the history
dracut: adapt for s/oem/platform in Ignition
  • Loading branch information
dustymabe authored Feb 27, 2019
2 parents 2c69925 + 67e092e commit 9aac3c5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
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
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

0 comments on commit 9aac3c5

Please sign in to comment.