2. Session overview
● Discussion of network management packages
● Runtime examples of configuring Wifi credentials
● Static configuration of credentials at build time
⎻ Recipes available in github1
● Other related considerations
● More “howto” than other talks
Goal: Gather all relevant details
in one place
1
https://github.com/drewmoseley/meta-wifi-credentials
3. About me
Drew Moseley
○ 10 years in Embedded Linux/Yocto development.
○ Longer than that in general Embedded Software.
○ Project Lead and Solutions Architect.
drew.moseley@mender.io
https://twitter.com/drewmoseley
https://www.linkedin.com/in/drewmoseley/
https://twitter.com/mender_io
Mender.io
○ Over-the-air updater for Embedded Linux
○ Open source (Apache License, v2)
○ Dual A/B rootfs layout (client)
○ Remote deployment management (server)
○ Under active development
4. Challenges for Credentials Storage in Embedded Devices
On-target user interface (or lack of)
Network management package variety
Credential availability at build time (?)
System init packages (systemd vs sysvinit)
Multiple systems/one image
Read-only root filesystem
Trusted storage(not discussed here)
5. Test Setup
● Raspberry Pi Zero W
● Serial console cable
● GL.iNET portable router
● SSID: scale17OEDemo
● Password: monkey123
9. Prerequisites - Test Basic Bringup
root@raspberrypi0-wifi:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether b8:27:eb:53:95:7d brd ff:ff:ff:ff:ff:ff
● Boot device and verify wlan0 device exists.
● Login is root with no password.
14. sysvinit + wpa_supplicant build time configuration (2/2)
# Ensure that wlan0 is set to auto
#
do_install_append () {
echo 'auto wlan0' >> ${D}${sysconfdir}/network/interfaces
}
$ bitbake-layers add-layer ../src/meta-wifi-credentials/sysvinit
recipes-connectivity/init-ifupdown/init-ifupdown_%.bbappend
15. systemd + systemd-networkd build
● Systemd-networkd is the thud branch default when systemd is enabled.
● There has been talk of making systemd the default init system
IMAGE_INSTALL_append += " wpa-supplicant"
DISTRO_FEATURES_append += " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
*
Snippet for local.conf:
*
Required for all systemd based configurations
19. Using systemd without networkd
● Need to disable resolved and networkd in systemd PACKAGECONFIG
PACKAGECONFIG_remove = "networkd resolved"
recipes-core/systemd/systemd_%.bbappend: