[OpenWrt-Devel] [PATCH v5] ramips: add support for JS76x8 series DEV boards

2019-11-04 Thread Robinson Wu
This commit adds support for the ZhuoTK JS76x8 series development boards. These devices have the following specifications: - SOC: MT7628AN/NN, MT7688AN, MT7628DAN - RAM of MT7628AN/NN and MT7688AN: 64/128/256 MB (DDR2) - RAM of MT7628DAN: 64 MB (DDR2) - FLASH:8/16/32 MB (SPI NOR) - Ethernet:3x 10/

Re: [OpenWrt-Devel] [PATCH uci 18/18] lua: fix error handling

2019-11-04 Thread Rosen Penev
On Mon, Nov 4, 2019 at 4:40 PM Petr Štetiar wrote: > > scan-build from clang version 9 has reported following issues: Note that CMake has integrated clang-tidy support. It supports all the clang-analyzer stuff and more. > > uci.c:389:3: warning: Value stored to 'err' is never read >

[OpenWrt-Devel] [PATCH uci 12/18] tests: add cram based unit tests

2019-11-04 Thread Petr Štetiar
I find them more flexible then shunit2 ones. Signed-off-by: Petr Štetiar --- .gitignore| 3 ++ tests/CMakeLists.txt | 1 + tests/cram/CMakeLists.txt | 21 ++ tests/cram/config/network | 25 + tests/cram/lua/basic.lua | 44 ++

[OpenWrt-Devel] [PATCH uci 15/18] cli: remove unused variable assigment

2019-11-04 Thread Petr Štetiar
scan-build from clang version 9 has reported following issue: cli.c:574:8: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' if ((ret = uci_parse_argument(ctx, input, &str, &argv[i])) != UCI_OK) {

[OpenWrt-Devel] [PATCH uci 16/18] delta: prevent possible null pointer use

2019-11-04 Thread Petr Štetiar
scan-build from clang version 9 has reported following issue: delta.c:39:13: warning: Null pointer passed to 1st parameter expecting 'nonnull' int size = strlen(section) + 1; ^~~ Signed-off-by: Petr Štetiar --- delta.c | 2 +- 1 file changed, 1 insertion

[OpenWrt-Devel] [PATCH uci 18/18] lua: fix error handling

2019-11-04 Thread Petr Štetiar
scan-build from clang version 9 has reported following issues: uci.c:389:3: warning: Value stored to 'err' is never read err = UCI_ERR_INVAL; ^ ~ uci.c:393:3: warning: Value stored to 'err' is never read err = UCI_ERR_NOTFOUND;

[OpenWrt-Devel] [PATCH uci 09/18] iron out all extra compiler warnings

2019-11-04 Thread Petr Štetiar
gcc 9.1 on x86/64 has reported following issues: list.c:140:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:572:51: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:850:15: error: comparison bet

[OpenWrt-Devel] [PATCH uci 13/18] lua: fix memory leak in changes method

2019-11-04 Thread Petr Štetiar
Configs returned by uci_list_configs call are not freed when not needed, leading to the memory leak. While at it make the code cleaner. Signed-off-by: Petr Štetiar --- lua/uci.c | 15 --- tests/cram/lua/test_cases/changes_doesnt_leak.lua | 11 +

[OpenWrt-Devel] [PATCH uci 14/18] lua: fix memory leak in set method

2019-11-04 Thread Petr Štetiar
scan-build from clang version 9 has reported following issue: uci.c:624:12: warning: Potential leak of memory pointed to by 's' return luaL_error(L, "Cannot set an uci option to an empty table value"); ^~ valgrind confirmed it on the supplied test case: ==31013== 8

[OpenWrt-Devel] [PATCH uci 08/18] tests: shunit2: run all tests under Valgrind by default

2019-11-04 Thread Petr Štetiar
The more tests, the better. Signed-off-by: Petr Štetiar --- tests/shunit2/tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/shunit2/tests.sh b/tests/shunit2/tests.sh index 72c48749feb6..00f56c5e3195 100755 --- a/tests/shunit2/tests.sh +++ b/tests/shunit2/tests.sh @@ -11,6 +11,

