summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2018-09-07 09:03:08 +0200
committertorben2018-09-07 09:03:08 +0200
commit6ac69b60fef27f046064336d082c0da213e82360 (patch)
treeb8f7d5d95b8c671701a04293abb63a6e54295126
parentfix. (diff)
downloadsystemd-init-6ac69b60fef27f046064336d082c0da213e82360.tar.gz
systemd-init-6ac69b60fef27f046064336d082c0da213e82360.tar.xz
systemd-init-6ac69b60fef27f046064336d082c0da213e82360.zip
Preparing tests, optimize initramfs against performance.
-rwxr-xr-xmodules.d/systemd-networkd-ext/hooks/prepare-network-service-in-newroot.sh16
-rwxr-xr-xmodules.d/systemd-networkd-ext/module-setup.sh6
-rw-r--r--modules.d/systemd-networkd-ext/restart-wireless-daemon.service6
3 files changed, 15 insertions, 13 deletions
diff --git a/modules.d/systemd-networkd-ext/hooks/prepare-network-service-in-newroot.sh b/modules.d/systemd-networkd-ext/hooks/prepare-network-service-in-newroot.sh
index ab0d93e1..8aa8feda 100755
--- a/modules.d/systemd-networkd-ext/hooks/prepare-network-service-in-newroot.sh
+++ b/modules.d/systemd-networkd-ext/hooks/prepare-network-service-in-newroot.sh
@@ -61,13 +61,11 @@ if $SLX_ONLINE; then
bl.logging.info \
Link service "$service_file_path" to \
"$NEWROOT_SYSINIT_TARGET_DIR/$service_name".
- if [[ "$service_name" != 'systemd-networkd.service' ]]; then
- ln \
- --force \
- --symbolic \
- "$service_file_path" \
- "$NEWROOT_SYSINIT_TARGET_DIR/$service_name"
- fi
+ ln \
+ --force \
+ --symbolic \
+ "$service_file_path" \
+ "$NEWROOT_SYSINIT_TARGET_DIR/$service_name"
done
if [[ "$SLX_WIRELESS_MAC" != false ]]; then
service_name=wpa_supplicant@wireless.service
@@ -98,8 +96,8 @@ if $SLX_ONLINE; then
# ../restart-wireless-daemon.service \
# "$NEWROOT/usr/lib/systemd/system/multi-user.target.wants/restart-wireless-daemon.service"
# Login to tty1 version, works:
- # TODO remove "false" if working and dynamically add relevant mac address.
- echo -e "false && [ ! -f /tmp/wireless-daemon-restarted ] && systemctl start systemd-netword && sed --in-place --regexp-extended 's/(CriticalConnection=true)/#\1/' /etc/systemd/network/wireless.network && systemctl start restart-wireless-daemon.service && systemctl restart systemd-netword && touch /tmp/wireless-daemon-restarted\n$(cat "$NEWROOT/root/.bash_profile")" \
+ # TODO remove "false" if pre-caching is working.
+ echo -e "false && [ ! -f /tmp/wireless-daemon-restarted ] && systemctl start restart-wireless-daemon.service && touch /tmp/wireless-daemon-restarted\nwget --output-document - http://..../BOOTED\n$(cat "$NEWROOT/root/.bash_profile")" \
> "$NEWROOT/root/.bash_profile"
# Stops daemon at boot yet.
#bl.logging.info \
diff --git a/modules.d/systemd-networkd-ext/module-setup.sh b/modules.d/systemd-networkd-ext/module-setup.sh
index 4986dc99..2fab6d8e 100755
--- a/modules.d/systemd-networkd-ext/module-setup.sh
+++ b/modules.d/systemd-networkd-ext/module-setup.sh
@@ -165,7 +165,6 @@ installkernel() {
kvm \
cfg80211 \
mac80211 \
- btrfs \
i915
}
@@ -185,7 +184,6 @@ install() {
$systemdsystemunitdir/systemd-networkd.socket \
$systemdsystemunitdir/systemd-resolved.service \
ip \
- networkctl \
nice \
sync
# wpa_supplicant version:
@@ -193,11 +191,11 @@ install() {
$systemdsystemunitdir/wpa_supplicant@.service \
wpa_supplicant
# optional:
- #inst_multiple -o \
+ # iwd version (needs dbus implication in initramfs):
#wpa_actiond \
#wpa_cli \
#wpa_passphrase
- # iwd version (needs dbus implication in initramfs):
+ #inst_multiple -o \
#$systemdsystemunitdir/iwd.service \
#$systemdsystemunitdir/dbus.service \
#$systemdsystemunitdir/dbus.socket \
diff --git a/modules.d/systemd-networkd-ext/restart-wireless-daemon.service b/modules.d/systemd-networkd-ext/restart-wireless-daemon.service
index a6687080..d8c248d8 100644
--- a/modules.d/systemd-networkd-ext/restart-wireless-daemon.service
+++ b/modules.d/systemd-networkd-ext/restart-wireless-daemon.service
@@ -3,6 +3,10 @@ Description=Restarts wireless daemon to handle re-connects by actively running s
After=network.target
[Service]
+# Before this service is running we got two ips for non static dhcp for the
+# wireless device. So we have to allow systemd-netword to deconfigure the
+# device and remove the old (coming from the initramfs) one.
+ExecStartPre=-/run/initramfs/usr/bin/sed --in-place --regexp-extended 's/(CriticalConnection=true)/#\1/' /etc/systemd/network/wireless.network
ExecStartPre=-/run/initramfs/usr/bin/killall --signal TERM -- iwd
ExecStartPre=-/run/initramfs/usr/bin/killall --signal TERM -- netctl
ExecStartPre=-/run/initramfs/usr/bin/killall --signal TERM -- netctl-auto
@@ -12,6 +16,8 @@ ExecStartPre=-/run/initramfs/usr/bin/sync
#ExecStartPre=-/run/initramfs/usr/bin/sleep 20
#ExecStart=/usr/bin/systemctl start iwd
ExecStart=/usr/bin/systemctl start wpa_supplicant@wireless.service
+# Restarts dhcp lease to retrieve a valid unique ip.
+ExecStartPost=/usr/bin/systemctl restart systemd-netword
RemainAfterExit=true
StandardError=null
StandardOutput=null