diff --git a/README.md b/README.md index 0e78594..f47f582 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,92 @@ This code is subject to the terms of the BSD+Patent license. See LICENSE file for more details. --> -## HOWTO build Yocto Poky 2.2 +# RDKB (OE 2.2) + +## Raspberry Pi 3 B+ + +### HOWTO build + +> Based on [official RDK build manual](https://wiki.rdkcentral.com/pages/viewpage.action?pageId=71011616#RDK-B(RaspberryPi3B+)BuildandSetupManual-RouterProfile-BuildInstructions) + +* Fetch sources +``` +repo init -u https://code.rdkcentral.com/r/manifests -b rdk-next -m rdkb-extsrc.xml +repo sync -j4 --no-clone-bundle +``` + +* Fetch meta-prplmesh +``` +git clone -b rdk-next https://github.com/prplfoundation/meta-prplmesh +``` + +* Source build env +``` +MACHINE=raspberrypi-rdk-broadband source meta-cmf-raspberrypi/setup-environment +``` + +* Append to file `conf/bblayers.conf` +``` +BBLAYERS =+ "${RDKROOT}/meta-prplmesh" +``` + +* Run image build +``` +bitbake rdk-generic-broadband-image +``` + +### HOWTO run + +* Run on board after boot +``` +hostapd -B /usr/ccsp/wifi/hostapd0.conf +/opt/prplmesh/scripts/prplmesh_utils.sh start +``` +* Check status +``` +/opt/prplmesh/scripts/prplmesh_utils.sh status +``` + +# RDKB (OE 3.1) + +## Turris Omnia + +Based on [RDK Central Wiki](https://wiki.rdkcentral.com/display/RDK/Yocto-3.1+rdk-generic-broadband-image+Turris+Omnia) + +## HOWTO build + +* Fetch sources +``` +repo init -u https://code.rdkcentral.com/r/manifests -m rdkb-turris-extsrc.xml -b yocto-dunfell-upgrade +repo sync -j4 --no-clone-bundle +``` + +* Fetch meta-prplmesh +``` +git clone -b master https://github.com/prplfoundation/meta-prplmesh +``` + +* Source build env +``` +MACHINE=turris source meta-turris/setup-environment +``` + +* Append to file `conf/bblayers.conf` +``` +BBLAYERS =+ "${RDKROOT}/meta-prplmesh" +``` + +* Run image build +``` +bitbake core-image-minimal +bitbake rdk-generic-broadband-image +``` + +# Yocto Poky 2.2 (Morty) + +## QEMU + +### HOWTO build * fetch sources ``` @@ -24,7 +109,25 @@ TEMPLATECONF=../meta-prplmesh/conf/poky source oe-init-build-env bitbake core-image-minimal ``` -## HOWTO build Yocto Poky 3.1 +### HOWTO run + +* Run QEMU by command +``` +runqemu tmp/deploy/images/qemux86-64 nographic +``` +* Login as "root" (no password) +* Run prplmesh inside +``` +/opt/prplmesh/scripts/prplmesh_utils.sh -p -v -D eth0 -C eth0 start +``` +* Check status +``` +/opt/prplmesh/scripts/prplmesh_utils.sh status +``` + +# Yocto Poky 3.1 Dunfell + +## HOWTO build * fetch sources ``` @@ -59,3 +162,4 @@ runqemu tmp/deploy/images/qemux86-64 nographic ``` /opt/prplmesh/scripts/prplmesh_utils.sh status ``` + diff --git a/recipes-connectivity/prplmesh/prplmesh.bb b/recipes-connectivity/prplmesh/prplmesh.bb index 4251098..9bb231c 100644 --- a/recipes-connectivity/prplmesh/prplmesh.bb +++ b/recipes-connectivity/prplmesh/prplmesh.bb @@ -18,6 +18,7 @@ RDEPENDS_${PN} = "iproute2 busybox" SRCREV = "d55b727b52158d46b3a0263734445ac29116220f" SRC_URI = "git://github.com/prplfoundation/prplMesh.git;protocol=http;branch=master \ + file://001-bpl-cfg-explicit-wlan-iface-names.patch \ " PACKAGECONFIG ??= "${BWL_TYPE} ${MSGLIB}" @@ -45,12 +46,22 @@ BEEROCKS_WLAN1_IFACE_raspberrypi-rdk-broadband = "wlan0" BEEROCKS_WLAN2_IFACE_raspberrypi-rdk-broadband = "wlan1" BEEROCKS_HOSTAP_WLAN1_CTRL_IFACE_raspberrypi-rdk-broadband="/var/run/hostapd0/wlan0" BEEROCKS_HOSTAP_WLAN2_CTRL_IFACE_raspberrypi-rdk-broadband="/var/run/hostapd4/wlan1" -BEEROCKS_BH_WIRE_IFACE_raspberrypi-rdk-broadband = "erouter0" +# +# Turris Omnia machine specific +# +BEEROCKS_WLAN1_IFACE_turris = "wifi0" +BEEROCKS_WLAN2_IFACE_turris = "wifi1" +BEEROCKS_WLAN3_IFACE_turris = "wifi2" + +BEEROCKS_HOSTAP_WLAN1_CTRL_IFACE="/var/run/hostapd/wifi0" +BEEROCKS_HOSTAP_WLAN2_CTRL_IFACE="/var/run/hostapd/wifi1" +BEEROCKS_HOSTAP_WLAN3_CTRL_IFACE="/var/run/hostapd/wifi2" # # RDKB specific # "ZeroMG" has incompatible license for RDKB so use NNG MSGLIB_rdk ?= "mq-nng" +BEEROCKS_BH_WIRE_IFACE_rdk = "erouter0" BEEROCKS_BRIDGE_IFACE_rdk ?= "brlan0" # # FIXME: There is a bug in script printing status diff --git a/recipes-connectivity/prplmesh/prplmesh/001-bpl-cfg-explicit-wlan-iface-names.patch b/recipes-connectivity/prplmesh/prplmesh/001-bpl-cfg-explicit-wlan-iface-names.patch new file mode 100644 index 0000000..4b79545 --- /dev/null +++ b/recipes-connectivity/prplmesh/prplmesh/001-bpl-cfg-explicit-wlan-iface-names.patch @@ -0,0 +1,45 @@ +diff --git a/framework/platform/bpl/CMakeLists.txt b/framework/platform/bpl/CMakeLists.txt +index 3fe9d810..9b34a584 100644 +--- a/framework/platform/bpl/CMakeLists.txt ++++ b/framework/platform/bpl/CMakeLists.txt +@@ -25,6 +25,12 @@ set(BEEROCKS_WPA_SUPPLICANT_WLAN3_CTRL_IFACE "/var/run/wpa_supplicant/${BEEROCKS + # Add prplmesh_platform_db config generation + add_subdirectory(platform_db) + ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/linux/bpl_cfg.cpp.in" ++ "${CMAKE_CURRENT_SOURCE_DIR}/linux/bpl_cfg.cpp" ++ ) ++ ++ + # OpenWRT + if (TARGET_PLATFORM STREQUAL "openwrt") + +diff --git a/framework/platform/bpl/linux/bpl_cfg.cpp b/framework/platform/bpl/linux/bpl_cfg.cpp.in +similarity index 97% +rename from framework/platform/bpl/linux/bpl_cfg.cpp +rename to framework/platform/bpl/linux/bpl_cfg.cpp.in +index 93975c38..9d4711d4 100644 +--- a/framework/platform/bpl/linux/bpl_cfg.cpp ++++ b/framework/platform/bpl/linux/bpl_cfg.cpp.in +@@ -296,11 +296,15 @@ int cfg_get_hostap_iface(int32_t radio_num, char hostap_iface[BPL_IFNAME_LEN]) + return RETURN_ERR; + } + +- // the linux implementation expects to receive "wlanX" for interface names where the X is: +- // 0,2 for Linux-PC +- // 0,1 for Turris-Omnia and GLInet +- // we return 0,1,2 and the upper layer filters the non-supported interface +- std::string iface_str("wlan" + std::to_string(radio_num)); ++ std::string iface_str; ++ switch (radio_num) { ++ case 0: iface_str = "@BEEROCKS_WLAN1_IFACE@"; break; ++ case 1: iface_str = "@BEEROCKS_WLAN2_IFACE@"; break; ++ case 2: iface_str = "@BEEROCKS_WLAN3_IFACE@"; break; ++ default: ++ MAPF_ERR("cfg_get_hostap_iface: unknown iface index: " + std::to_string(radio_num)); ++ return RETURN_ERR; ++ } + mapf::utils::copy_string(hostap_iface, iface_str.c_str(), BPL_IFNAME_LEN); + return RETURN_OK; + }