Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

README.md: add howto build RDKB (OE 3.1) with prplMesh for TurrisOmnia #24

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 106 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down Expand Up @@ -59,3 +162,4 @@ runqemu tmp/deploy/images/qemux86-64 nographic
```
/opt/prplmesh/scripts/prplmesh_utils.sh status
```

13 changes: 12 additions & 1 deletion recipes-connectivity/prplmesh/prplmesh.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we just overwrite BEEROCKS_HOSTAP_WLAN1_CTRL_IFACE and it can cause the problems in other platforms...

BEEROCKS_HOSTAP_WLAN2_CTRL_IFACE="/var/run/hostapd/wifi1"
BEEROCKS_HOSTAP_WLAN3_CTRL_IFACE="/var/run/hostapd/wifi2"
Comment on lines +56 to +58
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "_turris" suffix

#
# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/framework/platform/bpl/CMakeLists.txt b/framework/platform/bpl/CMakeLists.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this patch? I think better to create PR in prplmesh project.

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;
}