[LEDE-DEV] [PATCH] procd: get rid of putenv usage.

2018-01-22 Thread Rosen Penev
setenv is prefered according to POSIX. Also allows staticly allocated strings.

Saves 200 bytes when stripped. 400 without.

Signed-off-by: Rosen Penev 
---
 service/instance.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/service/instance.c b/service/instance.c
index 12c2efe..848679c 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -279,7 +279,7 @@ instance_run(struct service_instance *in, int _stdout, int 
_stderr)
struct blobmsg_list_node *var;
struct blob_attr *cur;
char **argv;
-   char *ld_preload;
+   char *ld_preload = "/lib/libsetlbf.so";
int argc = 1; /* NULL terminated */
int rem, _stdin;
bool seccomp = !in->trace && !in->has_jail && in->seccomp;
@@ -297,8 +297,8 @@ instance_run(struct service_instance *in, int _stdout, int 
_stderr)
if (seccomp)
setenv("SECCOMP_FILE", in->seccomp, 1);
 
-   if (setlbf && asprintf(_preload, "LD_PRELOAD=/lib/libsetlbf.so") > 0)
-   putenv(ld_preload);
+   if (setlbf)
+   setenv("LD_PRELOAD", ld_preload, 1);
 
blobmsg_list_for_each(>limits, var)
instance_limits(blobmsg_name(var->data), 
blobmsg_data(var->data));
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH/RFC] hostapd: update to git snapshot of 2017-12-21

2018-01-22 Thread Daniel Golle
The following patches were merged upstream:
000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
 replaced by commit 0e3bd7ac6
001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
 replaced by commit cb5132bb3
002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
 replaced by commit 87e2db16b
003-Prevent-installation-of-an-all-zero-TK.patch
 replaced by commit 53bb18cc8
004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
 replaced by commit 0adc9b28b
005-TDLS-Reject-TPK-TK-reconfiguration.patch
 replaced by commit ff89af96e
006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
 replaced by commit adae51f8b
007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
 replaced by commit 2a9c5217b
008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
 replaced by commit a00e946c1
009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
 replaced by commit b488a1294
010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
 replaced by commit 6f234c1e2
011-Additional-consistentcy-checks-for-PTK-component-len.patch
 replaced by commit a6ea66530
012-Clear-BSSID-information-in-supplicant-state-machine-.patch
 replaced by commit c0fe5f125
013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch
 replaced by commit 114f2830d

New patches added:
010-disable-dpp-with-internal-crypto.patch
 add ifdef'ery also around dpp headers to avoid openssl includes

Some patches had to be modified to work with changed upstream source:
380-disable_ctrl_iface_mib.patch
 add more ifdef'ery
plus some minor knits needed for other patches to apply which are not
worth being explicitely listed here.

For SAE key management in mesh mode, use the newly introduce
sae_password parameter instead of the psk parameter to also support
SAE keys which would fail the checks applied on the psk field (ie.
length and such).

