[OpenWrt-Devel] [PATCH] openvpn: add support for X.509 name options

2016-03-04 Thread Jeffery To
x509-username-field was added in OpenVPN 2.2, and verify-x509-name was
added in 2.3. This fixes ticket #18807.

Signed-off-by: Jeffery To 
---
 package/network/services/openvpn/files/openvpn.init | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/openvpn/files/openvpn.init 
b/package/network/services/openvpn/files/openvpn.init
index 342e5d8..5396d0b 100644
--- a/package/network/services/openvpn/files/openvpn.init
+++ b/package/network/services/openvpn/files/openvpn.init
@@ -124,6 +124,7 @@ start_instance() {
socks_proxy status status_version syslog tcp_queue_limit 
tls_auth \
tls_cipher tls_remote tls_timeout tls_verify tmp_dir topology 
tran_window \
tun_mtu tun_mtu_extra txqueuelen user verb down push up \
+   verify_x509_name x509_username_field \
ifconfig_ipv6 route_ipv6 server_ipv6 ifconfig_ipv6_pool 
ifconfig_ipv6_push iroute_ipv6
 
openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf"
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] zlib: Use relative paths in pkg-config metadata file

2019-05-02 Thread Jeffery To
The default zlib.pc file generated by cmake contains absolute paths.
This patches the file to use relative paths (relative to ${prefix} and
${exec_prefix}).

Signed-off-by: Jeffery To 
---
 package/libs/zlib/Makefile |  2 +-
 .../patches/004-relative-pkg-config-paths.patch| 14 ++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 
package/libs/zlib/patches/004-relative-pkg-config-paths.patch

diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile
index 4a2a0e53b0..c7a8415c79 100644
--- a/package/libs/zlib/Makefile
+++ b/package/libs/zlib/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zlib
 PKG_VERSION:=1.2.11
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
diff --git a/package/libs/zlib/patches/004-relative-pkg-config-paths.patch 
b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
new file mode 100644
index 00..c86d19b412
--- /dev/null
+++ b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
@@ -0,0 +1,14 @@
+--- a/zlib.pc.cmakein
 b/zlib.pc.cmakein
+@@ -1,8 +1,8 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+-libdir=@INSTALL_LIB_DIR@
+-sharedlibdir=@INSTALL_LIB_DIR@
+-includedir=@INSTALL_INC_DIR@
++libdir=${exec_prefix}/lib
++sharedlibdir=${exec_prefix}/lib
++includedir=${prefix}/include
+ 
+ Name: zlib
+ Description: zlib compression library
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH] build: fix STAGING_DIR cleaning when filenames contain spaces

2019-05-02 Thread Jeffery To
When looping through a package's STAGING_FILES_LIST (a list of
file/directory paths delimited by newlines), if the path contains
spaces, then the path will be split by the while loops, and the
file/directory will not be deleted/removed.

This sets the internal field separator to the newline only so that the
entire path is considered when deleting/removing.

Signed-off-by: Jeffery To 
---
 scripts/clean-package.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index e580566a52..3a824929c6 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -1,4 +1,6 @@
 #!/usr/bin/env bash
