Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dracut/50flatcar-network/afterburn-network-kargs.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ PartOf=systemd-networkd.service
# For extra safety
ConditionKernelCommandLine=|coreos.oem.id=vmware
ConditionKernelCommandLine=|flatcar.oem.id=vmware
ConditionKernelCommandLine=|coreos.oem.id=proxmoxve
ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve
ConditionKernelCommandLine=|coreos.oem.id=kubevirt
ConditionKernelCommandLine=|flatcar.oem.id=kubevirt

OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly

Expand Down
4 changes: 4 additions & 0 deletions dracut/50flatcar-network/parse-ip-for-networkd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ function mask2cidr() {
echo $bits
}

nameserver=$(getarg nameserver=)

# Check ip= lines
# XXX Would be nice if we could errorcheck ip addresses here as well
for p in $(getargs ip=); do
Expand Down Expand Up @@ -119,6 +121,7 @@ for p in $(getargs ip=); do
mkdir -p /etc/systemd/network
echo '[Match]' > $_net_file
_dev=${dev:-"*"}; echo "Name=$_dev" >> $_net_file
echo "Type=!loopback" >> $_net_file
echo '[Link]' >> $_net_file
[ -n "$macaddr" ] && echo "MACAddress=$macaddr" >> $_net_file
[ -n "$mtu" ] && echo "MTUBytes=$mtu" >> $_net_file
Expand All @@ -128,6 +131,7 @@ for p in $(getargs ip=); do
[ -n "$gw" ] && echo "Gateway=$gw" >> $_net_file
[ -n "$dns1" ] && echo "DNS=$dns1" >> $_net_file
[ -n "$dns2" ] && echo "DNS=$dns2" >> $_net_file
[ -n "$nameserver" ] && echo "DNS=$nameserver" >> $_net_file
echo '[Address]' >> $_net_file
[ -n "$ip" ] && echo "Address=$ip/${cidr:-24}" >> $_net_file
[ -n "$srv" ] && echo "Peer=$srv" >> $_net_file
Expand Down