-
Notifications
You must be signed in to change notification settings - Fork 158
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
WIP: Run NM via systemd unit, don't depend on ip=dhcp kargs #321
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@@KERNEL-ARGS@@ rd.neednet=1 ip=dhcp ignition.firstboot ignition.platform.id=metal | ||
@@KERNEL-ARGS@@ ignition.firstboot ignition.platform.id=metal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Network Manager (CoreOS initrd) | ||
Wants=network.target | ||
After=network-pre.target dbus.service | ||
Before=network.target network.service | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/libexec/nm-initrd-generator rd.neednet=1 ip=dhcp,dhcp6 | ||
ExecStart=/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon | ||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | ||
# ex: ts=8 sw=4 sts=4 et filetype=sh | ||
|
||
depends() { | ||
echo ignition network-manager | ||
} | ||
|
||
install_and_enable_unit() { | ||
unit="$1"; shift | ||
target="$1"; shift | ||
inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit" | ||
mkdir -p "$initdir/$systemdsystemunitdir/$target.requires" | ||
ln_r "../$unit" "$systemdsystemunitdir/$target.requires/$unit" | ||
} | ||
|
||
install() { | ||
# We're forcibly overriding NM to be run as a service | ||
install_and_enable_unit coreos-NetworkManager.service network-online.target | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm...debatable. See https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ |
||
} |
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.
I don't think this is going to work. I fear this is going to miss:
/etc/cmdline.d.
(e.g. the ones forwarded from vmware guestinfo)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.
Right, we probably need to make this an
ExecStartPre=
that looks at/proc/cmdline
and defers to that if any relevant arguments exist.This only exists in coreos/afterburn#379 right?
But hmm...either way, we should order
After=dracut-cmdline.service
and parse.../tmp/networking_opts
it looks like?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.
Yes, the vmware guestinfo bits specifically are only in a not-yet-merged PR, but generally I think the
cmdline.d
primitive is a useful one to keep.