+IFS="
+"
 [ -n "$1" -a -n "$2" ] || {
echo "Usage: $0  "
exit 1
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-05-02 Thread Jeffery To
This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
account (if set), so that packages do not need to manually override
PKG_BUILD_DIR just to handle variants.

This also updates most base packages with variants to use the updated
default PKG_BUILD_DIR.

Signed-off-by: Jeffery To 
---
 include/package.mk| 2 +-
 package/libs/ustream-ssl/Makefile | 2 --
 package/network/services/hostapd/Makefile | 2 --
 package/network/services/odhcpd/Makefile  | 2 --
 package/network/services/openvpn/Makefile | 1 -
 package/network/services/ppp/Makefile | 3 ++-
 package/network/utils/iproute2/Makefile   | 4 ++--
 package/network/utils/iw/Makefile | 1 -
 package/network/utils/tcpdump/Makefile| 1 -
 package/system/ucert/Makefile | 2 --
 package/utils/px5g/Makefile   | 1 -
 11 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/include/package.mk b/include/package.mk
index 569ad647d6..015117bd3a 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
 
 include $(INCLUDE_DIR)/download.mk
 
-PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if 
$(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
 PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
diff --git a/package/libs/ustream-ssl/Makefile 
b/package/libs/ustream-ssl/Makefile
index a15f3d8ab8..3b23d30b31 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl/Makefile
@@ -10,8 +10,6 @@ PKG_SOURCE_VERSION:=23a3f2830341acd1db149175baf7315a33bd0edb
 
PKG_MIRROR_HASH:=289bef5dac684015b6a40cfd72cf1c8c297bb77cf2efd54e562b628ba3afd83d
 CMAKE_INSTALL:=1
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
-
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile
index 235f178bc9..05789dbe6b 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -67,8 +67,6 @@ ifeq ($(LOCAL_VARIANT),mesh)
   CONFIG_VARIANT:=full
 endif
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 
 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
diff --git a/package/network/services/odhcpd/Makefile 
b/package/network/services/odhcpd/Makefile
index a588af0ea6..83cfdd235b 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -19,8 +19,6 @@ 
PKG_MIRROR_HASH:=27a0802a01bc6334c6c602b71d8521a2472b82d2bf67be63ae380f56234b0fb
 PKG_MAINTAINER:=Hans Dedecker 
 PKG_LICENSE:=GPL-2.0
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 PKG_INSTALL:=1
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
 
diff --git a/package/network/services/openvpn/Makefile 
b/package/network/services/openvpn/Makefile
index f01b74d8aa..538be5d51d 100644
--- a/package/network/services/openvpn/Makefile
+++ b/package/network/services/openvpn/Makefile
@@ -18,7 +18,6 @@ PKG_SOURCE_URL:=\
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_HASH:=a42f53570f669eaf10af68e98d65b531015ff9e12be7a62d9269ea684652f648
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Felix Fietkau 
 
 PKG_INSTALL:=1
diff --git a/package/network/services/ppp/Makefile 
b/package/network/services/ppp/Makefile
index e4a90384d4..0e11a1bb60 100644
--- a/package/network/services/ppp/Makefile
+++ b/package/network/services/ppp/Makefile
@@ -23,7 +23,8 @@ PKG_CPE_ID:=cpe:/a:samba:ppp
 PKG_RELEASE_VERSION:=2.4.7
 PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+# set by kernel.mk
+undefine PKG_BUILD_DIR
 
 PKG_BUILD_DEPENDS:=libpcap
 
diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index 8617a8ef2f..00f0f2ae1d 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -19,9 +19,9 @@ PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
 PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/kernel.mk
+# set by kernel.mk
+undefine PKG_BUILD_DIR
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
diff --git a/package/network/utils/iw/Makefile 
b/package/network/utils/iw/Makefile
index 58cf8319f5..64438a1931 100644
--- a/package/network/utils/iw/Makefile
+++ b/package/network/utils/iw/Makefile
@@ -15,7 +15,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/iw
 PKG_HASH

[OpenWrt-Devel] [PATCH] base-files: Add /etc/shinit for non-login shell init

2019-05-02 Thread Jeffery To
Because /etc/profile (and ~/.profile) are read by login shells only,
aliases and functions defined there are not available to non-login
shells, e.g. when using screen or tmux.

If the ENV environment variable exists (exported by /etc/profile or
~/.profile) and references an existing file, then all interactive shells
(login or non-login) will read that file as well.

This sets the ENV environment variable in /etc/profile, pointing to
/etc/shinit.

This also adds /etc/shinit, which:

* Contains alias and function definitions originally in /etc/profile

* Sources /etc/mkshrc if the user is using mksh (also originally in
  /etc/profile), as /etc/mkshrc is meant for all interactive shells

* Sources ~/.mkshrc if the user is using mksh, to compensate for the
  fact that mksh will not read ~/.mkshrc if ENV is set

* Sources ~/.shinit if the user is not using mksh

This also removes the shebang from /etc/profile, as the file is sourced,
not executed.

Signed-off-by: Jeffery To 
---
 package/base-files/Makefile   |  1 +
 package/base-files/files/etc/profile  | 21 +--
 package/base-files/files/etc/shinit   | 21 +++
 .../lib/upgrade/keep.d/base-files-essential   |  1 +
 4 files changed, 24 insertions(+), 20 deletions(-)
 create mode 100644 package/base-files/files/etc/shinit

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 609ffa2c38..f31f304af6 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -63,6 +63,7 @@ define Package/base-files/conffiles
 /etc/services
 /etc/shadow
 /etc/shells
+/etc/shinit
 /etc/sysctl.conf
 /etc/sysupgrade.conf
 $(call $(TARGET)/conffiles)
diff --git a/package/base-files/files/etc/profile 
b/package/base-files/files/etc/profile
index 9a3ac069a2..0beff1608f 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -1,4 +1,3 @@
-#!/bin/sh
 [ -e /tmp/.failsafe ] && export FAILSAFE=1
 
 [ -f /etc/banner ] && cat /etc/banner
@@ -13,6 +12,7 @@ export PATH="%PATH%"
 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 export HOME=${HOME:-/root}
 export PS1='\u@\h:\w\$ '
+export ENV=/etc/shinit
 
 case "$TERM" in
xterm*|rxvt*)
@@ -20,16 +20,6 @@ case "$TERM" in
;;
 esac
 
-[ -x /bin/more ] || alias more=less
-[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
-
-alias ll='ls -alF --color=auto'
-
-[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
-
-[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
-[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
-
 [ -n "$FAILSAFE" ] || {
for FILE in /etc/profile.d/*.sh; do
[ -e "$FILE" ] && . "$FILE"
@@ -48,12 +38,3 @@ in order to prevent unauthorized SSH logins.
 --
 EOF
 fi
-
-service() {
-   [ -f "/etc/init.d/$1" ] || {
-   echo "service "'"'"$1"'"'" not found, the following services 
are available:"
-   ls "/etc/init.d"
-   return 1
-   }
-   /etc/init.d/$@
-}
diff --git a/package/base-files/files/etc/shinit 
b/package/base-files/files/etc/shinit
new file mode 100644
index 00..6b715c1ef9
--- /dev/null
+++ b/package/base-files/files/etc/shinit
@@ -0,0 +1,21 @@
+[ -x /bin/more ] || alias more=less
+[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
+
+alias ll='ls -alF --color=auto'
+
+[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
+
+[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
+[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+service() {
+   [ -f "/etc/init.d/$1" ] || {
+   echo "service "'"'"$1"'"'" not found, the following services 
are available:"
+   ls "/etc/init.d"
+   return 1
+   }
+   /etc/init.d/$@
+}
+
+[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit"
+[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc"
diff --git a/package/base-files/files/lib/upgrade/keep.d/base-files-essential 
b/package/base-files/files/lib/upgrade/keep.d/base-files-essential
index 978d4b58bc..7a7a253466 100644
--- a/package/base-files/files/lib/upgrade/keep.d/base-files-essential
+++ b/package/base-files/files/lib/upgrade/keep.d/base-files-essential
@@ -6,5 +6,6 @@
 /etc/profile
 /etc/shadow
 /etc/shells
+/etc/shinit
 /etc/sysctl.conf
 /etc/rc.local
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH] build: fix STAGING_DIR cleaning when filenames contain spaces

2019-05-15 Thread Jeffery To
On Fri, May 3, 2019 at 5:40 PM Petr Štetiar  wrote:

> Jeffery To  [2019-05-03 01:33:27]:
>
> > When looping through a package's STAGING_FILES_LIST (a list of
> > file/directory paths delimited by newlines), if the path contains
> > spaces, then the path will be split by the while loops, and the
> > file/directory will not be deleted/removed.
> >
> > This sets the internal field separator to the newline only so that the
> > entire path is considered when deleting/removing.
> >
> > Signed-off-by: Jeffery To 
> > ---
> >  scripts/clean-package.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
> > index e580566a52..3a824929c6 100755
> > --- a/scripts/clean-package.sh
> > +++ b/scripts/clean-package.sh
> > @@ -1,4 +1,6 @@
> >  #!/usr/bin/env bash
> > +IFS="
> > +"
> >  [ -n "$1" -a -n "$2" ] || {
> >   echo "Usage: $0  "
> >   exit 1
>
> just for the record, copy&pasting my comment from your PR[1]:
>
> I'm just wondering, if this proposed fix with this strange looking IFS is
> the
> right direction. Usually if I've problem with whitespaces in filenames,
> it's
> because I've forget to use xargs. If I'm not mistaken, this [ -n "$entry"
> ] ||
> break construct could be replaced with xargs -r, there's even XARGS:=xargs
> -r
> in rules.mk. Just my two cents.
>
> 1. https://github.com/openwrt/openwrt/pull/1806#issuecomment-475454138
>
> -- ynezz
>

For the record, here is my reply from the PR[1]:

IFS[2] is a standard internal variable that controls how the shell splits
tokens. Setting it here determines how the while loops further down the
script will split the input (lines of file paths generated by find).
Normally, IFS contains space, newline, and tab, which causes the while
loops to incorrectly split paths with spaces. This problem is avoided by
setting IFS to the newline only.

The line you cite ([ -n "$entry" ] || break) causes the while loops (which
delete the input file paths) to exit on the first empty line of input. It
would make no sense to replace it with xargs.

* * *

I finally remembered, I copied this syntax from
package/network/services/openvpn/files/openvpn.init[3]:

LIST_SEP="
"

then further down it's used in append_param()[4] as IFS="$LIST_SEP" (I
won't quote the whole for loop here).

If you prefer, I can change this to use ksh93 syntax[5]:

IFS=$'\n'

If you want to rewrite the script to use xargs, please be my guest, but
setting IFS solves the issue here of spaces in file paths (technically,
lines of text read from a file list).


1. https://github.com/openwrt/openwrt/pull/1806#issuecomment-475506440
2. https://www.tldp.org/LDP/abs/html/internalvariables.html#IFSREF
3.
https://github.com/openwrt/openwrt/blob/172b02c05f2dc199f511f1577aeddfabb7790dc0/package/network/services/openvpn/files/openvpn.init#L13-L14
4.
https://github.com/openwrt/openwrt/blob/172b02c05f2dc199f511f1577aeddfabb7790dc0/package/network/services/openvpn/files/openvpn.init#L43
5. https://unix.stackexchange.com/a/184867
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: fix STAGING_DIR cleaning when filenames contain spaces

2019-05-15 Thread Jeffery To
On Wed, May 15, 2019 at 7:03 PM Jeffery To  wrote:

> On Fri, May 3, 2019 at 5:40 PM Petr Štetiar  wrote:
>
>> Jeffery To  [2019-05-03 01:33:27]:
>>
>> > When looping through a package's STAGING_FILES_LIST (a list of
>> > file/directory paths delimited by newlines), if the path contains
>> > spaces, then the path will be split by the while loops, and the
>> > file/directory will not be deleted/removed.
>> >
>> > This sets the internal field separator to the newline only so that the
>> > entire path is considered when deleting/removing.
>> >
>> > Signed-off-by: Jeffery To 
>> > ---
>> >  scripts/clean-package.sh | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
>> > index e580566a52..3a824929c6 100755
>> > --- a/scripts/clean-package.sh
>> > +++ b/scripts/clean-package.sh
>> > @@ -1,4 +1,6 @@
>> >  #!/usr/bin/env bash
>> > +IFS="
>> > +"
>> >  [ -n "$1" -a -n "$2" ] || {
>> >   echo "Usage: $0  "
>> >   exit 1
>>
>> just for the record, copy&pasting my comment from your PR[1]:
>>
>> I'm just wondering, if this proposed fix with this strange looking IFS is
>> the
>> right direction. Usually if I've problem with whitespaces in filenames,
>> it's
>> because I've forget to use xargs. If I'm not mistaken, this [ -n "$entry"
>> ] ||
>> break construct could be replaced with xargs -r, there's even
>> XARGS:=xargs -r
>> in rules.mk. Just my two cents.
>>
>> 1. https://github.com/openwrt/openwrt/pull/1806#issuecomment-475454138
>>
>> -- ynezz
>>
>
> For the record, here is my reply from the PR[1]:
>
> IFS[2] is a standard internal variable that controls how the shell splits
> tokens. Setting it here determines how the while loops further down the
> script will split the input (lines of file paths generated by find).
> Normally, IFS contains space, newline, and tab, which causes the while
> loops to incorrectly split paths with spaces. This problem is avoided by
> setting IFS to the newline only.
>
> The line you cite ([ -n "$entry" ] || break) causes the while loops (which
> delete the input file paths) to exit on the first empty line of input. It
> would make no sense to replace it with xargs.
>
> * * *
>
> I finally remembered, I copied this syntax from
> package/network/services/openvpn/files/openvpn.init[3]:
>
> LIST_SEP="
> "
>
> then further down it's used in append_param()[4] as IFS="$LIST_SEP" (I
> won't quote the whole for loop here).
>
> If you prefer, I can change this to use ksh93 syntax[5]:
>
> IFS=$'\n'
>
> If you want to rewrite the script to use xargs, please be my guest, but
> setting IFS solves the issue here of spaces in file paths (technically,
> lines of text read from a file list).
>
>
> 1. https://github.com/openwrt/openwrt/pull/1806#issuecomment-475506440
> 2. https://www.tldp.org/LDP/abs/html/internalvariables.html#IFSREF
> 3.
> https://github.com/openwrt/openwrt/blob/172b02c05f2dc199f511f1577aeddfabb7790dc0/package/network/services/openvpn/files/openvpn.init#L13-L14
> 4.
> https://github.com/openwrt/openwrt/blob/172b02c05f2dc199f511f1577aeddfabb7790dc0/package/network/services/openvpn/files/openvpn.init#L43
> 5. https://unix.stackexchange.com/a/184867
>
>
Just want to add, it may not be obvious why there would be spaces in file
paths (it wasn't obvious to me at first).

Apparently, some Go packages that users have been trying to build
(Docker[1], Delve[2]) include files with spaces in their names (mostly as
test cases for handling files with spaces in their name, I think). The Go
compilation issue was eventually fixed, but I noticed that the files were
not cleaned up properly from STAGING_DIR.


1. https://github.com/openwrt/packages/pull/7127#issuecomment-439688448
2. https://github.com/openwrt/packages/issues/7639
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-05-15 Thread Jeffery To
On Sun, May 12, 2019 at 3:15 AM Hauke Mehrtens  wrote:

> On 5/2/19 7:52 PM, Jeffery To wrote:
> > This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
> > account (if set), so that packages do not need to manually override
> > PKG_BUILD_DIR just to handle variants.
> >
> > This also updates most base packages with variants to use the updated
> > default PKG_BUILD_DIR.
> >
> > Signed-off-by: Jeffery To 
> > ---
> >  include/package.mk| 2 +-
> >  package/libs/ustream-ssl/Makefile | 2 --
> >  package/network/services/hostapd/Makefile | 2 --
> >  package/network/services/odhcpd/Makefile  | 2 --
> >  package/network/services/openvpn/Makefile | 1 -
> >  package/network/services/ppp/Makefile | 3 ++-
> >  package/network/utils/iproute2/Makefile   | 4 ++--
> >  package/network/utils/iw/Makefile | 1 -
> >  package/network/utils/tcpdump/Makefile| 1 -
> >  package/system/ucert/Makefile | 2 --
> >  package/utils/px5g/Makefile   | 1 -
> >  11 files changed, 5 insertions(+), 16 deletions(-)
> >
> > diff --git a/include/package.mk b/include/package.mk
> > index 569ad647d6..015117bd3a 100644
> > --- a/include/package.mk
> > +++ b/include/package.mk
> > @@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if
> $(CHECK),check,compile))
> >
> >  include $(INCLUDE_DIR)/download.mk
> >
> > -PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if
> $(PKG_VERSION),-$(PKG_VERSION))
> > +PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if
> $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if
> $(PKG_VERSION),-$(PKG_VERSION))
> >  PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
> >  PKG_BUILD_PARALLEL ?=
> >  PKG_USE_MIPS16 ?= 1
>
> Please also update the variable in include/kernel.mk then you should not
> need the workarounds for the packages which include include/kernel.mk
> and more.
>
> Hauke
>

I've updated include/kernel.mk and will submit a revised patch shortly, but
now iproute2 and ppp are built inside KERNEL_BUILD_DIR instead of
BUILD_DIR, not sure if this is an issue.

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


[OpenWrt-Devel] [PATCH v2] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-05-15 Thread Jeffery To
This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
account (if set), so that packages do not need to manually override
PKG_BUILD_DIR just to handle variants.

This also updates most base packages with variants to use the updated
default PKG_BUILD_DIR.

Signed-off-by: Jeffery To 
---
v2: updated PKG_BUILD_DIR in include/kernel.mk, removed undefines

 include/kernel.mk | 2 +-
 include/package.mk| 2 +-
 package/libs/ustream-ssl/Makefile | 2 --
 package/network/services/hostapd/Makefile | 2 --
 package/network/services/odhcpd/Makefile  | 2 --
 package/network/services/openvpn/Makefile | 1 -
 package/network/services/ppp/Makefile | 2 --
 package/network/utils/iproute2/Makefile   | 2 --
 package/network/utils/iw/Makefile | 1 -
 package/network/utils/tcpdump/Makefile| 1 -
 package/system/ucert/Makefile | 2 --
 package/utils/px5g/Makefile   | 1 -
 12 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 3195090a0a..24ece77e0f 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -77,7 +77,7 @@ else
   TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
 
   ifneq ($(TARGET_BUILD),1)
-PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(if 
$(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
   endif
 endif
 
diff --git a/include/package.mk b/include/package.mk
index 569ad647d6..015117bd3a 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
 
 include $(INCLUDE_DIR)/download.mk
 
-PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if 
$(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
 PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
diff --git a/package/libs/ustream-ssl/Makefile 
b/package/libs/ustream-ssl/Makefile
index a15f3d8ab8..3b23d30b31 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl/Makefile
@@ -10,8 +10,6 @@ PKG_SOURCE_VERSION:=23a3f2830341acd1db149175baf7315a33bd0edb
 
PKG_MIRROR_HASH:=289bef5dac684015b6a40cfd72cf1c8c297bb77cf2efd54e562b628ba3afd83d
 CMAKE_INSTALL:=1
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
-
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile
index 235f178bc9..05789dbe6b 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -67,8 +67,6 @@ ifeq ($(LOCAL_VARIANT),mesh)
   CONFIG_VARIANT:=full
 endif
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 
 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
diff --git a/package/network/services/odhcpd/Makefile 
b/package/network/services/odhcpd/Makefile
index a588af0ea6..83cfdd235b 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -19,8 +19,6 @@ 
PKG_MIRROR_HASH:=27a0802a01bc6334c6c602b71d8521a2472b82d2bf67be63ae380f56234b0fb
 PKG_MAINTAINER:=Hans Dedecker 
 PKG_LICENSE:=GPL-2.0
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 PKG_INSTALL:=1
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
 
diff --git a/package/network/services/openvpn/Makefile 
b/package/network/services/openvpn/Makefile
index f01b74d8aa..538be5d51d 100644
--- a/package/network/services/openvpn/Makefile
+++ b/package/network/services/openvpn/Makefile
@@ -18,7 +18,6 @@ PKG_SOURCE_URL:=\
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_HASH:=a42f53570f669eaf10af68e98d65b531015ff9e12be7a62d9269ea684652f648
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Felix Fietkau 
 
 PKG_INSTALL:=1
diff --git a/package/network/services/ppp/Makefile 
b/package/network/services/ppp/Makefile
index a588540a5d..1235d18471 100644
--- a/package/network/services/ppp/Makefile
+++ b/package/network/services/ppp/Makefile
@@ -23,8 +23,6 @@ PKG_CPE_ID:=cpe:/a:samba:ppp
 PKG_RELEASE_VERSION:=2.4.7
 PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 PKG_BUILD_DEPENDS:=libpcap
 
 PKG_BUILD_PARALLEL:=1
diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index 8617a8ef2f..2d69f1c1f3 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -19,8 +19,6 @@ PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
 PKG_CPE_ID:=cpe

Re: [OpenWrt-Devel] [PATCH] zlib: Use relative paths in pkg-config metadata file

2019-05-15 Thread Jeffery To
On Fri, May 3, 2019 at 5:32 PM Petr Štetiar  wrote:

> Jeffery To  [2019-05-03 00:47:06]:
>
> > The default zlib.pc file generated by cmake contains absolute paths.
> > This patches the file to use relative paths (relative to ${prefix} and
> > ${exec_prefix}).
>
> I can see that from the diff already, but I miss the information, why do
> you
> need this change. Could this perhaps be upstreamed first as well?
>
> -- ynezz
>

The buildroot pkg-config (in staging_dir/host/bin) overrides the prefix and
exec_prefix variables in *.pc files, to supply the correct (buildroot)
paths for callers. If other variables are not defined relative to prefix
and exec_prefix, then the returned values will be incorrect.

A similar change was merged for xz[1] in the packages repo.

I'm not sure upstream will want this change, since what is there currently
isn't "wrong"; it only affects our cross-compilation.


1. https://github.com/openwrt/packages/pull/8880
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: fix STAGING_DIR cleaning when filenames contain spaces

2019-05-15 Thread Jeffery To
On Wed, May 15, 2019 at 9:24 PM Petr Štetiar  wrote:

> Jeffery To  [2019-05-15 19:03:16]:
>
> > If you prefer, I can change this to use ksh93 syntax[5]:
> >
> > IFS=$'\n'
>
> indeed, I like this a lot more, and
>
>  IFS="$(printf '\n\t')"
>
> from that TLDP page you've linked looks good as well, seems even more
> readable
> to me. Anyway, I'll leave the decision up to you, both are fine with me.
>

 Sure, I'll change it to IFS=$'\n'.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] build: fix STAGING_DIR cleaning when filenames contain spaces

2019-05-15 Thread Jeffery To
When looping through a package's STAGING_FILES_LIST (a list of
file/directory paths delimited by newlines), if the path contains
spaces, then the path will be split by the while loops, and the
file/directory will not be deleted/removed.

This sets the internal field separator to the newline only so that the
entire path is considered when deleting/removing.

Signed-off-by: Jeffery To 
---
v2: use ksh93 syntax

 scripts/clean-package.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index e580566a52..6dd9bf7306 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+IFS=$'\n'
 [ -n "$1" -a -n "$2" ] || {
echo "Usage: $0  "
exit 1
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH] zlib: Use relative paths in pkg-config metadata file

2019-05-15 Thread Jeffery To
On Wed, May 15, 2019 at 9:33 PM Petr Štetiar  wrote:

> Jeffery To  [2019-05-15 21:00:28]:
>
> > The buildroot pkg-config (in staging_dir/host/bin) overrides the prefix
> and
> > exec_prefix variables in *.pc files, to supply the correct (buildroot)
> > paths for callers. If other variables are not defined relative to prefix
> > and exec_prefix, then the returned values will be incorrect.
>
> Ok, makes sense, so can you add this explanation to the commit message
> please?
>

Sure, will do.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] zlib: Use relative paths in pkg-config metadata file

2019-05-15 Thread Jeffery To
The buildroot pkg-config (in staging_dir/host/bin) overrides the prefix
and exec_prefix variables in *.pc files, to supply the correct
(buildroot) paths for callers. If other variables are not defined
relative to prefix and exec_prefix, then the returned values will be
incorrect.

The default zlib.pc file generated by cmake contains absolute paths.
This patches the file to use relative paths (relative to ${prefix} and
${exec_prefix}).

Signed-off-by: Jeffery To 
---
v2: expanded commit message

 package/libs/zlib/Makefile |  2 +-
 .../patches/004-relative-pkg-config-paths.patch| 14 ++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 
package/libs/zlib/patches/004-relative-pkg-config-paths.patch

diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile
index 4a2a0e53b0..c7a8415c79 100644
--- a/package/libs/zlib/Makefile
+++ b/package/libs/zlib/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zlib
 PKG_VERSION:=1.2.11
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
diff --git a/package/libs/zlib/patches/004-relative-pkg-config-paths.patch 
b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
new file mode 100644
index 00..c86d19b412
--- /dev/null
+++ b/package/libs/zlib/patches/004-relative-pkg-config-paths.patch
@@ -0,0 +1,14 @@
+--- a/zlib.pc.cmakein
 b/zlib.pc.cmakein
+@@ -1,8 +1,8 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+-libdir=@INSTALL_LIB_DIR@
+-sharedlibdir=@INSTALL_LIB_DIR@
+-includedir=@INSTALL_INC_DIR@
++libdir=${exec_prefix}/lib
++sharedlibdir=${exec_prefix}/lib
++includedir=${prefix}/include
+ 
+ Name: zlib
+ Description: zlib compression library
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH 2/5] build: image: Add pad-to and pad-rootfs-squashfs helpers

2019-05-18 Thread Jeffery To
On Mon, Apr 1, 2019 at 7:25 PM Petr Štetiar  wrote:

> Jo-Philipp Wich  [2019-04-01 11:18:55]:
>
> > Instead of having one set of images a few MB larger, we have a completely
> > new set of larger images *and* the existing ones.
>
> I'm all in for having usable images out of the box, without any additional
> post-processing steps, but on the other hand I understand, that this might
> slow down noticeably some existing use cases.
>
> BTW, we're talking on x86 probably about additional 40M (~10M per each of 4
> subtargets) and 8 additional QEMU ready images.  On armvirt/malta we're
> going
> to produce(if agreed upon) padded images by default, so no difference
> there.
>

May I ask, is there consensus on how to approach this? (Apologies, I
haven't been following this thread very closely.)

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


[OpenWrt-Devel] [PATCH] build: Remove STAGING_DIR_HOST references for InstallDev/UninstallDev

2019-06-08 Thread Jeffery To
Build/InstallDev no longer places a file list in
$(STAGING_DIR_HOST)/packages; this change removes the creation of
$(STAGING_DIR_HOST)/packages and the attempted removal of a
STAGING_DIR_HOST file list during package clean.

This also changes the host directory passed to Build/UninstallDev from
$(STAGING_DIR_HOST) to $(STAGING_DIR)/host, to match the directory
passed to Build/InstallDev.

Signed-off-by: Jeffery To 
---
 include/package.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/package.mk b/include/package.mk
index 569ad647d6..348f75fba7 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -195,7 +195,7 @@ define Build/CoreTargets
   $(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
   $(STAMP_INSTALLED): $(STAMP_BUILT)
rm -rf $(TMP_DIR)/stage-$(PKG_DIR_NAME)
-   mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages 
$(STAGING_DIR_HOST)/packages
+   mkdir -p $(TMP_DIR)/stage-$(PKG_DIR_NAME)/host $(STAGING_DIR)/packages
$(foreach hook,$(Hooks/InstallDev/Pre),\
$(call 
$(hook),$(TMP_DIR)/stage-$(PKG_DIR_NAME),$(TMP_DIR)/stage-$(PKG_DIR_NAME)/host)$(sep)\
)
@@ -314,9 +314,9 @@ clean-build: $(if $(wildcard 
$(PKG_BUILD_DIR)/.autoremove),force-clean-build)
 
 clean: force-clean-build
$(CleanStaging)
-   $(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
+   $(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR)/host)
$(Build/Clean)
-   rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) 
$(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
+   rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST)
 
 dist:
$(Build/Dist)
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH 1/6] build: Add auto file tracking / uninstall for Host/Install

2019-06-14 Thread Jeffery To
This adds automatic file tracking and uninstallation (similar to that
for Build/InstallDev) for files installed by Host/Install.

A path to a staging directory will be passed to Host/Install. If files
are placed in that staging directory, they will be tracked and installed
into $(HOST_BUILD_PREFIX) (either $(STAGING_DIR_HOST) or
$(STAGING_DIR_HOSTPKG), depend on the package/tool).

If Host/Install doesn't use the staging directory and install to
$(STAGING_DIR_HOST) / $(STAGING_DIR_HOSTPKG) directly, no error is
raised.

This also updates Host/Install/Default to handle the staging directory,
combined with setting DESTDIR in a new HOST_MAKE_INSTALL_FLAGS variable.

Host/Install/Default now also handles a second parameter, allowing a
different install target to be specified (similar to
Build/Install/Default).

Signed-off-by: Jeffery To 
---
 include/host-build.mk | 52 ++-
 1 file changed, 47 insertions(+), 5 deletions(-)

diff --git a/include/host-build.mk b/include/host-build.mk
index 827ea6bbfb..ce2fcc26eb 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -30,6 +30,20 @@ HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
 HOST_BUILD_PREFIX?=$(if 
$(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
 HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.$(PKG_NAME)_installed
 
+HOST_STAGING_FILES_LIST:=$(PKG_NAME).list
+HOST_STAGING_DIR:=$(TMP_DIR)/$(if 
$(IS_PACKAGE_BUILD),hostpkg,host)-stage-$(PKG_NAME)
+
+define HostCleanStaging
+   rm -f $(HOST_STAMP_INSTALLED)
+   @-(\
+   if [ -f 
$(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST) ]; then \
+   $(SCRIPT_DIR)/clean-package.sh \
+   
"$(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST)" \
+   "$(HOST_BUILD_PREFIX)"; \
+   fi; \
+   )
+endef
+
 override MAKEFLAGS=
 
 include $(INCLUDE_DIR)/autotools.mk
@@ -77,6 +91,10 @@ HOST_MAKE_VARS = \
 
 HOST_MAKE_FLAGS =
 
+HOST_MAKE_INSTALL_FLAGS = \
+   $(HOST_MAKE_FLAGS) \
+   DESTDIR="$(HOST_INSTALL_DIR)"
+
 HOST_CONFIGURE_CMD = $(BASH) ./configure
 
 ifeq ($(HOST_OS),Darwin)
@@ -112,11 +130,17 @@ define Host/Compile
 endef
 
 define Host/Install/Default
-   $(call Host/Compile/Default,install)
+   +$(HOST_MAKE_VARS) \
+   $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+   $(HOST_MAKE_INSTALL_FLAGS) \
+   $(if $(2),$(2),install)
+   $(if $(1),
+   $(CP) $(HOST_INSTALL_DIR)/$(HOST_BUILD_PREFIX)/* $(1)/
+   )
 endef
 
 define Host/Install
-  $(call Host/Install/Default,$(HOST_BUILD_PREFIX))
+  $(call Host/Install/Default,$(1),)
 endef
 
 
@@ -169,8 +193,25 @@ ifndef DUMP
 
   $(call Host/Exports,$(HOST_STAMP_INSTALLED))
   $(HOST_STAMP_INSTALLED): $(HOST_STAMP_BUILT) $(if 
$(FORCE_HOST_INSTALL),FORCE)
-   $(call Host/Install,$(HOST_BUILD_PREFIX))
-   $(foreach hook,$(Hooks/HostInstall/Post),$(call $(hook))$(sep))
+   rm -rf $(HOST_STAGING_DIR)
+   mkdir -p $(HOST_STAGING_DIR) $(HOST_BUILD_PREFIX)/packages
+   $(call Host/Install,$(HOST_STAGING_DIR))
+   $(foreach hook,$(Hooks/HostInstall/Post),\
+   $(call $(hook),$(HOST_STAGING_DIR))$(sep)\
+   )
+   if [ -f 
$(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST) ]; then \
+   $(SCRIPT_DIR)/clean-package.sh \
+   
"$(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST)" \
+   "$(HOST_BUILD_PREFIX)"; \
+   fi
+   if [ -z "(find $(HOST_STAGING_DIR) -maxdepth 0 -type d 
-empty)" ]; then \
+   (cd $(HOST_STAGING_DIR); find ./ > 
$(HOST_STAGING_DIR).files); \
+   $(call locked, \
+   mv $(HOST_STAGING_DIR).files 
$(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST) && \
+   $(CP) $(HOST_STAGING_DIR)/* 
$(HOST_BUILD_PREFIX)/ \
+   ,host-staging-dir); \
+   fi
+   rm -rf $(HOST_STAGING_DIR)
mkdir -p $$(shell dirname $$@)
touch $(HOST_STAMP_BUILT)
touch $$@
@@ -193,9 +234,10 @@ ifndef DUMP
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_BUILT)
 
   host-clean: host-clean-build
+   $(HostCleanStaging)
$(call Host/Clean)
$(call Host/Uninstall)
-   rm -rf $(HOST_STAMP_INSTALLED)
+   rm -f $(HOST_BUILD_PREFIX)/packages/$(HOST_STAGING_FILES_LIST)
 
 ifneq ($(CONFIG_AUTOREMOVE),)
   host-compile:
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH 2/6] build: Remove directory symbolic links when cleaning STAGING_DIR

2019-06-14 Thread Jeffery To
Currently, a symbolic link whose target is a directory will not be
removed by scripts/clean-package.sh. (In the first pass, the -f test is
false because the link target is a directory. In the second pass, the
link is not removed by rmdir.)

This updates clean-package.sh to remove all non-directories in the first
pass.

Signed-off-by: Jeffery To 
---
 scripts/clean-package.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index 6dd9bf7306..035725625d 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -12,7 +12,7 @@ cat "$1" | (
cd "$2"
while read entry; do
[ -n "$entry" ] || break
-   [ -f "$entry" ] && rm -f $entry
+   [ ! -d "$entry" ] || [ -L "$entry" ] && rm -f "$entry"
done
 )
 sort -r "$1" | (
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH 4/6] tools/autoconf, tools/quilt: Use default Host/Compile and Host/Install

2019-06-14 Thread Jeffery To
Since bash is used for all submake processes, it isn't necessary to
override Host/Compile and Host/Install to explicitly set SHELL=bash.

Using the default Host/Install also allows their files to be
automatically tracked and uninstalled.

Signed-off-by: Jeffery To 
---
 tools/autoconf/Makefile | 13 -
 tools/quilt/Makefile| 13 ++---
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/tools/autoconf/Makefile b/tools/autoconf/Makefile
index 6eb64d77d5..671564337f 100644
--- a/tools/autoconf/Makefile
+++ b/tools/autoconf/Makefile
@@ -21,17 +21,4 @@ HOST_CONFIGURE_ARGS += \
 HOST_CONFIGURE_VARS += \
PERL="/usr/bin/env perl"
 
-define Host/Compile
-   export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
-endef
-
-define Host/Install
-   export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
-endef
-
-define Host/Clean
-   -export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
-   $(call Host/Clean/Default)
-endef
-
 $(eval $(call HostBuild))
diff --git a/tools/quilt/Makefile b/tools/quilt/Makefile
index d0532b5984..e8f1a7a05f 100644
--- a/tools/quilt/Makefile
+++ b/tools/quilt/Makefile
@@ -21,16 +21,7 @@ define Host/Configure
[ -f $(HOST_BUILD_DIR)/Makefile ]
 endef
 
-define Host/Compile
-   $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" all
-endef
-
-define Host/Install
-   $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" install
-endef
-
-define Host/Clean
-   rm -f $(STAGING_DIR_HOST)/bin/quilt
-endef
+HOST_MAKE_INSTALL_FLAGS += \
+   BUILD_ROOT="$(HOST_INSTALL_DIR)"
 
 $(eval $(call HostBuild))
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH 5/6] tools: Install files into staging directory

2019-06-14 Thread Jeffery To
This updates Host/Install for many tools to install files into the given
staging directory, instead of into $(STAGING_DIR_HOST) directly, so that
files can be automatically tracked and uninstalled.

This also removes Host/Clean (now necessary) for many tools.

Signed-off-by: Jeffery To 
---
 tools/automake/Makefile   | 21 -
 tools/b43-tools/Makefile  | 17 +
 tools/bison/Makefile  |  9 ++---
 tools/cbootimage-configs/Makefile |  8 ++--
 tools/cbootimage/Makefile |  5 -
 tools/ccache/Makefile | 12 
 tools/e2fsprogs/Makefile  | 18 +++---
 tools/elftosb/Makefile|  3 ++-
 tools/expat/Makefile  |  4 
 tools/firmware-utils/Makefile |  3 ++-
 tools/flex/Makefile   |  9 ++---
 tools/flock/Makefile  |  3 ++-
 tools/genext2fs/Makefile  |  7 ++-
 tools/gengetopt/Makefile  |  7 ++-
 tools/kernel2minor/Makefile   |  7 ++-
 tools/libelf/Makefile | 12 +++-
 tools/libtool/Makefile| 13 -
 tools/lzma-old/Makefile   |  7 ++-
 tools/lzma/Makefile   |  7 ++-
 tools/m4/Makefile |  5 -
 tools/make-ext4fs/Makefile|  7 ++-
 tools/missing-macros/Makefile |  8 
 tools/mkimage/Makefile| 10 +++---
 tools/mklibs/Makefile | 15 ++-
 tools/mm-macros/Makefile  |  9 ++---
 tools/mtd-utils/Makefile  |  7 ++-
 tools/mtools/Makefile | 10 +++---
 tools/padjffs2/Makefile   |  7 ++-
 tools/patch-image/Makefile| 10 +++---
 tools/patchelf/Makefile   |  4 ++--
 tools/pkg-config/Makefile | 11 +++
 tools/qemu/Makefile   |  4 ++--
 tools/scons/Makefile  |  7 ---
 tools/sdimage/Makefile|  7 ++-
 tools/sed/Makefile|  7 ++-
 tools/sparse/Makefile |  3 ++-
 tools/squashfs/Makefile   | 10 +++---
 tools/squashfskit4/Makefile   | 10 +++---
 tools/sstrip/Makefile |  7 ++-
 tools/wrt350nv2-builder/Makefile  | 13 -
 tools/xz/Makefile |  2 +-
 tools/zip/Makefile|  4 ++--
 tools/zlib/Makefile   | 18 +++---
 43 files changed, 119 insertions(+), 248 deletions(-)

diff --git a/tools/automake/Makefile b/tools/automake/Makefile
index c016f1d76a..e63871f6ba 100644
--- a/tools/automake/Makefile
+++ b/tools/automake/Makefile
@@ -33,19 +33,14 @@ define Host/Install
# remove old automake resources to avoid version conflicts
rm -rf $(STAGING_DIR_HOST)/share/aclocal-[0-9]*
rm -rf $(STAGING_DIR_HOST)/share/automake-[0-9]*
-   $(MAKE) -C $(HOST_BUILD_DIR) install
-   mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real
-   $(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin
-   ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.9
-   ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.10
-   ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11
-   ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11.6
-   ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.15
-endef
-
-define Host/Clean
-   -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
-   $(call Host/Clean/Default)
+   $(call Host/Install/Default,$(1),)
+   mv $(1)/bin/aclocal $(1)/bin/aclocal.real
+   $(INSTALL_BIN) ./files/aclocal $(1)/bin/
+   ln -sf aclocal $(1)/bin/aclocal-1.9
+   ln -sf aclocal $(1)/bin/aclocal-1.10
+   ln -sf aclocal $(1)/bin/aclocal-1.11
+   ln -sf aclocal $(1)/bin/aclocal-1.11.6
+   ln -sf aclocal $(1)/bin/aclocal-1.15
 endef
 
 $(eval $(call HostBuild))
diff --git a/tools/b43-tools/Makefile b/tools/b43-tools/Makefile
index a99b0c9e53..1ef7d8ce58 100644
--- a/tools/b43-tools/Makefile
+++ b/tools/b43-tools/Makefile
@@ -33,18 +33,11 @@ define Host/Compile
 endef
 
 define Host/Install
-   $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/fwcutter/b43-fwcutter 
$(STAGING_DIR_HOST)/bin/
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm 
$(STAGING_DIR_HOST)/bin/
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm.bin 
$(STAGING_DIR_HOST)/bin/
-   $(INSTALL_BIN) ./files/b43-fwsquash.py $(STAGING_DIR_HOST)/bin/
-endef
-
-define Host/Clean
-   rm -f $(STAGING_DIR_HOST)/bin/b43-fwcutter
-   rm -f $(STAGING_DIR_HOST)/bin/b43-asm
-   rm -f $(STAGING_DIR_HOST)/bin/b43-asm.bin
-   rm -f $(STAGING_DIR_HOST)/bin/b43-fwsquash.py
+   $(INSTALL_DIR) $(1)/bin
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/fwcutter/b43-fwcutter $(1)/bin/
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm $(1)/bin/
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm.bin $(1)/bin/
+   $(INSTALL_BIN) ./files/b43-fwsquash.py

[OpenWrt-Devel] [PATCH 6/6] packages: Install files into staging directory in Host/Install

2019-06-14 Thread Jeffery To
This updates Host/Install for packages to install files into the given
staging directory, instead of into $(STAGING_DIR_HOSTPKG) (or
$(STAGING_DIR_HOST)) directly, so that files can be automatically
tracked and uninstalled.

Signed-off-by: Jeffery To 
---
 package/libs/gettext/Makefile   |  8 
 package/libs/libiconv/Makefile  | 12 ++--
 package/system/fwtool/Makefile  |  1 +
 package/system/iucode-tool/Makefile |  5 -
 package/system/opkg/Makefile|  4 +++-
 package/utils/bsdiff/Makefile   |  8 ++--
 package/utils/bzip2/Makefile|  8 +++-
 package/utils/lua/Makefile  |  9 +++--
 8 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/package/libs/gettext/Makefile b/package/libs/gettext/Makefile
index f37c4e4e74..2eff4410db 100644
--- a/package/libs/gettext/Makefile
+++ b/package/libs/gettext/Makefile
@@ -47,11 +47,11 @@ define Host/Compile
 endef
 
 define Host/Install
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
-   $(INSTALL_DATA) ./src/include/libintl.h $(STAGING_DIR_HOSTPKG)/include/
+   $(INSTALL_DIR) $(1)/include
+   $(INSTALL_DATA) ./src/include/libintl.h $(1)/include/
 
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/aclocal
-   $(INSTALL_DATA) ./src/m4/* $(STAGING_DIR_HOSTPKG)/share/aclocal/
+   $(INSTALL_DIR) $(1)/share/aclocal
+   $(INSTALL_DATA) ./src/m4/* $(1)/share/aclocal/
 endef
 
 define Package/libintl/install
diff --git a/package/libs/libiconv/Makefile b/package/libs/libiconv/Makefile
index 4d7dcd3498..7e9baa4129 100644
--- a/package/libs/libiconv/Makefile
+++ b/package/libs/libiconv/Makefile
@@ -65,14 +65,14 @@ define Host/Compile
 endef
 
 define Host/Install
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib
-   $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(STAGING_DIR_HOSTPKG)/lib/
+   $(INSTALL_DIR) $(1)/lib
+   $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(1)/lib/
 
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
-   $(INSTALL_DATA) ./src/include/iconv.h $(STAGING_DIR_HOSTPKG)/include/
+   $(INSTALL_DIR) $(1)/include
+   $(INSTALL_DATA) ./src/include/iconv.h $(1)/include/
 
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/aclocal
-   $(INSTALL_DATA) ./src/m4/* $(STAGING_DIR_HOSTPKG)/share/aclocal/
+   $(INSTALL_DIR) $(1)/share/aclocal
+   $(INSTALL_DATA) ./src/m4/* $(1)/share/aclocal/
 endef
 
 $(eval $(call HostBuild))
diff --git a/package/system/fwtool/Makefile b/package/system/fwtool/Makefile
index 901081c1f4..86ec807281 100644
--- a/package/system/fwtool/Makefile
+++ b/package/system/fwtool/Makefile
@@ -31,6 +31,7 @@ define Host/Compile
 endef
 
 define Host/Install
+   $(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/fwtool $(1)/bin/
 endef
 
diff --git a/package/system/iucode-tool/Makefile 
b/package/system/iucode-tool/Makefile
index 5f4cfb6238..afa75f61c6 100644
--- a/package/system/iucode-tool/Makefile
+++ b/package/system/iucode-tool/Makefile
@@ -22,6 +22,8 @@ PKG_LICENSE:=GPL-2.0
 
 PKG_INSTALL:=1
 
+HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -40,7 +42,8 @@ define Package/iucode-tool/install
 endef
 
 define Host/Install
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool 
$(STAGING_DIR_HOST)/bin/iucode_tool
+   $(INSTALL_DIR) $(1)/bin
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(1)/bin/iucode_tool
 endef
 
 $(eval $(call HostBuild))
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 313a058933..2f6735895a 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -33,6 +33,7 @@ HOST_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 HOST_BUILD_DEPENDS:=libubox/host
+HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
@@ -96,7 +97,8 @@ define Package/opkg/install
 endef
 
 define Host/Install
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl 
$(STAGING_DIR_HOST)/bin/opkg
+   $(INSTALL_DIR) $(1)/bin
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(1)/bin/opkg
 endef
 
 $(eval $(call BuildPackage,opkg))
diff --git a/package/utils/bsdiff/Makefile b/package/utils/bsdiff/Makefile
index db1f320872..b9e662b3ed 100644
--- a/package/utils/bsdiff/Makefile
+++ b/package/utils/bsdiff/Makefile
@@ -58,11 +58,6 @@ define Package/bspatch/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bspatch $(1)/usr/bin/bspatch
 endef
 
-define Host/Install
-   $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
-   $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOSTPKG)/ install
-endef
-
 define Host/Compile
$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
-o $(HOST_BUILD_DIR)/bsdiff \
@@ -70,7 +65,8 @@ define Host/Compile
 endef
 
 define Host/Install
-   $(INSTALL_BIN) $(HOST_BUILD_DIR)/bsdiff $(STAGING_DIR_HOSTPKG)/bin/
+   $(INSTALL_DIR) $(1)/bin
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/bsdiff

[OpenWrt-Devel] [PATCH 3/6] tools: Fix unintended lib link in $(STAGING_DIR_HOST)/lib

2019-06-14 Thread Jeffery To
Currently, if the $(STAGING_DIR_HOST)/lib64 link already exists, ln (in
tools/prepare) will interpret $(STAGING_DIR_HOST)/lib64 as a directory
rather than a link name.

The result is a symbolic link named "lib" inside
$(STAGING_DIR_HOST)/lib, pointing to itself.

This adds the -n option to ln so that $(STAGING_DIR_HOST)/lib64 is
treated as a link name.

Signed-off-by: Jeffery To 
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index d7207ba89d..f3d8debe23 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -138,7 +138,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
$(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
$(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h 
$(STAGING_DIR_HOST)/include/sys/
-   ln -sf lib $(STAGING_DIR_HOST)/lib64
+   ln -snf lib $(STAGING_DIR_HOST)/lib64
touch $@
 
 endif
-- 
2.20.1


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


[OpenWrt-Devel] Cryptodev-linux compile error with armvirt-64 sdk

2019-08-01 Thread Jeffery To
Hi,

I need to compile the Python package(s) somewhat regularly, but I haven't
been able to recently using the armvirt-64 sdk, because of a compile error
for cryptodev-linux. (I have copied the make output below.)

I believe this started after a459d237 (this added
CONFIG_ARM64_MODULE_PLTS=y, which leads make to look for a non-existent
linker script file "./arch/arm64/kernel/module.lds"), but I haven't
verified it yet.

I tried doing a fresh checkout of master and building the Python package
directly; it worked without an error, but it also didn't need to compile
cryptodev-linux, so I'm not sure if any conclusions can be drawn from this.

Does anyone have any insight on this? I'm not really sure where the root
issue is, or how to go about fixing it.

Thanks,
Jeff


Make output:
make[2]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/feeds/base/package/kernel/cryptodev-linux'
touch
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.prepared_c86d6c695a6eb4715e8aacaf7644c80b_6664517399ebbbc92a37c5bb081b5c53_check
. /media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/include/shell.sh;
gzip -dc /media/jeff/Jekyll/Files/openwrt/dl/cryptodev-linux-1.10.tar.gz |
tar -C
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/..
-xf -
[ ! -d ./src/ ] || cp -fpR ./src/.
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10
touch
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.prepared_c86d6c695a6eb4715e8aacaf7644c80b_6664517399ebbbc92a37c5bb081b5c53
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.configured_*
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/target-aarch64_generic_musl/stamp/.cryptodev-linux_installed
touch
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.built
touch
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/.built_check
cat /dev/null >
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/target-aarch64_generic_musl/pkginfo/cryptodev-linux.symvers;
for subdir in .; do cat
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/target-aarch64_generic_musl/pkginfo/*.symvers
2>/dev/null >
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/$subdir/Module.symvers;
done
make -C
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10
HOSTCFLAGS="-O2
-I/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/host/include
-I/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/hostpkg/include
-I/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/target-aarch64_generic_musl/host/include
-Wall -Wmissing-prototypes -Wstrict-prototypes"
CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" KBUILD_HAVE_NLS=no
KBUILD_BUILD_USER="builder" KBUILD_BUILD_HOST="buildhost"
KBUILD_BUILD_TIMESTAMP="Wed Jul 31 14:53:41 2019" KBUILD_BUILD_VERSION="0"
HOST_LOADLIBES="-L/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/staging_dir/host/lib"
CONFIG_SHELL="bash" V=''  cmd_syscalls= KERNELRELEASE=4.19.62
KERNEL_DIR="/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-4.19.62"
make[3]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10'
make -C
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-4.19.62
M=/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10
ARCH=arm64 CROSS_COMPILE=aarch64-openwrt-linux-musl- modules
make[4]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-4.19.62'
  CC [M]
 
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/cryptodev-linux-cryptodev-linux-1.10/ioctl.o
  CC [M]
 
/media/jeff/Jekyll/Files/openwrt/testing/armvirt-64/bui

[OpenWrt-Devel] [PATCH] sdk: Fix cryptodev-linux build when CONFIG_ARM64_MODULE_PLTS=y

2019-08-02 Thread Jeffery To
When CONFIG_ARM64_MODULE_PLTS=y, arch/arm64/kernel/module.lds is
required to build cryptodev-linux. This updates the sdk to include this
file.

Signed-off-by: Jeffery To 
---
 target/sdk/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 3b860db93a..0bed666d21 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -64,7 +64,8 @@ KERNEL_FILES_ARCH = \
include \
*/include \
scripts \
-   kernel/asm-offsets.s
+   kernel/asm-offsets.s \
+   kernel/module.lds
 
 KERNEL_FILES_BASE := \
.config \
-- 
2.20.1


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


Re: [OpenWrt-Devel] Cryptodev-linux compile error with armvirt-64 sdk

2019-08-02 Thread Jeffery To
On Fri, Aug 2, 2019 at 3:16 AM Petr Štetiar  wrote:

> Jeffery To  [2019-08-02 02:04:23]:
>
> > I believe this started after a459d237 (this added
> CONFIG_ARM64_MODULE_PLTS=y
>
> that config symbol is selected by ARM64_ERRATUM_843419 ("Cortex-A53:
> 843419: A
> load or store might access an incorrect address"), so probably the fix
> would
> be to bundle that linker script into SDK (target/sdk/Makefile).
>

Thanks for the pointer - I've sent the patch (
https://patchwork.ozlabs.org/patch/1141354/).

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


Re: [OpenWrt-Devel] [PATCH v2] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-08-02 Thread Jeffery To
On Wed, May 15, 2019 at 8:32 PM Jeffery To  wrote:

> This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
> account (if set), so that packages do not need to manually override
> PKG_BUILD_DIR just to handle variants.
>
> This also updates most base packages with variants to use the updated
> default PKG_BUILD_DIR.
>
> Signed-off-by: Jeffery To 
> ---
> v2: updated PKG_BUILD_DIR in include/kernel.mk, removed undefines
>

Can someone take a look at this patch? (I have un-delegated it in
patchwork.)

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


Re: [OpenWrt-Devel] [PATCH v2] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-08-03 Thread Jeffery To
On Sat, Aug 3, 2019 at 4:40 AM Paul Spooren  wrote:

> on commit 5e928acf22cdc956eabe6e4b2327b34eb0ee66da applying fails:
>
> error: patch failed: package/libs/ustream-ssl/Makefile:10
> error: package/libs/ustream-ssl/Makefile: patch does not apply
>
> However removing the ustream-ssl part of the patch results in a working
> version for (at least) all three openvpn variants!
>
Thanks for testing - I will rebase and post an update shortly :-)

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


[OpenWrt-Devel] [PATCH v3] build: include BUILD_VARIANT in PKG_BUILD_DIR

2019-08-03 Thread Jeffery To
This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
account (if set), so that packages do not need to manually override
PKG_BUILD_DIR just to handle variants.

This also updates most base packages with variants to use the updated
default PKG_BUILD_DIR.

Signed-off-by: Jeffery To 
---
v2: updated PKG_BUILD_DIR in include/kernel.mk, removed undefines
v3: rebased, use default PKG_BUILD_DIR for more packages

 include/kernel.mk   | 2 +-
 include/package.mk  | 2 +-
 package/boot/tfa-layerscape/Makefile| 1 -
 package/kernel/lantiq/ltq-adsl-mei/Makefile | 1 -
 package/kernel/lantiq/ltq-atm/Makefile  | 1 -
 package/kernel/lantiq/ltq-deu/Makefile  | 1 -
 package/kernel/lantiq/ltq-ptm/Makefile  | 1 -
 package/libs/ustream-ssl/Makefile   | 2 --
 package/network/services/hostapd/Makefile   | 2 --
 package/network/services/odhcpd/Makefile| 2 --
 package/network/services/openvpn/Makefile   | 1 -
 package/network/services/ppp/Makefile   | 2 --
 package/network/utils/iproute2/Makefile | 2 --
 package/network/utils/iw/Makefile   | 1 -
 package/network/utils/tcpdump/Makefile  | 1 -
 package/system/ucert/Makefile   | 2 --
 package/utils/px5g/Makefile | 1 -
 17 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 975cf455c4..97d23661c9 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -77,7 +77,7 @@ else
   TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
 
   ifneq ($(TARGET_BUILD),1)
-PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(if 
$(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
   endif
 endif
 
diff --git a/include/package.mk b/include/package.mk
index 66137f211b..c541f6edf7 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
 
 include $(INCLUDE_DIR)/download.mk
 
-PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if 
$(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if 
$(PKG_VERSION),-$(PKG_VERSION))
 PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
diff --git a/package/boot/tfa-layerscape/Makefile 
b/package/boot/tfa-layerscape/Makefile
index 28014e87f2..a34c52bc3b 100644
--- a/package/boot/tfa-layerscape/Makefile
+++ b/package/boot/tfa-layerscape/Makefile
@@ -15,7 +15,6 @@ PKG_SOURCE_PROTO:=git
 
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
 PKG_SOURCE_VERSION:=7e34aebe658c7c3439d2d68b0ce6b9776e8e6996
 
PKG_MIRROR_HASH:=9cf0bc32fa589a0ee7c48c87898679e645341f29da1253d0ba5d2e82c6ea074d
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=uboot-layerscape tfa-layerscape/host
 
 include $(INCLUDE_DIR)/host-build.mk
diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile 
b/package/kernel/lantiq/ltq-adsl-mei/Makefile
index 08e5775771..31e671e53f 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/Makefile
+++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-adsl-mei
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/
 
 PKG_MAINTAINER:=John Crispin 
 PKG_CHECK_FORMAT_SECURITY:=0
diff --git a/package/kernel/lantiq/ltq-atm/Makefile 
b/package/kernel/lantiq/ltq-atm/Makefile
index 5d63983d2c..455d7b25e3 100644
--- a/package/kernel/lantiq/ltq-atm/Makefile
+++ b/package/kernel/lantiq/ltq-atm/Makefile
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-atm
 PKG_RELEASE:=2
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin 
 PKG_LICENSE:=GPL-2.0+
diff --git a/package/kernel/lantiq/ltq-deu/Makefile 
b/package/kernel/lantiq/ltq-deu/Makefile
index af299d8883..7bc9e8532d 100644
--- a/package/kernel/lantiq/ltq-deu/Makefile
+++ b/package/kernel/lantiq/ltq-deu/Makefile
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-deu
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-deu-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin 
 PKG_LICENSE:=GPL-2.0+
diff --git a/package/kernel/lantiq/ltq-ptm/Makefile 
b/package/kernel/lantiq/ltq-ptm/Makefile
index 13831a2b6f..73fd63f42b 100644
--- a/package/kernel/lantiq/ltq-ptm/Makefile
+++ b/package/kernel/lantiq/ltq-ptm/Makefile
@@ -9,7 +9,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-ptm
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-ptm-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin 
 PKG_LICENSE:=GPL-2.0+
diff --git a/package/libs/ustream-ssl/Makefile 
b/package/libs/ustream-ssl/Makefile
index ca9ad5d98b..b8d0967282 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl

[OpenWrt-Devel] Cannot compile cryptodev-linux using x86-64 SDK

2019-08-16 Thread Jeffery To
Hi,

As the subject of this email says, I get an error when trying to compile
cryptodev-linux using the x86-64 SDK. (Though a different error than the
one I found with the armvirt-64 SDK.)

This error has been happening for a while, at least a month. (I haven't had
time to follow up until now.) I suspect this is also related to the switch
to the 4.19 kernel, though I have no direct evidence.

The error message (included below) doesn't seem too helpful. Any help in
fixing this would be appreciated.

Thanks,
Jeff


Make output:
make[2]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/feeds/base/package/kernel/cryptodev-linux'
touch
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.prepared_35c87bfa80bf594a5e3809806f37d832_6664517399ebbbc92a37c5bb081b5c53_check
. /media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/include/shell.sh; gzip
-dc /media/jeff/Jekyll/Files/openwrt/dl/cryptodev-linux-1.10.tar.gz | tar
-C
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/..
-xf -
[ ! -d ./src/ ] || cp -fpR ./src/.
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10
touch
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.prepared_35c87bfa80bf594a5e3809806f37d832_6664517399ebbbc92a37c5bb081b5c53
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.configured_*
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/target-x86_64_musl/stamp/.cryptodev-linux_installed
touch
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.built
touch
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/.built_check
cat /dev/null >
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/target-x86_64_musl/pkginfo/cryptodev-linux.symvers;
for subdir in .; do cat
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/target-x86_64_musl/pkginfo/*.symvers
2>/dev/null >
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/$subdir/Module.symvers;
done
make -C
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10
HOSTCFLAGS="-O2
-I/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/host/include
-I/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/hostpkg/include
-I/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/target-x86_64_musl/host/include
-Wall -Wmissing-prototypes -Wstrict-prototypes"
CROSS_COMPILE="x86_64-openwrt-linux-musl-" ARCH="x86" KBUILD_HAVE_NLS=no
KBUILD_BUILD_USER="builder" KBUILD_BUILD_HOST="buildhost"
KBUILD_BUILD_TIMESTAMP="Thu Aug 15 12:25:51 2019" KBUILD_BUILD_VERSION="0"
HOST_LOADLIBES="-L/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/staging_dir/host/lib"
CONFIG_SHELL="bash" V=''  cmd_syscalls= KERNELRELEASE=4.19.66
KERNEL_DIR="/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.66"
make[3]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10'
make -C
/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.66
M=/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10
ARCH=x86 CROSS_COMPILE=x86_64-openwrt-linux-musl- modules
make[4]: Entering directory
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.66'
make[5]: *** No rule to make target
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/ioctl.o',
needed by
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10/cryptodev.o'.
Stop.
make[4]: *** [Makefile:1517:
_module_/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/cryptodev-linux-cryptodev-linux-1.10]
Error 2
make[4]: Leaving directory
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.66'
make[3]: *** [Makefile:27: build] Error 2
make[3]: Leaving directory
'/media/jeff/Jekyll/Files/openwrt/testing/c/x86-64/buil

Re: [OpenWrt-Devel] Cannot compile cryptodev-linux using x86-64 SDK

2019-08-23 Thread Jeffery To
On Sat, Aug 17, 2019 at 2:25 AM Jeffery To  wrote:

> As the subject of this email says, I get an error when trying to compile
> cryptodev-linux using the x86-64 SDK. (Though a different error than the
> one I found with the armvirt-64 SDK.)
>
> This error has been happening for a while, at least a month. (I haven't
> had time to follow up until now.) I suspect this is also related to the
> switch to the 4.19 kernel, though I have no direct evidence.
>
> The error message (included below) doesn't seem too helpful. Any help in
> fixing this would be appreciated.
>

This is still happening with the latest snapshot SDK. I'm not asking for
someone to fix this for me, but I'm not familiar enough with Kbuild to know
what is missing for the SDK target.

(Honestly, I work around this issue by using the SDK of another arch for my
package testing, but I would like to get this fixed anyway.)

Any pointers or other help would be greatly appreciated.

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


[PATCH] cmake: Disable use of package registries

2020-08-17 Thread Jeffery To
CMake provides a user package registry (stored in ~/.cmake/packages) and
a system package registry (not available on non-Windows platforms).

The "export(PACKAGE)" command may store information in the user package
registry, and the "find_package()" command may search both user and
system package registries for information.

This sets various variables to disable the use of these package
registries (both saving and retrieval of package information).

This also sets deprecated variables that perform similar functions, in
case external toolchains include older versions of CMake.

Signed-off-by: Jeffery To 
---
 include/cmake.mk | 12 
 1 file changed, 12 insertions(+)

diff --git a/include/cmake.mk b/include/cmake.mk
index a5ba7d31bf..9dd95f5a64 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -71,6 +71,12 @@ define Build/Configure/Default
-DDL_LIBRARY=$(STAGING_DIR) \
-DCMAKE_PREFIX_PATH=$(STAGING_DIR) \
-DCMAKE_SKIP_RPATH=TRUE  \
+   -DCMAKE_EXPORT_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE \
+   -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE \
+   -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE \
$(CMAKE_OPTIONS) \
$(CMAKE_SOURCE_DIR) \
)
@@ -104,6 +110,12 @@ define Host/Configure/Default
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE  \
-DCMAKE_INSTALL_LIBDIR=lib \
+   -DCMAKE_EXPORT_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE \
+   -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE \
+   -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE \
+   -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE \
$(CMAKE_HOST_OPTIONS) \
$(HOST_CMAKE_SOURCE_DIR) \
)
-- 
2.25.1


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


Re:

2020-09-15 Thread Jeffery To
Hi Daniel,

(Resending due to HTML email being rejected...)

On Tue, Sep 15, 2020 at 2:26 PM Daniel Santos via openwrt-devel
 wrote:
> Thank you for the wonderful work on maintaining the Go packages!

You're welcome :-)

> I got a little irritated at CGo's restriction of arch flags (in the
> immutable GOGCCFLAGS variable) and put together a patch set for v19.07
> to override them with an environment variable and then (optionally) feed
> the machine flags in the Golang build.  In the OpenWRT repo, I did this
> by splitting out how DEFAULT_CFLAGS are put together in order to
> populate a DEFAULT_MACHINE_FLAGS, but it could probably be done with
> just a $(filter -m%,$(DEFAULT_CFLAGS)) instead.
>
> If you or others have any interest in this, I can clean them up for the
> master branch.  I'm probably going to submit the Golang patch upstream,
> since I don't see any good reason for such a restriction.  I see you've
> made a lot of changes on the HEAD.

I can't speak for the main OpenWrt repo changes, but I would prefer to
have the Go compiler patch accepted upstream first. They may have
certain assumptions/dependencies on the arch flags that I'm not aware
of.

Jeff

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


Re: Support for packages written in Go on powerpc_464fp

2020-10-06 Thread Jeffery To
Hi Martin,

(I see you have already found the answer[1] but I thought I should
reply for those who search the mailing list.)

On Sat, Sep 26, 2020 at 11:18 AM Martin Kennedy  wrote:
> What would need to be done to get Go packages to compile for the APM82181?

Go currently does not support 32-bit PowerPC processors, only 64-bit.
AFAIK powerpc_464fp is 32-bit.

There is a tracking issue[2] where those who are interested in 32-bit
support can voice their interest.

Hope this helps,
Jeff

[1]: https://github.com/golang/go/issues/22885#issuecomment-699299761
[2]: https://github.com/golang/go/issues/22885

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


Merging /usr

2020-11-17 Thread Jeffery To
Hi,

It appears most of the major distros (Debian/Ubuntu, Fedora, Arch,
Solaris) have moved to merge the contents of /{bin,sbin,lib}/ into
/usr/{bin,sbin,lib}/, with top-level symbolic links added for
compatibility.

There is a wiki page on freedesktop.org[1] that goes into the
reasoning, and LWN[2][3] has also written about it.

Is this something we would like to consider as well? It may be too
late for 20.x but this change does appear to simplify things (at least
for package maintainers).

Jeff

[1]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
[2]: https://lwn.net/Articles/670071/
[3]: https://lwn.net/Articles/483921/

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


[PATCH] ath79: fix button labels for WZR-HP-AG300H and WZR-600DHP

2022-03-06 Thread Jeffery To
These were present in ar71xx but overlooked when porting to ath79.

Fixes: 480bf2827392 ("ath79: add support for Buffalo WZR-HP-AG300H")

Signed-off-by: Jeffery To 
---
 target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi 
b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
index 006755e418..35e083bc61 100644
--- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
+++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
@@ -75,24 +75,28 @@
compatible = "gpio-keys";
 
reset {
+   label = "reset";
linux,code = ;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
 
usb {
+   label = "usb";
linux,code = ;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
 
aoss {
+   label = "aoss";
linux,code = ;
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
 
router_auto {
+   label = "router_auto";
linux,code = ;
linux,input-type = ;
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
@@ -100,6 +104,7 @@
};
 
router_off {
+   label = "router_off";
linux,code = ;
linux,input-type = ;
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
@@ -107,6 +112,7 @@
};
 
movie_engine {
+   label = "movie_engine";
linux,code = ;
linux,input-type = ;
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
-- 
2.32.0


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


Re: [sdwalker/sdwalker.github.io] 2bdb42: This week's update

2022-05-12 Thread Jeffery To
On Fri, May 13, 2022 at 6:26 AM Sergey Ryazanov  wrote:
>
> +1
>
> Stephan, may I sincerely ask you to stop spamming the list?
>
> On Mon, May 9, 2022 at 12:08 PM  wrote:
> > is the below weekly message of any informational value to _all_? can 
> > someone maybe block this if it's not? ..thanks ede
> >
> > On 08.05.2022 23:05, Stephen Walker via openwrt-devel wrote:
> >> 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.

As a package maintainer, I want to know that uscan is running
correctly. These emails are relevant to me.

It would be very simple to set up any competent email client to filter
out these messages, if you so choose.

Jeff

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


Re: [sdwalker/sdwalker.github.io] 2bdb42: This week's update

2022-05-13 Thread Jeffery To
Hi Sergey,

On Fri, May 13, 2022 at 8:00 AM Sergey Ryazanov  wrote:
> May I ask why these notifications are directed to the mailing list
> that is dedicated for development talks? Such a notification just
> _looks_ irrelevant to some thread, it is not even a patchwork
> notification or a buildbot warning that is sent as a reply to a patch.

Maybe it would help to explain what uscan does:
https://sdwalker.github.io/uscan/

It scans for updates to all packages in the main repo and other feeds,
and sends (individual) email notifications to package maintainers when
their package has an update and/or any CVE vulnerabilities. I'm sure
many maintainers (including myself) rely on these notifications to
know when to update their packages.

The weekly update email could be more informative, but uscan is a very
useful piece of infrastructure that I (and suspect some others) want
to know is functioning correctly.

> It is a matter of balance. Everyone is happy to read these
> notifications, but someone will not need them and will create an
> automatic filtering rule. Or someone found these notifications useful,
> but everyone else wonders why they received them.

In the years that I have been subscribed to this list, this is the
first time I have replied to any email about these notifications. I
would suspect that most people are not bothered by them, or have
filtered them out and moved on.

As a point of comparison, I am subscribed here so that I don't miss
any development discussions but I have a filter to automatically
archive all patches (which is the bulk of the mail). The mailing list
isn't perfect and no one is going to be 100% happy with it.

> Is it possible to reconfigure these notifications to send them
> directly to your mailbox? Or maybe set up a dedicated mailing list? We
> already have the mailing list for commit notifications. I am
> subscribed and quite happy to be informed of development progress this
> way - it saves me a lot of time and does not bother people who prefer
> some other monitoring approach.

As I said, I think the majority of subscribers are not bothered by
these notifications; it is one email per week. I am open to being
wrong about this. I don't mind subscribing to another mailing list for
these notifications.

There could be dozens of commits per day; it makes sense to have a
separate mailing list for commit notifications.

Thanks,
Jeff

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


[OpenWrt-Devel] Looking for beta testers for new package: slide-switch

2016-09-05 Thread Jeffery To
Hi,

I've written a small utility called slide-switch that translates slide
switch position changes into normal button presses.

For devices with a (3-position) slide switch, for example the TP-Link
TL-MR3020, the switch is usually represented to the system as two push
buttons. So a change to the switch position triggers one or two button
events, and finding the current position requires reading from two GPIOs.

Others have shared script snippets for specific devices, but I thought it
was time to create a package that anyone can install and start using their
slide switch without having to re-script the wheel.

I've combed the wiki for devices with a slide switch and have incorporated
their details, but since I only have a TL-MR3020, I'm unable to verify that
the package works correctly on those other devices. (I may also be missing
devices that have a slide switch but aren't described in the wiki.)

I'd like to make sure the package works on a few more devices before
submitting to the official package feed. So if you have a device with a
slide switch, I'd really appreciate it if you can install the package and
let me know if it works (or doesn't work) for you, either on this thread or
on GitHub.

Home page (with a list of supported devices):
https://github.com/jefferyto/openwrt-slide-switch
Packages for CC 15.05.1:
https://github.com/jefferyto/openwrt-slide-switch/releases/tag/0.9.0
(Not sure if these will install correctly on trunk; let me know if they
don't.)

Thanks in advance!
Jeff
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] cryptodev-linux: Fix error when compiling with 5.4 kernel

2020-03-17 Thread Jeffery To
Currently, cryptodev-linux fails to compile with a
'"crypto_givcipher_type" undefined' error for targets on the 5.4 kernel,
e.g. armvirt[1].

This backports an upstream patch[2] that fixes this error.

[1]: 
https://downloads.openwrt.org/snapshots/faillogs/aarch64_generic/base/cryptodev-linux/compile.txt
[2]: 
https://github.com/cryptodev-linux/cryptodev-linux/commit/f971e0cd4a0ebe59fb2e8e17240399bf6901b09b

Signed-off-by: Jeffery To 
---
 package/kernel/cryptodev-linux/Makefile   |  2 +-
 ...x-module-loading-with-Linux-v5.0-rc5.patch | 50 +++
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 
package/kernel/cryptodev-linux/patches/010-Fix-module-loading-with-Linux-v5.0-rc5.patch

diff --git a/package/kernel/cryptodev-linux/Makefile 
b/package/kernel/cryptodev-linux/Makefile
index da18c714b0..9bea63ebd1 100644
--- a/package/kernel/cryptodev-linux/Makefile
+++ b/package/kernel/cryptodev-linux/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=cryptodev-linux
 PKG_VERSION:=1.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 
PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git 
a/package/kernel/cryptodev-linux/patches/010-Fix-module-loading-with-Linux-v5.0-rc5.patch
 
b/package/kernel/cryptodev-linux/patches/010-Fix-module-loading-with-Linux-v5.0-rc5.patch
new file mode 100644
index 00..5909f6dfb3
--- /dev/null
+++ 
b/package/kernel/cryptodev-linux/patches/010-Fix-module-loading-with-Linux-v5.0-rc5.patch
@@ -0,0 +1,50 @@
+From f971e0cd4a0ebe59fb2e8e17240399bf6901b09b Mon Sep 17 00:00:00 2001
+From: "Derald D. Woods" 
+Date: Sun, 10 Feb 2019 13:22:19 -0600
+Subject: [PATCH] Fix module loading with Linux v5.0-rc5
+
+This commit fixes this module load error:
+[...]
+[   29.112091] cryptodev: loading out-of-tree module taints kernel.
+[   29.128906] cryptodev: Unknown symbol crypto_givcipher_type (err -2)
+[   29.188842] cryptodev: Unknown symbol crypto_givcipher_type (err -2)
+modprobe: can't load module cryptodev (extra/cryptodev.ko): unknown symbol in 
module, or unknown parameter
+[...]
+
+Upstream Linux support for unused GIVCIPHER, and others, was dropped here:
+
+c79b411eaa72 (crypto: skcipher - remove remnants of internal IV generators)
+
+Signed-off-by: Derald D. Woods 
+---
+ cryptlib.c | 9 +++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/cryptlib.c b/cryptlib.c
+index 6e66698..4a87037 100644
+--- a/cryptlib.c
 b/cryptlib.c
+@@ -38,7 +38,9 @@
+ #include "cryptodev_int.h"
+ #include "cipherapi.h"
+ 
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
+ extern const struct crypto_type crypto_givcipher_type;
++#endif
+ 
+ static void cryptodev_complete(struct crypto_async_request *req, int err)
+ {
+@@ -157,8 +159,11 @@ int cryptodev_cipher_init(struct cipher_data *out, const 
char *alg_name,
+ 
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+   tfm = crypto_skcipher_tfm(out->async.s);
+-  if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type) ||
+-  (tfm->__crt_alg->cra_type == &crypto_givcipher_type)) {
++  if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
++  || (tfm->__crt_alg->cra_type == &crypto_givcipher_type)
++#endif
++  ) {
+   struct ablkcipher_alg *alg;
+ 
+   alg = &tfm->__crt_alg->cra_ablkcipher;
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH 2/6] x86: switch image generation to new code

2020-03-23 Thread Jeffery To
On Fri, Mar 20, 2020 at 6:37 PM Paul Spooren  wrote:

> This commit introduces few related changes which need to be done in
> single commit to keep images buildable between git revisions. In result
> it retains all previous image creation possibilities with slight name
> change of generated images. Brief summary of the commit:
>

Would it be possible to restore the building of a separate kernel and
rootfs? It's much easier to resize a rootfs than a disk image.

(Or alternatively, an easy way to enlarge disk images would be welcome.)

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


[OpenWrt-Devel] Build variants and Build/InstallDev

2020-04-20 Thread Jeffery To
Hi,

I've noticed that there are a few packages in the packages feed that have
build variants and a Build/installDev recipe, e.g. libarchive,
libmicrohttpd. With the exception of ffmpeg[1], it appears that what is
installed by InstallDev is determined by the last variant that is compiled
(i.e. each variant's InstallDev overwrites the files installed by previous
variants).

I'm not really sure what is the best way to address this issue:
* Should at most only one variant's files be allowed to be installed, or is
there a way to allow for all variant's files to coexist?
* If one variant is to be prioritized, are there generally-agreed rules for
prioritization that can be followed (nossl vs ssl, mbedtls vs openssl) or
is it up to each package to decide for themselves?
* If another package depends on a specific variant, is there a way to
ensure that that variant's InstallDev files are present?

I don't mind working on a way to resolve this issue but I'm not sure what
direction is best. Any help would be appreciated.

Thanks,
Jeff

[1]:
https://github.com/openwrt/packages/blob/99e4842e3384107f914d32457889b1eedea9b89a/multimedia/ffmpeg/Makefile#L716-L738
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Bug on procps-ng-skill OpenWrt 19.07.2

2020-04-20 Thread Jeffery To
On Mon, Apr 20, 2020 at 12:28 PM Marcelo Pacheco  wrote:

> In module procps-ng-3.3.15, source skill.c, function check_proc
> char buf[128];
>
> This buffer is too small to read /proc//stat
> The code requires the whole file to be read:
>  len = read(fd, buf, sizeof(buf));
> if (len <= 0 || (size_t)len >= sizeof(buf))
> goto closure;
>
> Fix I used is to increase to 256 bytes.
> Worked for me.
>

You may want to open an issue/PR at the packages repo:
https://github.com/openwrt/packages

You may also want to open an issue/MR upstream (
https://gitlab.com/procps-ng/procps) or explain why this issue is specific
to OpenWrt.

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


[OpenWrt-Devel] [PATCH] kernel: kmod-ptp-qoriq: Package kernel object file

2020-05-19 Thread Jeffery To
This updates the package to contain the kernel object (.ko) file instead
of the plain object (.o) file.

Signed-off-by: Jeffery To 
---
 package/kernel/linux/modules/other.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 43709228f9..f05c758340 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -975,8 +975,8 @@ define KernelPackage/ptp-qoriq
   TITLE:=Freescale QorIQ PTP support
   DEPENDS:=@TARGET_mpc85xx +kmod-ptp @!LINUX_4_14
   KCONFIG:=CONFIG_PTP_1588_CLOCK_QORIQ
-  FILES:=$(LINUX_DIR)/drivers/ptp/ptp_qoriq.o
-  AUTOLOAD:=$(call AutoProbe,ptp_qoriq)
+  FILES:=$(LINUX_DIR)/drivers/ptp/ptp-qoriq.ko
+  AUTOLOAD:=$(call AutoProbe,ptp-qoriq)
 endef
 
 
-- 
2.25.1


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


Re: [OpenWrt-Devel] Compile error compiling golang for Raspberri Pi3 image.

2020-05-22 Thread Jeffery To
(resending as I forgot to CC the list, sigh)

Hi Perry,

On Fri, May 22, 2020 at 6:18 AM Perry Couprie  wrote:

> I am trying to compile openwrt for Raspberri PI3.
>
> On of the selected packages to compile in the firmware is GOLANG.
>
> When compiling golang i get the following compile error.
>
> What can i do to get it to compile ?
>

Can you describe your build system (OS, version, etc.)? Also, I am assuming
you are building using OpenWrt master? Can you do a clean checkout of
master and try the build again?

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


Re: [OpenWrt-Devel] Problems with e-mail DMARC policy, and other usability issues

2020-06-11 Thread Jeffery To
Hello,

On Thu, Jun 11, 2020 at 6:56 PM  wrote:

> Sorry, but this is not us being mean, it's just the fact that this kind of
> spam protection and mailing list are inherently incompatible.
>

I don't think OP was asking for spam protection to be disabled... I think
the main issue is the DMARC warning is being picked up by Patchwork as part
of the commit message.

OP's suggestions (forwarding/wrapping the original message without adding
the DMARC warning text, switching to another patch management system like
Gerrit, having Patchwork pick up patches from attachments) are workarounds
for this issue.

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


[OpenWrt-Devel] [PATCH] toolchain/gcc: Backport patch to fix unconditional MULTIARCH_DIRNAME

2019-11-18 Thread Jeffery To
This backports the patch for GCC PR target/89587 (gcc's rs6000
configuration unconditionally sets MULTIARCH_DIRNAME, even when
multiarch is disabled).

This currently affects apm821xx and may cause issues when
cross-compiling packages, e.g. Python 3[1].

This includes patches for GCC 7 and 8 (with the changelog diff removed);
this change is already included in GCC 9.2.

[1]: https://github.com/openwrt/packages/issues/10552

Signed-off-by: Jeffery To 
---
 .../patches/7.4.0/090-rs6000-PR-89587.patch   | 33 +++
 .../patches/8.3.0/090-rs6000-PR-89587.patch   | 30 +
 2 files changed, 63 insertions(+)
 create mode 100644 toolchain/gcc/patches/7.4.0/090-rs6000-PR-89587.patch
 create mode 100644 toolchain/gcc/patches/8.3.0/090-rs6000-PR-89587.patch

diff --git a/toolchain/gcc/patches/7.4.0/090-rs6000-PR-89587.patch 
b/toolchain/gcc/patches/7.4.0/090-rs6000-PR-89587.patch
new file mode 100644
index 00..00d5c3ce5c
--- /dev/null
+++ b/toolchain/gcc/patches/7.4.0/090-rs6000-PR-89587.patch
@@ -0,0 +1,33 @@
+From 0eec4161396ba6cf6052e1076d4548418c6ebcc1 Mon Sep 17 00:00:00 2001
+From: jakub 
+Date: Fri, 30 Aug 2019 12:12:56 +
+Subject: [PATCH]   Backported from mainline2019-03-05  Jakub
+ Jelinek  
+
+   PR target/89587
+   * config/rs6000/t-linux (MULTIARCH_DIRNAME): Set to non-empty only
+   if_multiarch.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@275123 
138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/ChangeLog | 4 
+ gcc/config/rs6000/t-linux | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
+index 4cb63bdca5d1..23f3fd236df3 100644
+--- a/gcc/config/rs6000/t-linux
 b/gcc/config/rs6000/t-linux
+@@ -5,9 +5,9 @@ ifneq (,$(findstring powerpc64,$(target)))
+ MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+ else
+ ifneq (,$(findstring spe,$(target)))
+-MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 
8548,$(with_cpu)),,v1)
++MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnuspe$(if 
$(findstring 8548,$(with_cpu)),,v1))
+ else
+-MULTIARCH_DIRNAME := powerpc-linux-gnu
++MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
+ endif
+ endif
+ ifneq (,$(findstring powerpcle,$(target)))
diff --git a/toolchain/gcc/patches/8.3.0/090-rs6000-PR-89587.patch 
b/toolchain/gcc/patches/8.3.0/090-rs6000-PR-89587.patch
new file mode 100644
index 00..83bfbbe712
--- /dev/null
+++ b/toolchain/gcc/patches/8.3.0/090-rs6000-PR-89587.patch
@@ -0,0 +1,30 @@
+From 045e60da05ec1d4997864883143a951f152cfc9f Mon Sep 17 00:00:00 2001
+From: jakub 
+Date: Tue, 30 Apr 2019 20:37:12 +
+Subject: [PATCH]   Backported from mainline2019-03-05  Jakub
+ Jelinek  
+
+   PR target/89587
+   * config/rs6000/t-linux (MULTIARCH_DIRNAME): Set to non-empty only
+   if_multiarch.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@270720 
138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/ChangeLog | 4 
+ gcc/config/rs6000/t-linux | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
+index acfde1f48aec..aeb7440c4920 100644
+--- a/gcc/config/rs6000/t-linux
 b/gcc/config/rs6000/t-linux
+@@ -4,7 +4,7 @@ ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring 
soft,$(with_float)))
+ ifneq (,$(findstring powerpc64,$(target)))
+ MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+ else
+-MULTIARCH_DIRNAME := powerpc-linux-gnu
++MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
+ endif
+ ifneq (,$(findstring powerpcle,$(target)))
+ MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH] toolchain/gcc: Backport patch to fix unconditional MULTIARCH_DIRNAME

2019-12-19 Thread Jeffery To
On Tue, Nov 19, 2019 at 6:05 AM Jeffery To  wrote:

> This backports the patch for GCC PR target/89587 (gcc's rs6000
> configuration unconditionally sets MULTIARCH_DIRNAME, even when
> multiarch is disabled).
>

Can someone take a look at this change? This issue is preventing the Python
3 package from compiling for apm821xx (
https://github.com/openwrt/packages/issues/10552).

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


[OpenWrt-Devel] dev.archive.openwrt.org cert expired

2019-12-26 Thread Jeffery To
Hi,

Apologies if this isn't the right place to mention this, but the Let's
Encrypt certificate for dev.archive.openwrt.org has expired (on 22 Dec 2019
21:44:43 GMT).

I tried sending this to openwrt-adm but the messages were stuck in the
moderator queue.

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


Re: [OpenWrt-Devel] Migration in ath79 for swapped ethernet

2020-01-28 Thread Jeffery To
On Tue, Jan 28, 2020 at 11:48 PM Adrian Schmutzler 
wrote:

> I do not really see a viable/desirable option to support eth migration at
> the
> moment. And I'm not really a fan of adding lots of migration stuff which
> spoils
> the new ath79 target already, so after all I think I also do not _want_ to
> add
> eth migration either.
>

(I should first say that I don't know enough about the ar71xx-ath79
migration to know if this idea will work, but I don't recall seeing it
mentioned before.)

What if we add a migration package for 18.06 that ar71xx users can opt-in
and install, which (when the user initiates the process) will migrate their
config and perform an upgrade to 19.07 (ath79)? Their config would be
broken for 18.06 after the first step, but if the sysupgrade completes
successfully then their config works for 19.07 after the reboot. (Would be
nice if there is a way to roll back the config changes if the sysupgrade
fails.)

This is perhaps a variation of the transition image idea from Peter Geis,
but this would be less intrusive to the overall upgrade process (at least
for me).

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


[OpenWrt-Devel] [PATCH] build: Fix directory symlinks not removed when cleaning STAGING_DIR

2020-02-18 Thread Jeffery To
Currently, a symbolic link whose target is a directory will not be
removed when cleaning packages from STAGING_DIR.

In the first cleaning pass in scripts/clean-package.sh, the -f test for
a directory symlink returns false (because the link target is a
directory) and so the symlink is not removed.

In the second pass, the -d test returns true for a directory symlink,
but the symlink is not removed by rmdir because rmdir only removes
(real) directories.

This updates clean-package.sh to remove all non-directories (including
symbolic links) in the first pass.

Signed-off-by: Jeffery To 
---
 scripts/clean-package.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index 6dd9bf7306..035725625d 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -12,7 +12,7 @@ cat "$1" | (
cd "$2"
while read entry; do
[ -n "$entry" ] || break
-   [ -f "$entry" ] && rm -f $entry
+   [ ! -d "$entry" ] || [ -L "$entry" ] && rm -f "$entry"
done
 )
 sort -r "$1" | (
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH] tools: Fix "lib" symlink created inside $(STAGING_DIR_HOST)/lib

2020-02-18 Thread Jeffery To
Currently, if "make tools/install" is called after tools have already
been installed, a symbolic link named "lib" will be created inside
$(STAGING_DIR_HOST)/lib, pointing to "lib" (i.e. itself).

During tools/prepare, a "lib64" symlink is created inside
$(STAGING_DIR_HOST) that points to "lib" (also inside
$(STAGING_DIR_HOST)).

If tools/prepare is called and the "lib64" symlink already exists, then
ln will treat it as a directory and instead create a symlink named "lib"
inside of that directory.

This adds the -n option for ln so that $(STAGING_DIR_HOST)/lib64 is
always treated as a normal file (the link name), not as a directory.

Signed-off-by: Jeffery To 
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 2f57d25525..b7e236cbd2 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -138,7 +138,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
$(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
$(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h 
$(STAGING_DIR_HOST)/include/sys/
-   ln -sf lib $(STAGING_DIR_HOST)/lib64
+   ln -snf lib $(STAGING_DIR_HOST)/lib64
touch $@
 
 endif
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH] openvpn: add handling for route-pre-down option

2015-10-02 Thread Jeffery To
(resending as I wasn't subscribed to the list before, my apologies)

OpenVPN 2.3 added a route-pre-down option, to run a command before
routes are removed upon disconnection.

Signed-off-by: Jeffery To 
---
 package/network/services/openvpn/files/openvpn.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/openvpn/files/openvpn.init 
b/package/network/services/openvpn/files/openvpn.init
index 861d0d6..994973b 100644
--- a/package/network/services/openvpn/files/openvpn.init
+++ b/package/network/services/openvpn/files/openvpn.init
@@ -120,7 +120,7 @@ start_instance() {
redirect_gateway remap_usr1 remote remote_cert_eku 
remote_cert_ku remote_cert_tls \
reneg_bytes reneg_pkts reneg_sec \
replay_persist replay_window resolv_retry route route_delay 
route_gateway \
-   route_metric route_up rport script_security secret server 
server_bridge setenv shaper sndbuf \
+   route_metric route_pre_down route_up rport script_security 
secret server server_bridge setenv shaper sndbuf \
socks_proxy status status_version syslog tcp_queue_limit 
tls_auth \
tls_cipher tls_remote tls_timeout tls_verify tmp_dir topology 
tran_window \
tun_mtu tun_mtu_extra txqueuelen user verb down push up \
-- 
2.1.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


toolchain/gcc: Always build gccgo?

2023-03-15 Thread Jeffery To
Hello,

I'm considering looking into using gccgo to bootstrap the Go compiler
in the packages feed.

Currently, Go 1.4 (the last version written in C) is first built for
host, then it is used to build the newest Go for host. This host Go
compiler is then used to build the target Go package and other Go
programs.

There are some current and future limitations of using Go 1.4 to
bootstrap this process:

* Go 1.4 doesn't support certain platforms, most notably aarch64. (I
have worked around this by allowing the user to use their system Go as
bootstrap.)

* Upstream will likely start requiring a newer bootstrap version every
year[1]. Go 1.20 already requires Go 1.17 to bootstrap. Their plan
would have Go 1.22 require Go 1.20, Go 1.24 require Go 1.22, etc.

Using gccgo as bootstrap could potentially resolve all of these issues.

Before investigating this further, I would like to ask if there are
any disadvantages/opposition to always building gccgo? It is currently
optional and it would complicate this plan if it stayed optional.

[1]: https://github.com/golang/go/issues/54265

Thanks,
Jeff

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


[PATCH] build: export GIT_CEILING_DIRECTORIES for package builds

2023-05-31 Thread Jeffery To
A package may run git as part of its build process, and if the package
source code is not from a git checkout, then git may traverse up the
directory tree to find buildroot's repository directory (.git).

For instance, Poetry Core, a Python build backend, will read the
contents of .gitignore for paths to exclude when creating a Python
package. If it finds buildroot's .gitignore file, then Poetry Core will
exclude all of the package's files[1].

This exports GIT_CEILING_DIRECTORIES for both package and host builds so
that git will not traverse beyond $(BUILD_DIR)/$(BUILD_DIR_HOST).

[1]: https://github.com/python-poetry/poetry/issues/5547

Signed-off-by: Jeffery To 
---
 include/host-build.mk | 1 +
 include/package.mk| 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/host-build.mk b/include/host-build.mk
index b7fb0a737f14..7485f91e422e 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -131,6 +131,7 @@ define Host/Exports/Default
   $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
   $(1) : export 
PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
   $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
+  $(1) : export GIT_CEILING_DIRECTORIES=$$(BUILD_DIR_HOST)
   $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
   $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
 endef
diff --git a/include/package.mk b/include/package.mk
index f03cb15f05d5..c391d320aa2c 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -194,6 +194,7 @@ define Build/Exports/Default
   $(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
   $(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
   $(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
+  $(1) : export GIT_CEILING_DIRECTORIES:=$$(BUILD_DIR)
 endef
 Build/Exports=$(Build/Exports/Default)
 
-- 
2.39.2


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


[PATCH] sdk: Expose CCACHE_DIR option

2023-06-04 Thread Jeffery To
As the CCACHE option is already exposed, it would be helpful to also
make the ccache directory easily customizable.

Signed-off-by: Jeffery To 
---
 target/sdk/files/Config.in | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in
index a14c17fe955b..0cf68faa6e12 100644
--- a/target/sdk/files/Config.in
+++ b/target/sdk/files/Config.in
@@ -119,6 +119,13 @@ menu "Advanced configuration options (for developers)"
help
  Compiler cache; see https://ccache.samba.org/
 
+   config CCACHE_DIR
+   string "Set ccache directory" if CCACHE
+   default ""
+   help
+ Store ccache in this directory.
+ If not set, uses './.ccache'
+
config BUILD_LOG
bool "Enable log files during build process"
help
-- 
2.39.2


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


mips: Make mips64 n32/o32 userland possible or remove support completely

2023-07-19 Thread Jeffery To
Hi,

I've been looking into platform triplets for Python and figuring out
the possible combinations. This has led me to trying to compile images
of the possible combinations for testing.

As a result, I've been trying to compile malta/be64 with n32/o32
userland. I haven't been successful so far but before trying to fix
all the issues, I wanted to take a step back and ask a more general
question.

I see there is the option to select mips64 ABI in toolchain/Config.in.
On the other hand, there are commits like 46af22de16b2 ("kernel:
Remove CONFIG_COMPAT") and 38666e8ae42d ("malta: Deactivate MIPS O32
and N32 support") (and also the recent discussion with amd64 x32
support).

Is there a preference to make n32/o32 userland optional/possible, and
so I should continue trying to get it to work? Or is the preference to
remove support completely, so I should submit patches to do so?

Thanks,
Jeff

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


[OpenWrt-Devel] [PATCH] Add shorewall-lite package

2008-01-29 Thread Jeffery To
Add shorewall-lite package. (Shoreline Firewall Lite 
<http://www.shorewall.net/>)

I wrote this for my router running whiterussian, so some tweaks may be 
necessary for kamikaze. (The dependencies could also be refined.)

Signed-off-by: Jeffery To <[EMAIL PROTECTED]>
---
diff -Nru shorewall-lite.orig/files/hostname shorewall-lite/files/hostname
--- shorewall-lite.orig/files/hostname  1970-01-01 08:00:00.0 +0800
+++ shorewall-lite/files/hostname   2008-01-15 20:20:20.0 +0800
@@ -0,0 +1,2 @@
+#!/bin/sh
+cat /proc/sys/kernel/hostname
diff -Nru shorewall-lite.orig/files/shorewall-lite.init 
shorewall-lite/files/shorewall-lite.init
--- shorewall-lite.orig/files/shorewall-lite.init   1970-01-01 
08:00:00.0 +0800
+++ shorewall-lite/files/shorewall-lite.init2008-01-15 22:32:28.0 
+0800
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+
+START=46
+start() {
+   touch /var/log/messages
+   mkdir -p /var/lock/subsys
+   /sbin/shorewall-lite -qq start -f
+}
+
+stop() {
+   /sbin/shorewall-lite -qq stop
+}
+
+restart() {
+   /sbin/shorewall-lite -qq restart
+}
diff -Nru shorewall-lite.orig/files/vardir shorewall-lite/files/vardir
--- shorewall-lite.orig/files/vardir1970-01-01 08:00:00.0 +0800
+++ shorewall-lite/files/vardir 2008-01-15 21:41:30.0 +0800
@@ -0,0 +1,2 @@
+# move state dir out of ram
+VARDIR=/etc/shorewall-lite/state
diff -Nru shorewall-lite.orig/Makefile shorewall-lite/Makefile
--- shorewall-lite.orig/Makefile1970-01-01 08:00:00.0 +0800
+++ shorewall-lite/Makefile 2008-01-26 18:11:30.0 +0800
@@ -0,0 +1,61 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall-lite
+PKG_VERSION:=4.0.8
+PKG_RELEASE:=1
+PKG_MD5SUM:=9eb449aed51d2f040c67baa23477b89c
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/
 \
+   http://www1.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://slovakia.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   http://shorewall.de/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   http://www.shorewall.com.au/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://shorewall.infohiiway.com/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://www.shorewall.com.ar/pub/shorewall/shorewall/4.0/shorewall-$(PKG_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_CAT=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall-lite
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+ip +iptables +iptables-utils
+  TITLE:=Shorewall Lite
+  DESCRIPTION:=Shoreline Firewall Lite is an iptables-based firewall for Linux 
systems.
+  URL:=http://www.shorewall.net/
+  SUBMENU:=firewall
+endef
+
+#define Package/shorewall-lite/description
+#  Shoreline Firewall Lite is an iptables-based firewall for Linux systems.
+#endef
+
+define Package/shorewall-lite/conffiles
+/etc/shorewall-lite/shorewall-lite.conf
+/etc/shorewall-lite/vardir
+endef
+
+define Build/Compile
+   rm -rf $(PKG_INSTALL_DIR)
+   mkdir -p $(PKG_INSTALL_DIR)
+   PREFIX=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall-lite/install
+   $(INSTALL_DIR) $(1)/sbin
+   $(INSTALL_DIR) $(1)/etc/init.d
+   $(INSTALL_DIR) $(1)/etc/shorewall-lite
+   $(INSTALL_DIR) $(1)/usr/share
+   $(INSTALL_BIN) ./files/shorewall-lite.init 
$(1)/etc/init.d/shorewall-lite
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/shorewall-lite $(1)/sbin
+   $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall-lite $(1)/usr/share
+   $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall-lite
+   $(CP) $(PKG_INSTALL_DIR)/etc/shorewall-lite $(1)/etc
+   $(CP) ./files/vardir $(1)/etc/shorewall-lite
+endef
+
+$(eval $(call BuildPackage,shorewall-lite))
diff -Nru shorewall-lite.orig/patches/100-hostname.patch 
shorewall-lite/patches/100-hostname.patch
--- shorewall-lite.orig/patches/100-hostname.patch  1970-01-01 
08:00:00.0 +0800
+++ shorewall-lite/patches/100-hostname.patch   2008-01-26 18:06:11.0 
+0800
@@ -0,0 +1,12 @@
+diff -Nru shorewall-lite-4.0.8.orig/shorewall-lite 
shorewall-lite-4.0.8/shorewall-lite
+--- shorewall-lite-4.0.8.orig/shorewall-lite   2007-12-15 07:13:36.0 
+0800
 shorewall-lite-4.0.8/shorewall-lite2008-01-26 18:05:13.0 
+0800
+@@ -153,7 +153,7 @@
+ 
+ export VERBOSE
+ 
+-[ -n "${HOSTNAME:=$(hostname)}" ]
++[ -n "${HOSTNAME:=$(${SHAREDIR}/hostname)}" ]
+ 
+ }
+ 
diff -Nru shorewall-lite.orig/patches/110-MODULESDIR.patch 
shorewall-lite/patches/110-MODULESDIR.patch
--- shorewall-lite.orig/patches/110-MODULESDIR.patch1970-01-01 
08:00:00.0 +0800
+++ shorewall-lite/patches/110-MODULESDIR.patch 2008-01-26 18:08:56.0 
+0800
@@ -0,0 +1,21 @@
+diff -Nru shorewall-lite-4.

Re: [OpenWrt-Devel] [PATCH] Add shorewall-lite package

2008-02-02 Thread Jeffery To
Re-diff with a (hopefully) better patch level.

Signed-off-by: Jeffery To <[EMAIL PROTECTED]>
---
diff -Nru a/net/shorewall-lite/files/hostname 
b/net/shorewall-lite/files/hostname
--- a/net/shorewall-lite/files/hostname 1970-01-01 08:00:00.0 +0800
+++ b/net/shorewall-lite/files/hostname 2008-01-15 20:20:20.0 +0800
@@ -0,0 +1,2 @@
+#!/bin/sh
+cat /proc/sys/kernel/hostname
diff -Nru a/net/shorewall-lite/files/shorewall-lite.init 
b/net/shorewall-lite/files/shorewall-lite.init
--- a/net/shorewall-lite/files/shorewall-lite.init  1970-01-01 
08:00:00.0 +0800
+++ b/net/shorewall-lite/files/shorewall-lite.init  2008-01-15 
22:32:28.0 +0800
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+
+START=46
+start() {
+   touch /var/log/messages
+   mkdir -p /var/lock/subsys
+   /sbin/shorewall-lite -qq start -f
+}
+
+stop() {
+   /sbin/shorewall-lite -qq stop
+}
+
+restart() {
+   /sbin/shorewall-lite -qq restart
+}
diff -Nru a/net/shorewall-lite/files/vardir b/net/shorewall-lite/files/vardir
--- a/net/shorewall-lite/files/vardir   1970-01-01 08:00:00.0 +0800
+++ b/net/shorewall-lite/files/vardir   2008-01-15 21:41:30.0 +0800
@@ -0,0 +1,2 @@
+# move state dir out of ram
+VARDIR=/etc/shorewall-lite/state
diff -Nru a/net/shorewall-lite/Makefile b/net/shorewall-lite/Makefile
--- a/net/shorewall-lite/Makefile   1970-01-01 08:00:00.0 +0800
+++ b/net/shorewall-lite/Makefile   2008-01-26 18:11:30.0 +0800
@@ -0,0 +1,61 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall-lite
+PKG_VERSION:=4.0.8
+PKG_RELEASE:=1
+PKG_MD5SUM:=9eb449aed51d2f040c67baa23477b89c
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/
 \
+   http://www1.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://slovakia.shorewall.net/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   http://shorewall.de/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   http://www.shorewall.com.au/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://shorewall.infohiiway.com/pub/shorewall/4.0/shorewall-$(PKG_VERSION)/ \
+   
http://www.shorewall.com.ar/pub/shorewall/shorewall/4.0/shorewall-$(PKG_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_CAT=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall-lite
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+ip +iptables +iptables-utils
+  TITLE:=Shorewall Lite
+  DESCRIPTION:=Shoreline Firewall Lite is an iptables-based firewall for Linux 
systems.
+  URL:=http://www.shorewall.net/
+  SUBMENU:=firewall
+endef
+
+#define Package/shorewall-lite/description
+#  Shoreline Firewall Lite is an iptables-based firewall for Linux systems.
+#endef
+
+define Package/shorewall-lite/conffiles
+/etc/shorewall-lite/shorewall-lite.conf
+/etc/shorewall-lite/vardir
+endef
+
+define Build/Compile
+   rm -rf $(PKG_INSTALL_DIR)
+   mkdir -p $(PKG_INSTALL_DIR)
+   PREFIX=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall-lite/install
+   $(INSTALL_DIR) $(1)/sbin
+   $(INSTALL_DIR) $(1)/etc/init.d
+   $(INSTALL_DIR) $(1)/etc/shorewall-lite
+   $(INSTALL_DIR) $(1)/usr/share
+   $(INSTALL_BIN) ./files/shorewall-lite.init 
$(1)/etc/init.d/shorewall-lite
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/shorewall-lite $(1)/sbin
+   $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall-lite $(1)/usr/share
+   $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall-lite
+   $(CP) $(PKG_INSTALL_DIR)/etc/shorewall-lite $(1)/etc
+   $(CP) ./files/vardir $(1)/etc/shorewall-lite
+endef
+
+$(eval $(call BuildPackage,shorewall-lite))
diff -Nru a/net/shorewall-lite/patches/100-hostname.patch 
b/net/shorewall-lite/patches/100-hostname.patch
--- a/net/shorewall-lite/patches/100-hostname.patch 1970-01-01 
08:00:00.0 +0800
+++ b/net/shorewall-lite/patches/100-hostname.patch 2008-01-26 
18:06:11.0 +0800
@@ -0,0 +1,12 @@
+diff -Nru shorewall-lite-4.0.8.orig/shorewall-lite 
shorewall-lite-4.0.8/shorewall-lite
+--- shorewall-lite-4.0.8.orig/shorewall-lite   2007-12-15 07:13:36.0 
+0800
 shorewall-lite-4.0.8/shorewall-lite2008-01-26 18:05:13.0 
+0800
+@@ -153,7 +153,7 @@
+ 
+ export VERBOSE
+ 
+-[ -n "${HOSTNAME:=$(hostname)}" ]
++[ -n "${HOSTNAME:=$(${SHAREDIR}/hostname)}" ]
+ 
+ }
+ 
diff -Nru a/net/shorewall-lite/patches/110-MODULESDIR.patch 
b/net/shorewall-lite/patches/110-MODULESDIR.patch
--- a/net/shorewall-lite/patches/110-MODULESDIR.patch   1970-01-01 
08:00:00.0 +0800
+++ b/net/shorewall-lite/patches/110-MODULESDIR.patch   2008-01-26 
18:08:56.0 +0800
@@ -0,0 +1,21 @@
+diff -Nru shorewall-lite-4.0.8.orig/lib.base shorewall-lite-4.0.8/lib.base
+--- shorewall-lite-4.0.8.orig/lib.base 2008-01-2