Signed-off-by: Daniel Golle 
---
 package/network/services/hostapd/Makefile  |   8 +-
 package/network/services/hostapd/files/hostapd.sh  |   6 +-
 ...-Avoid-key-reinstallation-in-FT-handshake.patch | 154 -
 ...nstallation-of-an-already-in-use-group-ke.patch | 244 -
 ...ection-of-GTK-IGTK-reinstallation-of-WNM-.patch | 182 ---
 ...03-Prevent-installation-of-an-all-zero-TK.patch |  73 --
 ...Fix-PTK-rekeying-to-generate-a-new-ANonce.patch |  56 -
 .../005-TDLS-Reject-TPK-TK-reconfiguration.patch   | 124 ---
 ...WNM-Sleep-Mode-Response-without-pending-r.patch |  35 ---
 ...llow-multiple-Reassociation-Response-fram.patch |  68 --
 ...efense-against-PTK-reinstalls-in-4-way-ha.patch |  34 ---
 ...ength-and-check-for-this-when-deriving-PT.patch |  53 -
 ...-side-workaround-for-key-reinstallation-a.patch | 221 ---
 .../010-disable-dpp-with-internal-crypto.patch |  44 
 ...consistentcy-checks-for-PTK-component-len.patch | 100 -
 ...-information-in-supplicant-state-machine-.patch |  25 ---
 ...WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch |  35 ---
 .../hostapd/patches/110-no_eapol_fix.patch |   2 +-
 .../services/hostapd/patches/200-multicall.patch   |  48 ++--
 .../services/hostapd/patches/300-noscan.patch  |   4 +-
 .../hostapd/patches/310-rescan_immediately.patch   |   2 +-
 .../hostapd/patches/330-nl80211_fix_set_freq.patch |   2 +-
 .../patches/350-nl80211_del_beacon_bss.patch   |   8 +-
 .../hostapd/patches/360-ctrl_iface_reload.patch|  10 +-
 .../hostapd/patches/370-ap_sta_support.patch   |  16 +-
 .../patches/380-disable_ctrl_iface_mib.patch   |  53 +++--
 .../patches/390-wpa_ie_cap_workaround.patch|   4 +-
 .../patches/400-wps_single_auth_enc_type.patch |   4 +-
 .../hostapd/patches/420-indicate-features.patch|   4 +-
 .../hostapd/patches/430-hostapd_cli_ifdef.patch|   4 +-
 .../services/hostapd/patches/450-scan_wait.patch   |  12 +-
 ...ant-add-new-config-params-to-be-used-with.patch |  12 +-
 ...80211-use-new-parameters-during-ibss-join.patch |   4 +-
 .../patches/463-add-mcast_rate-to-11s.patch|   6 +-
 .../hostapd/patches/464-fix-mesh-obss-check.patch  |   2 +-
 .../hostapd/patches/600-ubus_support.patch |  44 ++--
 36 files changed, 183 insertions(+), 1520 deletions(-)
 delete mode 100644 
package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
 delete mode 100644 
package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
 delete mode 100644 
package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
 delete mode 100644 
package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
 delete mode 100644 
package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
 delete mode 100644 
package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
 delete 

Re: [LEDE-DEV] [PATCH-v2 3/3] ath10k-firmware: Support CT IPQ4019 firmware.

