Re: [LEDE-DEV] [OpenWrt-Devel] Images are too big in LEDE but not in OpenWRT

2018-02-08 Thread David Lang
two years of development means that lots of packages are larger. you will have 
to see fi there are config options for the packages that you are using that 
reduce their size


I don't know what configuring limits would mean? not produce an image if it's 
too large? start leaving things out when it hits a limit?


David Lang

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


[LEDE-DEV] Images are too big in LEDE but not in OpenWRT

2018-02-08 Thread Jakub Jančo
Hello,

is there any reason why LEDE needs more empty space in firmware for
TP-link tl-wr1043nd v3 ?

In OpenWRT 15.01 we are building 7.3MB large images and have just
enought space for configs.
In LEDE 17.01 is max size ~6.5MB and we are not able to build our
images, because we cannot strip more packages, now we are on 6.8MB.

Is it possible to configure limits?

Thanks for help.

Number of duplicate files found 281
Number of inodes 2517
Number of files 2109
Number of fragments 55
Number of symbolic links  266
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 141
Number of ids (unique uids + gids) 1
Number of uids 1
root (0)
Number of gids 1
root (0)
13189+1 records in
13189+1 records out
6753020 bytes (6.8 MB) copied, 0.0269157 s, 251 MB/s
[mktplinkfw] kernel length aligned to 1360344
[mktplinkfw] *** error: images are too big by 249556 bytes
cp: cannot stat
'/var/lib/jenkins/workspace/openwrt-buildbot-17-01-imagebuilder/lede-imagebuilder-ar71xx-generic.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/tmp/lede-ar71xx-generic-tl-wr1043nd-v3-squashfs-sysupgrade.bin':
No such file or directory
13189+1 records in
13189+1 records out
6753020 bytes (6.8 MB) copied, 0.0267773 s, 252 MB/s
[mktplinkfw] kernel length aligned to 1360344
[mktplinkfw] *** error: images are too big by 249556 bytes
cp: cannot stat
'/var/lib/jenkins/workspace/openwrt-buildbot-17-01-imagebuilder/lede-imagebuilder-ar71xx-generic.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/tmp/lede-ar71xx-generic-tl-wr1043nd-v3-squashfs-factory.bin':
No such file or directory
padding image to 0068
padding image to 00671000
padding image to 00672000
padding image to 00674000
padding image to 0068
52+1 records in
53+0 records out
6946816 bytes (6.9 MB) copied, 0.00822619 s, 844 MB/s



--
S pozdravom Jakub Janco

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


[LEDE-DEV] [PATCH v1 1/1] openssh: disable passwords for openssh server

2018-02-08 Thread Philip Prindeville
From: Philip Prindeville 

Allowing password logins leaves you vulnerable to dictionary
attacks.  We disable password-based authentication, limiting
authentication to keys only which are more secure.

Note: You'll need to pre-populate your image with some initial
keys. To do this:

1. Create the appropriate directory as "mkdir -p files/root/.ssh"
   from your top-level directory;
2. Copy your "~/.ssh/id_rsa.pub" (or as appropriate) into
   "files/root/.ssh/authorized_keys" and indeed, you can collect
   keys from several sources this way by concatenating them;
3. Set the permissions on "authorized_keys" to 644 or 640.

Signed-off-by: Philip Prindeville 
---
 net/openssh/Makefile | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/openssh/Makefile b/net/openssh/Makefile
index 
3a19387b0d0110fc5c25d7ffccb524a61c0588c4..7ca61f6ce6d5916016a554b4a283a874e950232c
 100644
--- a/net/openssh/Makefile
+++ b/net/openssh/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
 PKG_VERSION:=7.6p1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
@@ -248,7 +248,10 @@ define Package/openssh-server/install
$(INSTALL_DIR) $(1)/etc/ssh
chmod 0700 $(1)/etc/ssh
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
-   sed -r -i 's,^#(HostKey 
/etc/ssh/ssh_host_(rsa|ecdsa|ed25519)_key),\1,' $(1)/etc/ssh/sshd_config
+   sed -r -i \
+   -e 's,^#(HostKey 
/etc/ssh/ssh_host_(rsa|ecdsa|ed25519)_key),\1,' \
+   -e 's,^#PasswordAuthentication yes,PasswordAuthentication no,' \
+   $(1)/etc/ssh/sshd_config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
$(INSTALL_DIR) $(1)/usr/sbin
-- 
2.7.4


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


Re: [LEDE-DEV] [PATCH v2 0/5] mvebu: add kernel 4.14 support

2018-02-08 Thread Lucian Cristian

On 21.01.2018 19:53, Hauke Mehrtens wrote:

This add support for kernel 4.14 to the mvebu target. My main reason to
add kernel 4.14 support is to make it easier to also add support for the
Marvell Armada 3700LP ARM64 SoCs especially the ESPRESSObin board.

I do not have any of the currently supported boards so I can not runtime
test this myself, Lucian Cristian already tested an older version of
these patches on one of his boards.

My current working tree for this target can be found here:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/mvebu-4.14
This tree also contains the code needed for the ESPRESSObin, but we
still have some problems with the image creation, the bootloader boots
by default the kernel + dtb from a ext4 file system on a SD card and
also uses this partition as root file system.
Tomasz Maciej Nowak is working on the image generation for the
ESPRESSObin board.

I am waiting for positive and negative feedback on these patches, if you
run into a problem which you do not have with kernel 4.9 please report
this.

changes in:
v2:
  * refresh on current generic kernel 4.14 integration
  * create ubifs fs format version 4 also with kernel 4.14, this should
fix sysupgrade (downgrade) from kernel 4.14 to 4.9
  * rename the wireless driver path when upgrading


Hauke Mehrtens (5):
   kernel: ubifs: create use file system format 4 by default
   mvebu: move files to files-4.9 and files-4.4 folder
   mvebu: copy config and patches from 4.9 to 4.14
   mvebu: Make kernel 4.14 patches apply
   mvebu: migrate uci config to new PCIe path

  target/linux/generic/config-4.14   |   1 +
  ...ption-to-create-UBI-FS-version-4-on-empty.patch |  63 ++
  .../base-files/etc/uci-defaults/05-migrate-wifi|  23 +
  target/linux/mvebu/config-4.14 | 486 ++
  .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
  .../arm/boot/dts/armada-385-linksys-shelby.dts |   0
  .../arch/arm/boot/dts/armada-385-linksys-rango.dts |   0
  .../arm/boot/dts/armada-385-linksys-shelby.dts |   0
  .../mvebu/patches-4.14/002-add_powertables.patch   | 770 
  .../mvebu/patches-4.14/003-add_switch_nodes.patch  |  40 +
  .../004-add_sata_disk_activity_trigger.patch   |  39 +
  .../mvebu/patches-4.14/100-find_active_root.patch  |  60 ++
  .../mvebu/patches-4.14/102-revert_i2c_delay.patch  |  15 +
  .../103-remove-nand-driver-bug.patch   |   0
  .../104-linksys_mamba_disable_keep_config.patch|  10 +
  .../110-pxa3xxx_revert_irq_thread.patch|  69 ++
  .../205-armada-385-rd-mtd-partitions.patch |   0
  .../206-ARM-mvebu-385-ap-Add-partitions.patch  |   0
  .../patches-4.14/210-clearfog_switch_node.patch|  21 +
  .../300-mvneta-tx-queue-workaround.patch   |  35 +
  ...bu-indicate-failure-to-enter-deeper-sleep.patch |  40 +
  .../401-pci-mvebu-time-out-reset-on-link-up.patch  |  60 ++
  .../402-sfp-display-SFP-module-information.patch   | 290 ++
  .../403-net-mvneta-convert-to-phylink.patch| 979 +
  .../404-net-mvneta-hack-fix-phy_interface.patch|  28 +
  ...disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch |  56 ++
  ...-mvneta-add-module-EEPROM-reading-support.patch |  44 +
  ...y-fixed-phy-remove-fixed_phy_update_state.patch |  80 ++
  ...dule-eeprom-ethtool-access-into-netdev-co.patch | 181 
  ...409-sfp-use-netdev-sfp_bus-for-start-stop.patch |  34 +
  ...-allow-marvell-10G-phy-support-to-use-SFP.patch | 130 +++
  .../patches-4.14/411-sfp-add-sfp-compatible.patch  |  24 +
  ...-armada388-clearfog-emmc-on-clearfog-base.patch |  87 ++
  ...ada388-clearfog-increase-speed-of-i2c0-to.patch |  42 +
  ...armada388-clearfog-add-SFP-module-support.patch |  81 ++
  ...dts-armada388-clearfog-document-MPP-usage.patch | 124 +++
  36 files changed, 3912 insertions(+)
  create mode 100644 
