From bc8ac0507d7e8443a6c26cd401c83d6544bd9cdc Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 21 Apr 2017 16:53:32 +0200 Subject: [PATCH] init-ifupdown: disable wlan interfaces on non-wireless variants Added a post-installation script to disable the wireless interfaces on module variants without wireless support. This fixes following messages on boot: wlan: driver load failure modprobe: can't load module wlan (extra/wlan.ko): No such device ... https://jira.digi.com/browse/DEL-3781 Signed-off-by: Javier Viguera --- .../init-ifupdown/init-ifupdown_1.0.bbappend | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend index 38e5d2f17..99a1c3890 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2013 Digi International. +# Copyright (C) 2013-2017 Digi International Inc. FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" @@ -138,3 +138,21 @@ do_install_append_ccimx6ul() { sed -i -e "s,##WLAN1_STATIC_GATEWAY##,${WLAN1_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces sed -i -e "s,##WLAN1_STATIC_DNS##,${WLAN1_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces } + +# Disable wireless interfaces on first boot for non-wireless variants +pkg_postinst_${PN}() { + if [ -n "$D" ]; then + exit 1 + fi + + if [ ! -d "/proc/device-tree/wireless" ]; then + sed -i -e '/^auto wlan/{s,^,#,g};/^auto p2p/{s,^,#,g}' /etc/network/interfaces + fi + + # Create the symlinks in the different runlevels + if type update-rc.d >/dev/null 2>/dev/null; then + update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} + fi + + exit 0 +}