-
Notifications
You must be signed in to change notification settings - Fork 27
WIP: 30ignition: remove initramfs networking #77
WIP: 30ignition: remove initramfs networking #77
Conversation
I have not tested operation on FCOS, only RHCOS so far, see: #78 . Note that the only case this is currently handling is |
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/sbin/coreos-remove-initramfs-network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, let's make this /usr/libexec
so it's not in default $PATH
as a bash completion hazard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't exist in the real root so that's not an issue right? We also do this for e.g.https://github.com/coreos/ignition-dracut/blob/master/dracut/30ignition/coreos-populate-var.service#L14
@@ -0,0 +1,11 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shell script always should have
set -euo pipefail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, have been testing in #78 since its more time-sensitive in RHCOS, will update this right after
# Clean up the interfaces set up in the initramfs | ||
for f in /sys/class/net/*; do | ||
interface=$(basename "$f") | ||
ip link set $interface down |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this enough to kill dhclient
? I think we also want to loop over /run/dhclient*.pid
or so, actually before doing the interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dhclient isn't actually running AFAICT in the initramfs (nothing from ps aux). It doesn't try to re-lease if I down the interfaces at least.
e87c38c
to
85f2e65
Compare
Add coreos-remove-initramfs-network.service to run after ignition has finished using initramfs networking, so NetworkManager properly brings up ignition-configured networking in the real root. Otherwise the initramfs network persists into the real root. Signed-off-by: Yu Qi Zhang <[email protected]>
Whoops, bad force-push |
After jlebon's PRs merge, we'll want to move this to the fcos-config repo instead of here |
@yuqi-zhang Can you reopen this against https://github.com/coreos/fedora-coreos-config ? Would be good to get this working in FCOS as well. |
Yep, sorry, will close and PR there |
New PR here: coreos/fedora-coreos-config#89 |
Add coreos-remove-initramfs-network.service to run after ignition
has finished using initramfs networking, so NetworkManager properly
brings up ignition-configured networking in the real root. Otherwise
the initramfs network persists into the real root.
Signed-off-by: Yu Qi Zhang [email protected]