[OpenWrt-Devel] [PATCH uci 17/18] ucimap: fix possible use of memory after it is freed

2019-11-04 Thread Petr Štetiar
scan-build from clang version 9 has reported following issue: ucimap.c:710:8: warning: Use of memory after it is freed err = ucimap_parse_options(map, sm, sd, s); ^~~~ Signed-off-by: Petr Štetiar --- ucimap.c | 15 +++ 1 file ch

[OpenWrt-Devel] [PATCH uci 06/18] cmake: build Lua module only if enabled

2019-11-04 Thread Petr Štetiar
Makes the resulting lua/CMakeLists.txt file simpler. Signed-off-by: Petr Štetiar --- CMakeLists.txt | 4 +++- lua/CMakeLists.txt | 32 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2559b1ec1507..0bbd3b

[OpenWrt-Devel] [PATCH uci 10/18] cli: fix realloc issue spotted by cppcheck

2019-11-04 Thread Petr Štetiar
Cppcheck 1.90 dev reports following: cli.c:117:4: error: Common realloc mistake: 'typestr' nulled but not freed upon failure [memleakOnRealloc] typestr = realloc(typestr, maxlen); ^ Signed-off-by: Petr Štetiar --- cli.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-)

[OpenWrt-Devel] [PATCH uci 11/18] lua: fix copy&paste in error string

2019-11-04 Thread Petr Štetiar
When uci_set_confdir fails we should say so. Signed-off-by: Petr Štetiar --- lua/uci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/uci.c b/lua/uci.c index f4dce89b7c9f..323f81a68c17 100644 --- a/lua/uci.c +++ b/lua/uci.c @@ -1006,7 +1006,7 @@ uci_lua_cursor(lua_State

[OpenWrt-Devel] [PATCH uci 05/18] tests: shunit2: fix issues reported by shellcheck

2019-11-04 Thread Petr Štetiar
In tests.sh line 10: [ -x $UCI_BIN ] || { ^--^ SC2086: Double quote to prevent globbing and word splitting. In tests.sh line 63: for suite in $(ls ${SCRIPTS_DIR}/*) ^^ SC2045: Iterating over ls output is fragile. Use globs. In tests.sh line 65:

[OpenWrt-Devel] [PATCH uci 07/18] cmake: enable extra compiler checks

2019-11-04 Thread Petr Štetiar
Let's enforce additional automatic checks enforced by the compiler in order to catch possible errors during compilation. Signed-off-by: Petr Štetiar --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bbd3b2046ec..92adf4

[OpenWrt-Devel] [PATCH uci 03/18] tests: shunit2: make it working under CMake

2019-11-04 Thread Petr Štetiar
uci is being passed from CMake as environment variable. Signed-off-by: Petr Štetiar --- tests/shunit2/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 tests/shunit2/tests.sh diff --git a/tests/shunit2/tests.sh b/tests/shunit2/tests.sh old mode 100644

[OpenWrt-Devel] [PATCH uci 01/18] test: move shunit2 tests under standalone subdirectory

2019-11-04 Thread Petr Štetiar
So we could start adding other tests as well. While at it rename the parent directory from test to the more common tests name. Signed-off-by: Petr Štetiar --- .gitignore | 2 +- {test => tests/shunit2}/Makefile|

[OpenWrt-Devel] [PATCH uci 00/18] fixes and improvements

2019-11-04 Thread Petr Štetiar
Hi, while working on possible test case for CVE-2019-15513, I've made uci compile with -Wextra flags (needs Hauke's PW#1188122[1] patch), tried to make clang/cppcheck static code analyzers happy, fixed some memleaks in Lua module, integrated shunit2 tests in CMake and run them under valgrind by de

[OpenWrt-Devel] [PATCH uci 02/18] cmake: add unit testing option and shunit2 tests

2019-11-04 Thread Petr Štetiar
For convenient tests invocation. Signed-off-by: Petr Štetiar --- CMakeLists.txt | 5 + tests/CMakeLists.txt | 1 + tests/shunit2/CMakeLists.txt | 7 +++ 3 files changed, 13 insertions(+) create mode 100644 tests/CMakeLists.txt create mode 100644 tests/shunit2/CMak

[OpenWrt-Devel] [PATCH uci 04/18] add initial GitLab CI support

2019-11-04 Thread Petr Štetiar
Uses currently proof-of-concept openwrt-ci[1] in order to: * improve the quality of the codebase in various areas * decrease code review time and help merging contributions faster * get automagic feedback loop on various platforms and tools - out of tree build with OpenWrt SDK on following t

Re: [OpenWrt-Devel] [PATCH uci 2/2] build: Add -Wclobbered to detect problems with longjmp

2019-11-04 Thread Petr Štetiar
Hi, Hauke Mehrtens [2019-11-01 17:06:34]: > +ADD_DEFINITIONS(-Os -Wall -Werror -Wclobbered --std=gnu99 -g3 -I. > -DUCI_PREFIX="${CMAKE_INSTALL_PREFIX}") is there any reason to not use -Wextra directly? list.c:140:11: error: comparison between signed and unsigned integer expressions [-Werror

[OpenWrt-Devel] [PATCH 0/3] Further preparations for USB gadget usage

2019-11-04 Thread Michael Heimpold
This patch series bundles some more steps towards the usage of I2SE Duckbills as USB gadget devices. Michael Heimpold (3): procd: start additional consoles during hotplugging mxs: switch to askconsole mxs: start a console on USB gadget serial ports package/system/procd/Makefile |

[OpenWrt-Devel] [PATCH 3/3] mxs: start a console on USB gadget serial ports

2019-11-04 Thread Michael Heimpold
The I2SE Duckbill devices are pen-drive like and thus the usage of the USB gadget subsystem is highly indicated. Spawning a console if a serial gadget is configured saves us from connecting a physical debug uart. On Olimex OLinuXino Maxi/Mini boards, this does not hurt. Signed-off-by: Michael He

[OpenWrt-Devel] [PATCH 1/3] procd: start additional consoles during hotplugging

2019-11-04 Thread Michael Heimpold
Now that 'start-console' procd command has reached the main repo, we can add a rule to start consoles on serial devices which are created when USB gadget driver reports creation with hotplugging. Signed-off-by: Michael Heimpold --- package/system/procd/Makefile | 2 +- package/system/p

[OpenWrt-Devel] [PATCH 2/3] mxs: switch to askconsole

2019-11-04 Thread Michael Heimpold
Remove the dedicated tty name and use askconsole to spawn the console on serial debug uart. Signed-off-by: Michael Heimpold --- target/linux/mxs/base-files/etc/inittab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mxs/base-files/etc/inittab b/target/linux/mxs/

[OpenWrt-Devel] [PATCH] uboot-mxs: bump to v2019.10

2019-11-04 Thread Michael Heimpold
Also update the U-Boot BSP patch for I2SE Duckbill devices. Run tested on I2SE Duckbill and Olimex OLinuXino Maxi boards. Signed-off-by: Michael Heimpold --- Superseeds my patch to upgrade to v2019.07. package/boot/uboot-mxs/Makefile | 4 ++-- .../patches/001-add-i2se-duckbi

[OpenWrt-Devel] [PATCH RESEND] mxs: add support and switch to kernel 4.19

2019-11-04 Thread Michael Heimpold
Also remove kernel 4.14 support and the meanwhile obsolete patch. This was run-tested on I2SE Duckbill device and Olimex OLinuXino Maxi board. Signed-off-by: Michael Heimpold --- target/linux/mxs/Makefile | 2 +- target/linux/mxs/{config-4.14 => config-4.19} | 42 +++---

[OpenWrt-Devel] [PATCH v2] build: unify SIGNATURE and make it reproducible

2019-11-04 Thread Paul Spooren
The SIGNATURE variable is a unique ID used as partition identifier for x86, tegra and mvebu. This patch unifies the generation of SIGNATURE by creating it once in include/image.mk instead differently for each target. Also make it reproducible by using SOURCE_DATE_EPOCH, resulting in equal SIGNATUR

[OpenWrt-Devel] [PATCH v3 2/2] base-files: rename hostname with EUI of mac address

2019-11-04 Thread Adrian Schmutzler
From: Rosy Song If a label MAC address is provided for device, system will rename the hostname with OpenWrt_{eui mac address}. This helps to distinguish between different devices. Since it's no good idea to nest json_* functions, this code does not use get_mac_label directly, but only get_mac_la

[OpenWrt-Devel] [PATCH v3 1/2] base-files: don't store label MAC address in uci system config

2019-11-04 Thread Adrian Schmutzler
If set, label MAC address is available from one of two sources, device tree or board.json. So far, the function get_mac_label was meant for retrieving the address, while an option in uci system config was specified only for case 2 (board.json). The uci config option has several drawbacks: - it is

Re: [OpenWrt-Devel] [PATCH] ath79: add D-Link DIR-615 rev. E4

2019-11-04 Thread Paul Fertser
On Mon, Nov 04, 2019 at 05:16:15PM +0100, Adrian Schmutzler wrote: > > + power_green: power_green { > > + label = "d-link:green:power"; > > It's policy to use boardname instead of "d-link" here, except for tplink as > far as I know. But in this case there're three oth

Re: [OpenWrt-Devel] [PATCH uci 2/2] build: Add -Wclobbered to detect problems with longjmp

2019-11-04 Thread Hauke Mehrtens
On 11/4/19 4:29 AM, Yousong Zhou wrote: > Hi Hauke > > On Sat, 2 Nov 2019 at 00:07, Hauke Mehrtens wrote: >> >> When we jump back to a save point in UCI_THROW() with longjmp all the >> registers will be reset to the old values when we called UCI_TRAP_SAVE() >> last time, but the memory is not res

[OpenWrt-Devel] New ath10k-ct firmware available

2019-11-04 Thread Ben Greear
Please see new file names and checksums below: 988x 3b2c584f7070c3e286ce27a370cc181d70b45f9cdaa462fb4f44c6c20d2ee8c1 firmware-2-ct-full-community-22.bin.lede.012 a7042b2c90de82b21e87f243411b6fb12142bb4fb28266ea92cdf3101557b6de firmware-2-ct-full-htt-mgt-community-22.bin.lede.012 /home/greearb

Re: [OpenWrt-Devel] [PATCH v4] ramips: add support for JS76x8 series DEV boards

2019-11-04 Thread Adrian Schmutzler
Hi, there has been a split of the board.d files in ramips target towards the subtargets, so you would have to rebase onto that. (Put your definitions into mt76x8/base-files/etc/board.d/0x... instead of base-files/etc/board.d/0x...). Despite, two additional comments below. > diff --git a/target

Re: [OpenWrt-Devel] [PATCH] ath79: add D-Link DIR-615 rev. E4

2019-11-04 Thread Paul Fertser
Hello, Thank you for the review indeed! On Mon, Nov 04, 2019 at 05:16:15PM +0100, Adrian Schmutzler wrote: > > + power_green: power_green { > > + label = "d-link:green:power"; > > It's policy to use boardname instead of "d-link" here, except for tplink as > far as I

Re: [OpenWrt-Devel] [PATCH] ath79: add D-Link DIR-615 rev. E4

2019-11-04 Thread Adrian Schmutzler
Hi, > > + dlink,dir-615-e4) > > + caldata_extract "art" 0x1000 0x1000 > > + ath9k_patch_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") > 0x10c > > lan mac seems to be used for wlan as is (without +1/-1) by ar71xx > code. That's not uncommon, however you'll only know for sur

Re: [OpenWrt-Devel] [PATCH] ath79: add D-Link DIR-615 rev. E4

2019-11-04 Thread Adrian Schmutzler
Hi, > diff --git a/target/linux/ath79/dts/ar7240_dlink_dir-600-a1.dtsi > b/target/linux/ath79/dts/ar7240_dlink_dir-600-a1.dtsi > new file mode 100644 > index 00..e6206f6f42 > --- /dev/null > +++ b/target/linux/ath79/dts/ar7240_dlink_dir-600-a1.dtsi > @@ -0,0 +1,173 @@ > +// SPDX-License-Id

Re: [OpenWrt-Devel] [PATCH v2 1/2] base-files: always store label MAC address in uci system config

2019-11-04 Thread Kristian Evensen
Hi, On Mon, Nov 4, 2019 at 4:36 PM Adrian Schmutzler wrote: > However, I'm not aware of a case where board.json is used for anything else > than setting up config files, like in a script with user-interaction etc. While I agree that those are the most common use-cases for board.json, board.json

Re: [OpenWrt-Devel] [PATCH v2 1/2] base-files: always store label MAC address in uci system config

2019-11-04 Thread Adrian Schmutzler
Hi, > -Original Message- > From: Kristian Evensen [mailto:kristian.even...@gmail.com] > Sent: Montag, 4. November 2019 14:57 > To: Adrian Schmutzler > Cc: OpenWrt Development List > Subject: Re: [OpenWrt-Devel] [PATCH v2 1/2] base-files: always store label MAC > address in uci system con

Re: [OpenWrt-Devel] [PATCH v3 2/2] ramips: Add support for ZBT WE1026-H

2019-11-04 Thread Kristian Evensen
Hi, On Sun, Nov 3, 2019 at 3:14 PM wrote: > Okay, if it's not visible I do not think it's worth to deviate from normal > procedure here. > > I've remove the power_led label and aliases. > > Feel free to test and provide an updated solution for the use as USB LED. > > Despite, note that the first

Re: [OpenWrt-Devel] [PATCH v2 1/2] base-files: always store label MAC address in uci system config

2019-11-04 Thread Kristian Evensen
Hi Adrian, On Mon, Nov 4, 2019 at 11:44 AM Adrian Schmutzler wrote: > > If set, label MAC address is available from one of two sources, > device tree or board.json. So far, the function get_mac_label > was meant for retrieving the address, while an option in uci > system config was specified only

[OpenWrt-Devel] [PATCH] ipset: update to 7.4

2019-11-04 Thread DENG Qingfang
Signed-off-by: DENG Qingfang --- package/network/utils/ipset/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 2cb6ec981e..0bab21a12f 100644 --- a/package/network/utils/ipset/Makefile

Re: [OpenWrt-Devel] [PATCH] x86: generate reproducible UUID

2019-11-04 Thread Petr Štetiar
On November 4, 2019 4:02:07 AM UTC, Yousong Zhou wrote: >On Mon, 4 Nov 2019 at 07:47, Paul Spooren wrote: >> >> -SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0x))') >> +SIGNATURE:=$(shell echo "$(SOURCE_DATE_EPOCH)" | sha256sum | cut -c >1-8 -z) > >Maybe just unify with other targets s

[OpenWrt-Devel] [PATCH v2 2/2] base-files: rename hostname with EUI of mac address

2019-11-04 Thread Adrian Schmutzler
From: Rosy Song If a label MAC address is provided for device, system will rename the hostname with OpenWrt_{eui mac address}. This helps to distinguish between different devices. Signed-off-by: Rosy Song [merged with commit introducing macaddr_geteui, rebased on updated label MAC address stora

[OpenWrt-Devel] [PATCH v2 1/2] base-files: always store label MAC address in uci system config

2019-11-04 Thread Adrian Schmutzler
If set, label MAC address is available from one of two sources, device tree or board.json. So far, the function get_mac_label was meant for retrieving the address, while an option in uci system config was specified only for case 2 (board.json). Since this has been perceived as counter-intuitive, t

[OpenWrt-Devel] [PATCH] busybox: support output new-linux model for arp

2019-11-04 Thread daxiong
Compatible with the output of net-tools. Using new-linux model by default. arp -n: Address HWtype HWaddress Flags Mask Iface 192.168.1.1 ether 00:11:22:33:44:55 C eth1 arp -an: ? (192.168.1.1) at 00:11:22:33:44:55