[OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Petr Štetiar
Currently minimal GNU supported GCC version is 7 (from May 2, 2017), buildbots
are using default GCC version 6 on Debian 9 (old stable), current Debian
stable 10 has GCC version 8.

Signed-off-by: Petr Štetiar 
---

While adding CI support in C based projects, I've started adding -Wextra as
well, which seems to work just fine for gcc6+, but it's apparently causing
issues with older GCCs like for example gcc 4.8.5[1] on CentOS 7.

Although it's certainly possible to fix those issues and make gcc 4 usable, I
think, that it's not worth the additional effort and resources anymore.

1. 
https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b

 README  |  2 +-
 include/prereq-build.mk | 18 --
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/README b/README
index c867c1fa4da8..6d11dd1188ff 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX 
system (case
 sensitive filesystem required). Cygwin is unsupported because of the lack
 of a case sensitive file system.
 
-You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff,
+You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
diff,
 unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
 
 1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 4c5991005634..58cbc0678fa1 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -27,12 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
umask | grep -xE 0?0[012][012]))
 
 $(eval $(call SetupHostCommand,gcc, \
-   Please install the GNU C Compiler (gcc) 4.8 or later, \
-   $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc48 --version | grep gcc, \
-   gcc49 --version | grep gcc, \
-   gcc5 --version | grep gcc, \
+   Please install the GNU C Compiler (gcc) 6 or later, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
@@ -40,18 +35,13 @@ $(eval $(call SetupHostCommand,gcc, \
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-gcc, \
-   \nPlease reinstall the GNU C Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
gcc -x c -o $(TMP_DIR)/a.out -))
 
 $(eval $(call SetupHostCommand,g++, \
-   Please install the GNU C++ Compiler (g++) 4.8 or later, \
-   $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++48 --version | grep g++, \
-   g++49 --version | grep g++, \
-   g++5 --version | grep g++, \
+   Please install the GNU C++ Compiler (g++) 6 or later, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
@@ -59,7 +49,7 @@ $(eval $(call SetupHostCommand,g++, \
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-g++, \
-   \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C++ Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Paul Spooren
Looks good to me, I ran into this issue before and would appreciate 
moving forward to 6.


On 11/11/19 10:16 PM, Petr Štetiar wrote:

Currently minimal GNU supported GCC version is 7 (from May 2, 2017), buildbots
are using default GCC version 6 on Debian 9 (old stable), current Debian
stable 10 has GCC version 8.

Signed-off-by: Petr Štetiar 
---

While adding CI support in C based projects, I've started adding -Wextra as
well, which seems to work just fine for gcc6+, but it's apparently causing
issues with older GCCs like for example gcc 4.8.5[1] on CentOS 7.

Although it's certainly possible to fix those issues and make gcc 4 usable, I
think, that it's not worth the additional effort and resources anymore.

1. 
https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b

  README  |  2 +-
  include/prereq-build.mk | 18 --
  2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/README b/README
index c867c1fa4da8..6d11dd1188ff 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX 
system (case
  sensitive filesystem required). Cygwin is unsupported because of the lack
  of a case sensitive file system.
  
-You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff,

+You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
diff,
  unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
  
  1. Run "./scripts/feeds update -a" to obtain all the latest package definitions

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 4c5991005634..58cbc0678fa1 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -27,12 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
umask | grep -xE 0?0[012][012]))
  
  $(eval $(call SetupHostCommand,gcc, \

-   Please install the GNU C Compiler (gcc) 4.8 or later, \
-   $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc48 --version | grep gcc, \
-   gcc49 --version | grep gcc, \
-   gcc5 --version | grep gcc, \
+   Please install the GNU C Compiler (gcc) 6 or later, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
@@ -40,18 +35,13 @@ $(eval $(call SetupHostCommand,gcc, \
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
  
  $(eval $(call TestHostCommand,working-gcc, \

-   \nPlease reinstall the GNU C Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
gcc -x c -o $(TMP_DIR)/a.out -))
  
  $(eval $(call SetupHostCommand,g++, \

-   Please install the GNU C++ Compiler (g++) 4.8 or later, \
-   $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++48 --version | grep g++, \
-   g++49 --version | grep g++, \
-   g++5 --version | grep g++, \
+   Please install the GNU C++ Compiler (g++) 6 or later, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
@@ -59,7 +49,7 @@ $(eval $(call SetupHostCommand,g++, \
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
  
  $(eval $(call TestHostCommand,working-g++, \

-   \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C++ Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Yousong Zhou
On Tue, 12 Nov 2019 at 16:16, Petr Štetiar  wrote:
>
> Currently minimal GNU supported GCC version is 7 (from May 2, 2017), buildbots
> are using default GCC version 6 on Debian 9 (old stable), current Debian
> stable 10 has GCC version 8.
>
> Signed-off-by: Petr Štetiar 
> ---
>
> While adding CI support in C based projects, I've started adding -Wextra as
> well, which seems to work just fine for gcc6+, but it's apparently causing
> issues with older GCCs like for example gcc 4.8.5[1] on CentOS 7.
>
> Although it's certainly possible to fix those issues and make gcc 4 usable, I
> think, that it's not worth the additional effort and resources anymore.
>
> 1. 
> https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b

NAK from me ;(

Not quite sure how much benefit enforcing -Wextra can bring to the
whole code base.  Excluding support for vanilla CentOS7 will certainly
cause inconvenience for large numbers of users.  That is probably more
so to serious industrial users.

yousong

>
>  README  |  2 +-
>  include/prereq-build.mk | 18 --
>  2 files changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/README b/README
> index c867c1fa4da8..6d11dd1188ff 100644
> --- a/README
> +++ b/README
> @@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX 
> system (case
>  sensitive filesystem required). Cygwin is unsupported because of the lack
>  of a case sensitive file system.
>
> -You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
> diff,
> +You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
> diff,
>  unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
>
>  1. Run "./scripts/feeds update -a" to obtain all the latest package 
> definitions
> diff --git a/include/prereq-build.mk b/include/prereq-build.mk
> index 4c5991005634..58cbc0678fa1 100644
> --- a/include/prereq-build.mk
> +++ b/include/prereq-build.mk
> @@ -27,12 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
> umask | grep -xE 0?0[012][012]))
>
>  $(eval $(call SetupHostCommand,gcc, \
> -   Please install the GNU C Compiler (gcc) 4.8 or later, \
> -   $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   gcc48 --version | grep gcc, \
> -   gcc49 --version | grep gcc, \
> -   gcc5 --version | grep gcc, \
> +   Please install the GNU C Compiler (gcc) 6 or later, \
> gcc6 --version | grep gcc, \
> gcc7 --version | grep gcc, \
> gcc8 --version | grep gcc, \
> @@ -40,18 +35,13 @@ $(eval $(call SetupHostCommand,gcc, \
> gcc --version | grep -E 'Apple.(LLVM|clang)' ))
>
>  $(eval $(call TestHostCommand,working-gcc, \
> -   \nPlease reinstall the GNU C Compiler (4.8 or later) - \
> +   \nPlease reinstall the GNU C Compiler (6 or later) - \
> it appears to be broken, \
> echo 'int main(int argc, char **argv) { return 0; }' | \
> gcc -x c -o $(TMP_DIR)/a.out -))
>
>  $(eval $(call SetupHostCommand,g++, \
> -   Please install the GNU C++ Compiler (g++) 4.8 or later, \
> -   $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   g++48 --version | grep g++, \
> -   g++49 --version | grep g++, \
> -   g++5 --version | grep g++, \
> +   Please install the GNU C++ Compiler (g++) 6 or later, \
> g++6 --version | grep g++, \
> g++7 --version | grep g++, \
> g++8 --version | grep g++, \
> @@ -59,7 +49,7 @@ $(eval $(call SetupHostCommand,g++, \
> g++ --version | grep -E 'Apple.(LLVM|clang)' ))
>
>  $(eval $(call TestHostCommand,working-g++, \
> -   \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
> +   \nPlease reinstall the GNU C++ Compiler (6 or later) - \
> it appears to be broken, \
> echo 'int main(int argc, char **argv) { return 0; }' | \
> g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Petr Štetiar
Yousong Zhou  [2019-11-12 16:26:14]:

Hi,

> Not quite sure how much benefit enforcing -Wextra can bring to the
> whole code base.

I'm adding -Wextra for some time already to any C project I touch, nobody has
objected against it so far. I'm adding it because I think, that the latest
compilers are producing usable warnings, less false positives and that it
should be one of the standard hardening options for any network facing
project. I see -Wextra just as another pair of review eyes for me, even if
it's provided by the machine.

It's just older GCC versions making -Wextra PITA, so if we decide to keep
support for gcc-4.8+, then it would probably make sense to enable -Wextra for
gcc6+.

> Excluding support for vanilla CentOS7 will certainly cause inconvenience for
> large numbers of users. 

Well, I don't see anything bad about sunsetting of old tools. This is master,
so next OpenWrt release somewhere in the 2020, so probably not a big deal,
right? They're going to install python3 anyway as well.

> That is probably more so to serious industrial users.

If I'm able to install gcc-4.8 on my latest stable Debian, then I assume, that
it should be relatively straight forward to install some decent GCC version on
 as well.

If we decide to keep gcc-4.8 support, wouldn't it make sense to use gcc-4.8 on
buildbots as well? You know, in order to catch similar issues during QA
process.

I can certainly add gcc-4.8, gcc-4.9, gcc-5 to the CI compiler mix (currently
has gcc-7, gcc-8, gcc-9 and clang-9 compilers), but this is going to result in
the 6 additional compile/run tests (3 * release/debug), so it makes me wonder
if it's really worth the resources/efforts.

-- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] build: separate signing logic

2019-11-12 Thread Paul Spooren
This separates the options for signature creation and verification

* SIGNED_PACKAGES create Packages.sig
* SIGNED_IMAGES add ucert signature to created images
* CHECK_SIGNATURE add verification capabilities to images
* INSTALL_LOCAL_KEY add local key-build to /etc/opkg/keys

Right now the buildbot.git contains some hacks to create images that
have signature verification capabilities while not storing private keys
on buildbot slaves. This commit allows to disable these steps for the
buildbots and only perform signing on the master.

Signed-off-by: Paul Spooren 
---
v2: fix missing endif if base-files/Makefile

 config/Config-build.in  | 12 ++--
 include/image-commands.mk   | 13 -
 package/base-files/Makefile | 18 ++
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index 872e5c12ab..c6591708a2 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -37,13 +37,21 @@ menu "Global build settings"
  - Enabling per-device rootfs support
  ...
 
+   config INSTALL_LOCAL_KEY
+   bool "Install local usign key into image"
+   default n
+
config SIGNED_PACKAGES
bool "Cryptographically signed package lists"
-   default y
+   default n
+
+   config SIGNED_IMAGES
+   bool "Cryptographically signed firmware images"
+   default n
 
config SIGNATURE_CHECK
bool "Enable signature checking in opkg"
-   default SIGNED_PACKAGES
+   default y
 
comment "General build options"
 
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 5dfd6a2c2f..3d10b18bc8 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -373,11 +373,14 @@ metadata_json = \
 
 define Build/append-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call 
metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
-   [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
-   cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
-   usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
-   ucert -A -c "$@.ucert" -x "$@.sig" ;\
-   fwtool -S "$@.ucert" "$@" ;\
+   [ -z "$(SIGNED_IMAGES)" \
+   -o ! -s "$(BUILD_KEY)" \
+   -o ! -s "$(BUILD_KEY).ucert" \
+   -o ! -s "$@" ] || { \
+   cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
+   usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
+   ucert -A -c "$@.ucert" -x "$@.sig" ;\
+   fwtool -S "$@.ucert" "$@" ;\
}
 endef
 
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index addbac8664..3625f1320d 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -37,7 +37,7 @@ endif
 define Package/base-files
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign 
+SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
+  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNATURE_CHECK:usign 
+SIGNATURE_CHECK:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
   TITLE:=Base filesystem for OpenWrt
   URL:=http://openwrt.org/
   VERSION:=$(PKG_RELEASE)-$(REVISION)
@@ -116,12 +116,6 @@ ifdef CONFIG_SIGNED_PACKAGES
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p 
$(BUILD_KEY).pub -s $(BUILD_KEY)
 
   endef
-
-  define Package/base-files/install-key
-   mkdir -p $(1)/etc/opkg/keys
-   $(CP) $(BUILD_KEY).pub 
$(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
-
-  endef
 endif
 
 ifeq ($(CONFIG_NAND_SUPPORT),)
@@ -130,9 +124,17 @@ ifeq ($(CONFIG_NAND_SUPPORT),)
   endef
 endif
 
+ifdef CONFIG_INSTALL_LOCAL_KEY
+  define Package/base-files/install-local-key
+   mkdir -p $(1)/etc/opkg/keys
+   $(CP) $(BUILD_KEY).pub 
$(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign \
+   -F -p $(BUILD_KEY).pub`
+  endef
+endif
+
 define Package/base-files/install
$(CP) ./files/* $(1)/
-   $(Package/base-files/install-key)
+   $(Package/base-files/install-local-key)
$(Package/base-files/nand-support)
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
-- 
2.24.0.rc1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2] build: separate signing logic

2019-11-12 Thread Felix Fietkau
On 2019-11-12 10:31, Paul Spooren wrote:
> This separates the options for signature creation and verification
> 
> * SIGNED_PACKAGES create Packages.sig
> * SIGNED_IMAGES add ucert signature to created images
> * CHECK_SIGNATURE add verification capabilities to images
> * INSTALL_LOCAL_KEY add local key-build to /etc/opkg/keys
> 
> Right now the buildbot.git contains some hacks to create images that
> have signature verification capabilities while not storing private keys
> on buildbot slaves. This commit allows to disable these steps for the
> buildbots and only perform signing on the master.
> 
> Signed-off-by: Paul Spooren 
> ---
> v2: fix missing endif if base-files/Makefile
> 
>  config/Config-build.in  | 12 ++--
>  include/image-commands.mk   | 13 -
>  package/base-files/Makefile | 18 ++
>  3 files changed, 28 insertions(+), 15 deletions(-)
> 
> diff --git a/config/Config-build.in b/config/Config-build.in
> index 872e5c12ab..c6591708a2 100644
> --- a/config/Config-build.in
> +++ b/config/Config-build.in
> @@ -37,13 +37,21 @@ menu "Global build settings"
> - Enabling per-device rootfs support
> ...
>  
> + config INSTALL_LOCAL_KEY
> + bool "Install local usign key into image"
> + default n
> +
>   config SIGNED_PACKAGES
>   bool "Cryptographically signed package lists"
> - default y
> + default n
> +
> + config SIGNED_IMAGES
> + bool "Cryptographically signed firmware images"
> + default n
>  
>   config SIGNATURE_CHECK
>   bool "Enable signature checking in opkg"
> - default SIGNED_PACKAGES
> + default y
>  
>   comment "General build options"
Please make all of these default to 'y if !BUILDBOT' in order to not add
extra inconvenience for people doing their own builds.
Just like before, builds should trust packages/images generated from the
same tree by default.

- Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] build: separate signing logic

2019-11-12 Thread Paul Spooren
This separates the options for signature creation and verification

* SIGNED_PACKAGES create Packages.sig
* SIGNED_IMAGES add ucert signature to created images
* CHECK_SIGNATURE add verification capabilities to images
* INSTALL_LOCAL_KEY add local key-build to /etc/opkg/keys

Right now the buildbot.git contains some hacks to create images that
have signature verification capabilities while not storing private keys
on buildbot slaves. This commit allows to disable these steps for the
buildbots and only perform signing on the master.

Signed-off-by: Paul Spooren 
---
v3: set "y if !BUILDBOT" to all new options

 config/Config-build.in  | 12 ++--
 include/image-commands.mk   | 13 -
 package/base-files/Makefile | 18 ++
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index 872e5c12ab..af5de42ac6 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -37,13 +37,21 @@ menu "Global build settings"
  - Enabling per-device rootfs support
  ...
 
+   config INSTALL_LOCAL_KEY
+   bool "Install local usign key into image"
+   default y if !BUILDBOT
+
config SIGNED_PACKAGES
bool "Cryptographically signed package lists"
-   default y
+   default y if !BUILDBOT
+
+   config SIGNED_IMAGES
+   bool "Cryptographically signed firmware images"
+   default y if !BUILDBOT
 
config SIGNATURE_CHECK
bool "Enable signature checking in opkg"
-   default SIGNED_PACKAGES
+   default y
 
comment "General build options"
 
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 5dfd6a2c2f..3d10b18bc8 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -373,11 +373,14 @@ metadata_json = \
 
 define Build/append-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call 
metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
-   [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
-   cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
-   usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
-   ucert -A -c "$@.ucert" -x "$@.sig" ;\
-   fwtool -S "$@.ucert" "$@" ;\
+   [ -z "$(SIGNED_IMAGES)" \
+   -o ! -s "$(BUILD_KEY)" \
+   -o ! -s "$(BUILD_KEY).ucert" \
+   -o ! -s "$@" ] || { \
+   cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
+   usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
+   ucert -A -c "$@.ucert" -x "$@.sig" ;\
+   fwtool -S "$@.ucert" "$@" ;\
}
 endef
 
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index addbac8664..3625f1320d 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -37,7 +37,7 @@ endif
 define Package/base-files
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign 
+SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
+  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNATURE_CHECK:usign 
+SIGNATURE_CHECK:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
   TITLE:=Base filesystem for OpenWrt
   URL:=http://openwrt.org/
   VERSION:=$(PKG_RELEASE)-$(REVISION)
@@ -116,12 +116,6 @@ ifdef CONFIG_SIGNED_PACKAGES
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p 
$(BUILD_KEY).pub -s $(BUILD_KEY)
 
   endef
-
-  define Package/base-files/install-key
-   mkdir -p $(1)/etc/opkg/keys
-   $(CP) $(BUILD_KEY).pub 
$(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
-
-  endef
 endif
 
 ifeq ($(CONFIG_NAND_SUPPORT),)
@@ -130,9 +124,17 @@ ifeq ($(CONFIG_NAND_SUPPORT),)
   endef
 endif
 
+ifdef CONFIG_INSTALL_LOCAL_KEY
+  define Package/base-files/install-local-key
+   mkdir -p $(1)/etc/opkg/keys
+   $(CP) $(BUILD_KEY).pub 
$(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign \
+   -F -p $(BUILD_KEY).pub`
+  endef
+endif
+
 define Package/base-files/install
$(CP) ./files/* $(1)/
-   $(Package/base-files/install-key)
+   $(Package/base-files/install-local-key)
$(Package/base-files/nand-support)
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
-- 
2.24.0.rc1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Yousong Zhou
On Tue, 12 Nov 2019 at 17:12, Petr Štetiar  wrote:
>
> Yousong Zhou  [2019-11-12 16:26:14]:
>
> Hi,
>
> > Not quite sure how much benefit enforcing -Wextra can bring to the
> > whole code base.
>
> I'm adding -Wextra for some time already to any C project I touch, nobody has
> objected against it so far. I'm adding it because I think, that the latest
> compilers are producing usable warnings, less false positives and that it
> should be one of the standard hardening options for any network facing
> project. I see -Wextra just as another pair of review eyes for me, even if
> it's provided by the machine.

I agree, especially when it comes to quality assurance.

>
> It's just older GCC versions making -Wextra PITA, so if we decide to keep
> support for gcc-4.8+, then it would probably make sense to enable -Wextra for
> gcc6+.

This is not bad.  Only feeding those options to toolchains with decent
support of them, with less confusing false positives.  Users with
better toolchains will notice them and users with old toolchains still
benefit from it.

>
> > Excluding support for vanilla CentOS7 will certainly cause inconvenience for
> > large numbers of users.
>
> Well, I don't see anything bad about sunsetting of old tools. This is master,
> so next OpenWrt release somewhere in the 2020, so probably not a big deal,
> right? They're going to install python3 anyway as well.
>
> > That is probably more so to serious industrial users.
>
> If I'm able to install gcc-4.8 on my latest stable Debian, then I assume, that
> it should be relatively straight forward to install some decent GCC version on
>  as well.

How old to be old that is a question to ask.  In the specific case of
rhel7/centos7, I suppose it is still widely deployed and used.  It is
supposed to have at least 10 years support backed by redhat.  Its
"retirement" is supposed to be at year 2024 with extended life-cycle
support not yet decided.

Nah, I cannot speak for/represent rhel/centos community.  I have never
owned a red hat.

Python3 has been around for more than 10 years and it's no surprise
that it should be readily available.  Even the eol centos6 could have
it with epel enabled.  With centos7, I am not aware of any official
ways to install newer versions of software, only bugfixes.  I tried
for a few times with packages provided by SoftwareCollections.org, but
it's definitely not "straightforward" enough in my opinion.

>
> If we decide to keep gcc-4.8 support, wouldn't it make sense to use gcc-4.8 on
> buildbots as well? You know, in order to catch similar issues during QA
> process.
>
> I can certainly add gcc-4.8, gcc-4.9, gcc-5 to the CI compiler mix (currently
> has gcc-7, gcc-8, gcc-9 and clang-9 compilers), but this is going to result in
> the 6 additional compile/run tests (3 * release/debug), so it makes me wonder
> if it's really worth the resources/efforts.
>
> -- ynezz

I think we agree that whatever the decision is at the end, it's just
trade-off.  My concern is that closing doors for support of gcc 4.8 is
being too rigid.  Note that we are talking about host build with host
toolchain whose input we control and whose product only runs on the
host itself at build times.

Regards,
yousong

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] OpenWrt: read label MAC address for FRITZ!WLAN Repeater 300E

2019-11-12 Thread Adrian Schmutzler
Hi,

I'm currently trying to remove the dependency of label_mac in 02_network from 
phy setup, i.e. replacing stuff like
$(cat /sys/class/ieee80211/phyX/macaddress)
with extraction from the proper flash location.

One obstacle is the AVM FRITZ!WLAN Repeater 300E, where the calibration data is 
extracted with
caldata_extract_reverse "urloader" 0x1541 0x440

Is there a sufficiently easy way to get the MAC address out of there _without_ 
relying on initialized Wifi?
I'm looking for something like
label_mac=$(some_extraction_function "urloader" )
Technically, it should be somewhere in the reversed caldata, shouldn't it?

If this is not possible (with reasonable effort), I would just calculate it 
based on the lan_mac in 02_network.

Best

Adrian

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf 
Of Adrian Schmutzler
Sent: Montag, 11. November 2019 00:32
To: openwrt-devel@lists.openwrt.org
Subject: [OpenWrt-Devel] [PATCH 2/2] ath79: read label MAC address from flash 
instead of using phy0/phy1

This replaces all uses of $(cat /sys/class/ieee80211/phyX/macaddress)
by retrieval from the proper flash locations. This will make
02_network independent of WiFi setup again.

For the AVM FRITZ!WLAN Repeater 300E this replacement is non-trivial.
As it would be the only device in the whole trunk to keep the old
mechanism, this drops label MAC address for this device for now.

Signed-off-by: Adrian Schmutzler 

---

Is there an easy way to retrieve phy0 MAC address from fritz-300e?
Can it by deduced from the caldata extraction by assuming the
standard MAC offset after reverse?
---
 target/linux/ath79/generic/base-files/etc/board.d/02_network | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network
b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 34f6e31047..a8ab07aef5 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -292,11 +292,10 @@ ath79_setup_macs()
ubnt,nanostation-m|\
ubnt,rocket-m|\
ubnt,unifi)
-   label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+   label_mac=$(mtd_get_mac_binary art 0x1002)
;;
avm,fritz300e)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs
(1)"))
-   label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
;;
avm,fritz4020)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs
(1)"))
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread Michal Cieslakiewicz
Netgear WNDR routers (AR9344 models) like WNDR4300 have 128 MiB of flash
memory but only first 32 MiB are used now - both by vendor's firmware and
OpenWrt. This patch concatenates two regions of flash memory: ubi part
of firmware partition and reserved (unused) space beyond 'caldata_backup'
while preserving ART backup. No data is wiped or moved away.
This increases area for OS ubi volumes from 23 to 119 Megabytes.

Signed-off-by: Michal Cieslakiewicz 
---
 .../linux/ath79/dts/ar9344_netgear_wndr.dtsi  | 25 +++
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi 
b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
index 16a4e3f6e8..d5a699e774 100644
--- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
@@ -97,6 +97,22 @@
linux,default-trigger = "usbport";
};
};
+
+   ubi-concat {
+   compatible = "mtd-concat";
+   devices = <&ubipart0 &ubipart1>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   ubi@8c {
+   label = "ubi";
+   reg = <0x0 0x770>;
+   };
+   };
+   };
 };
 
 &pinmux {
@@ -155,8 +171,8 @@
reg = <0x6c 0x20>;
};
 
-   ubi@8c {
-   label = "ubi";
+   ubipart0: partition@8c {
+   label = "ubipart0";
reg = <0x8c 0x170>;
};
 
@@ -172,10 +188,9 @@
read-only;
};
 
-   partition@200 {
-   label = "reserved";
+   ubipart1: partition@200 {
+   label = "ubipart1";
reg = <0x200 0x600>;
-   read-only;
};
};
 };
-- 
2.24.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ath79: split dts file for Netgear WNDR4300

2019-11-12 Thread Michal Cieslakiewicz
Move board configuration to dtsi file in preparation for WNDR3700v4
router support.

Signed-off-by: Michal Cieslakiewicz 
---
 .../linux/ath79/dts/ar9344_netgear_wndr.dtsi  | 290 ++
 .../ath79/dts/ar9344_netgear_wndr4300.dts | 286 +
 2 files changed, 291 insertions(+), 285 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr.dtsi

diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi 
b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
new file mode 100644
index 00..16a4e3f6e8
--- /dev/null
+++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
@@ -0,0 +1,290 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "ar9344.dtsi"
+
+/ {
+   chosen {
+   bootargs = "console=ttyS0,115200n8";
+   };
+
+   aliases {
+   led-boot = &led_power_amber;
+   led-failsafe = &led_power_amber;
+   led-running = &led_power_green;
+   led-upgrade = &led_power_amber;
+   label-mac-device = ð0;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   wps {
+   label = "wps";
+   linux,code = ;
+   gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+   };
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
+   };
+
+   rfkill {
+   label = "rfkill";
+   linux,code = ;
+   gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <&enable_gpio_11>;
+
+   led_power_green: power_green {
+   label = "netgear:green:power";
+   gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+   };
+
+   led_power_amber: power_amber {
+   label = "netgear:amber:power";
+   gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+   default-state = "keep";
+   };
+
+   wan_green {
+   label = "netgear:green:wan";
+   gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+   };
+
+   wan_amber {
+   label = "netgear:amber:wan";
+   gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+   };
+
+   wlan2g_green {
+   label = "netgear:green:wlan2g";
+   gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   wlan5g_blue {
+   label = "netgear:blue:wlan5g";
+   gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wps_green {
+   label = "netgear:green:wps";
+   gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+   };
+
+   wps_amber {
+   label = "netgear:amber:wps";
+   gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+   };
+
+   usb_green {
+   label = "netgear:green:usb";
+   gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+   trigger-sources = <&hub_port>;
+   linux,default-trigger = "usbport";
+   };
+   };
+};
+
+&pinmux {
+   enable_gpio_11: pinmux_enable_gpio_11 {
+   pinctrl-single,bits = <0x8 0x0 0xff00>;
+   };
+};
+
+&nand {
+   status = "okay";
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x4>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x4 0x4>;
+   };
+
+   art: partition@8 {
+   label = "caldata";
+   reg = <0x8 0x4>;
+   read-only;
+   };
+
+   partition@c {
+   label = "pot";
+   reg = <0xc 0x8>;
+   };
+
+   partition@14 {
+   label = "language";
+   reg = <0x14 0x20>;
+   };
+
+   partition@34 {
+   label = "config";
+   reg = <0x34 0x8>;
+   };
+
+   partition@3c {
+   

Re: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread Enrico Mioso

Wow!! This is applicable also to Netgear R6220!


On Tue, 12 Nov 2019, Michal Cieslakiewicz wrote:


Date: Tue, 12 Nov 2019 14:02:14
From: Michal Cieslakiewicz 
To: "openwrt-devel@lists.openwrt.org" 
Cc: Adrian Schmutzler 
Subject: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear
ar9344-based WNDR routers

Netgear WNDR routers (AR9344 models) like WNDR4300 have 128 MiB of flash
memory but only first 32 MiB are used now - both by vendor's firmware and
OpenWrt. This patch concatenates two regions of flash memory: ubi part
of firmware partition and reserved (unused) space beyond 'caldata_backup'
while preserving ART backup. No data is wiped or moved away.
This increases area for OS ubi volumes from 23 to 119 Megabytes.

Signed-off-by: Michal Cieslakiewicz 
---
.../linux/ath79/dts/ar9344_netgear_wndr.dtsi  | 25 +++
1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi 
b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
index 16a4e3f6e8..d5a699e774 100644
--- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
@@ -97,6 +97,22 @@
linux,default-trigger = "usbport";
};
};
+
+   ubi-concat {
+   compatible = "mtd-concat";
+   devices = <&ubipart0 &ubipart1>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   ubi@8c {
+   label = "ubi";
+   reg = <0x0 0x770>;
+   };
+   };
+   };
};

&pinmux {
@@ -155,8 +171,8 @@
reg = <0x6c 0x20>;
};

-   ubi@8c {
-   label = "ubi";
+   ubipart0: partition@8c {
+   label = "ubipart0";
reg = <0x8c 0x170>;
};

@@ -172,10 +188,9 @@
read-only;
};

-   partition@200 {
-   label = "reserved";
+   ubipart1: partition@200 {
+   label = "ubipart1";
reg = <0x200 0x600>;
-   read-only;
};
};
};
--
2.24.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread Piotr Dymacz

Hi Michal,

On 12.11.2019 14:02, Michal Cieslakiewicz wrote:

Netgear WNDR routers (AR9344 models) like WNDR4300 have 128 MiB of flash
memory but only first 32 MiB are used now - both by vendor's firmware and
OpenWrt. This patch concatenates two regions of flash memory: ubi part
of firmware partition and reserved (unused) space beyond 'caldata_backup'
while preserving ART backup. No data is wiped or moved away.
This increases area for OS ubi volumes from 23 to 119 Megabytes.


Is revert to vendor firmware still possible with this change, e.g. using 
Netgear TFTP recovery mode?


--
Cheers,
Piotr



Signed-off-by: Michal Cieslakiewicz 
---
  .../linux/ath79/dts/ar9344_netgear_wndr.dtsi  | 25 +++
  1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi 
b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
index 16a4e3f6e8..d5a699e774 100644
--- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
@@ -97,6 +97,22 @@
linux,default-trigger = "usbport";
};
};
+
+   ubi-concat {
+   compatible = "mtd-concat";
+   devices = <&ubipart0 &ubipart1>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   ubi@8c {
+   label = "ubi";
+   reg = <0x0 0x770>;
+   };
+   };
+   };
  };
  
  &pinmux {

@@ -155,8 +171,8 @@
reg = <0x6c 0x20>;
};
  
-		ubi@8c {

-   label = "ubi";
+   ubipart0: partition@8c {
+   label = "ubipart0";
reg = <0x8c 0x170>;
};
  
@@ -172,10 +188,9 @@

read-only;
};
  
-		partition@200 {

-   label = "reserved";
+   ubipart1: partition@200 {
+   label = "ubipart1";
reg = <0x200 0x600>;
-   read-only;
};
};
  };




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] dts-v1 in DTSI files

2019-11-12 Thread Adrian Schmutzler
Hi,

is it correct to put /dts-v1/ into DTSI files?

In the documentation, it only says "DTS" files, and technically all DTSI are 
included somewhere, so it should be enough to have the /dts-v1/ in the DTSes?

Best

Adrian



openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH fwtool] cmake: use extra compiler warnings only on gcc6+

2019-11-12 Thread Petr Štetiar
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) and -Wextra produces
following:

 fwtool.c:288:9: error: missing initializer for field 'cur' of 'struct 
data_buf' [-Werror=missing-field-initializers]
  struct data_buf dbuf = {};
 ^
 fwtool.c:37:8: note: 'cur' declared here
  char *cur;
^

Ref: 
https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b#commitcomment-35906526
Ref: 
http://lists.infradead.org/pipermail/openwrt-devel/2019-November/020039.html
Signed-off-by: Petr Štetiar 
---
 CMakeLists.txt | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfe6045fb4e8..0c2692a2a6ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,9 +3,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
 PROJECT(fwtool C)
 INCLUDE(GNUInstallDirs)
 
-ADD_DEFINITIONS(-Wall -Werror -Wextra -Wno-unused-parameter)
+ADD_DEFINITIONS(-Wall -Werror)
 ADD_EXECUTABLE(fwtool fwtool.c)
 
+IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
+   ADD_DEFINITIONS(-Wextra -Wno-unused-parameter)
+ENDIF()
+
 IF(UNIT_TESTING)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] v5.4 as next kernel

2019-11-12 Thread Petr Štetiar
Hi,

so my oppinion is, that I'm fine with v5.4 as next kernel and it seems
sensible to have 20.01 still on v4.19 and 20.07 based on v5.4.

-- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread Michal Cieslakiewicz
>
> Is revert to vendor firmware still possible with this change, e.g.
> using Netgear TFTP recovery mode?
>   

Hello Piotr,

Yes, it is possible. I've performed such operation using fw_recovery
command from u-boot prompt.

However, looking at factory logs, reserved space is used somehow by
vendor firmware in a way that I wasn't able to investigate. My
WNDR4300 (bought used) had this whole area erased. I do not know if
that was default setup or deliberate action of previous owner. Vendor
firmware does not reflash that partition at all.

Cheers
Michal

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread David Bauer
Hello Michal,

On 11/12/19 2:02 PM, Michal Cieslakiewicz wrote:
> Netgear WNDR routers (AR9344 models) like WNDR4300 have 128 MiB of flash
> memory but only first 32 MiB are used now - both by vendor's firmware and
> OpenWrt. This patch concatenates two regions of flash memory: ubi part
> of firmware partition and reserved (unused) space beyond 'caldata_backup'
> while preserving ART backup. No data is wiped or moved away.
> This increases area for OS ubi volumes from 23 to 119 Megabytes.

Have you tried if this breaks sysupgrade from an older OpenWrt firmware?
I'm not sure if an UBI resize works without additional steps.

Best wishes
David

> 
> Signed-off-by: Michal Cieslakiewicz 
> ---
>  .../linux/ath79/dts/ar9344_netgear_wndr.dtsi  | 25 +++
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi 
> b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
> index 16a4e3f6e8..d5a699e774 100644
> --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
> +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
> @@ -97,6 +97,22 @@
>   linux,default-trigger = "usbport";
>   };
>   };
> +
> + ubi-concat {
> + compatible = "mtd-concat";
> + devices = <&ubipart0 &ubipart1>;
> +
> + partitions {
> + compatible = "fixed-partitions";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + ubi@8c {
> + label = "ubi";
> + reg = <0x0 0x770>;
> + };
> + };
> + };
>  };
>  
>  &pinmux {
> @@ -155,8 +171,8 @@
>   reg = <0x6c 0x20>;
>   };
>  
> - ubi@8c {
> - label = "ubi";
> + ubipart0: partition@8c {
> + label = "ubipart0";
>   reg = <0x8c 0x170>;
>   };
>  
> @@ -172,10 +188,9 @@
>   read-only;
>   };
>  
> - partition@200 {
> - label = "reserved";
> + ubipart1: partition@200 {
> + label = "ubipart1";
>   reg = <0x200 0x600>;
> - read-only;
>   };
>   };
>  };
> 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Petr Štetiar
Yousong Zhou  [2019-11-12 18:37:21]:

> I tried for a few times with packages provided by SoftwareCollections.org,
> but it's definitely not "straightforward" enough in my opinion.

I tried to install developer toolset version 8 in CentOS 7 Docker container in
order to triage the same compile failure happening with GCC 8.3[1] and it
simply worked as advertised, I was able to use GCC 8.3 on CentOS 7 just fine.

> Note that we are talking about host build with host toolchain whose input we
> control and whose product only runs on the host itself at build times.

Note that fwtool is just a tip of the iceberg, reminder, that we're still
supporting archaic compiler versions. Just imagine tools/firmware-utils with
-Wextra as the next step...

1. 
https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b#commitcomment-35914043

-- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: enable all space on Netgear ar9344-based WNDR routers

2019-11-12 Thread Michal Cieslakiewicz
On Tue, 12 Nov 2019 17:15:17 +0100
David Bauer  wrote:

> Hello Michal,
> 
> Have you tried if this breaks sysupgrade from an older OpenWrt
> firmware? I'm not sure if an UBI resize works without additional
> steps.
> 
> Best wishes
> David
> 

Hello David,

Thanks! Good point, I was usually flashing from uboot to a clean state.
I will test this sysupgrade scenario and come back with results.

Best regards
Michal

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] kernel-build: fix kernel_menuconfig breakage by forcing YACC

2019-11-12 Thread Thomas Albers via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
On Mon, 11 Nov 2019 at 14:56, Petr Štetiar  wrote:
> Commit 965f341aa9fd ("build: fix host menu config targets using
> ncurses") has moved host's path with pkg-config (usually /usr/bin) at
> the first place in PATH variable, which is now causing issues with bison
> as BISON_PKGDATADIR points into STAGING_DIR_HOST, but the actual bison
> used is the one under host PATH

This fixes "make kernel_menuconfig" for 4.19 kernels.

Tested-by: Thomas Albers 

--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] fstools: Question: Approach to make jffs2reset NAND-aware

2019-11-12 Thread Jeff Kletsky

One of the next things on my list is getting `firstboot` to work with
NAND (UBI) flash.

As reported[1], `jff2reset.c` does not seem to consider that there is
a UBI volume being used for the overlay. It appears to fail in
"marking" the file system as needing erasure.

root@(none):/# firstboot
[   32.530266] jffs2reset: This will erase all settings and remove any 
installed packages. Are you sure? [N/y]

y
[   34.958257] jffs2reset: /dev/ubi0_1 is not mounted
[   34.963187] jffs2reset: /dev/ubi0_1 will be erased on next mount
[   34.969244] jffs2reset: writing /dev/ubi0_1 failed: Operation not 
permitted


While there are command-line work-arounds, this also impacts the
"button-press reset" functionality.

The failure is due to at least

  sz = write(fd, &deadc0de, sizeof(deadc0de));

which returns -1 when trying to write directly to NAND flash.


Before I dive into dealing with UBI from C code, what would be a
project-preferred way to mark a UBI volume for erasure at next mount?

  * Presence of `.erase_this_volume` in the root of the file system?
  * Some other mark?


I'll work through how to erase the volume without losing track of the
existing wear-balancing and bad-block management features once I've
got a good way to detect that it should be done at next mount,
preferably without a "double erase" occurring[2].

Jeff




[1] https://bugs.openwrt.org/index.php?do=details&task_id=468
    https://bugs.openwrt.org/index.php?do=details&task_id=2121

[2] http://www.linux-mtd.infradead.org/faq/ubifs.html#L_why_ubiformat





___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Etienne Champetier
Hi Petr,

Le mar. 12 nov. 2019 à 00:16, Petr Štetiar  a écrit :
>
> Currently minimal GNU supported GCC version is 7 (from May 2, 2017), buildbots
> are using default GCC version 6 on Debian 9 (old stable), current Debian
> stable 10 has GCC version 8.
>
> Signed-off-by: Petr Štetiar 
> ---
>
> While adding CI support in C based projects, I've started adding -Wextra as
> well, which seems to work just fine for gcc6+, but it's apparently causing
> issues with older GCCs like for example gcc 4.8.5[1] on CentOS 7.
>
> Although it's certainly possible to fix those issues and make gcc 4 usable, I
> think, that it's not worth the additional effort and resources anymore.
>
> 1. 
> https://github.com/openwrt/openwrt/commit/4ba8f7b1ef1e4c0607185a41c06b51928c625d8b
>
>  README  |  2 +-
>  include/prereq-build.mk | 18 --
>  2 files changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/README b/README
> index c867c1fa4da8..6d11dd1188ff 100644
> --- a/README
> +++ b/README
> @@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX 
> system (case
>  sensitive filesystem required). Cygwin is unsupported because of the lack
>  of a case sensitive file system.
>
> -You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
> diff,
> +You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
> diff,
>  unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
>
>  1. Run "./scripts/feeds update -a" to obtain all the latest package 
> definitions
> diff --git a/include/prereq-build.mk b/include/prereq-build.mk
> index 4c5991005634..58cbc0678fa1 100644
> --- a/include/prereq-build.mk
> +++ b/include/prereq-build.mk
> @@ -27,12 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \
> umask | grep -xE 0?0[012][012]))
>
>  $(eval $(call SetupHostCommand,gcc, \
> -   Please install the GNU C Compiler (gcc) 4.8 or later, \
> -   $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   gcc48 --version | grep gcc, \
> -   gcc49 --version | grep gcc, \
> -   gcc5 --version | grep gcc, \
> +   Please install the GNU C Compiler (gcc) 6 or later, \
> gcc6 --version | grep gcc, \
> gcc7 --version | grep gcc, \
> gcc8 --version | grep gcc, \

Don't we also want to reverse the order to choose the newest compiler first ?
Also on Fedora 31, in the path I only have gcc, not gcc9, what I match is:
$ gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)'
9
not the other rules, so this patch breaks at least Fedora 31

Etienne

> @@ -40,18 +35,13 @@ $(eval $(call SetupHostCommand,gcc, \
> gcc --version | grep -E 'Apple.(LLVM|clang)' ))
>
>  $(eval $(call TestHostCommand,working-gcc, \
> -   \nPlease reinstall the GNU C Compiler (4.8 or later) - \
> +   \nPlease reinstall the GNU C Compiler (6 or later) - \
> it appears to be broken, \
> echo 'int main(int argc, char **argv) { return 0; }' | \
> gcc -x c -o $(TMP_DIR)/a.out -))
>
>  $(eval $(call SetupHostCommand,g++, \
> -   Please install the GNU C++ Compiler (g++) 4.8 or later, \
> -   $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
> -   g++48 --version | grep g++, \
> -   g++49 --version | grep g++, \
> -   g++5 --version | grep g++, \
> +   Please install the GNU C++ Compiler (g++) 6 or later, \
> g++6 --version | grep g++, \
> g++7 --version | grep g++, \
> g++8 --version | grep g++, \
> @@ -59,7 +49,7 @@ $(eval $(call SetupHostCommand,g++, \
> g++ --version | grep -E 'Apple.(LLVM|clang)' ))
>
>  $(eval $(call TestHostCommand,working-g++, \
> -   \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
> +   \nPlease reinstall the GNU C++ Compiler (6 or later) - \
> it appears to be broken, \
> echo 'int main(int argc, char **argv) { return 0; }' | \
> g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] build: make GCC version 6+ minimal host build requirement

2019-11-12 Thread Petr Štetiar
Currently minimal GNU supported GCC version is 7 (from May 2, 2017),
buildbots are using default GCC version 6 on Debian 9 (old stable),
current Debian stable has GCC version 8.3.0.

Cc: Etienne Champetier 
Signed-off-by: Petr Štetiar 
---
 v2: fix regexps (champtar)

 README  |  2 +-
 include/prereq-build.mk | 22 --
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/README b/README
index c867c1fa4da8..6d11dd1188ff 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ To build your own firmware you need a Linux, BSD or MacOSX 
system (case
 sensitive filesystem required). Cygwin is unsupported because of the lack
 of a case sensitive file system.
 
-You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff,
+You need gcc6+, binutils, bzip2, flex, python3.5+, perl, make, find, grep, 
diff,
 unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
 
 1. Run "./scripts/feeds update -a" to obtain all the latest package definitions
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 4c5991005634..2a225fc25298 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -27,12 +27,9 @@ $(eval $(call TestHostCommand,proper-umask, \
umask | grep -xE 0?0[012][012]))
 
 $(eval $(call SetupHostCommand,gcc, \
-   Please install the GNU C Compiler (gcc) 4.8 or later, \
-   $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   gcc48 --version | grep gcc, \
-   gcc49 --version | grep gcc, \
-   gcc5 --version | grep gcc, \
+   Please install the GNU C Compiler (gcc) 6 or later, \
+   $(CC) -dumpversion | grep -E '^([6-9]\.?|[0-9]{2}\.?)', \
+   gcc -dumpversion | grep -E '^([6-9]\.?|[0-9]{2}\.?)', \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
@@ -40,18 +37,15 @@ $(eval $(call SetupHostCommand,gcc, \
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-gcc, \
-   \nPlease reinstall the GNU C Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
gcc -x c -o $(TMP_DIR)/a.out -))
 
 $(eval $(call SetupHostCommand,g++, \
-   Please install the GNU C++ Compiler (g++) 4.8 or later, \
-   $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
-   g++48 --version | grep g++, \
-   g++49 --version | grep g++, \
-   g++5 --version | grep g++, \
+   Please install the GNU C++ Compiler (g++) 6 or later, \
+   $(CXX) -dumpversion | grep -E '^([6-9]\.?|[0-9]{2}\.?)', \
+   g++ -dumpversion | grep -E '^([6-9]\.?|[0-9]{2}\.?)', \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
@@ -59,7 +53,7 @@ $(eval $(call SetupHostCommand,g++, \
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
 
 $(eval $(call TestHostCommand,working-g++, \
-   \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
+   \nPlease reinstall the GNU C++ Compiler (6 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: add /usr/share/libubox/jshn.sh to sysupgrade stage2

2019-11-12 Thread Russell Senior


Discovered recent changes had broken sysupgrade for ar71xx mikrotik
rb-493g, traced the problem to missing /usr/share/libubox/jshn.sh after
switching to tmpfs.


Signed-off-by: Russell Senior 
---
 package/base-files/files/lib/upgrade/stage2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/stage2 
b/package/base-files/files/lib/upgrade/stage2
index 5d3d46ee80..41a3b2aeb3 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -48,7 +48,7 @@ switch_to_ramfs() {
local file="$(which "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
-   install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh 
/lib/upgrade/*.sh /lib/upgrade/do_stage2 $RAMFS_COPY_DATA
+   install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh 
/lib/upgrade/*.sh /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh 
$RAMFS_COPY_DATA
 
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
 
-- 
2.24.0



-- 
Russell Senior, President
russ...@personaltelco.net

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: config_generate: split macaddr with multiple ifaces

2019-11-12 Thread Adrian Schmutzler
From: Sungbo Eo 

netifd does not handle network.@device[x].name properly if it
contains multiple ifaces separated by spaces. Due to this, board.d
lan_mac setup does not work if multiple ifaces are set to LAN by
ucidef_set_interface_lan.

To fix this, create a device node for each member iface when
running config_generate. Those are named based on the member
ifname:

  ucidef_set_interface_lan "eth0 eth1.1"
  ucidef_set_interface_macaddr "lan" "yy:yy:yy:yy:yy:01"

will return

  config device 'eth0_dev'
option name 'eth0'
option macaddr 'yy:yy:yy:yy:yy:01'

  config device 'eth1_1_dev'
option name 'eth1.1'
option macaddr 'yy:yy:yy:yy:yy:01'

The updated node names are only used for cases where more than
one member iface is specified. The typical single-ifname case
won't be altered (lan_dev, wan_dev).

Signed-off-by: Sungbo Eo 
[extended description, changed commit title]
Signed-off-by: Adrian Schmutzler 

---

I plan to also backport this to at least 19.07 and 18.06, as it's
essentially a fix.

Note that it actually would be easier to use the new naming scheme
consistently also for single-member lan/wan. I have not done that
here as it would mean a (cosmetic) change affecting many users,
while the changes shown here would limit the new node names to those
users actually having multiple members in lan.

>From the perspective of tidyness however, it would actually be
preferable to switch to the new syntax entirely:
- It will only change for new installations/sysupgrade -n anyway
- It is more logical to extend when the user adds a member to lan
  manually later
- No duplicate setup code
- Uniform names for device nodes

Please share your views on this aspect.
---
 package/base-files/files/bin/config_generate | 27 +++-
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/package/base-files/files/bin/config_generate 
b/package/base-files/files/bin/config_generate
index 3ca035ca8b..874ce289cf 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -85,12 +85,27 @@ generate_network() {
set network.$1.proto='none'
EOF
 
-   [ -n "$macaddr" ] && uci -q batch <<-EOF
-   delete network.$1_dev
-   set network.$1_dev='device'
-   set network.$1_dev.name='$ifname'
-   set network.$1_dev.macaddr='$macaddr'
-   EOF
+   [ -n "$macaddr" ] && case "$ifname" in
+   *\ *)
+   uci -q delete network.$1_dev
+   for name in $ifname; do
+   uci -q batch <<-EOF
+   delete network.${name/./_}_dev
+   set network.${name/./_}_dev='device'
+   set network.${name/./_}_dev.name='$name'
+   set network.${name/./_}_dev.macaddr='$macaddr'
+   EOF
+   done
+   ;;
+   *)
+   uci -q batch <<-EOF
+   delete network.$1_dev
+   set network.$1_dev='device'
+   set network.$1_dev.name='$ifname'
+   set network.$1_dev.macaddr='$macaddr'
+   EOF
+   ;;
+   esac
 
case "$protocol" in
static)
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] base-files: config_generate: split macaddr with multiple ifaces

2019-11-12 Thread mail
> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Adrian Schmutzler
> Sent: Mittwoch, 13. November 2019 00:57
> To: openwrt-devel@lists.openwrt.org
> Cc: Sungbo Eo 
> Subject: [OpenWrt-Devel] [PATCH] base-files: config_generate: split
> macaddr with multiple ifaces
> 

base-files package version bump got eaten up by the latest rebase. I will add 
it for v2/before merge.
(I will also add the version bump to my other pending patches ...)

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Download link not working for 18.06.5 and 19.07.0rc1

2019-11-12 Thread Luiz Angelo Daros de Luca
Hello,

The OpenWrt front page has a "Download a firmware image for your device"
for each released version. However, the last two links are currently
useless. Both show no devices.

For 18.06.5, it seems that something somewhere must be updated from 18.06.4
to 18.06.5.

For 19.07, it could be only a temporary issue while in RC. However, if so,
OpenWrt should not advertise that link for now.

And please, hide "Firmware OpenWrt snapshot Install URL" and "Firmware
OpenWrt snapshot Upgrade URL" from a ToH link that filter support for a
specific release. It only allows the user to wrongly install snapshot
versions.

Regards,

---
 Luiz Angelo Daros de Luca
luizl...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt: read label MAC address for FRITZ!WLAN Repeater 300E

2019-11-12 Thread Mathias Kresin

12/11/2019 13:26, Adrian Schmutzler:

Hi,

I'm currently trying to remove the dependency of label_mac in 02_network from 
phy setup, i.e. replacing stuff like
$(cat /sys/class/ieee80211/phyX/macaddress)
with extraction from the proper flash location.

One obstacle is the AVM FRITZ!WLAN Repeater 300E, where the calibration data is 
extracted with
caldata_extract_reverse "urloader" 0x1541 0x440

Is there a sufficiently easy way to get the MAC address out of there _without_ 
relying on initialized Wifi?
I'm looking for something like
label_mac=$(some_extraction_function "urloader" )
Technically, it should be somewhere in the reversed caldata, shouldn't it?

If this is not possible (with reasonable effort), I would just calculate it 
based on the lan_mac in 02_network.

Best

Adrian


Hey Adrian,

all mac-addresses can be found in the urlader key value store.

maca  24:65:11:AE:CB:6B
macb  24:65:11:AE:CB:6C
macwlan   24:65:11:AE:CB:6D
macdsl24:65:11:AE:CB:6E

Following the fritz_tffs call in 02_network it will be:

lan=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
wlan=$(fritz_tffs -n macwlan -i $(find_mtd_part "tffs (1)"))

FYI, the label mac is macwlan.

Does that answer your question?

Mathias

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel