Repository navigation
grub: de-hardcode firstboot network configuration - #1373
Conversation
|
/hold |
|
See #1298 for the other spots we need to tweak too. Worth noting in the commit message also that the eventual goal is to remove |
|
we need to be real careful with this because it will change it for all streams. We need to make sure when we merge this and do our first testing release that we also tag coreos-assembler so we can use the same one for the subsequent stable release (this is related to https://github.com/coreos/fedora-coreos-streams/issues/64) |
Yeah, good point. Tagging cosa would work, though another approach is to just add a new |
|
There is a potential way to deal with N streams: embed the kargs into the That said, I don't have a strong opinion either way. The change seems sensible to me. |
ashcrow
left a comment
There was a problem hiding this comment.
I'm OK with this move but let's be careful to ensure all required updates make it into RHCOS as well here (IE: updated afterburn and the referenced service).
This is part of moving to conditional networking (coreos/fedora-coreos-tracker#443). Let's move the firstboot kargs here as prep for dropping them entirely. See also: coreos/coreos-assembler#1373
jlebon
left a comment
There was a problem hiding this comment.
Some comments, but LGTM overall! I've tested this as part of coreos/fedora-coreos-config#426.
| # above $ignition_network_kcmdline with static networking config. | ||
| # This override feature is primarily used by coreos-installer to | ||
| # persist static networking config provided during install to the | ||
| # first boot of the machine. |
There was a problem hiding this comment.
Hmm, I think this comment is still true, no?
|
|
||
| # Firstboot kernel arguments. | ||
| firstboot_kargs="$(python3 -c ' | ||
| import sys, yaml; |
There was a problem hiding this comment.
Minor/optional: I think we can drop the semicolons here and below since this is a proper multiline string now?
| import sys, yaml; | ||
| LEGACY_DEFAULT = [ "rd.neednet=1", "ip=dhcp,dhcp6" ]; | ||
| args = yaml.safe_load(sys.stdin).get("firstboot-kargs", LEGACY_DEFAULT); | ||
| if not args: |
There was a problem hiding this comment.
One subtlety here that I missed at first (which contributed to why I originally wanted something more explicit than this) is that it appears like this can never be false since we provide a default. Maybe a comment here like: # firstboot-kargs provided, but is empty ?
There was a problem hiding this comment.
(I blame PEP8 for convincing a generation of programmers that a list and a boolean are isomorphic)
This removes the hardcoded network configuration kargs from grub, moving them into handling within initramfs by `dracut-cmdline.service`.
|
Rebased. There was actually a bug in the logic writing This PR can land as soon review-stamped, as it internally preserve the previously-GRUB-hardcoded defaults. I manually tested that this works with the logic in Afterburn 4.4.0 in F32. |
|
/hold cancel |
Perfect 👍 /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashcrow, jlebon, lucab The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| # stage on s390x, either through zipl->grub2-emu or zipl standalone. | ||
| # See https://github.com/coreos/ignition-dracut/issues/84 | ||
| # A similar hack is present in https://github.com/coreos/coreos-assembler/blob/master/src/gf-platformid#L55 | ||
| echo "$(grep options $blsfile) ignition.firstboot rd.neednet=1 ip=dhcp,dhcp6" > $tmpfile |
There was a problem hiding this comment.
Hmm actually, I think we need to add ${firstboot_kargs} here, right? Because s390x doesn't use the GRUB config yet. And in gf_platformid too.
Or... we just sprint to coreos/fedora-coreos-config#426.
There was a problem hiding this comment.
This will also affect RHCOS and slower FCOS streams, so let's fix it.
I'm unsure however how to wire this new variable content to gf_platformid. Do we actually need to have it there, if that is only injecting the platform ID?
We've now reached the end of the conditional networking 🌈 rainbow 🌈. We can rip out the legacy default network firstboot kargs from cosa. These now live in the config repo. E.g.: https://github.com/coreos/fedora-coreos-config/blob/be456c437d4181435022ce47079b587f5bcb0319/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/50-afterburn-network-kargs-default.conf For more details, see: coreos#1373 coreos/fedora-coreos-config#426
We've now reached the end of the conditional networking 🌈 rainbow 🌈. We can rip out the legacy default network firstboot kargs from cosa. These now live in the config repo. E.g.: https://github.com/coreos/fedora-coreos-config/blob/be456c437d4181435022ce47079b587f5bcb0319/overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/50-afterburn-network-kargs-default.conf For more details, see: #1373 coreos/fedora-coreos-config#426
This removes the hardcoded network configuration kargs from grub,
moving them into handling within initramfs by
dracut-cmdline.service.Ref: coreos/fedora-coreos-tracker#460
Ref: coreos/fedora-coreos-config#427