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

05core: add support for root on iSCSI #2702

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Oct 30, 2023

See individual commit messages. The high-level overview here is that we just shuffle some services around and neuter others as needed so that we get out of the way of the existing iSCSI code in dracut when the right kargs are present (notably, rd.iscsi.firmware or netroot).

Rather than having the unit have `After=coreos-gpt-setup.service`
as a way to conditionally require the bootfs to be available, have
`coreos-diskful-generator` actually inject the requirement dynamically,
just like it does already for `coreos-ignition-setup-user.service`.

This is prep for moving `coreos-gpt-setup.service`.

Part of: coreos/fedora-coreos-tracker#1590
These services need to manipulate the boot disk but if the disk is
backed by iSCSI, we need networking first. Move them to run later in the
boot process but still before `ignition-disks`.

Part of: coreos/fedora-coreos-tracker#1590
In an iSCSI boot, we need networking before we can see the bootfs. So
`coreos-ignition-setup-user.service` needs to run after networking. We
also can't rely on the `fetch-offline` stage. Tweak things so that in
an iSCSI boot (1) we neuter the `fetch-offline` stage, and (2) we still
ensure that `coreos-ignition-setup-user.service` runs before the `fetch`
stage, which will take care of "consuming" the injected Ignition config.

Part of: coreos/fedora-coreos-tracker#1590
In an iSCSI boot, we have no utility for
`coreos-copy-firstboot-network.service` since it copies network settings
from the bootfs, which will only show up after networking has already
come up. Users are required to configure non-default networking via
kargs for iSCSI boots.

Part of: coreos/fedora-coreos-tracker#1590
During an iSCSI boot, we rely on networking to access the root device.
So at no point can networking go down once the rootfs is mounted. This
means we have to skip the teardown logic in `coreos-teardown-initramfs`
in that case.

One way to look at this conceptually is: the goal of this service is to
reset everything so that the real root is configured on the first boot
like it would be on any other boot (i.e. avoid first boot-specific state
carried from the initramfs). Since initramfs networking is required on
every boot for iSCSI, it's true on every boot that networking needs to
be carried forward across switchroot. So the goal is still met since
it's not a first boot-only concern.

Part of: coreos/fedora-coreos-tracker#1590
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

I have trouble adding this new path into my head for the boot flow. But I think the code makes sense.

cgwalters
cgwalters previously approved these changes Oct 30, 2023
…explicit

The decryption script requires the encrypted Ignition virtio device to be
present. Previously, we used `Before=coreos-gpt-setup.service`, which I
think ran late enough that the device would always be present by then.
But we've now moved that service and `After=systemd-udevd.service` isn't
good enough so the service now fails because the device doesn't exist.

Fix this by directly listing the requirement on the device in
the unit, which is more explicit anyway. And because of systemd's
"ConditionPathExists don't turn off Requires" semantic, make the unit
dynamically enabled by the diskful generator. As a bonus, we now have
one less service in the default initramfs transaction (which actually
was getting pulled in on all arches too).
@jlebon
Copy link
Member Author

jlebon commented Oct 31, 2023

Added another commit now to fix a bug with s390x Secure Execution Ignition decryption!

@jlebon
Copy link
Member Author

jlebon commented Nov 6, 2023

Can I get a restamp on this one? I've tested this pretty heavily now and it's looking good. We've also now effectively cleared f39 GA (we already have our testing build staged).

@cgwalters cgwalters merged commit 48ad3a3 into coreos:testing-devel Nov 6, 2023
2 checks passed
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