Skip to content

dracut: Ensure that /etc/systemd/network/ exists to write networkd unit #15

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

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

pothos
Copy link
Member

@pothos pothos commented Jun 29, 2020

The /etc/systemd/network/ folder didn't exist by default, which caused
static IP assignment via the kernel command line being broken
(The format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
is documented in https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
and parsed in the initramfs).
Create the folder before trying to write a networkd unit into it.

Reported in flatcar/Flatcar#148

How to use

Boot a QEMU VM and add this kernel parameter in GRUB:

ip=10.0.2.15::10.0.2.2:255.255.255.0::eth0:none:1.1.1.1:8.8.8.8

Currently journalctl --e -u dracut-cmdline show these errors which should be gone with the patch:

dracut-cmdline[191]: //lib/dracut/hooks/cmdline/99-parse-ip-for-networkd.sh: line 76: /etc/systemd/network/10-dracut-cmdline-99.network: No such file or directory

Testing done

The error messages are gone following the instructions above. I didn't test it with something else.

The /etc/systemd/network/ folder didn't exist by default, which caused
static IP assignment via the kernel command line being broken
(The format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
is documented in https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
and parsed in the initramfs).
Create the folder before trying to write a networkd unit into it.

Reported in flatcar/Flatcar#148
@pothos pothos requested a review from a team June 29, 2020 15:09
@pothos pothos marked this pull request as ready for review June 29, 2020 18:37
@pothos pothos merged commit 135602e into flatcar-master Jun 30, 2020
@pothos pothos deleted the kai/fix-static-ips branch June 30, 2020 09:46
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jun 30, 2020
This pulls in flatcar/bootengine#15
to ensure that /etc/systemd/network/ exists to write networkd unit
when static IP addresses are configured through the kernel command
line in the format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jun 30, 2020
This pulls in flatcar/bootengine#15
to ensure that /etc/systemd/network/ exists to write networkd unit
when static IP addresses are configured through the kernel command
line in the format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jun 30, 2020
This pulls in flatcar/bootengine#15
to ensure that /etc/systemd/network/ exists to write networkd unit
when static IP addresses are configured through the kernel command
line in the format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jun 30, 2020
This pulls in flatcar/bootengine#15
to ensure that /etc/systemd/network/ exists to write networkd unit
when static IP addresses are configured through the kernel command
line in the format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jul 20, 2020
This pulls in flatcar/bootengine#15
to ensure that /etc/systemd/network/ exists to write networkd unit
when static IP addresses are configured through the kernel command
line in the format ip=<ip>::<gateway>:<netmask>:<hostname>:<iface>:none[:<dns1>[:<dns2>]]
https://docs.flatcar-linux.org/ignition/network-configuration/#using-static-ip-addresses-with-ignition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants