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

Commit

Permalink
dracut: Add an ignition-fetch.service
Browse files Browse the repository at this point in the history
This invokes the new `fetch` stage which does just that - fetch
the Ignition config into `/run/ignition.json` and nothing else.

Prep for adding support for redeploying the rootfs, which is
an expensive process, so we only want to do it if the fetched
Ignition config is replacing the `rootfs`.
  • Loading branch information
cgwalters committed Sep 24, 2019
1 parent db047c6 commit e093b21
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
10 changes: 1 addition & 9 deletions dracut/30ignition/ignition-disks.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@
Description=Ignition (disks)
DefaultDependencies=false
Before=ignition-complete.target
After=ignition-fetch.service

# This stage runs between `basic.target` and `initrd-root-fs.target`,
# see https://www.freedesktop.org/software/systemd/man/bootup.html

# Note that CL runs this before `local-fs-pre.target` to allow for configs that
# completely wipe the rootfs. Though we're not there yet. But we still run
# before `sysroot.mount` on principle.
After=basic.target
Before=initrd-root-fs.target
Before=sysroot.mount

# Run after ignition-setup has run because ignition-setup
# may copy in new/different ignition configs for us to consume.
After=ignition-setup-base.service
After=ignition-setup-user.service

# Network may be used to fetch userdata content.
After=network.target

# This stage requires udevd to detect disk partitioning changes.
Requires=systemd-udevd.service
After=systemd-udevd.service
Expand Down
20 changes: 20 additions & 0 deletions dracut/30ignition/ignition-fetch.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

[Unit]
Description=Ignition (fetch)
DefaultDependencies=false
Before=ignition-complete.target
After=basic.target

# Run after ignition-setup has run because ignition-setup
# may copy in new/different ignition configs for us to consume.
After=ignition-setup-base.service
After=ignition-setup-user.service

# Network may be used to fetch userdata content.
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=fetch
1 change: 1 addition & 0 deletions dracut/30ignition/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ install() {

install_ignition_unit ignition-setup-base.service
install_ignition_unit ignition-setup-user.service
install_ignition_unit ignition-fetch.service
install_ignition_unit ignition-disks.service
install_ignition_unit ignition-mount.service
install_ignition_unit ignition-files.service
Expand Down

0 comments on commit e093b21

Please sign in to comment.