Carrying over wifi settings between deployments on a Raspberry Pi

I can successfully push updates to a Raspberry Pi plugged in via an ethernet cable. Unfortunately, when I try to push new deployments to a Pi that has already been configured, I’m losing my ability to connect to the Wifi network. The thought was to push the wifi configurations to /data and create an operating system sym link from the Pi’s wifi settings (/etc/wpa_supplicant/wpa_supplicant.conf), thus carrying over the configs between Mender deployments. This is a way around the statelessness partitions (A/B). Perhaps there’s another method? Can someone help me understand the best way to persistent Raspberry wifi network settings on a device (SSID and Password) between Mender deployments?

Thanks

Creating a symlink is a common approach and is probably the simplest to setup.

Other ways of doing it is to use a state-script, e.g

Or using an unionfs, such as overlayfs

For future reference, I was able to use the following .bb_append for Kirkstone to preserve the WiFi wpa_supplicant file. However, not for the Raspberry Pi but for STM32mp1.

wpa-supplicant_%.bbappend

do_install:append() {
    # Move the default to data directory
    install -d ${D}/data/etc/wpa_supplicant
    mv ${D}${sysconfdir}/wpa_supplicant.conf ${D}/data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
    
    # Add directory for config file
    install -d ${D}${sysconfdir}/wpa_supplicant/

    # Link config file to data 
    ln -sf /data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf ${D}${sysconfdir}/wpa_supplicant/wpa_supplicant-wlan0.conf 
}

FILES:${PN}:append = " /data/etc/wpa_supplicant/wpa_supplicant-wlan0.conf "