This commit is contained in:
parent
8d1e6666f1
commit
b32bce4f74
23
ignition-enable-network.service
Normal file
23
ignition-enable-network.service
Normal file
@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Start network if needed
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
DefaultDependencies=false
|
||||
After=basic.target
|
||||
|
||||
# Triggering conditions for cases where we need network
|
||||
ConditionPathExists=|/run/ignition/neednet
|
||||
|
||||
# Creates /run/ignition/neednet
|
||||
After=ignition-fetch-offline.service
|
||||
# Needs networking
|
||||
Before=ignition-fetch.service
|
||||
|
||||
# See hack in coreos-enable-network, as well as coreos-copy-firstboot-network.service;
|
||||
# adapted for SUSE / wicked use
|
||||
After=dracut-cmdline.service
|
||||
Before=dracut-initqueue.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/sbin/ignition-enable-network
|
10
ignition-enable-network.sh
Normal file
10
ignition-enable-network.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if [ -f /run/ignition/neednet ] && ! getargbool 0 'rd.neednet'; then
|
||||
echo "rd.neednet=1 ip=dhcp" > /etc/cmdline.d/40-ignition-neednet.conf
|
||||
|
||||
# Re-trigger generation of network rules
|
||||
. /lib/dracut/hooks/pre-udev/60-net-genrules.sh
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user