Skip to content
Snippets Groups Projects
Commit 155fd878 authored by Stefan Schmidt's avatar Stefan Schmidt
Browse files

ot-br-posix: Add bbappend to add configuration script


A simple configuration script to set the Thread border router up.
Wrapped into a systemd service to handle execution and service
dependencies.

Signed-off-by: default avatarStefan Schmidt <stefan.schmidt@huawei.com>
parent 2fa2f891
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
set -e
# Bring up a OpenThread border router for the given configuration
ot-ctl thread stop
ot-ctl ifconfig down
ot-ctl dataset clear
ot-ctl dataset init new
ot-ctl dataset panid 0x1357
ot-ctl dataset extpanid 11112222deadbeef
ot-ctl dataset networkname "ASOS\ Thread"
ot-ctl dataset channel 26
ot-ctl dataset masterkey 00112233445566778899aabbccddeeff
ot-ctl dataset commit active
ot-ctl ifconfig up
ot-ctl thread start
#ot-ctl prefix add 2001::/64 paros
#ot-ctl prefix add fd11:22::/64 pasor
#ot-ctl dataset meshlocalprefix fdde:00be:ef00:aaaa::
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[Unit]
Description=OpenThread Border Router Configuration
ConditionPathExists=/usr/sbin/otbr-configuration
After=sys-subsystem-net-devices-wpan0.device
BindsTo=sys-subsystem-net-devices-wpan0.device
[Service]
Type=oneshot
ExecStart=/usr/sbin/otbr-configuration
FILESEXTRAPATHS_prepend := "${THISDIR}/ot-br-posix:"
SRC_URI_append = "file://60-otbr-ip-forward.conf"
SRC_URI_append = " \
file://60-otbr-ip-forward.conf \
file://otbr-configuration \
file://otbr-configuration.service \
"
do_install_append() {
install -d ${D}${sysconfdir}/sysctl.d/
install -m 0644 ${WORKDIR}/60-otbr-ip-forward.conf ${D}${sysconfdir}/sysctl.d/
install -D ${WORKDIR}/otbr-configuration ${D}${sbindir}/
install -D -m 0644 ${WORKDIR}/otbr-configuration.service ${D}${systemd_unitdir}/system/
}
SYSTEMD_SERVICE_${PN} += " otbr-configuration.service"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment