< # CONFIG_BATMAN_ADV --- > CONFIG_BATMAN_ADV=m > CONFIG_BATMAN_ADV_BLA=y > CONFIG_BATMAN_ADV_DAT=y > CONFIG_BATMAN_ADV_NC=y > # CONFIG_BATMAN_ADV_DEBUG
mkdir -p device-software/meta-edison-distro/recipes-support/batman/ cat > device-software/meta-edison-distro/recipes-support/batman/batctl_2014.4.0.bb <<EOF DESCRIPTION = "Control application for BATMAN routing protocol kernel module for multi-hop ad-hoc mesh networks." HOMEPAGE = "http://www.open-mesh.net/" SECTION = "console/network" PRIORITY = "optional" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://../license-destdir/${PN}/generic_GPLv2;md5=801f80980d171dd6425610833a22dbe6" RDEPENDS_${PN} = "kernel-module-batman-adv" DEPENDS = "libnl" SRC_URI = "http://downloads.open-mesh.net/batman/stable/sources/batctl/batctl-${PV}.tar.gz\ file://patch.patch" SRC_URI[md5sum] = "f3a14565699313258ee6ba3de783eb0a" SRC_URI[sha256sum] = "77509ed70232ebc0b73e2fa9471ae13b12d6547d167dda0a82f7a7fad7252c36" EXTRA_OEMAKE = 'STAGING_INC="${STAGING_INC}"' do_compile() { oe_runmake } do_install() { install -d ${D}${bindir} install -m 0755 batctl ${D}${bindir} } EOF
mkdir -p device-software/meta-edison-distro/recipes-support/batman/files cat > device-software/meta-edison-distro/recipes-support/batman/files/patch.patch <<EOF --- a/Makefile 2015-02-27 09:10:45.768409932 +0100 +++ b/Makefile 2015-02-27 09:11:32.710554513 +0100 @@ -29,7 +29,7 @@ MANPAGE = man/batctl.8 # batctl flags and options -CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP +CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP –I${STAGING_INC}/libnl3 CPPFLAGS += -D_GNU_SOURCE LDLIBS += -lm EOF
bitbake batctl
root@edison:~/ # modprobe batman-adv
root@edison:~/ # modinfo batman-adv filename: /lib/modules/3.10.17-poky-edison+/kernel/net/batman-adv/batman-adv.ko version: 2013.2.0 description: BATMAN advanced author: Marek Lindner <lindner_marek@yahoo.de>, Simon Wunderlich <siwu@hrz.tu-chemnitz.de> license: GPL srcversion: 66711903985B5CAAE0DAF30 depends: intree: Y vermagic: 3.10.17-poky-edison+ SMP preempt mod_unload ATOM
root@edison:~/ # batctl if add enp0s17u1 root@edison:~/ # batctl if enp0s17u1: active root@edison:~/ # batctl s tx: 6 tx_bytes: 468 tx_dropped: 0 rx: 1 rx_bytes: 42 forward: 0 forward_bytes: 0 mgmt_tx: 60 mgmt_tx_bytes: 2428 mgmt_rx: 0 mgmt_rx_bytes: 0 tt_request_tx: 0 tt_request_rx: 0 tt_response_tx: 0 tt_response_rx: 0 tt_roam_adv_tx: 0 tt_roam_adv_rx: 0 dat_get_tx: 0 dat_get_rx: 0 dat_put_tx: 0 dat_put_rx: 0 dat_cached_reply_tx: 0 nc_code: 0 nc_code_bytes: 0 nc_recode: 0 nc_recode_bytes: 0 nc_buffer: 0 nc_decode: 0 nc_decode_bytes: 0 nc_decode_failed: 0 nc_sniffed: 0 # ifconfig bat0 bat0 Link encap:Ethernet HWaddr 52:78:97:51:ba:9d inet6 addr: fe80::5078:97ff:fe51:ba9d/64 Scope:Link UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1 RX packets:1 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:42 (42.0 B) TX bytes:468 (468.0 B)
Source: https://habr.com/ru/post/267817/
All Articles