Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Ignition v3 #34

Merged
merged 3 commits into from
Mar 7, 2022
Merged

Port to Ignition v3 #34

merged 3 commits into from
Mar 7, 2022

Conversation

pothos
Copy link
Member

@pothos pothos commented Feb 1, 2022

  • dracut/30ignition/ignition-setup.sh: migrate to Ignition v3
    In Ignition v3 we don't have a "default" config anymore and there can
    now be multiple "base" configurations but they have to be in a
    subfolder.
    Skip copying the "default" config, which should be repaced by a new OEM
    systemd service that checks whether Ignition found a config or not.
    Use the new "base.d" subfolder as target for the OEM "base" config.
  • dracut/99setup-root: Fix failed setup of wants dependency
    The build log contained this error message:
    ln: failed to create symbolic link '/var/tmp/portage/sys-kernel/coreos-kernel-5.15.24/temp/dracut.Ddrb5k/initramfs//usr/lib/systemd/system/initrd.target.wants/initrd-setup-root.service': No such file or directory
    Make sure the directory exists to be able to set up the link.
  • Port to Ignition v3
    The dracut/30ignition files had to be updated to match the folder
    dracut/30ignition found in the ignition repo but with some adaptions
    because Flatcar allows to overwrite the root filesystem and has a
    different initramfs service setup.
    For Ignition v3 we had to provide an implementation for is-live-image
    and ignition-kargs-helper. The kargs helper does not handle all cases
    due to the complexity of evaluation grub.cfg.

How to use

Goes with the Ignition v3 update

Clevis is not yet supported. We need docs for the kargs support.

Testing done

With this v3 config we have can control that the kernel arguments in /usr/share/oem/grub.cfg contains only the entry that should exist but no the other if it was present.

{
  "ignition": {
    "version": "3.3.0"
  },
  "storage": {
    "files": [
      {
        "path": "/works",
        "contents": {
          "source": "data:,helloworld%0A",
          "verification": {}
        },
        "mode": 420
      }
    ]
  },
  "kernelArguments": {
    "shouldExist": ["ishouldexist"],
    "shouldNotExist": ["ishouldnotexist"]
  }
}
  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
    ↑ will do in coreos-overlay

In Ignition v3 we don't have a "default" config anymore and there can
now be multiple "base" configurations but they have to be in a
subfolder.

Skip copying the "default" config, which should be repaced by a new OEM
systemd service that checks whether Ignition found a config or not.
Use the new "base.d" subfolder as target for the OEM "base" config.
The build log contained this error message:
  ln: failed to create symbolic link '/var/tmp/portage/sys-kernel/coreos-kernel-5.15.24/temp/dracut.Ddrb5k/initramfs//usr/lib/systemd/system/initrd.target.wants/initrd-setup-root.service': No such file or directory
Make sure the directory exists to be able to set up the link.
@pothos pothos force-pushed the kai/ignition-v3 branch 2 times, most recently from a63f7e4 to f3d2737 Compare March 3, 2022 10:52
@pothos pothos changed the title dracut/30ignition/ignition-setup.sh: migrate to Ignition v3 Port to Ignition v3 Mar 3, 2022
@pothos pothos requested a review from a team March 3, 2022 10:58
@pothos pothos marked this pull request as ready for review March 3, 2022 10:58
The dracut/30ignition files had to be updated to match the folder
dracut/30ignition found in the ignition repo but with some adaptions
because Flatcar allows to overwrite the root filesystem and has a
different initramfs service setup.
For Ignition v3 we had to provide an implementation for is-live-image
and ignition-kargs-helper. The kargs helper does not handle all cases
due to the complexity of evaluation grub.cfg.
Copy link
Contributor

@tormath1 tormath1 left a comment

Choose a reason for hiding this comment

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

well it looks good to me, and the CI is passing. Just have one question regarding the Documentation= parameter in unit files, they target CoreOS' github not sure if we should keep them or use Flatcar's URL.

@pothos
Copy link
Member Author

pothos commented Mar 7, 2022

I think it's ok to use the upstream URL (not even sure if someone sees these entries). It also reduces the noise when comparing the files to upstream.

@tormath1
Copy link
Contributor

tormath1 commented Mar 7, 2022

It also reduces the noise when comparing the files to upstream.

Yeah, I agree too - so let's merge this. 🎉

@pothos pothos merged commit 820a5ad into flatcar-master Mar 7, 2022
@pothos pothos deleted the kai/ignition-v3 branch March 7, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants