init-ifupdown: add support for ccimx6qpsbc platform
https://jira.digi.com/browse/DEL-5082 Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
f1dd256c5b
commit
553337afc3
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
## Example bridge between eth0 and wlan1
|
||||||
|
#auto br0
|
||||||
|
#iface br0 inet static
|
||||||
|
# bridge_ports eth0 wlan1
|
||||||
|
# address 192.168.42.50
|
||||||
|
# netmask 255.255.255.0
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
auto wlan1
|
||||||
|
iface wlan1 inet dhcp
|
||||||
|
udhcpc_opts -S -b >/dev/null &
|
||||||
|
post-up /etc/init.d/hostapd start
|
||||||
|
pre-down /etc/init.d/hostapd stop
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
auto wlan1
|
||||||
|
iface wlan1 inet static
|
||||||
|
address ##WLAN1_STATIC_IP##
|
||||||
|
netmask ##WLAN1_STATIC_NETMASK##
|
||||||
|
gateway ##WLAN1_STATIC_GATEWAY##
|
||||||
|
dns-nameservers ##WLAN1_STATIC_DNS##
|
||||||
|
post-up /etc/init.d/hostapd start
|
||||||
|
pre-down /etc/init.d/hostapd stop
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 2017, Digi International Inc.
|
||||||
|
#
|
||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
#
|
||||||
|
|
||||||
|
# This will create a second wireless network device
|
||||||
|
if [ -s "/proc/device-tree/wireless/mac-address1" ] &&
|
||||||
|
[ -s "/proc/device-tree/wireless/mac-address2" ] &&
|
||||||
|
[ -s "/proc/device-tree/wireless/mac-address3" ]; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "[WARN] Using default MAC addresses for virtual interfaces, please program them referring to the Digi U-Boot Documentation"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "/sys/class/net/wlan1" ]; then
|
||||||
|
# This will create a second wireless network device
|
||||||
|
iw dev wlan0 interface add wlan1 type managed
|
||||||
|
fi
|
||||||
|
|
@ -11,6 +11,12 @@ SRC_URI_append = " \
|
||||||
file://resolv \
|
file://resolv \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
SRC_URI_append_ccimx6qpsbc = "\
|
||||||
|
file://interfaces.wlan1.static \
|
||||||
|
file://interfaces.wlan1.dhcp \
|
||||||
|
file://virtwlans.sh \
|
||||||
|
"
|
||||||
|
|
||||||
SRC_URI_append_ccimx6ul = "\
|
SRC_URI_append_ccimx6ul = "\
|
||||||
file://interfaces.wlan1.static \
|
file://interfaces.wlan1.static \
|
||||||
file://interfaces.wlan1.dhcp \
|
file://interfaces.wlan1.dhcp \
|
||||||
|
|
@ -49,6 +55,28 @@ do_install_append_ccimx6sbc() {
|
||||||
cat ${WORKDIR}/interfaces.br0.example >> ${D}${sysconfdir}/network/interfaces
|
cat ${WORKDIR}/interfaces.br0.example >> ${D}${sysconfdir}/network/interfaces
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_install_append_ccimx6qpsbc() {
|
||||||
|
install -d ${D}${base_bindir}
|
||||||
|
install -m 0755 ${WORKDIR}/virtwlans.sh ${D}${base_bindir}
|
||||||
|
if [ -n "${HAVE_WIFI}" ]; then
|
||||||
|
cat ${WORKDIR}/interfaces.wlan1.${WLAN1_MODE} >> ${D}${sysconfdir}/network/interfaces
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove config entries if corresponding variable is not defined
|
||||||
|
[ -z "${WLAN1_STATIC_DNS}" ] && sed -i -e "/##WLAN1_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces
|
||||||
|
[ -z "${WLAN1_STATIC_GATEWAY}" ] && sed -i -e "/##WLAN1_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces
|
||||||
|
[ -z "${WLAN1_STATIC_IP}" ] && sed -i -e "/##WLAN1_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces
|
||||||
|
[ -z "${WLAN1_STATIC_NETMASK}" ] && sed -i -e "/##WLAN1_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces
|
||||||
|
|
||||||
|
# Replace interface parameters
|
||||||
|
sed -i -e "s,##WLAN1_STATIC_IP##,${WLAN1_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces
|
||||||
|
sed -i -e "s,##WLAN1_STATIC_NETMASK##,${WLAN1_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces
|
||||||
|
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
|
||||||
|
|
||||||
|
cat ${WORKDIR}/interfaces.br0.example >> ${D}${sysconfdir}/network/interfaces
|
||||||
|
}
|
||||||
|
|
||||||
do_install_append_ccimx6ul() {
|
do_install_append_ccimx6ul() {
|
||||||
install -d ${D}${base_bindir}
|
install -d ${D}${base_bindir}
|
||||||
install -m 0755 ${WORKDIR}/virtwlans.sh ${D}${base_bindir}
|
install -m 0755 ${WORKDIR}/virtwlans.sh ${D}${base_bindir}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue