diff options
16 files changed, 32 insertions, 38 deletions
diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service new file mode 120000 index 00000000..a2e7487d --- /dev/null +++ b/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service @@ -0,0 +1 @@ +udhcpc@.service
\ No newline at end of file diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service deleted file mode 120000 index dff66b14..00000000 --- a/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service +++ /dev/null @@ -1 +0,0 @@ -../udhcpc@.service
\ No newline at end of file diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service index 6547de5b..9226f00c 100644 --- a/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service +++ b/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service @@ -1,7 +1,6 @@ [Unit] -Description=DHCP Client -DefaultDependencies=no -Before=sysinit.target +Description=DHCP Client for %i +After=systemd-tmpfiles-setup.service [Service] Type=forking @@ -9,5 +8,3 @@ PIDFile=/run/udhcpc/udhcpc.%I.pid ExecStart=/opt/openslx/scripts/systemd-udhcpc++ %I ExecStopPost=/bin/rm /run/udhcpc/udhcpc.%I.pid -[Install] -WantedBy=multi-user.target diff --git a/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf b/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf new file mode 100644 index 00000000..3f83df3b --- /dev/null +++ b/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf @@ -0,0 +1 @@ +D /run/udhcpc 0755 root root diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx index 546750b9..e43afb33 100755 --- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx +++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx @@ -20,12 +20,12 @@ . /opt/openslx/config RESOLV_CONF="/etc/resolv.conf" -THIS_RESOLV="/run/dhcpc/${interface}.resolv" +THIS_RESOLV="/run/network/${interface}.resolv" rebuild_resolv_conf () { # Maybe make this smarter some time, if anyone is using client's that are on multiple networks at once etc... # This is a little braindead but should work most of the time - sort -u /run/dhcpc/*.resolv > "$RESOLV_CONF" 2> /dev/null + sort -u /run/network/*.resolv > "$RESOLV_CONF" 2> /dev/null } escape_search() { @@ -96,7 +96,7 @@ case "$1" in sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config # Only if network is not ready yet - if [ ! -e "/run/dhcpc/network-ready" ]; then + if [ ! -e "/run/network/network-ready" ]; then # Update hostname if [ -z "$dns_host" ]; then # fallback to what the dhcp told us @@ -130,7 +130,7 @@ case "$1" in fi # Update /etc/issue for proper spacing /opt/openslx/scripts/openslx-create_issue - touch "/run/dhcpc/network-ready" + touch "/run/network/network-ready" # Mark network target as reached systemctl start network.target & fi # end "network not ready yet" @@ -158,16 +158,16 @@ case "$1" in sed -i -r '/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\s*$/d' /etc/hosts # "dns ready" target - if [ -n "$dns" ] && [ ! -e "/run/dhcpc/dns-ready" ]; then - touch "/run/dhcpc/dns-ready" + if [ -n "$dns" ] && [ ! -e "/run/network/dns-ready" ]; then + touch "/run/network/dns-ready" # Write to openslx-config echo "# Config written by openslx-dhcp-script (2)" >> /opt/openslx/config echo "SLX_DNS='$dns'" >> /opt/openslx/config systemctl start network-dns.target & fi # "default route exists" target - if [ -n "$router" ] && [ ! -e "/run/dhcpc/routing-ready" ]; then - touch "/run/dhcpc/routing-ready" + if [ -n "$router" ] && [ ! -e "/run/network/gateway-ready" ]; then + touch "/run/network/gateway-ready" # Write to openslx-config echo "# Config written by openslx-dhcp-script (3)" >> /opt/openslx/config echo "SLX_DNS='$dns'" >> /opt/openslx/config diff --git a/remote/modules/systemd/data/etc/systemd/system/network-interface@.service b/remote/modules/systemd/data/etc/systemd/system/network-interface@.service index 73cc6239..ea9cc56e 100644 --- a/remote/modules/systemd/data/etc/systemd/system/network-interface@.service +++ b/remote/modules/systemd/data/etc/systemd/system/network-interface@.service @@ -1,7 +1,7 @@ [Unit] Description=Brings interface %i up -Wants=udhcpc@%i.service -Before=udhcpc@%i.service +Wants=dhcpc@%i.service +Before=dhcpc@%i.service [Service] Type=simple diff --git a/remote/modules/systemd/data/etc/systemd/system/network.target b/remote/modules/systemd/data/etc/systemd/system/network.target deleted file mode 100644 index 0bc2a410..00000000 --- a/remote/modules/systemd/data/etc/systemd/system/network.target +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Network -Documentation=man:systemd.special(7) -Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget -ConditionPathExists=/run/udhcpc/network-ready - diff --git a/remote/modules/systemd/data/usr/lib/systemd/system/network.target b/remote/modules/systemd/data/usr/lib/systemd/system/network.target index 65fc64b0..4186c088 100644 --- a/remote/modules/systemd/data/usr/lib/systemd/system/network.target +++ b/remote/modules/systemd/data/usr/lib/systemd/system/network.target @@ -9,3 +9,6 @@ Description=Network Documentation=man:systemd.special(7) Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget +DefaultDependencies=no +ConditionPathExists=/run/network/network-ready + diff --git a/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules b/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules index c148de7a..99cdf676 100644 --- a/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules +++ b/remote/modules/systemd/data/usr/lib/udev/rules.d/99-systemd.rules @@ -31,7 +31,9 @@ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_T # # http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=libudev/libudev-enumerate.c;h=da831449dcaf5e936a14409e8e68ab12d30a98e2;hb=HEAD#l742 -#SUBSYSTEM=="net", KERNEL=="eth*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service" +SUBSYSTEM=="net", KERNEL=="eth*", TAG=="openslxignore", GOTO="systemd_end" + +SUBSYSTEM=="net", KERNEL=="br0|eth*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service" SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/%k" SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target" @@ -43,8 +45,7 @@ SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.tar SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.target" # Apply sysctl variables to network devices (and only to those) as they appear. - -#SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name" +SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name" # Asynchronously mount file systems implemented by these modules as # soon as they are loaded. diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_network b/remote/rootfs/rootfs-stage31/data/inc/setup_network index ed29050f..9e52cfaa 100755 --- a/remote/rootfs/rootfs-stage31/data/inc/setup_network +++ b/remote/rootfs/rootfs-stage31/data/inc/setup_network @@ -58,6 +58,8 @@ for LINE in $IP_OUT; do else NOIPYET="yes" fi + # Ignore this device later on when systemd handles network interfaces (see hacked 99-systemd.rules in systemd data dir) + echo "SUBSYSTEM==\"net\", ACTION==\"add\", KERNEL==\"eth*\", ATTR{address}==\"$IFMAC\", TAG+=\"openslxignore\"" >> "${FUTURE_ROOT}/etc/udev/rules.d/01-ignore-boot-interface.rules" fi # youdev echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$IFMAC\", ATTR{dev_id}==\"0x0\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"$IFACE\"" >> "${FUTURE_ROOT}/etc/udev/rules.d/70-net-boot-nic-name.rules" diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service index 7ed6e2a6..4713dae1 100644 --- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service @@ -3,7 +3,9 @@ [Unit] Description=Trigger network targets early DefaultDependencies=no +Wants=systemd-tmpfiles-setup.service Before=sysinit.target +After=systemd-tmpfiles-setup.service [Service] Type=oneshot diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target index c0b7793b..bc12cd1b 100644 --- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target @@ -1,4 +1,4 @@ [Unit] - Description=DNS Server available +ConditionPathExists=/run/network/dns-ready diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target index cfeb719c..770eb697 100644 --- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target @@ -1,3 +1,4 @@ [Unit] - Description=Default route configured +ConditionPathExists=/run/network/gateway-ready + diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service index a48375d0..ebaa9afb 100644 --- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/ntpdate.service @@ -2,7 +2,6 @@ Description=Update date from local time server After=network.target Requires=network.target -ConditionPathExists=/run/udhcpc/network-ready [Service] Type=oneshot diff --git a/remote/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf b/remote/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf new file mode 100644 index 00000000..dd67e785 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf @@ -0,0 +1 @@ +D /run/network 0755 root root diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers index bc471116..dc639535 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers @@ -8,17 +8,17 @@ BRIDGE="br0" if [ ! -e "/sys/class/net/${BRIDGE}/operstate" -o "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && [ -e "/opt/openslx/uniontmp/etc/hostname" -o -e "/opt/openslx/uniontmp/etc/resolv.conf" ]; then - touch "/run/dhcpc/network-ready" + touch "/run/network/network-ready" systemctl start network.target & fi if [ -s "/etc/resolv.conf" ] && grep -q "^nameserver" "/etc/resolv.conf"; then - touch "/run/dhcpc/dns-ready" + touch "/run/network/dns-ready" systemctl start network-dns.target & fi if route -n | grep -q -E '^0\.0\.0\.0.*U.*G'; then - touch "/run/dhcpc/routing-ready" + touch "/run/network/gateway-ready" systemctl start network-gateway.target & fi |