2018-01-22 Thread Christian Lamparter
On Sunday, January 21, 2018 10:49:19 PM CET Ben Greear wrote:
> 
> On 01/21/2018 07:54 AM, Christian Lamparter wrote:
> > On Saturday, January 20, 2018 1:27:04 AM CET gree...@candelatech.com wrote:
> >> From: Ben Greear 
> >>
> >> Initial beta release of the CT IPQ4019 firmware.  Features are
> >> similar to the CT 9984 firmware
> 
> >> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
> >> +$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
> >>  $(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
> >>
> > ---
> > I applied the full series on top of the r5904 (see attached
> > diffconfig). But I ran into issues when selecting ath10k-ct
> > and ath10k-firmware-qca4019-ct during image creation.
> > So what's the recommended way to install these?
> 
> Are you able to un-select the default firmware? In that case,
> there should be no issue with the board-2.bin?
Try the diffconfig. It a multi-image built that includes all the current
qca4019 targets. From what I can see, neither kmod-ath10k or
ath10k-firmware-qca4019 can be deselected. At best kmod-ath10k
can be compiled as an installable package (=m). However 
ath10k-firmware-qca4019 will always be included (=y)
(due to the ipq-wifi packages' DEPENDS).

kconfig/menuconfig provides some information to why the packages
are being picked:

kmod-ath10k is Selected by: MODULE_DEFAULT_kmod-ath10k [=y] && \
 TARGET_PER_DEVICE_ROOTFS [=y] && m && MODULES [=y]

ath10k-firmware-qca4019 is Selected by:
  MODULE_DEFAULT_ath10k-firmware-qca4019 [=y] && TARGET_PER_DEVICE_ROOTFS [=y] 
\\ 
  && m && MODULES [=y] || PACKAGE_ipq-wifi-avm_fritzbox-4040 [=m] && \
  TARGET_ipq806x [=y] || PACKAGE_ipq-wifi-openmesh_a42 [=y] &&
  TARGET_ipq806x [=y] && (m && MODULES [=y] || 
PACKAGE_ipq-wifi-avm_fritzbox-4040 [=m]!=y)

> I expect the use case is to install exactly one of the firmware targets.
>
> If we take the board-2.bin out of the firmware install target, then users
> would somehow have to know to install some sort of board-2.bin or similar
> file, otherwise the driver still will not load.
>
> Since some boards have their own custom board-2.bin, I'm not sure how to
> automate this properly.  But, if we just assume users will select the
> right thing, then splitting board-2.bin out of the FW install target
> should be OK I guess?
I guess. Separating the board-2.bin files also has an advantage that it
will make it possible for users to update the ath10k-firmware-* package
on a deployed system without needing to reinstall the custom ipq-wifi
for their device each time.

But why not ask the ath10k-firmware package maintainer for input as well?
It could just be that a solution is just hiding in plain sight.

For example a easy solution would be just add a short note to the package
description of ath10k-firmware-qca4019-ct(-htt) like the one that was added
to ath10k-firmware-qca9984-ct: 
"This firmware conflicts with the standard 9984 firmware, so select only
one." [0] (but tailored to qca4019). This will leave it to the user to
either select/deselect the right firmware and driver combo manually.

Another possible way would be to set the "CONFLICTS" variable on the
kmod-ath10k(-ct) and all the ath10k-firmware-* packages. This would have
the advantage that the package/firmware/driver selection would be automatic.

Or maybe there's an elegant solution with "ALTERNATIVES"/"REPLACES"/"PROVIDES"/
"DEPENDS" package variables. With the kmod-ath10k-ct and ath10k-firmware-*-ct
packages at a higher priority, so they'll take precedence if selected.

... etc.

Regards,
Christian

[0] 



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/2 procd] trace: check asprintf() return value

2018-01-22 Thread Hans Dedecker
Check asprintf() return value; fixes ignoring return value warnings:

warning: ignoring return value of 'asprintf', declared with attribute
warn_unused_result [-Wunused-result]

Signed-off-by: Hans Dedecker 
---
 trace/trace.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/trace/trace.c b/trace/trace.c
index 1c1e757..27cf108 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -317,13 +317,17 @@ int main(int argc, char **argv, char **envp)
case SECCOMP_TRACE:
preload = "/lib/libpreload-seccomp.so";
newenv = 2;
-   asprintf(&_envp[1], "SECCOMP_FILE=%s", json ? json : 
"");
+   if (asprintf(&_envp[1], "SECCOMP_FILE=%s", json ? json 
: "") < 0)
+   ULOG_ERR("failed to allocate SECCOMP_FILE env: 
%m\n");
+
kill(getpid(), SIGSTOP);
break;
}
-   asprintf(&_envp[0], "LD_PRELOAD=%s%s%s", preload,
-old_preload ? ":" : "",
-old_preload ? old_preload : "");
+   if (asprintf(&_envp[0], "LD_PRELOAD=%s%s%s", preload,
+old_preload ? ":" : "",
+ old_preload ? old_preload : "") < 0)
+   ULOG_ERR("failed to allocate LD_PRELOAD env: %m\n");
+
memcpy(&_envp[newenv], envp, envc * sizeof(char *));
 
ret = execve(_argv[0], _argv, _envp);
@@ -383,7 +387,8 @@ int main(int argc, char **argv, char **envp)
case SECCOMP_TRACE:
if (!violation_count)
return 0;
-   asprintf(, "/tmp/%s.%u.violations.json", basename(*argv), 
child);
+   if (asprintf(, "/tmp/%s.%u.violations.json", 
basename(*argv), child) < 0)
+   ULOG_ERR("failed to allocate violations output path: 
%m\n");
break;
}
print_syscalls(policy, json);
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 1/2 procd] trace: add missing limits.h include

2018-01-22 Thread Hans Dedecker
Fixes compile issue when using glibc as INT_MAX is reported as
undeclared.

Signed-off-by: Hans Dedecker 
---
 trace/trace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/trace/trace.c b/trace/trace.c
index b156e2a..1c1e757 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifndef PTRACE_EVENT_STOP
 /* PTRACE_EVENT_STOP is defined in linux/ptrace.h, but this header
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] [RFC] build: log time taken by each packages/steps

2018-01-22 Thread Etienne Champetier
Hi John,

agreed, I was pretty sure there was/is a better way ;)
i'll not have any time until next week, so if you or anyone want to
implement it please do

Regards
Etienne

2018-01-22 9:23 GMT+01:00 John Crispin :
>
>
> On 21/01/18 00:01, Etienne Champetier wrote:
>>
>> The idea is to easily get the list of packages taking the most time to
>> build,
>> and see if we can improve them
>>
>> Sending as RFC as this is a quick hack that might break in some case
>> (different implementation of time)
>>
>> Signed-off-by: Etienne Champetier 
>
>
> Hi Etienne,
>
>  the time command should be set up in include/prereq-build.mk, the
> SetupHostCommand.
> might also make sense to just print the time on the shell, always ... and
> not only when LOG is enabled
>
> John
>
>
>> ---
>>   include/subdir.mk | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/subdir.mk b/include/subdir.mk
>> index 79a80528ae..85d2daf1bd 100644
>> --- a/include/subdir.mk
>> +++ b/include/subdir.mk
>> @@ -42,7 +42,8 @@ log_make = \
>>  $(if $(call debug,$(1),v),,@)+ \
>>  $(if $(BUILD_LOG), \
>> set -o pipefail; \
>> -   mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
>> +   mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
>> +   /usr/bin/time -f $(1)$(if $(4),/$(4))/$(if
>> $(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
>> $$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
>> $(if $(BUILD_LOG),SILENT= 2>&1 | tee
>> $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
>>
>
>

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] openssl: remove cause of buildbot failures

2018-01-22 Thread Val Kulkov
Compiling openssl generates a number of error messages as make executes
openssl on host, producing errors: "wrong ELF class: ELFCLASS32". These
errors trigger buildbot failures as described in issue 5432 [1] at
openwrt/packages Github repo.

This patch fixes issue 5432 by removing demo certificates from the
build directory. The demo certificates are not necessary for compiling
or packaging openssl on OpenWrt.

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

Signed-off-by: Val Kulkov 
---
 package/libs/openssl/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index b75aa45..d25c248 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -208,6 +208,9 @@ TARGET_CFLAGS += $(FPIC) -I$(CURDIR)/include 
-ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections
 
 define Build/Compile
+   # Remove demo certificates to avoid execution of openssl on host 
triggering buildbot failures:
+   # ERROR: ld.so: object <...> libcrypto.so.1.0.0 from LD_PRELOAD cannot 
be preloaded (wrong ELF class: ELFCLASS32)
+   -rm $(PKG_BUILD_DIR)/certs/demo/*.pem
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Board specific Kconfig?

2018-01-22 Thread Jonas Gorski
Hi,

On 22 January 2018 at 07:16, perillamint  wrote:
> Hello,
>
> I'm currently porting LEDE(wait, OpenWRT now?) on Intel Galileo.
>
> Since not every Intel Quark board has GPIO multiplexer chips like
> Galileo, I think I have to separate board specific components into
> separate Kconfig and keep platform Kconfig clean.
>
> Is there any documentation about this kind of work available?

There is intentionally no support for board specific kernel config
support. This allows all boards of a (sub)target to share the kernel
and modules. Also OpenWrt supports building for multiple boards at the
same time, which would be broken by this.

If you don't want to create a subtarget per board (which wouldn't be
acceptable if you plan to submit), your options are:

1) building the GPIO multiplexer driver as a module and selectively
including it in the board's specific packages list
2) Deciding that the driver is small enough and have it included in
the kernel for all boards regardless if needed


Regards
Jonas

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] config: add option to select kernel compile optimization type

2018-01-22 Thread Jonas Gorski
On 22 January 2018 at 10:20, Koen Vandeputte
 wrote:
>
>
> On 2018-01-21 13:37, Jonas Gorski wrote:
>>
>> Hi,
>>
>> On 18 January 2018 at 10:50, Koen Vandeputte
>>  wrote:
>>>
>>> A lot of targets have more than sufficient space to allow
>>> building the kernel for speed iso size.
>>>
>>> Export this performance option to the main config:
>>>
>>> - Making it easy accessable for users
>>> - Discarding the need to adjust it in the kernel config each time
>>> when building from scratch and only using "make oldconfig"
>>>
>>> Compiling for size is still the default.
>>
>> This would be a "regression" for layerscape, as this target sets
>> CC_OPTIMIZE_FOR_PERFORMANCE to y.
>>
>>> Purely informational:
>>>
>>> On my cns3xxx board, kernel size increases by ~100kB
>>> but boot time decreased by ~8%.
>>>
>>> Signed-off-by: Koen Vandeputte 
>>> ---
>>>   config/Config-kernel.in | 16 
>>>   1 file changed, 16 insertions(+)
>>>
>>> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
>>> index fa06b5044219..b98c5dd04591 100644
>>> --- a/config/Config-kernel.in
>>> +++ b/config/Config-kernel.in
>>> @@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
>>>  bool "Compile the kernel with gpio debugging"
>>>  select KERNEL_DEBUG_KERNEL
>>>
>>> +config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
>>> +bool
>>> +default y if COMPILE_KERNEL_FOR_SPEED
>>> +default n
>>> +
>>> +config KERNEL_CC_OPTIMIZE_FOR_SIZE
>>> +bool
>>> +default n if COMPILE_KERNEL_FOR_SPEED
>>> +default y
>>> +
>>> +config COMPILE_KERNEL_FOR_SPEED
>>> +bool "Optimize the kernel for speed instead of size"
>>> +default n
>>> +help
>>> +  This will compile your kernel for maximum speed (-O2) instead
>>> of smaller size (-Os)
>>
>> The kernel uses a choice here, so I think it would be better to just
>> copy that. One less config option as well.
>
> Hi Jonas,
>
> Could you elaborate a bit more on this specific point?
> I'm not quite fully understanding your proposal here.

See http://elixir.free-electrons.com/linux/latest/source/init/Kconfig#L1034


Regards
Jonas

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2] imx6: fix pcie scanning on boot

2018-01-22 Thread Koen Vandeputte

3rd time's the charm :)  .. without html ..




>

Hi Koen,

Thanks for this info!

Have you asked the linux-pci group about this? I'm curious what the
patch to 4.9.71 was trying to do and if this is the proper place to
fix this. I assume if we set that value in the bootloader it
would get
reset when the kernel does a PCI reset.

It seems like every couple of months there is some upstream breakage
dealing with the i.MX6 and a PCIe switch :(

Regards,

Tim



Hi Tim,

After this quick fix, Ive investigated this deeper.

It seems not only imx6 was affected but all platforms using dwc for pcie.
meanwhile, a definitive fix was submitted upstream towards the pci guys:
https://patchwork.kernel.org/patch/10163363/


The patch causing this actually makes sense:
It enforces setting all port params to be set correctly according to 
pcie spec.


Separate backports are needed for 4.9 and older LTS kernels as the dwc 
init code got moved.

In 4.9 the backport will actually fix enumeration behind bridges.
in 4.4 and older, no functional behaviour changes, but the nasty 
warnings and errors are gone during boot.


it is correct that setting this in bootloader doesnt affect the kernel 
which resets the bus and reinits it completely.
Just to ensure both are correct, Ive also submitted a fix to uboot 
(imx6 only)

http://git.denx.de/?p=u-boot.git;a=commit;h=f57263ee9bb8b5d9f39b48d09d21114c9dbb6a02


Kind regards,

Koen



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] config: add option to select kernel compile optimization type

2018-01-22 Thread Koen Vandeputte



On 2018-01-21 13:37, Jonas Gorski wrote:

Hi,

On 18 January 2018 at 10:50, Koen Vandeputte
 wrote:

A lot of targets have more than sufficient space to allow
building the kernel for speed iso size.

Export this performance option to the main config:

- Making it easy accessable for users
- Discarding the need to adjust it in the kernel config each time
when building from scratch and only using "make oldconfig"

Compiling for size is still the default.

This would be a "regression" for layerscape, as this target sets
CC_OPTIMIZE_FOR_PERFORMANCE to y.


Purely informational:

On my cns3xxx board, kernel size increases by ~100kB
but boot time decreased by ~8%.

Signed-off-by: Koen Vandeputte 
---
  config/Config-kernel.in | 16 
  1 file changed, 16 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index fa06b5044219..b98c5dd04591 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
 bool "Compile the kernel with gpio debugging"
 select KERNEL_DEBUG_KERNEL

+config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
+bool
+default y if COMPILE_KERNEL_FOR_SPEED
+default n
+
+config KERNEL_CC_OPTIMIZE_FOR_SIZE
+bool
+default n if COMPILE_KERNEL_FOR_SPEED
+default y
+
+config COMPILE_KERNEL_FOR_SPEED
+bool "Optimize the kernel for speed instead of size"
+default n
+help
+  This will compile your kernel for maximum speed (-O2) instead of 
smaller size (-Os)

The kernel uses a choice here, so I think it would be better to just
copy that. One less config option as well.

Hi Jonas,

Could you elaborate a bit more on this specific point?
I'm not quite fully understanding your proposal here.

Thanks

Also the options should be removed from the kernel configs then.




Regards
Jonas



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] config: add option to select kernel compile optimization type

2018-01-22 Thread Koen Vandeputte



On 2018-01-21 13:46, Arjen de Korte wrote:

Citeren Jonas Gorski :


Hi,

On 18 January 2018 at 10:50, Koen Vandeputte
 wrote:

A lot of targets have more than sufficient space to allow
building the kernel for speed iso size.

Export this performance option to the main config:

- Making it easy accessable for users
- Discarding the need to adjust it in the kernel config each time
when building from scratch and only using "make oldconfig"

Compiling for size is still the default.


This would be a "regression" for layerscape, as this target sets
CC_OPTIMIZE_FOR_PERFORMANCE to y.



Purely informational:

On my cns3xxx board, kernel size increases by ~100kB
but boot time decreased by ~8%.

Signed-off-by: Koen Vandeputte 
---
 config/Config-kernel.in | 16 
 1 file changed, 16 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index fa06b5044219..b98c5dd04591 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -194,6 +194,22 @@ config KERNEL_DEBUG_GPIO
    bool "Compile the kernel with gpio debugging"
    select KERNEL_DEBUG_KERNEL

+config KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE
+    bool
+    default y if COMPILE_KERNEL_FOR_SPEED
+    default n
+
+config KERNEL_CC_OPTIMIZE_FOR_SIZE
+    bool
+    default n if COMPILE_KERNEL_FOR_SPEED
+    default y
+
+config COMPILE_KERNEL_FOR_SPEED
+    bool "Optimize the kernel for speed instead of size"
+    default n
+    help
+  This will compile your kernel for maximum speed (-O2) 
instead of smaller size (-Os)


The kernel uses a choice here, so I think it would be better to just
copy that. One less config option as well.

Also the options should be removed from the kernel configs then.


One thing that wonders me, couldn't the option CONFIG_TARGET_OPTIONS=y 
and CONFIG_TARGET_OPTIMIZATION that is already available be used for 
this as well? So far I have used this to set the optimization used, 
which seems to do the job just fine (for the whole target, not just 
the kernel).



Only packages are affected by this flag. (If they don't override it by 
setting -O flags themselves)


Also, using this one for the kernel too changes building to "all or nothing"
Depending on target space, it can be useful to just have a fast kernel 
(O2), with slower packages (Os)  or vice-versa






___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] [RFC] build: log time taken by each packages/steps

2018-01-22 Thread John Crispin



On 21/01/18 00:01, Etienne Champetier wrote:

The idea is to easily get the list of packages taking the most time to build,
and see if we can improve them

Sending as RFC as this is a quick hack that might break in some case (different 
implementation of time)

Signed-off-by: Etienne Champetier 


Hi Etienne,

 the time command should be set up in include/prereq-build.mk, the 
SetupHostCommand.
might also make sense to just print the time on the shell, always ... 
and not only when LOG is enabled


    John


---
  include/subdir.mk | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/subdir.mk b/include/subdir.mk
index 79a80528ae..85d2daf1bd 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -42,7 +42,8 @@ log_make = \
 $(if $(call debug,$(1),v),,@)+ \
 $(if $(BUILD_LOG), \
set -o pipefail; \
-   mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
+   mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
+   /usr/bin/time -f $(1)$(if $(4),/$(4))/$(if 
$(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if 
$(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
  



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH iwinfo] nl80211: Do not block when driver aborts scan

2018-01-22 Thread John Crispin



On 09/01/18 15:16, osiverts...@gmail.com wrote:

From: Olof Sivertsson 

Drivers may abort a scan by calling cfg80211_scan_done() with a struct
cfg80211_scan_info that sets aborted to true.

To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
and NL80211_CMD_SCAN_ABORTED when waiting for scan results.

Tested with Broadcom's bcmdhd driver.

Signed-off-by: Olof Sivertsson 


Hi Olof,

Jow prepare an alternate solution ot the problem
https://git.openwrt.org/?p=project/iwinfo.git;a=commitdiff;h=75c572074f272f0b983d888f7dd23ee59719c6b0 


https://git.openwrt.org/?p=project/iwinfo.git;a=commitdiff;h=fb749bf51a7855ee955fc221acdc51b94231db2b

    John



---
  iwinfo_nl80211.c | 12 
  iwinfo_nl80211.h |  1 +
  2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 2776531..d84da24 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -510,7 +510,7 @@ static int nl80211_wait_cb(struct nl_msg *msg, void *arg)
struct nl80211_event_conveyor *cv = arg;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
  
-	if (gnlh->cmd == cv->wait)

+   if (gnlh->cmd == cv->wait || gnlh->cmd == cv->cancel)
cv->recv = gnlh->cmd;
  
  	return NL_SKIP;

@@ -521,9 +521,9 @@ static int nl80211_wait_seq_check(struct nl_msg *msg, void 
*arg)
return NL_OK;
  }
  
-static int nl80211_wait(const char *family, const char *group, int cmd)

+static int nl80211_wait(const char *family, const char *group, int wait, int 
cancel)
  {
-   struct nl80211_event_conveyor cv = { .wait = cmd };
+   struct nl80211_event_conveyor cv = { .wait = wait, .cancel = cancel };
struct nl_cb *cb;
int err = 0;
  
@@ -544,6 +544,9 @@ static int nl80211_wait(const char *family, const char *group, int cmd)
  
  	nl_cb_put(cb);
  
+	if (cv.recv == cancel)

+   return -ECANCELED;
+
return err;
  }
  
@@ -2091,7 +2094,8 @@ static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)

if (nl80211_request(ifname, NL80211_CMD_TRIGGER_SCAN, 0, NULL, NULL))
goto out;
  
-	if (nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS))

+   if (nl80211_wait("nl80211", "scan",
+NL80211_CMD_NEW_SCAN_RESULTS, 
NL80211_CMD_SCAN_ABORTED))
goto out;
  
  	if (nl80211_request(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP,

diff --git a/iwinfo_nl80211.h b/iwinfo_nl80211.h
index bb5117e..38089d2 100644
--- a/iwinfo_nl80211.h
+++ b/iwinfo_nl80211.h
@@ -49,6 +49,7 @@ struct nl80211_msg_conveyor {
  
  struct nl80211_event_conveyor {

int wait;
+   int cancel;
int recv;
  };
  



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev