[OpenWrt-Devel] [PATCH] lua: create "lua" symlink in staging dir

2019-07-23 Thread Rafał Miłecki
From: Rafał Miłecki 

Packages using host lua expect /bin/lua which has been recently renamed
to /bin/lua5.1. Create symlink for them.

This fixes e.g. following error with gluon:
/bin/sh: 1: openwrt/staging_dir/hostpkg/bin/lua: not found

Fixes: fe59b46ca7e0 ("lua: include version number in installed files")
Reported-by: Petr Štetiar 
Signed-off-by: Rafał Miłecki 
---
 package/utils/lua/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
index c911c6a913..a399a837cf 100644
--- a/package/utils/lua/Makefile
+++ b/package/utils/lua/Makefile
@@ -133,6 +133,7 @@ define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) \
INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
install
+   $(LN) lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
 endef
 
 define Build/InstallDev
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH] toolchain: fix gcc depends on kernel headers

2019-07-23 Thread Hauke Mehrtens
GCC needs the kernel headers to compile.
Some GCC file includes asm/unistd.h which is provided by the kernel headers.
Normally the kernel headers build is very fast and ready before the gcc uses
it, but if it clones the kernel from a slow git repository it takes longer
and then it could be that the gcc already wants to use the kernel headers
before they are available. This patch fixes this problem by adding the
missing dependency.

Signed-off-by: Hauke Mehrtens 
---
 toolchain/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/Makefile b/toolchain/Makefile
