forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Run NM via systemd unit, don't depend on ip=dhcp kargs
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
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
12 changes: 12 additions & 0 deletions
12
....d/05core/usr/lib/dracut/modules.d/39coreos-ignitionnetwork/coreos-NetworkManager.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
20 changes: 20 additions & 0 deletions
20
overlay.d/05core/usr/lib/dracut/modules.d/39coreos-ignitionnetwork/module-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |