Skip to content

Commit

Permalink
WIP: Run NM via systemd unit, don't depend on ip=dhcp kargs
Browse files Browse the repository at this point in the history
See https://github.com/coreos/ignition-dracut/issues/94
and coreos/ignition#948

Needs pairing with a cosa PR to drop the default `ip=dhcp` kargs.

And yes we really want to upstream this into NM by default or so.

Co-Authored-By: Dusty Mabe <dusty@dustymabe.com>
  • Loading branch information
2 people authored and jlebon committed Mar 30, 2020
1 parent 324a2f2 commit 3c2b2c4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion live/EFI/fedora/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ set timeout=5

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora CoreOS (Live)' --class fedora --class gnu-linux --class gnu --class os {
linux /images/vmlinuz @@KERNEL-ARGS@@ rd.neednet=1 ip=dhcp ignition.firstboot ignition.platform.id=metal
linux /images/vmlinuz @@KERNEL-ARGS@@ ignition.firstboot ignition.platform.id=metal
initrd /images/initramfs.img
}
2 changes: 1 addition & 1 deletion live/isolinux/isolinux.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ label linux
menu label ^Fedora CoreOS (Live)
menu default
kernel /images/vmlinuz
append initrd=/images/initramfs.img @@KERNEL-ARGS@@ rd.neednet=1 ip=dhcp ignition.firstboot ignition.platform.id=metal
append initrd=/images/initramfs.img @@KERNEL-ARGS@@ ignition.firstboot ignition.platform.id=metal

menu separator # insert an empty line

Expand Down
2 changes: 1 addition & 1 deletion live/zipl.prm
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
}

0 comments on commit 3c2b2c4

Please sign in to comment.