[arch-releng] [RFC][PATCH] [configs/releng] Use systemd-networkd instead of dhcpcd
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- .../releng/root-image/etc/systemd/network/dhcp-on-ethernet.network | 5 +++++ configs/releng/root-image/etc/udev/rules.d/81-dhcpcd.rules | 1 - configs/releng/root-image/root/customize_root_image.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 configs/releng/root-image/etc/systemd/network/dhcp-on-ethernet.network delete mode 100644 configs/releng/root-image/etc/udev/rules.d/81-dhcpcd.rules diff --git a/configs/releng/root-image/etc/systemd/network/dhcp-on-ethernet.network b/configs/releng/root-image/etc/systemd/network/dhcp-on-ethernet.network new file mode 100644 index 0000000..aec1849 --- /dev/null +++ b/configs/releng/root-image/etc/systemd/network/dhcp-on-ethernet.network @@ -0,0 +1,5 @@ +[Match] +Name=en* + +[Network] +DHCP=yes diff --git a/configs/releng/root-image/etc/udev/rules.d/81-dhcpcd.rules b/configs/releng/root-image/etc/udev/rules.d/81-dhcpcd.rules deleted file mode 100644 index 1c4053c..0000000 --- a/configs/releng/root-image/etc/udev/rules.d/81-dhcpcd.rules +++ /dev/null @@ -1 +0,0 @@ -ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="en*|eth*", ENV{SYSTEMD_WANTS}="dhcpcd@$name.service" diff --git a/configs/releng/root-image/root/customize_root_image.sh b/configs/releng/root-image/root/customize_root_image.sh index 9c85453..3e01e2d 100755 --- a/configs/releng/root-image/root/customize_root_image.sh +++ b/configs/releng/root-image/root/customize_root_image.sh @@ -18,5 +18,5 @@ chmod 440 /etc/sudoers.d/g_wheel sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist sed -i 's/#\(Storage=\)auto/\1volatile/' /etc/systemd/journald.conf -systemctl enable pacman-init.service choose-mirror.service +systemctl enable pacman-init.service choose-mirror.service systemd-networkd.service systemctl set-default multi-user.target -- 1.8.5.2
On Wed, Feb 26, 2014 at 1:43 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Please also symlink /etc/resolv.conf to /run/systemd/network/resolv.conf (I need to document that better, sorry about that). Otherwise, (surprisingly ;-) ) +1 from me. Cheers, Tom
On 02/25/2014 10:10 PM, Tom Gundersen wrote:
Oki doki! Thanks for your great work! The issue here is when booting via PXE... The initcpio hook, writes on (append) etc/resolv.conf. Now, I think that I need to hack, and write to /run/systemd/network/resolv.conf instead. * Under PXE scenario: systemd-networkd will not be used because interface rename will fail (already UP from initramfs as eth) then /run/systemd/network/resolv.conf is untouched from systemd-network. * Under non-PXE scenario: /run/systemd/network/resolv.conf will be touched only by systemd-network. Also I think that can be a good idea for PXE scenario if-down-eth0, on initramfs as last step, then in this case, rename does work and dhcpcd is requested again but from systemd-networkd on real-root-fs. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 26.02.2014 03:04, schrieb Gerardo Exequiel Pozzi:
Why don't we just copy all renaming and networkd-related stuff to initramfs and use it for initialization there, too? For that we'd probably have to switch initramfs to systemd entirely, but we should do that anyway.
On 02/26/2014 04:22 AM, Thomas Bächler wrote:
Will be great, sure. But how to extract ROOTSERVER for later usage?
For that we'd probably have to switch initramfs to systemd entirely, but we should do that anyway.
Hehe. I tried this some times, but I fail. At least doing in a only systemd-way (only using units, no shell scripts), for the most simple boot scenario used by default and with fixed values.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 26.02.2014 14:04, schrieb Gerardo Exequiel Pozzi:
Ask Tom. networkd should get the ability to extract those special options from DHCP (like next-server, filename option, special dhcp options, ...) to be able to be fully useful in initramfs. OTOH, in archiso, we do not have to rely on such mechanisms, we can transmit all options via the command line.
You won't get anywhere without shell scripts I'm afraid. I'd put some parts of archiso into generators and some parts into services which call shell scripts. Once we have a working solution, we can still make it more systemd-y.
On Wed, Feb 26, 2014 at 2:47 PM, Thomas Bächler <thomas@archlinux.org> wrote:
I have worked a bit on this with Harald, but haven't finished yet (not even decided on exactly how we want to do it). I'll keep you posted once there is progress (you'll see it in the systemd repo anyway I guess).
On Wed, Feb 26, 2014 at 3:04 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Thanks for integrating it this quickly!
Hm, are you sure you can't just keep it at /etc/resolv.conf? The hook should should follow the symlink just fine :)
This sounds ok... or is there an issue here I'm not seeing?
If the network connection is no longer used at that stage, it may make sense. -t
Am 26.02.2014 01:43, schrieb Gerardo Exequiel Pozzi:
I'd say let's wait till DHCPv6 is supported here. We might hope that most people use dual-stack or auto discovery does work, but technically that would be a feature regression compared to our current solution. What do you guys think? Greetings, Pierre -- Pierre Schmitz, https://pierre-schmitz.com
participants (4)
-
Gerardo Exequiel Pozzi
-
Pierre Schmitz
-
Thomas Bächler
-
Tom Gundersen