index 0336b2f..23a5529 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -49,7 +49,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
 
   $(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile
   $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile
-  $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
+  $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile 
$(curdir)/kernel-headers/compile
   $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
 endif
 
-- 
2.10.1


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


[OpenWrt-Devel] OpenWRT Summit.... 2019????

2019-07-23 Thread Michael Richardson
Are there any plans to host an OpenWRT summit in 2019?
I learnt of the 2018 summit in Lisbon the week after :-(
and I'd like to make better plans, if it will happen.

I notice that prplFoundation is planning an event in October
in Berlin.

-- 
]   Never tell me the odds! | ipv6 mesh networks [ 
]   Michael Richardson, Sandelman Software Works| network architect  [ 
] m...@sandelman.ca  http://www.sandelman.ca/|   ruby on rails[ 



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


[OpenWrt-Devel] [PATCH 2/2] treewide: remove now default USE_PROCD=1 from init scripts

2019-07-23 Thread Petr Štetiar
commit 08abd36204a8 ("base-files: make USE_PROCD=1 default") made
USE_PROCD=1 default, so let's remove this line from all init scripts.

Signed-off-by: Petr Štetiar 
---
 package/base-files/files/etc/init.d/gpio_switch   | 1 -
 package/base-files/files/etc/init.d/system| 1 -
 package/kernel/om-watchdog/files/om-watchdog.init | 1 -
 package/network/config/firewall/files/firewall.init   | 1 -
 package/network/config/ltq-adsl-app/files/dsl_control | 1 -
 package/network/config/ltq-vdsl-app/files/dsl_control | 1 -
 package/network/config/netifd/files/etc/init.d/network| 1 -
 package/network/config/qos-scripts/files/etc/init.d/qos   | 1 -
 package/network/services/dnsmasq/files/dnsmasq.init   | 1 -
 package/network/services/dropbear/files/dropbear.init | 1 -
 package/network/services/igmpproxy/files/igmpproxy.init   | 1 -
 package/network/services/ipset-dns/files/ipset-dns.init   | 1 -
 package/network/services/lldpd/files/lldpd.init   | 1 -
 package/network/services/odhcpd/files/odhcpd.init | 1 -
 package/network/services/omcproxy/files/omcproxy.init | 1 -
 package/network/services/openvpn/files/openvpn.init   | 1 -
 package/network/services/relayd/files/relay.init  | 1 -
 package/network/services/samba36/files/samba.init | 1 -
 package/network/services/uhttpd/files/uhttpd.init | 1 -
 package/network/services/umdns/files/umdns.init   | 1 -
 package/network/utils/linux-atm/files/br2684ctl   | 1 -
 package/system/fstools/files/blockd.init  | 1 -
 package/system/rpcd/files/rpcd.init   | 1 -
 package/system/ubox/files/log.init| 1 -
 package/system/urandom-seed/files/etc/init.d/urandom_seed | 1 -
 package/system/urngd/files/urngd.init | 1 -
 package/utils/busybox/files/cron  | 1 -
 package/utils/busybox/files/sysntpd   | 1 -
 package/utils/ct-bugcheck/src/bugcheck.initd  | 1 -
 package/utils/mdadm/files/mdadm.init  | 1 -
 package/utils/ugps/files/ugps.init| 1 -
 package/utils/usbmode/files/usbmode.init  | 1 -
 32 files changed, 32 deletions(-)

diff --git a/package/base-files/files/etc/init.d/gpio_switch 
b/package/base-files/files/etc/init.d/gpio_switch
index 6b2dcdce4183..e1f86ac2b348 100755
--- a/package/base-files/files/etc/init.d/gpio_switch
+++ b/package/base-files/files/etc/init.d/gpio_switch
@@ -3,7 +3,6 @@
 
 START=94
 STOP=10
-USE_PROCD=1
 
 
 load_gpio_switch()
diff --git a/package/base-files/files/etc/init.d/system 
b/package/base-files/files/etc/init.d/system
index a98a9724691f..a94586916e4e 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -2,7 +2,6 @@
 # Copyright (C) 2014 OpenWrt.org
 
 START=10
-USE_PROCD=1
 
 validate_system_section()
 {
diff --git a/package/kernel/om-watchdog/files/om-watchdog.init 
b/package/kernel/om-watchdog/files/om-watchdog.init
index 4c407dadaeb7..e65bef9cb0ce 100644
--- a/package/kernel/om-watchdog/files/om-watchdog.init
+++ b/package/kernel/om-watchdog/files/om-watchdog.init
@@ -6,7 +6,6 @@
 START=11
 STOP=11
 
-USE_PROCD=1
 NAME=om-watchdog
 PROG=/sbin/om-watchdog
 
diff --git a/package/network/config/firewall/files/firewall.init 
b/package/network/config/firewall/files/firewall.init
index ee3ed1a28356..05b1d28d7096 100755
--- a/package/network/config/firewall/files/firewall.init
+++ b/package/network/config/firewall/files/firewall.init
@@ -1,7 +1,6 @@
 #!/bin/sh /etc/rc.common
 
 START=19
-USE_PROCD=1
 QUIET=""
 
 validate_firewall_redirect()
diff --git a/package/network/config/ltq-adsl-app/files/dsl_control 
b/package/network/config/ltq-adsl-app/files/dsl_control
index 91fcb46beb82..0ab8d2b92628 100644
--- a/package/network/config/ltq-adsl-app/files/dsl_control
+++ b/package/network/config/ltq-adsl-app/files/dsl_control
@@ -2,7 +2,6 @@
 # Copyright (C) 2012 OpenWrt.org
 
 START=97
-USE_PROCD=1
 
 EXTRA_COMMANDS="status lucistat"
 EXTRA_HELP="   status  Get DSL status information
diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control 
b/package/network/config/ltq-vdsl-app/files/dsl_control
index e62a5e558cf8..8c76469b4fce 100644
--- a/package/network/config/ltq-vdsl-app/files/dsl_control
+++ b/package/network/config/ltq-vdsl-app/files/dsl_control
@@ -2,7 +2,6 @@
 # Copyright (C) 2012 OpenWrt.org
 
 START=97
-USE_PROCD=1
 
 EXTRA_COMMANDS="status lucistat"
 EXTRA_HELP="   status  Get DSL status information
diff --git a/package/network/config/netifd/files/etc/init.d/network 
b/package/network/config/netifd/files/etc/init.d/network
index dc208c4ce0a1..5aeea68658d2 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -3,7 +3,6 @@
 START=20
 STOP=90
 
-USE_PROCD=1
 
 init_switch() {
setup_switch() { return 0; 

[OpenWrt-Devel] [PATCH 1/2] base-files: make USE_PROCD=1 default

2019-07-23 Thread Petr Štetiar
Transition period for init script migration was long enough, let's
make USE_PROCD=1 default now so there's enough time to convert the
remaining services/init scripts for the next release.

Signed-off-by: Petr Štetiar 
---
 package/base-files/files/etc/rc.common | 113 ++---
 1 file changed, 47 insertions(+), 66 deletions(-)

diff --git a/package/base-files/files/etc/rc.common 
b/package/base-files/files/etc/rc.common
index 4fdf7485096c..b8dbe123ca18 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -1,25 +1,15 @@
 #!/bin/sh
 # Copyright (C) 2006-2012 OpenWrt.org
 
+initscript=$1
+
 . $IPKG_INSTROOT/lib/functions.sh
 . $IPKG_INSTROOT/lib/functions/service.sh
+. $IPKG_INSTROOT/lib/functions/procd.sh
 
-initscript=$1
 action=${2:-help}
 shift 2
 
-start() {
-   return 0
-}
-
-stop() {
-   return 0
-}
-
-reload() {
-   restart
-}
-
 restart() {
trap '' TERM
stop "$@"
@@ -73,11 +63,10 @@ Available commands:
reload  Reload configuration files (or restart if service does not 
implement reload)
enable  Enable service autostart
disable Disable service autostart
-$EXTRA_HELP
+   running Check if service is running
 EOF
 }
 
-# for procd
 start_service() {
return 0
 }
@@ -104,57 +93,49 @@ ${INIT_TRACE:+set -x}
 
 . "$initscript"
 
-[ -n "$USE_PROCD" ] && {
-   EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
-   EXTRA_HELP="\
-   running Check if service is running
-   "
-
-   . $IPKG_INSTROOT/lib/functions/procd.sh
-   basescript=$(readlink "$initscript")
-   rc_procd() {
-   local method="set"
-   [ -n "$2" ] && method="add"
-   procd_open_service "$(basename ${basescript:-$initscript})" 
"$initscript"
-   "$@"
-   procd_close_service "$method"
-   }
-
-   start() {
-   rc_procd start_service "$@"
-   if eval "type service_started" 2>/dev/null >/dev/null; then
-   service_started
-   fi
-   }
-
-   trace() {
-   TRACE_SYSCALLS=1
-   start "$@"
-   }
-
-   stop() {
+basescript=$(readlink "$initscript")
+rc_procd() {
+   local method="set"
+   [ -n "$2" ] && method="add"
+   procd_open_service "$(basename ${basescript:-$initscript})" 
"$initscript"
+   "$@"
+   procd_close_service "$method"
+}
+
+start() {
+   rc_procd start_service "$@"
+   if eval "type service_started" 2>/dev/null >/dev/null; then
+   service_started
+   fi
+}
+
+trace() {
+   TRACE_SYSCALLS=1
+   start "$@"
+}
+
+stop() {
+   procd_lock
+   stop_service "$@"
+   procd_kill "$(basename ${basescript:-$initscript})" "$1"
+   if eval "type service_stopped" 2>/dev/null >/dev/null; then
+   service_stopped
+   fi
+}
+
+reload() {
+   if eval "type reload_service" 2>/dev/null >/dev/null; then
procd_lock
-   stop_service "$@"
-   procd_kill "$(basename ${basescript:-$initscript})" "$1"
-   if eval "type service_stopped" 2>/dev/null >/dev/null; then
-   service_stopped
-   fi
-   }
-
-   reload() {
-   if eval "type reload_service" 2>/dev/null >/dev/null; then
-   procd_lock
-   reload_service "$@"
-   else
-   start
-   fi
-   }
-
-   running() {
-   service_running "$@"
-   }
-}
-
-ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled 
depends ${EXTRA_COMMANDS}"
+   reload_service "$@"
+   else
+   start
+   fi
+}
+
+running() {
+   service_running "$@"
+}
+
+ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled 
depends running trace"
 list_contains ALL_COMMANDS "$action" || action=help
 $action "$@"

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


Re: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-23 Thread Chongjun.Luo
Hi,Adrian


The MAC address is the MAC address on the label


Best regards
Luochongjun

--原始邮件--
发件人:"Adrian Schmutzler ";
发送时间:2019年7月23日(星期二) 晚上7:41
收件人:"'Luochongjun'" ;"openwrt-devel" 
;
主题:RE: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750
---

 Hi,

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
> Behalf Of Luochongjun
> Sent: Dienstag, 23. Juli 2019 09:45
> To: openwrt-devel@lists.openwrt.org
> Cc: Luochongjun 
> Subject: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750
> 
> This patch supports gl-ar750, which was previously supported by ar71xx.
> 

...

> + {
> + status = "okay";
> + mtd-mac-address = < 0x0>;

Is this the MAC address on the device's label/case/box?

Best

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


Re: [OpenWrt-Devel] [PATCH 2/2] netifd, lldpd, rpcd, log: use generic service_running

2019-07-23 Thread Petr Štetiar
Yousong Zhou  [2019-07-23 19:51:34]:

> > -service_running() {
> > -   ubus -t 30 wait_for network.interface
> > -   /sbin/wifi reload_legacy
> > -}
> > -
> 
> Likely we should keep this.  If not, a note in the commit message could help.

It's broken anyway:

 $ /etc/init.d/network stop; service network running && echo "yes" || echo 
"nope"
 Command failed: Request timed out
 yes

I'll add this information to the commit message, thanks!

-- ynezz

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


Re: [OpenWrt-Devel] [PATCH 2/2] netifd, lldpd, rpcd, log: use generic service_running

2019-07-23 Thread Yousong Zhou
On Tue, 23 Jul 2019 at 18:25, Petr Štetiar  wrote:
>
> commit eb204d14f75c ("base-files: implement generic service_running")
> introduced generic service_running so it's not needed to copy same
> 3 lines over and over again.
>
> Signed-off-by: Petr Štetiar 
> ---
>  package/network/config/netifd/files/etc/init.d/network | 5 -
>  package/network/services/lldpd/files/lldpd.init| 4 
>  package/system/rpcd/files/rpcd.init| 4 
>  package/system/ubox/files/log.init | 4 
>  4 files changed, 17 deletions(-)
>
> diff --git a/package/network/config/netifd/files/etc/init.d/network 
> b/package/network/config/netifd/files/etc/init.d/network
> index 2321a309a5ce..dc208c4ce0a1 100755
> --- a/package/network/config/netifd/files/etc/init.d/network
> +++ b/package/network/config/netifd/files/etc/init.d/network
> @@ -40,11 +40,6 @@ stop_service() {
> sleep 1
>  }
>
> -service_running() {
> -   ubus -t 30 wait_for network.interface
> -   /sbin/wifi reload_legacy
> -}
> -

Likely we should keep this.  If not, a note in the commit message could help.

yousong

>  validate_atm_bridge_section()
>  {
> uci_validate_section network "atm-bridge" "${1}" \
> diff --git a/package/network/services/lldpd/files/lldpd.init 
> b/package/network/services/lldpd/files/lldpd.init
> index bc429de484d3..9fb3a8255995 100644
> --- a/package/network/services/lldpd/files/lldpd.init
> +++ b/package/network/services/lldpd/files/lldpd.init
> @@ -96,10 +96,6 @@ start_service() {
> procd_close_instance
>  }
>
> -service_running() {
> -   pgrep -x /usr/sbin/lldpd &> /dev/null
> -}
> -
>  reload_service() {
> running || return 1
> $LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
> diff --git a/package/system/rpcd/files/rpcd.init 
> b/package/system/rpcd/files/rpcd.init
> index 77ebcbe6cb7b..447133c67a5a 100755
> --- a/package/system/rpcd/files/rpcd.init
> +++ b/package/system/rpcd/files/rpcd.init
> @@ -18,7 +18,3 @@ start_service() {
>  reload_service() {
> procd_send_signal rpcd
>  }
> -
> -service_running() {
> -   procd_running rpcd
> -}
> diff --git a/package/system/ubox/files/log.init 
> b/package/system/ubox/files/log.init
> index ba9c124c8ba6..250f805b4406 100644
> --- a/package/system/ubox/files/log.init
> +++ b/package/system/ubox/files/log.init
> @@ -96,7 +96,3 @@ start_service()
> config_foreach validate_log_section system start_service_file
> config_foreach validate_log_section system start_service_remote
>  }
> -
> -service_running() {
> -   procd_running log
> -}
>
> ___
> 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 1/2] base-files: implement generic service_running

2019-07-23 Thread Yousong Zhou
On Tue, 23 Jul 2019 at 18:25, Petr Štetiar  wrote:
>
> DRY is good, otherwise we're going to suffer with a copy disease
> in the init scripts.
>
> Signed-off-by: Petr Štetiar 
> ---
>  package/base-files/files/etc/rc.common | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/package/base-files/files/etc/rc.common 
> b/package/base-files/files/etc/rc.common
> index 75dbeedf34d4..3bd382ae27ac 100755
> --- a/package/base-files/files/etc/rc.common
> +++ b/package/base-files/files/etc/rc.common
> @@ -95,7 +95,11 @@ service_data() {
>  }
>
>  service_running() {
> -   return 0
> +   [ -n "$USE_PROCD" ] || return 0

These xx_service() and service_xxx() functions as commented are for
procd, so no need to check for USE_PROCD here.

yousong
> +
> +   local service="${1:-$(basename $initscript)}"
> +   local instance="${2:-*}"
> +   procd_running "$service" "${instance}" "$@"
>  }
>
>  ${INIT_TRACE:+set -x}
> @@ -104,6 +108,9 @@ ${INIT_TRACE:+set -x}
>
>  [ -n "$USE_PROCD" ] && {
> EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
> +   EXTRA_HELP="\
> +   running Check if service is running
> +   "
>
> . $IPKG_INSTROOT/lib/functions/procd.sh
> basescript=$(readlink "$initscript")
>
> ___
> 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: add support for gl-ar750

2019-07-23 Thread Adrian Schmutzler
Hi,

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
> Behalf Of Luochongjun
> Sent: Dienstag, 23. Juli 2019 09:45
> To: openwrt-devel@lists.openwrt.org
> Cc: Luochongjun 
> Subject: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750
> 
> This patch supports gl-ar750, which was previously supported by ar71xx.
> 

...

> + {
> + status = "okay";
> + mtd-mac-address = < 0x0>;

Is this the MAC address on the device's label/case/box?

Best

Adrian


pgpWzrKY7P1R_.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-23 Thread Chongjun . Luo
My local openwrt tree has not been updated to the latest, so DEVICE_VENDOR and 
DEVICE_MODEL are not yet used

Date: Tue, 23 Jul 2019 12:27:03 +0200
From: Moritz Warning 
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750
Message-ID: <47ab81c8-bd2b-a4f0-f94c-0aa68a7c5...@web.de>
Content-Type: text/plain; charset=utf-8
 
It would be a good idea to rewrite
 
DEVICE_TITLE := GL.iNet GL-AR750
 
to
 
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-AR750
 
See https://github.com/openwrt/openwrt/pull/2124
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: rules.mk: allow overriding of HOSTCC and HOSTCXX

2019-07-23 Thread Petr Štetiar
Yousong Zhou  [2019-07-23 18:57:32]:

Hi,

> Variables specified as command arguments can override `:=` assignment.

thanks, didn't know about this.

> But the change is still helpful if such HOSTCC and HOSTCXX are from
> environment.

I think, that current default is better, I'm able to override it, so I'm quite
reluctant to change the default behavior just for the case. Anyway, thanks a
lot for review!

Cheers,

Petr

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


Re: [OpenWrt-Devel] [PATCH] build: rules.mk: allow overriding of HOSTCC and HOSTCXX

2019-07-23 Thread Yousong Zhou
On Tue, 23 Jul 2019 at 18:23, Petr Štetiar  wrote:
>
> Currently it's not possible to change the host compiler version during
> devlopment/test/fixing and one has to always hand edit rules.mk which is
> tiresome, so let's allow changing of those variables from make/env vars.
>
> Signed-off-by: Petr Štetiar 
> ---
>  rules.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rules.mk b/rules.mk
> index 80cb3d63f449..dc8a1bac8d83 100644
> --- a/rules.mk
> +++ b/rules.mk
> @@ -245,8 +245,8 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
>
>  export PKG_CONFIG
>
> -HOSTCC:=gcc
> -HOSTCXX:=g++
> +HOSTCC?=gcc
> +HOSTCXX?=g++

Variables specified as command arguments can override `:=` assignment.
But the change is still helpful if such HOSTCC and HOSTCXX are from
environment.

Acked-by: Yousong Zhou 

yousong

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


Re: [OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-23 Thread Moritz Warning
It would be a good idea to rewrite

DEVICE_TITLE := GL.iNet GL-AR750

to

DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-AR750

See https://github.com/openwrt/openwrt/pull/2124

On 7/23/19 9:45 AM, Luochongjun wrote:
> This patch supports gl-ar750, which was previously supported by ar71xx.
>
> Specification:
> - SOC: QCA9531 (650MHz)
> - Flash: 16 MiB (W25Q128FVSG)
> - RAM: 128 MiB DDR2
> - Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
> - Wireless: 2.4GHz (bgn) and 5GHz (ac)
> - USB: 1x USB 2.0 port
> - Switch: 1x switch
> - Button: 1x reset button
> - LED: 3x LEDS (white)
>
> Flash instruction:
> Support for sysupgrade directive upgrades, as well as luci upgrades.
>
> Signed-off-by: Luochongjun 
> ---
>  .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
>  target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 149 
> +
>  target/linux/ath79/image/generic.mk|   9 ++
>  3 files changed, 159 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
>
> diff --git 
> a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
> b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> index 8f0ea1d..6a9cb1c 100644
> --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> @@ -116,6 +116,7 @@ case "$FIRMWARE" in
>   ath10kcal_extract "art" 20480 2116
>   ath10kcal_patch_mac $(macaddr_add $(cat 
> /sys/class/net/eth0/address) +1)
>   ;;
> + glinet,gl-ar750|\
>   glinet,gl-ar750s)
>   ath10kcal_extract "art" 20480 2116
>   ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
> +1)
> diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
> b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
> new file mode 100644
> index 000..b8f9735
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
> @@ -0,0 +1,149 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> +/dts-v1/;
> +
> +#include 
> +#include 
> +
> +#include "qca953x.dtsi"
> +
> +/ {
> + compatible = "glinet,gl-ar750", "qca,qca9531";
> + model = "GL.iNet GL-AR750";
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_disable_pins>;
> +
> + reset {
> + label = "reset";
> + linux,code = ;
> + gpios = < 3 GPIO_ACTIVE_LOW>;
> + };
> +
> + mode {
> + label = "mode";
> + linux,code = ;
> + gpios = < 0 GPIO_ACTIVE_LOW>;
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + power {
> + label = "gl-ar750:white:power";
> + gpios = < 12 GPIO_ACTIVE_LOW>;
> + default-state = "on";
> + };
> +
> + wlan2g {
> + label = "gl-ar750:white:wlan2g";
> + gpios = < 14 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "phy1tpt";
> + };
> +
> + wlan5g {
> + label = "gl-ar750:white:wlan5g";
> + gpios = < 13 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "phy0tpt";
> + };
> +
> + };
> +
> + i2c {
> + compatible = "i2c-gpio";
> +
> + sda-gpios = < 17 GPIO_ACTIVE_LOW>;
> + scl-gpios = < 16 GPIO_ACTIVE_LOW>;
> + };
> +
> +
> +};
> +
> + {
> + status = "okay";
> +
> + wifi@0,0 {
> + compatible = "qcom,ath10k";
> + reg = <0 0 0 0 0>;
> + device_type = "pci";
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + hub_port: port@1 {
> + reg = <1>;
> + #trigger-source-cells = <0>;
> + };
> +};
> +
> +_phy {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> + num-cs = <0>;
> +
> + flash@0 {
> + compatible = "jedec,spi-nor";
> + reg = <0>;
> + spi-max-frequency = <2500>;
> +
> + partitions {
> + compatible = "fixed-partitions";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x00 0x04>;
> + read-only;
> + };
> +
> + partition@4 {
> + label = "u-boot-env";
> + reg = <0x04 0x01>;
> + read-only;
> +   

[OpenWrt-Devel] [PATCH 2/2] netifd, lldpd, rpcd, log: use generic service_running

2019-07-23 Thread Petr Štetiar
commit eb204d14f75c ("base-files: implement generic service_running")
introduced generic service_running so it's not needed to copy same
3 lines over and over again.

Signed-off-by: Petr Štetiar 
---
 package/network/config/netifd/files/etc/init.d/network | 5 -
 package/network/services/lldpd/files/lldpd.init| 4 
 package/system/rpcd/files/rpcd.init| 4 
 package/system/ubox/files/log.init | 4 
 4 files changed, 17 deletions(-)

diff --git a/package/network/config/netifd/files/etc/init.d/network 
b/package/network/config/netifd/files/etc/init.d/network
index 2321a309a5ce..dc208c4ce0a1 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -40,11 +40,6 @@ stop_service() {
sleep 1
 }
 
-service_running() {
-   ubus -t 30 wait_for network.interface
-   /sbin/wifi reload_legacy
-}
-
 validate_atm_bridge_section()
 {
uci_validate_section network "atm-bridge" "${1}" \
diff --git a/package/network/services/lldpd/files/lldpd.init 
b/package/network/services/lldpd/files/lldpd.init
index bc429de484d3..9fb3a8255995 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -96,10 +96,6 @@ start_service() {
procd_close_instance
 }
 
-service_running() {
-   pgrep -x /usr/sbin/lldpd &> /dev/null
-}
-
 reload_service() {
running || return 1
$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
diff --git a/package/system/rpcd/files/rpcd.init 
b/package/system/rpcd/files/rpcd.init
index 77ebcbe6cb7b..447133c67a5a 100755
--- a/package/system/rpcd/files/rpcd.init
+++ b/package/system/rpcd/files/rpcd.init
@@ -18,7 +18,3 @@ start_service() {
 reload_service() {
procd_send_signal rpcd
 }
-
-service_running() {
-   procd_running rpcd
-}
diff --git a/package/system/ubox/files/log.init 
b/package/system/ubox/files/log.init
index ba9c124c8ba6..250f805b4406 100644
--- a/package/system/ubox/files/log.init
+++ b/package/system/ubox/files/log.init
@@ -96,7 +96,3 @@ start_service()
config_foreach validate_log_section system start_service_file
config_foreach validate_log_section system start_service_remote
 }
-
-service_running() {
-   procd_running log
-}

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


[OpenWrt-Devel] [PATCH 1/2] base-files: implement generic service_running

2019-07-23 Thread Petr Štetiar
DRY is good, otherwise we're going to suffer with a copy disease
in the init scripts.

Signed-off-by: Petr Štetiar 
---
 package/base-files/files/etc/rc.common | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/rc.common 
b/package/base-files/files/etc/rc.common
index 75dbeedf34d4..3bd382ae27ac 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -95,7 +95,11 @@ service_data() {
 }
 
 service_running() {
-   return 0
+   [ -n "$USE_PROCD" ] || return 0
+
+   local service="${1:-$(basename $initscript)}"
+   local instance="${2:-*}"
+   procd_running "$service" "${instance}" "$@"
 }
 
 ${INIT_TRACE:+set -x}
@@ -104,6 +108,9 @@ ${INIT_TRACE:+set -x}
 
 [ -n "$USE_PROCD" ] && {
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
+   EXTRA_HELP="\
+   running Check if service is running
+   "
 
. $IPKG_INSTROOT/lib/functions/procd.sh
basescript=$(readlink "$initscript")

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


[OpenWrt-Devel] [PATCH] build: rules.mk: allow overriding of HOSTCC and HOSTCXX

2019-07-23 Thread Petr Štetiar
Currently it's not possible to change the host compiler version during
devlopment/test/fixing and one has to always hand edit rules.mk which is
tiresome, so let's allow changing of those variables from make/env vars.

Signed-off-by: Petr Štetiar 
---
 rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules.mk b/rules.mk
index 80cb3d63f449..dc8a1bac8d83 100644
--- a/rules.mk
+++ b/rules.mk
@@ -245,8 +245,8 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
 
 export PKG_CONFIG
 
-HOSTCC:=gcc
-HOSTCXX:=g++
+HOSTCC?=gcc
+HOSTCXX?=g++
 HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if 
$(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include 
-I$(STAGING_DIR)/host/include)
 HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
 HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if 
$(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)

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


[OpenWrt-Devel] [PATCH] ath79: add support for gl-ar750

2019-07-23 Thread Luochongjun
This patch supports gl-ar750, which was previously supported by ar71xx.

Specification:
- SOC: QCA9531 (650MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 10/100: 2xLAN + 10/100: 1xWAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Switch: 1x switch
- Button: 1x reset button
- LED: 3x LEDS (white)

Flash instruction:
Support for sysupgrade directive upgrades, as well as luci upgrades.

Signed-off-by: Luochongjun 
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 149 +
 target/linux/ath79/image/generic.mk|   9 ++
 3 files changed, 159 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 8f0ea1d..6a9cb1c 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -116,6 +116,7 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +1)
;;
+   glinet,gl-ar750|\
glinet,gl-ar750s)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) 
+1)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts 
b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
new file mode 100644
index 000..b8f9735
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca953x.dtsi"
+
+/ {
+   compatible = "glinet,gl-ar750", "qca,qca9531";
+   model = "GL.iNet GL-AR750";
+
+   keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_disable_pins>;
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = < 3 GPIO_ACTIVE_LOW>;
+   };
+
+   mode {
+   label = "mode";
+   linux,code = ;
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power {
+   label = "gl-ar750:white:power";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "gl-ar750:white:wlan2g";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "gl-ar750:white:wlan5g";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+   i2c {
+   compatible = "i2c-gpio";
+
+   sda-gpios = < 17 GPIO_ACTIVE_LOW>;
+   scl-gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+
+};
+
+ {
+   status = "okay";
+
+   wifi@0,0 {
+   compatible = "qcom,ath10k";
+   reg = <0 0 0 0 0>;
+   device_type = "pci";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   hub_port: port@1 {
+   reg = <1>;
+   #trigger-source-cells = <0>;
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   num-cs = <0>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   read-only;
+   };
+
+   art: partition@5 {
+   label = "art";
+   reg = <0x05 0x01>;
+   read-only;
+   };
+
+   partition@6 {
+   compatible = "denx,uimage";
+