target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
  create mode 100644 
target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi
  create mode 100644 target/linux/mvebu/config-4.14
  copy target/linux/mvebu/{files => 
files-4.4}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
  copy target/linux/mvebu/{files => 
files-4.4}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
  rename target/linux/mvebu/{files => 
files-4.9}/arch/arm/boot/dts/armada-385-linksys-rango.dts (100%)
  rename target/linux/mvebu/{files => 
files-4.9}/arch/arm/boot/dts/armada-385-linksys-shelby.dts (100%)
  create mode 100644 target/linux/mvebu/patches-4.14/002-add_powertables.patch
  create mode 100644 target/linux/mvebu/patches-4.14/003-add_switch_nodes.patch
  create mode 100644 
target/linux/mvebu/patches-4.14/004-add_sata_disk_activity_trigger.patch
  create mode 100644 target/linux/mvebu/patches-4.14/100-find_active_root.patch
  create mode 100644 target/linux/mvebu/patches-4.14/102-revert_i2c_delay.patch
  copy target/linux/mvebu/{patch

[LEDE-DEV] [PATCH mountd] autofs: don't check if /tmp/run/mountd/ mount point exists

2018-02-08 Thread Rafał Miłecki
From: Rafał Miłecki 

First of all this check was never working. Mount points are stored
without trailing slash so passing "/tmp/run/mountd/" as argument was a
mistake.

This could get fixed but that would make mountd refuse to start in
situations people used to have it working. When stopping mountd with
some devices mounted in the /tmp/run/mountd/ umount_autofs() won't be
able to unmount it (umount will return 256). This isn't critical
thought as new mountd instance can just mount aufofs again (using the
same mount point and its own pipefd).

Signed-off-by: Rafał Miłecki 
---
 autofs.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/autofs.c b/autofs.c
index a898f49..fd37f1f 100644
--- a/autofs.c
+++ b/autofs.c
@@ -48,11 +48,6 @@ static int mount_autofs(void)
int pipefd[2];
struct stat st;
log_printf("trying to mount %s as the autofs root\n", 
"/tmp/run/mountd/");
-   if(is_mounted(0, "/tmp/run/mountd/"))
-   {
-   log_printf("%s is already mounted\n", "/tmp/run/mountd/");
-   return -1;
-   }
fdout = fdin = -1;
mkdir("/tmp/run/mountd/", 0555);
if(pipe(pipefd) < 0)
-- 
2.11.0


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


[LEDE-DEV] [PATCH mountd] mount: don't mount device that is already mounted

2018-02-08 Thread Rafał Miłecki
From: Rafał Miłecki 

It may happen that on mountd start some devices are already mounted.
This could due to killing previous mountd instance or just a crash. In
such case device shouldn't get remounted but added to the list with a
mounted flag set. That will make mountd monitor it and take needed steps
when it disappears.

Signed-off-by: Rafał Miłecki 
---
 mount.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/mount.c b/mount.c
index f995745..d7aa27c 100644
--- a/mount.c
+++ b/mount.c
@@ -138,7 +138,7 @@ static void mount_add_list(char *name, char *dev, char 
*serial,
char *vendor, char *model, char *rev, int ignore, char *size, char 
*sector_size, int fs)
 {
struct mount *mount;
-   char tmp[64], tmp2[64];
+   char tmp[64], run_mount_path[64];
 
mount  = malloc(sizeof(struct mount));
INIT_LIST_HEAD(&mount->list);
@@ -154,12 +154,18 @@ static void mount_add_list(char *name, char *dev, char 
*serial,
mount->mounted = 0;
mount->fs = fs;
list_add(&mount->list, &mounts);
+
+   snprintf(run_mount_path, 64, "/tmp/run/mountd/%s", dev);
+   if (is_mounted(NULL, run_mount_path)) {
+   log_printf("mount point %s already exists!\n", run_mount_path);
+   mount->mounted = 1;
+   return;
+   }
if (!mount->ignore)
{
log_printf("new mount : %s -> %s (%s)\n", name, dev, 
fs_names[mount->fs]);
snprintf(tmp, 64, "%s%s", uci_path, name);
-   snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev);
-   symlink(tmp2, tmp);
+   symlink(run_mount_path, tmp);
if (!mount_new("/tmp/run/mountd/", dev))
system_printf("ACTION=add DEVICE=%s NAME=%s 
/sbin/hotplug-call mount", dev, name);
}
-- 
2.11.0


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


[LEDE-DEV] [PATCH 1/2] mount: improve handling mounts table size

2018-02-08 Thread Rafał Miłecki
From: Rafał Miłecki 

This is static array with a size set to MAX_MOUNTED. Old code:
1) Was never using the last table entry/row
2) Was logging the same message for every mount entry above limit

This fixes off-by-one, moves limit check to the proper place and uses
"break" when needed.

Signed-off-by: Rafał Miłecki 
---
 mount.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/mount.c b/mount.c
index db77f10..9cb1a43 100644
--- a/mount.c
+++ b/mount.c
@@ -626,6 +626,12 @@ static void mount_check_mount_list(void)
while(fgets(tmp, 256, fp) != NULL)
{
char *t, *t2;
+
+   if (mounted_count + 1 > MAX_MOUNTED) {
+   log_printf("found more than %d mounts \n", MAX_MOUNTED);
+   break;
+   }
+
t = strstr(tmp, " ");
if(t)
{
@@ -651,10 +657,8 @@ static void mount_check_mount_list(void)
mounted[mounted_count][0],
mounted[mounted_count][1],
mounted[mounted_count][2]);*/
-   if(mounted_count < MAX_MOUNTED - 1)
-   mounted_count++;
-   else
-   log_printf("found more than %d mounts \n", MAX_MOUNTED);
+
+   mounted_count++;
}
fclose(fp);
 }
