hostapd: adapt recipe for read-only-rootfs

The access point configuration files are dynamically modified on a post
install script to generate an SSID name based on the last digits of the
MAC address (physical or virtual) assigned to a wlanX interface.

On read-only file systems, this is not possible, so add some conditional
code to the do_install() to use instead the $DIGI_FAMILY name.

Caveat: if several identical SOMs with read-only-rootfs co-exist on the
same network as APs, they will identify with the same SSID.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://onedigi.atlassian.net/browse/DEL-7708
This commit is contained in:
Hector Palacios 2021-10-28 08:59:20 +02:00
parent 7cd57a40e3
commit 0ba9b85574
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2016-2020 Digi International.
# Copyright (C) 2016-2021 Digi International.
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
@ -23,6 +23,12 @@ do_install_append() {
# Install custom hostapd_IFACE.conf file
install -m 0644 ${WORKDIR}/hostapd_wlan1.conf ${D}${sysconfdir}
fi
# Read-only rootfs: actions that substitute postinst script
# - append the ${DIGI_FAMILY} string to SSID
if [ -n "${@bb.utils.contains('IMAGE_FEATURES', 'read-only-rootfs', '1', '', d)}" ]; then
sed -i -e "s,##MAC##,${DIGI_FAMILY},g" ${D}${sysconfdir}/hostapd_wlan?.conf
fi
}
pkg_postinst_ontarget_${PN}() {