From 0ba9b85574d6492e87bce7d92e1f528a5901b211 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 28 Oct 2021 08:59:20 +0200 Subject: [PATCH] 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 https://onedigi.atlassian.net/browse/DEL-7708 --- .../recipes-connectivity/hostapd/hostapd_%.bbappend | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend index d38caa54e..765fcdbec 100644 --- a/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/hostapd/hostapd_%.bbappend @@ -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}() {