-- 
2.11.0


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


[LEDE-DEV] [PATCH 2/2] mount: rename /proc/mount parser to mount_update_mount_list()

2018-02-08 Thread Rafał Miłecki
From: Rafał Miłecki 

Using "update" in the function name should better match its role than
"check". The main purpose of this function is to update content of the
"mounted" array.

Signed-off-by: Rafał Miłecki 
---
 mount.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mount.c b/mount.c
index 9cb1a43..f995745 100644
--- a/mount.c
+++ b/mount.c
@@ -612,7 +612,7 @@ char* is_mounted(char *block, char *path)
return 0;
 }
 
-static void mount_check_mount_list(void)
+static void mount_update_mount_list(void)
 {
FILE *fp = fopen("/proc/mounts", "r");
char tmp[256];
@@ -779,7 +779,7 @@ static void mount_check_enum(void)
 void mount_init(void)
 {
INIT_LIST_HEAD(&mounts);
-   timer_add(mount_check_mount_list, 2);
+   timer_add(mount_update_mount_list, 2);
timer_add(mount_check_enum, 1);
-   mount_check_mount_list();
+   mount_update_mount_list();
 }
-- 
2.11.0


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


Re: [LEDE-DEV] [PATCH 0/3] uqmi: fix more dial-in issues

2018-02-08 Thread Koen Vandeputte



On 2018-02-08 10:53, Bjørn Mork wrote:

Bjørn Mork  writes:


Backporting the raw-ip feature to v4.4 is simple.  Just cherry-pick

  81e0ce79f291 ("usbnet: allow mini-drivers to consume L2 headers")
  32f7adf633b9 ("net: qmi_wwan: support "raw IP" mode")
  6c730080e663 ("net: qmi_wwan: should hold RTNL while changing netdev type")


These still apply cleanly on top of v4.4.115.

Correction. A complete(?) backport should include these two fixes as well:

  a4abd7a80add ("usbnet: fix alignment for frames with no ethernet header")
  0de0add10e58 ("qmi_wwan: Add missing skb_reset_mac_header-call")


Hope I got them all now...


Thank you Bjorn!
I'm happy to say I've used exactly these 5 patches this morning for 
backporting it.


For backporting support for the EC25 modem, following patches were used:

--> net: qmi_wwan: MDM9x30 specific power management
--> qmi_wwan: add support for Quectel EC21 and EC25

I'm currently testing the build on a Gl-Mifi device (ar71xx)

Koen



Bjørn



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


Re: [LEDE-DEV] [PATCH 0/3] uqmi: fix more dial-in issues

2018-02-08 Thread Bjørn Mork
Bjørn Mork  writes:

> Backporting the raw-ip feature to v4.4 is simple.  Just cherry-pick
>
>  81e0ce79f291 ("usbnet: allow mini-drivers to consume L2 headers")
>  32f7adf633b9 ("net: qmi_wwan: support "raw IP" mode")
>  6c730080e663 ("net: qmi_wwan: should hold RTNL while changing netdev type")
>
>
> These still apply cleanly on top of v4.4.115.

Correction. A complete(?) backport should include these two fixes as well:

 a4abd7a80add ("usbnet: fix alignment for frames with no ethernet header")
 0de0add10e58 ("qmi_wwan: Add missing skb_reset_mac_header-call")


Hope I got them all now...




Bjørn

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


Re: [LEDE-DEV] [PATCH 0/3] uqmi: fix more dial-in issues

2018-02-08 Thread Bjørn Mork
Koen Vandeputte  writes:
> On 07-02-18 22:14, Levente Kovacs wrote:
>> On Wed,  7 Feb 2018 13:23:25 +0100
>> Koen Vandeputte  wrote:
>>
 Quectel EC25-A
>> Does the EC25 work without any kernel patch? I was testing EC25 with 17.01.1,
>> and it was working only with a kernel patch. Can you give me a status update
>> on this? Now I migrated to 17.01.4, but I haven't tested the qmi/ethernet
>> interface.
> This modem only supports raw-ip mode for QMI, which was only added in
> kernel 4.5.
> The 17.01 branch uses 4.4, while the master branch uses 4.9 for my
> target containing this modem (ar71xx - Gl.Mifi)
>
>> For the time being, I'm using it with the PPP interface.
>>
>> What is your estimate on timing of your patch goes into a release?
> afaik, the required patch(es) have not been backported yet.
> If it's no too much work, I'm more than happy to provide a backport
> (it's a bit out of my scope as I'm mostly using Master)

Backporting the raw-ip feature to v4.4 is simple.  Just cherry-pick

 81e0ce79f291 ("usbnet: allow mini-drivers to consume L2 headers")
 32f7adf633b9 ("net: qmi_wwan: support "raw IP" mode")
 6c730080e663 ("net: qmi_wwan: should hold RTNL while changing netdev type")


These still apply cleanly on top of v4.4.115.

The only reason the backport wasn't done upstream is because "raw-ip"
support is considered a new feature and therefore out-of-scope for
stable.

Note that you'll probable have to track down and add a number of device
IDs for the devices with raw-ip support too.  I haven't done this.

But running master with v4.9 or v4.14 sounds like a much better
alternative to me



Bjørn

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


[LEDE-DEV] [PATCH libubox v2] sh/jshn.sh: add json_for_each_item()

2018-02-08 Thread Hans Dedecker
Function usefull to iterate through the different elements of an
array or object; the provided callback function is called for each
element which is passed the value, key and user provided arguments.
For field types different from array or object the callback is called
with the retrieved value.

Signed-off-by: Hans Dedecker 
---
v2 : Pass the key as well to the callback function

 sh/jshn.sh | 25 +
 1 file changed, 25 insertions(+)

diff --git a/sh/jshn.sh b/sh/jshn.sh
index bf76edb..a7b9b0c 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -278,3 +278,28 @@ json_is_a() {
json_get_type type "$1"
[ "$type" = "$2" ]
 }
+
+json_for_each_item() {
+   [ "$#" -ge 2 ] || return 0
+   local function="$1"; shift
+   local target="$1"; shift
+   local type val
+
+   json_get_type type "$target"
+   case "$type" in
+   object|array)
+   local keys key
+   json_select "$target"
+   json_get_keys keys
+   for key in $keys; do
+   json_get_var val "$key"
+   eval "$function \"\$val\" \"\$key\" \"\$@\""
+   done
+   json_select ..
+   ;;
+   *)
+   json_get_var val "$target"
+   eval "$function \"\$val\" \"\" \"\$@\""
+   ;;
+   esac
+}
-- 
2.16.1


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