How did you run
systemctl , without being already booted ?
The goal is to set up WiFi before even booting the Pi. I did the following (will write in the How-to section later)
-------------------------------------------------------------------------
Edit systemd-networkd-wait-online.service to not wait for ethernet :
$this->bbcode_second_pass_code('', '
# mkdir root/etc/systemd/system/systemd-networkd-wait-online.service.d
# nano root/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any
')
Set up WiFi :
$this->bbcode_second_pass_code('', '
# wpa_passphrase <SSID> <pwd> > root/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
')
Optionally add `country=XX` to `wpa_supplicant-wlan0.conf`
Enable `wpa_supplicant` :
$this->bbcode_second_pass_code('', '
# ln -s /usr/lib/systemd/system/wpa_supplicant@.service root/etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service
')
Configure `systemd-networkd`
$this->bbcode_second_pass_code('', '
# nano root/etc/systemd/network/wl.network
[Match]
Name=wl*
[Network]
DHCP=yes
')
------------------------------------------------------------------------
except that right now, I have the problems described
here, so might need adapting :