[LEDE-DEV] LEDE layerscape hangs with squash rootfs on QSPI flash

2017-12-17 Thread Y.b. Lu
Hi,

(Resent the email since HTML format email was rejected by mailing list...)

Has anyone seen below issue when LEDE started up. The system would hang when 
created jffs2 area.
This issue occurred on QSPI flash on layerscape like ls1046ardb, but Nor flash 
worked fine with same rootfs like ls1043ardb.

[2.298409] fsl-quadspi 155.quadspi: s25fl512s (65536 Kbytes)
[2.304658] 9 cmdlinepart partitions found on MTD device 155.quadspi
[2.311674] Creating 9 MTD partitions on "155.quadspi":
[2.317676] 0x-0x0010 : "rcw"
[2.327552] 0x0010-0x0030 : "u-boot"
[2.337822] 0x0030-0x0040 : "u-boot-env"
[2.348446] 0x0040-0x0090 : "reserved-1"
[2.359001] 0x0090-0x0094 : "fman"
[2.369017] 0x0094-0x00f0 : "reserved-2"
[2.379597] 0x00f0-0x0100 : "dtb"
[2.389523] 0x0100-0x0200 : "kernel"
[2.399723] 0x0200-0x0400 : "rootfs"
[2.409917] mtd: device 8 (rootfs) set to be root filesystem

Actually jffs2 rootfs worked fine on QSPI flash, but we don't know why it 
failed with LEDE squashfs when create jffs2 area.
Any suggestion to find out the root casue? Or any config may casue this issue?

Appreciate your help.


Best regards,
Yangbo Lu

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


Re: [LEDE-DEV] [PATCH] gcc: 7.2: remove mips patch causing broken code

2017-12-17 Thread Kevin Darbyshire-Bryant


> On 17 Dec 2017, at 21:21, Hauke Mehrtens  wrote:
> 
> This patch made GCC produce broken code, remove it.
> In mp_cmp_d() function in th libtommath shipped with dropbear the
> following code was compiled wrong:
> 
> /* compare based on magnitude */
> if (a->used > 1) {
>  return 1;
> }
> 
> In the broken ASM this part returned -1 like the previous return
> statement did instead of 1 like it should.
> 
> This did not happen when the -funroll-loops option was given to GCC.
> 
> Signed-off-by: Hauke Mehrtens 
> ---
> .../7.2.0/300-mips_Os_cpu_rtx_cost_model.patch  | 21 -
> 1 file changed, 21 deletions(-)
> delete mode 100644 
> toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch
> 
> diff --git a/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch 
> b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch
> deleted file mode 100644
> index 84c0fdab66..00
> --- a/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -commit ecf7671b769fe96f7b5134be442089f8bdba55d2
> -Author: Felix Fietkau 
> -Date:   Thu Aug 4 20:29:45 2016 +0200
> -
> -gcc: add a patch to generate better code with Os on mips
> -
> -Also happens to reduce compressed code size a bit
> -
> -Signed-off-by: Felix Fietkau 
> -
>  a/gcc/config/mips/mips.c
> -+++ b/gcc/config/mips/mips.c
> -@@ -19784,7 +19784,7 @@ mips_option_override (void)
> - flag_pcc_struct_return = 0;
> -
> -   /* Decide which rtx_costs structure to use.  */
> --  if (optimize_size)
> -+  if (0 && optimize_size)
> - mips_cost = _rtx_cost_optimize_size;
> -   else
> - mips_cost = _rtx_cost_data[mips_tune];
> --
> 2.11.0
> 

I have long carried an identical patch in my tree - see FS#814

Tested-by: 

Cheers,

Kevin D-B

GPG fingerprint: 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



signature.asc
Description: Message signed with OpenPGP
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] gcc: 7.2: remove mips patch causing broken code

2017-12-17 Thread Hauke Mehrtens
On 12/17/2017 10:21 PM, Hauke Mehrtens wrote:
> This patch made GCC produce broken code, remove it.
> In mp_cmp_d() function in th libtommath shipped with dropbear the
> following code was compiled wrong:
> 
> /* compare based on magnitude */
> if (a->used > 1) {
>   return 1;
> }
> 
> In the broken ASM this part returned -1 like the previous return
> statement did instead of 1 like it should.
> 
> This did not happen when the -funroll-loops option was given to GCC.
> 
> Signed-off-by: Hauke Mehrtens 

This is the broken code:

0041d978 :
  41d978:   8c830008lw  v1,8(a0)
  41d97c:   24020001li  v0,1
  41d980:   1062000cbeq v1,v0,41d9b4 
  41d984:   2402li  v0,-1
  41d988:   8c83lw  v1,0(a0)
  41d98c:   28630002sltiv1,v1,2
  41d990:   1068beqzv1,41d9b4 
  41d994:   nop
  41d998:   8c82000clw  v0,12(a0)
  41d99c:   8c42lw  v0,0(v0)
  41d9a0:   00a2182bsltuv1,a1,v0
  41d9a4:   1465bnezv1,41d9bc 
  41d9a8:   nop
  41d9ac:   0045102bsltuv0,v0,a1
  41d9b0:   00021023neguv0,v0
  41d9b4:   03e8jr  ra
  41d9b8:   nop
  41d9bc:   03e8jr  ra
  41d9c0:   24020001li  v0,1


To fix this in line 41d994 "li  v0,1" should be added instated of the nop.

Without this patch I ma getting this code:

0041d864 :
  41d864:   8c860008lw  a2,8(a0)
  41d868:   24030001li  v1,1
  41d86c:   10c3000bbeq a2,v1,41d89c 
  41d870:   2402li  v0,-1
  41d874:   8c86lw  a2,0(a0)
  41d878:   28c60002sltia2,a2,2
  41d87c:   10c7beqza2,41d89c 
  41d880:   24020001li  v0,1
  41d884:   8c83000clw  v1,12(a0)
  41d888:   8c63lw  v1,0(v1)
  41d88c:   00a3202bsltua0,a1,v1
  41d890:   1482bneza0,41d89c 
  41d894:   0065182bsltuv1,v1,a1
  41d898:   00031023neguv0,v1
  41d89c:   03e8jr  ra
  41d8a0:   nop

This looks correct.

Hauke

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


[LEDE-DEV] [PATCH] gcc: 7.2: remove mips patch causing broken code

2017-12-17 Thread Hauke Mehrtens
This patch made GCC produce broken code, remove it.
In mp_cmp_d() function in th libtommath shipped with dropbear the
following code was compiled wrong:

/* compare based on magnitude */
if (a->used > 1) {
  return 1;
}

In the broken ASM this part returned -1 like the previous return
statement did instead of 1 like it should.

This did not happen when the -funroll-loops option was given to GCC.

Signed-off-by: Hauke Mehrtens 
---
 .../7.2.0/300-mips_Os_cpu_rtx_cost_model.patch  | 21 -
 1 file changed, 21 deletions(-)
 delete mode 100644 
toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch

diff --git a/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch 
b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch
deleted file mode 100644
index 84c0fdab66..00
--- a/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit ecf7671b769fe96f7b5134be442089f8bdba55d2
-Author: Felix Fietkau 
-Date:   Thu Aug 4 20:29:45 2016 +0200
-
-gcc: add a patch to generate better code with Os on mips
-
-Also happens to reduce compressed code size a bit
-
-Signed-off-by: Felix Fietkau 
-
 a/gcc/config/mips/mips.c
-+++ b/gcc/config/mips/mips.c
-@@ -19784,7 +19784,7 @@ mips_option_override (void)
- flag_pcc_struct_return = 0;
- 
-   /* Decide which rtx_costs structure to use.  */
--  if (optimize_size)
-+  if (0 && optimize_size)
- mips_cost = _rtx_cost_optimize_size;
-   else
- mips_cost = _rtx_cost_data[mips_tune];
-- 
2.11.0


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


[LEDE-DEV] [PATCH 1/3] busybox: enable flock by default

2017-12-17 Thread Roman Yeryomin
This is needed for procd init script protection to work.
flock adds 4248 bytes to stripped busybox binary.

Signed-off-by: Roman Yeryomin 
---
 package/utils/busybox/Config-defaults.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/busybox/Config-defaults.in 
b/package/utils/busybox/Config-defaults.in
index 2a8d9dd397..6fc5093055 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS
default n
 config BUSYBOX_DEFAULT_FLOCK
bool
-   default n
+   default y
 config BUSYBOX_DEFAULT_FDFLUSH
bool
default n
-- 
2.14.1


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


Re: [LEDE-DEV] [PATCH v3] kernel: bump 4.4 to 4.4.106 for 17.01

2017-12-17 Thread Kevin Darbyshire-Bryant


> On 17 Dec 2017, at 17:22, Etienne Haarsma  wrote:
> 
>   uint8_t *oob = ops->oobbuf;
>   uint8_t *buf = ops->datbuf;
> -@@ -2662,7 +2697,7 @@ err_out:
> - static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
> - size_t *retlen, const uint8_t *buf)
> - {
> --struct nand_chip *chip = mtd->priv;
> -+struct nand_chip *chip = mtd_to_nand(mtd);
> - struct mtd_oob_ops ops;
> - int ret;
> -

I’m unconvinced this is the correct thing to do - in essence just dropping that 
bit of the patch.  Will panic to nand still work?

Kevin


signature.asc
Description: Message signed with OpenPGP
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] kernel: add kmod-fou

2017-12-17 Thread Filip Moc
Once installed fou kernel module allows you to use FOU (Foo over UDP)
and GUE (Generic UDP encapsulation) tunnel protocols.

To get ip fou command working you also need to install ip-full.

Signed-off-by: Filip Moc 
---

Notes:
More info about FOU can be found here: https://lwn.net/Articles/614348/

 package/kernel/linux/modules/netsupport.mk | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index e4740428af..6f9c48f8ab 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -432,6 +432,28 @@ endef
 $(eval $(call KernelPackage,sit))
 
 
+define KernelPackage/fou
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=FOU and GUE decapsulation
+  DEPENDS:= \
+   +kmod-iptunnel \
+   +kmod-udptunnel4 \
+   +IPV6:kmod-udptunnel6
+  KCONFIG:= \
+   CONFIG_NET_FOU \
+   CONFIG_NET_FOU_IP_TUNNELS=y
+  FILES:=$(LINUX_DIR)/net/ipv4/fou.ko
+  AUTOLOAD:=$(call AutoLoad,32,fou)
+endef
+
+define KernelPackage/fou/description
+ Kernel module for FOU (Foo over UDP) and GUE (Generic UDP Encapsulation) 
tunnelling.
+ Requires Kernel 3.18 or newer.
+endef
+
+$(eval $(call KernelPackage,fou))
+
+
 define KernelPackage/ip6-tunnel
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=IP-in-IPv6 tunnelling
-- 
2.11.0


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


[LEDE-DEV] [PATCH v3] kernel: bump 4.4 to 4.4.106 for 17.01

2017-12-17 Thread Etienne Haarsma
Refreshed all patches.

Made the following patch for Mediatek and Oxnas compatible with kernel 4.4.106:
0072-mtd-backport-v4.7-0day-patches-from-Boris.patch

Compile-tested: ar71xx
Run-tested: ar71xx

Signed-off-by: Etienne Haarsma 
---
 include/kernel-version.mk  |  4 +-
 .../patches-4.4/432-spi-rb4xx-spi-driver.patch |  2 +-
 .../patches-4.4/433-spi-rb4xx-cpld-driver.patch|  2 +-
 .../patches-4.4/435-spi-vsc7385_driver.patch   |  2 +-
 .../patches-4.4/0029-Add-dwc_otg-driver.patch  |  2 +-
 ...optional-field-in-the-driver-struct-for-G.patch |  2 +-
 ...ate-a-bunch-of-code-to-match-upstream-sub.patch |  4 +-
 ...-simple-Add-the-7-DPI-panel-from-Adafruit.patch |  4 +-
 .../patches-4.4/630-packet_socket_type.patch   | 18 
 .../ixp4xx/patches-4.4/160-delayed_uart_io.patch   |  4 +-
 ...spi-add-support-for-Lantiq-SPI-controller.patch |  2 +-
 ...mtd-backport-v4.7-0day-patches-from-Boris.patch | 49 +-
 ...mtd-backport-v4.7-0day-patches-from-Boris.patch | 49 +-
 ...0074-mtd-nand-import-nand_hw_control_init.patch |  2 +-
 .../0040-nand-add-mtk-nand-hack-hook.patch |  2 +-
 ...0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch |  2 +-
 .../patches-4.4/0043-spi-add-mt7621-support.patch  |  2 +-
 ...k-add-support-for-the-multiphy-carrier-pa.patch |  2 +-
 ...diatek-add-swconfig-driver-for-gsw_mt762x.patch |  2 +-
 .../patches-4.4/0901-spansion_nand_id_fix.patch|  4 +-
 20 files changed, 71 insertions(+), 89 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index e90a3c70ab..e35827dfb3 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .103
+LINUX_VERSION-4.4 = .106
 
 LINUX_KERNEL_HASH-3.18.43 = 
1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.103 = 
1d01d0785fdf52b3f3b9f7ad05b6cff6be034869935962478e19f265b022f904
+LINUX_KERNEL_HASH-4.4.106 = 
fe90300fe95756a19bcddd148b4359b6dd549d3bbe03587b179d4220781deb40
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/ar71xx/patches-4.4/432-spi-rb4xx-spi-driver.patch 
b/target/linux/ar71xx/patches-4.4/432-spi-rb4xx-spi-driver.patch
index d6b71be46a..7d99c43b95 100644
--- a/target/linux/ar71xx/patches-4.4/432-spi-rb4xx-spi-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/432-spi-rb4xx-spi-driver.patch
@@ -1,6 +1,6 @@
 --- a/drivers/spi/Kconfig
 +++ b/drivers/spi/Kconfig
-@@ -478,6 +478,12 @@ config SPI_QUP
+@@ -477,6 +477,12 @@ config SPI_QUP
  This driver can also be built as a module.  If so, the module
  will be called spi_qup.
  
diff --git a/target/linux/ar71xx/patches-4.4/433-spi-rb4xx-cpld-driver.patch 
b/target/linux/ar71xx/patches-4.4/433-spi-rb4xx-cpld-driver.patch
index 61c186ce9e..0932c729f9 100644
--- a/target/linux/ar71xx/patches-4.4/433-spi-rb4xx-cpld-driver.patch
+++ b/target/linux/ar71xx/patches-4.4/433-spi-rb4xx-cpld-driver.patch
@@ -1,6 +1,6 @@
 --- a/drivers/spi/Kconfig
 +++ b/drivers/spi/Kconfig
-@@ -714,6 +714,13 @@ config SPI_TLE62X0
+@@ -713,6 +713,13 @@ config SPI_TLE62X0
  sysfs interface, with each line presented as a kind of GPIO
  exposing both switch control and diagnostic feedback.
  
diff --git a/target/linux/ar71xx/patches-4.4/435-spi-vsc7385_driver.patch 
b/target/linux/ar71xx/patches-4.4/435-spi-vsc7385_driver.patch
index 94dd1d4508..880c088c56 100644
--- a/target/linux/ar71xx/patches-4.4/435-spi-vsc7385_driver.patch
+++ b/target/linux/ar71xx/patches-4.4/435-spi-vsc7385_driver.patch
@@ -1,6 +1,6 @@
 --- a/drivers/spi/Kconfig
 +++ b/drivers/spi/Kconfig
-@@ -721,6 +721,11 @@ config SPI_RB4XX_CPLD
+@@ -720,6 +720,11 @@ config SPI_RB4XX_CPLD
  SPI driver for the Xilinx CPLD chip present on the
  MikroTik RB4xx boards.
  
diff --git a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch 
b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
index 8e9657abcf..1f652dc998 100644
--- a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
+++ b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch
@@ -659,7 +659,7 @@ dwc_otg: Remove duplicate gadget probe/unregister function
  }
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -4978,7 +4978,7 @@ static void port_event(struct usb_hub *h
+@@ -4987,7 +4987,7 @@ static void port_event(struct usb_hub *h
if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
u16 status = 0, unused;
  
diff --git 
a/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch
 
b/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch
index 7fbaa27ca2..10c5e43fdf 100644
--- 

[LEDE-DEV] partial port of DPDK

2017-12-17 Thread Alexandru Ardelean
Hey,

I remember seeing some interest a while back in DPDK.

I started a port of DPDK for some experiment I wanted to do, but in
the meantime I stopped because of reasons.

Here's the current code so far:
https://github.com/commodo/packages/tree/dpdk/net/dpdk

It should build in the current master of OpenWrt. I tried it real quick now.
I did not manage to try it much.
It compiles on x86_64 ; I haven't tried to compile it on any other
platform/target,

If anyone wants to take this and maintain it, feel free to do so ; you
don't even need to mention me anywhere.

Alex

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


[LEDE-DEV] [PATCH 4/4] brcm2708: use x86's upgrade scripts for all rpi targets

2017-12-17 Thread Christian Lamparter
Advantages:
 - preserves existing partition layout on the sd-card.
   Only the boot and rootfs partition will be overwritten.

Please note that sysupgrade will refuse to upgrade, if the existing
installation  has an incompatible partition layout. Future changes
to the bootfs and/or rootfs partition size will likely cause breakage
to the sysupgrade procedure. In these cases, the ext4-sdcard.img.gz
will have to be written to the sdcard manually.
Please don't forget to backup your configuration in this case.

Signed-off-by: Christian Lamparter 
---
 .../brcm2708/base-files/lib/upgrade/platform.sh| 102 +++--
 1 file changed, 93 insertions(+), 9 deletions(-)

diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh 
b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
index 5b8e1e15b3..b9cd8d282f 100644
--- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -1,20 +1,104 @@
+. /lib/functions.sh
+
 REQUIRE_IMAGE_METADATA=1
 
+# copied from x86's platform.sh
+
 platform_check_image() {
-   return 0
+   local diskdev partdev diff
+
+   [ "$#" -gt 1 ] && return 1
+
+   export_bootdevice && export_partdevice diskdev -2 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
+
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
+
+   rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image
+
+   if [ -n "$diff" ]; then
+   echo "Partition layout has changed. Full image will be written."
+   ask_bool 0 "Abort" && exit 1
+   return 0
+   fi
+
+   return 0;
 }
 
 platform_do_upgrade() {
+   local diskdev partdev diff
+
+   export_bootdevice && export_partdevice diskdev -2 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
+
sync
-   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
-   sleep 1
+
+   if [ "$SAVE_PARTITIONS" = "1" ]; then
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk 
/tmp/partmap.image)"
+   else
+   diff=1
+   fi
+
+   if [ -n "$diff" ]; then
+   get_image "$@" | dd of="/dev/$diskdev" bs=2M conv=fsync
+
+   # Separate removal and addtion is necessary; otherwise, 
partition 1
+   # will be missing if it overlaps with the old partition 2
+   partx -d - "/dev/$diskdev"
+   partx -a - "/dev/$diskdev"
+
+   return 0
+   fi
+
+   #iterate over each partition from the image and write it to the boot 
disk
+   while read part start size; do
+   # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some 
problem
+   # one of which is this offset, I'm not sure what's the best 
fix, so
+   # here's a WA.
+   let part=$((part - 2))
+   if export_partdevice partdev $part; then
+   echo "Writing image to /dev/$partdev..."
+   get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M 
skip="$start" count="$size" conv=fsync
+   else
+   echo "Unable to find partition $part device, skipped."
+   fi
+   done < /tmp/partmap.image
+
+   #copy partition uuid
+   echo "Writing new UUID to /dev/$diskdev..."
+   get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 
conv=fsync
 }
 
 platform_copy_config() {
-   mkdir -p /boot
-   [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime /dev/mmcblk0p1 
/boot
-   cp -af "$CONF_TAR" /boot/
-   tar --directory / -xvf "$CONF_TAR" boot/config.txt
-   sync
-   umount /boot
+   local partdev
+
+   # Same as above /dev/sd[a|b]2 is root, so /boot is -1
+   if export_partdevice partdev -1; then
+   mkdir -p /boot
+   [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime 
"/dev/$partdev" /boot
+   cp -af "$CONF_TAR" /boot/
+   tar --directory / -xvf "$CONF_TAR" boot/config.txt
+   sync
+   unmount /boot
+   fi
 }
-- 
2.15.1


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


[LEDE-DEV] [PATCH 2/4] brcm2708: add compatible strings

2017-12-17 Thread Christian Lamparter
This patch adds the compatible string for the various RPIs from
4.14 upstream.

Note: The 4.14 upstream does not include the compute modules.
If the CM* would just house the SoC, it could in theory use the
"raw" chip compatible string. However, these CM boards also come
with RAM and eMMC. So they have to have a proper comaptible.

For now, "raspberrypi,compute-module-{1|3}" will be good enough.

Note2: The original CM was renamed to CM1 when CM3 was released.

Signed-off-by: Christian Lamparter 
---
 .../960-add-rasbperrypi-compatible.patch   | 70 ++
 1 file changed, 70 insertions(+)
 create mode 100644 
target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch

diff --git 
a/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch 
b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch
new file mode 100644
index 00..db2f6c9b80
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch
@@ -0,0 +1,70 @@
+--- a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts2017-12-01 00:09:35.165577128 
+0100
 b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts2017-12-01 00:10:02.418981698 
+0100
+@@ -4,6 +4,7 @@
+ #include "bcm283x-rpi-smsc9512.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
+   model = "Raspberry Pi Zero W";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts2017-12-01 00:23:43.869682792 
+0100
 b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts2017-12-01 00:25:07.686338314 
+0100
+@@ -8,6 +8,7 @@
+ #include "bcm283x-rpi-smsc9514.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,3-model-b", "brcm,bcm2837", "brcm,bcm2836";
+   model = "Raspberry Pi 3 Model B";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts2017-12-01 00:24:16.899675426 
+0100
 b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts2017-12-01 00:24:53.973005148 
+0100
+@@ -4,6 +4,7 @@
+ #include "bcm283x-rpi-smsc9514.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
+   model = "Raspberry Pi 2 Model B";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts  2017-12-01 00:32:37.426847451 
+0100
 b/arch/arm/boot/dts/bcm2708-rpi-b.dts  2017-12-01 00:33:22.656955034 
+0100
+@@ -4,6 +4,7 @@
+ #include "bcm283x-rpi-smsc9512.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,model-b", "brcm,bcm2835";
+   model = "Raspberry Pi Model B";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 2017-12-01 00:34:04.227056139 
+0100
 b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 2017-12-01 00:33:48.953685419 
+0100
+@@ -4,6 +4,7 @@
+ #include "bcm283x-rpi-smsc9514.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
+   model = "Raspberry Pi Model B+";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts 2017-12-01 00:21:41.226415322 
+0100
 b/arch/arm/boot/dts/bcm2708-rpi-cm.dts 2017-12-01 00:21:08.206444802 
+0100
+@@ -3,6 +3,7 @@
+ #include "bcm2708-rpi-cm.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,compute-module-1", "brcm,bcm2835";
+   model = "Raspberry Pi Compute Module";
+ };
+ 
+--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts2017-12-01 00:40:17.454702202 
+0100
 b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts2017-12-01 00:40:10.521349773 
+0100
+@@ -3,6 +3,7 @@
+ #include "bcm2710.dtsi"
+ 
+ / {
++  compatible = "raspberrypi,compute-module-3", "brcm,bcm2837", 
"brcm,bcm2836";
+   model = "Raspberry Pi Compute Module 3";
+ };
+ 
-- 
2.15.1


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


[LEDE-DEV] [PATCH 1/4] brcm2708: convert to metadata

2017-12-17 Thread Christian Lamparter
This patch converts all the raspberrypi images to utilize
the common metadata-based image verification.

Note: the CM1 and CM3 currently use the same "rpi-cm"
boardname.

Signed-off-by: Christian Lamparter 
---
 .../linux/brcm2708/base-files/lib/upgrade/platform.sh   | 17 ++---
 target/linux/brcm2708/image/Makefile|  7 +--
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh 
b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
index b7613b446d..5b8e1e15b3 100644
--- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -1,20 +1,7 @@
-get_magic_at() {
-   local file="$1"
-   local pos="$2"
-   get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump 
-v -n 2 -e '1/1 "%02x"'
-}
+REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
-   local file="$1"
-   local magic
-
-   magic=$(get_magic_at "$file" 510)
-   [ "$magic" != "55aa" ] && {
-   echo "Failed to verify MBR boot signature."
-   return 1
-   }
-
-   return 0;
+   return 0
 }
 
 platform_do_upgrade() {
diff --git a/target/linux/brcm2708/image/Makefile 
b/target/linux/brcm2708/image/Makefile
index 7909c6d814..41730b6803 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -50,13 +50,14 @@ define Device/Default
   FILESYSTEMS := ext4
   KERNEL := kernel-bin | kernel-img
   KERNEL_IMG := kernel.img
-  IMAGES := sdcard.img
-  IMAGE/sdcard.img := boot-img | sdcard-img
+  IMAGES := sdcard.img.gz
+  IMAGE/sdcard.img.gz := boot-img | sdcard-img | gzip | append-metadata
 endef
 
 define Device/rpi
   DEVICE_TITLE := Raspberry Pi B/B+/CM/Zero/ZeroW
   DEVICE_DTS := bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm bcm2708-rpi-0-w
+  SUPPORTED_DEVICES := rpi-b rpi-b-plus rpi-cm rpi-zero-w
 endef
 ifeq ($(SUBTARGET),bcm2708)
   TARGET_DEVICES += rpi
@@ -65,6 +66,7 @@ endif
 define Device/rpi-2
   DEVICE_TITLE := Raspberry Pi 2B/3B/3CM
   DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-cm3
+  SUPPORTED_DEVICES := rpi-2-b rpi-3-b rpi-cm
 endef
 ifeq ($(SUBTARGET),bcm2709)
   TARGET_DEVICES += rpi-2
@@ -74,6 +76,7 @@ define Device/rpi-3
   KERNEL_IMG := kernel8.img
   DEVICE_TITLE := Raspberry Pi 3B (64 bit)
   DEVICE_DTS := broadcom/bcm2710-rpi-3-b
+  SUPPORTED_DEVICES := rpi-3-b
 endef
 ifeq ($(SUBTARGET),bcm2710)
   TARGET_DEVICES += rpi-3
-- 
2.15.1


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


[LEDE-DEV] [PATCH 3/4] brcm2708: convert to dt-based board-detection

2017-12-17 Thread Christian Lamparter
Use the values populated by the generic board detect function. The
first compatible from the device tree source file will be the board
name in userspace. The model property from the device tree source file
will be the model name.

Change the board name where used in the userspace and drop the target
specific board detect, to use the generic one.

Signed-off-by: Christian Lamparter 
---
 .../brcm2708/base-files/etc/board.d/02_network | 12 +++---
 target/linux/brcm2708/base-files/etc/diag.sh   | 11 +++---
 target/linux/brcm2708/base-files/lib/brcm2708.sh   | 43 --
 .../lib/preinit/01_preinit_do_brcm2708.sh  | 10 -
 .../lib/preinit/05_set_preinit_iface_brcm2708  |  9 +++--
 target/linux/brcm2708/image/Makefile   |  6 +--
 6 files changed, 20 insertions(+), 71 deletions(-)
 delete mode 100644 target/linux/brcm2708/base-files/lib/brcm2708.sh
 delete mode 100644 
target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh

diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network 
b/target/linux/brcm2708/base-files/etc/board.d/02_network
index 29bcf33e33..a9c947b65a 100755
--- a/target/linux/brcm2708/base-files/etc/board.d/02_network
+++ b/target/linux/brcm2708/base-files/etc/board.d/02_network
@@ -11,13 +11,15 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-rpi-2-b |\
-rpi-3-b |\
-rpi-b |\
-rpi-b-plus)
+raspberrypi,model-b |\
+raspberrypi,model-b-plus |\
+raspberrypi,model-b-rev2 |\
+raspberrypi,2-model-b |\
+raspberrypi,3-model-b)
ucidef_set_interface_lan "eth0"
;;
-rpi-zero-w)
+
+raspberrypi,model-zero-w)
ucidef_set_interface_lan "wlan0"
;;
 esac
diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
b/target/linux/brcm2708/base-files/etc/diag.sh
index 6f5810ed58..ce0f591517 100644
--- a/target/linux/brcm2708/base-files/etc/diag.sh
+++ b/target/linux/brcm2708/base-files/etc/diag.sh
@@ -7,14 +7,13 @@
 
 set_state() {
case "$(board_name)" in
-   rpi-2-b |\
-   rpi-b-plus)
+   raspberrypi,2-model-b |\
+   raspberrypi,model-b-plus)
status_led="led1"
;;
-   rpi-b |\
-   rpi-cm |\
-   rpi-zero |\
-   rpi-zero-w)
+   raspberrypi,model-b |\
+   raspberrypi,model-zero |\
+   raspberrypi,model-zero-w)
status_led="led0"
;;
esac
diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/brcm2708.sh
deleted file mode 100644
index 76e678ff97..00
--- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2015-2016 OpenWrt.org
-# Copyright (C) 2017 LEDE project
-
-ifname=""
-
-brcm2708_detect() {
-   local board_name model
-
-   model=$(cat /proc/device-tree/model)
-   case "$model" in
-   "Raspberry Pi 2 Model B Rev"*)
-   board_name="rpi-2-b"
-   ;;
-   "Raspberry Pi 3 Model B Rev"*)
-   board_name="rpi-3-b"
-   ;;
-   "Raspberry Pi Compute Module Rev"*)
-   board_name="rpi-cm"
-   ;;
-   "Raspberry Pi Model B Plus Rev"* |\
-   "Raspberry Pi Model B+ Rev"*)
-   board_name="rpi-b-plus"
-   ;;
-   "Raspberry Pi Model B Rev"*)
-   board_name="rpi-b"
-   ;;
-   "Raspberry Pi Zero Rev"*)
-   board_name="rpi-zero"
-   ;;
-   "Raspberry Pi Zero W Rev"*)
-   board_name="rpi-zero-w"
-   ;;
-   *)
-   board_name="unknown"
-   ;;
-   esac
-
-   [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
-
-   echo "$board_name" > /tmp/sysinfo/board_name
-   echo "$model" > /tmp/sysinfo/model
-}
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh
deleted file mode 100644
index 294364848d..00
--- a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2015 OpenWrt.org
-
-do_brcm2708() {
-   . /lib/brcm2708.sh
-
-   brcm2708_detect
-}
-
-boot_hook_add preinit_main do_brcm2708
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 
b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
index 95497cc586..76eb5905e8 100644
--- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
+++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
@@ -6,10 +6,11 @@ set_preinit_iface() {
. /lib/functions.sh
 
case "$(board_name)" in
-   rpi-2-b |\
-   rpi-3-b |\
-   rpi-b |\
-   rpi-b-plus)
+   raspberrypi,2-model-b |\
+   raspberrypi,3-model-b |\
+   raspberrypi,model-b |\
+   

[LEDE-DEV] [PATCH 8/9] apm821xx: enable metadata for packaging

2017-12-17 Thread Christian Lamparter
This patch enables metadata-supported image verification
for all apm821xx supported devices. Since this method comes
with a built-in image verification tool (fwtool), the previous
image checks can be removed.

Signed-off-by: Mathias Kresin 
Signed-off-by: Christian Lamparter 
---
 .../apm821xx/base-files/lib/upgrade/merakinand.sh  | 68 --
 .../apm821xx/base-files/lib/upgrade/platform.sh| 15 ++---
 target/linux/apm821xx/image/Makefile   |  9 +--
 3 files changed, 9 insertions(+), 83 deletions(-)
 delete mode 100755 target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh

diff --git a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh 
b/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh
deleted file mode 100755
index fb961b8945..00
--- a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2016 Chris Blake 
-#
-# Custom upgrade script for Meraki NAND devices (ex. MR24)
-# Based on merakinand.sh from the ar71xx target
-#
-. /lib/apm821xx.sh
-. /lib/functions.sh
-
-merakinand_do_kernel_check() {
-   local board_name="$1"
-   local tar_file="$2"
-   local image_magic_word=`(tar xf $tar_file sysupgrade-$board_name/kernel 
-O 2>/dev/null | dd bs=1 count=4 skip=0 2>/dev/null | hexdump -v -n 4 -e '1/1 
"%02x"')`
-
-   # What is our kernel magic string?
-   case "$board_name" in
-   "mr24"|\
-   "mx60")
-   [ "$image_magic_word" == "8e73ed8a" ] && {
-   echo "pass" && return 0
-   }
-   ;;
-   esac
-
-   exit 1
-}
-
-merakinand_do_platform_check() {
-   local board_name="$1"
-   local tar_file="$2"
-   local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL 
-O | wc -c) 2> /dev/null`
-   local file_type="$(identify_tar $2 sysupgrade-$board_name/root)"
-   local kernel_magic="$(merakinand_do_kernel_check $1 $2)"
-
-   case "$board_name" in
-   "mr24"|\
-   "mx60")
-   [ "$control_length" = 0 -o "$file_type" != "squashfs" -o 
"$kernel_magic" != "pass" ] && {
-   echo "Invalid sysupgrade file for $board_name"
-   return 1
-   }
-   ;;
-   *)
-   echo "Unsupported device $board_name";
-   return 1
-   ;;
-   esac
-
-   return 0
-}
-
-merakinand_do_upgrade() {
-   local tar_file="$1"
-   local board_name="$(board_name)"
-
-   # Do we need to do any platform tweaks?
-   case "$board_name" in
-   "mr24"|\
-   "mx60")
-   nand_do_upgrade $1
-   ;;
-   *)
-   echo "Unsupported device $board_name";
-   exit 1
-   ;;
-   esac
-}
diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh 
b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh
index 8c716bf44e..ecfd70b9ee 100755
--- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
local board=$(board_name)
@@ -14,14 +15,9 @@ platform_check_image() {
;;
 
mr24|\
-   mx60)
-   merakinand_do_platform_check $board "$1"
-   return $?;
-   ;;
-
+   mx60|\
wndr4700)
-   nand_do_platform_check $board "$1"
-   return $?;
+   return 0;
;;
 
*)
@@ -37,10 +33,7 @@ platform_pre_upgrade() {
 
case "$board" in
mr24|\
-   mx60)
-   merakinand_do_upgrade "$1"
-   ;;
-
+   mx60|\
wndr4700)
nand_do_upgrade "$1"
;;
diff --git a/target/linux/apm821xx/image/Makefile 
b/target/linux/apm821xx/image/Makefile
index bff3947039..251ef5f359 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -14,6 +14,7 @@ define Device/Default
   KERNEL_ENTRY := 0x
   KERNEL_LOADADDR := 0x
   DEVICE_DTS_DIR := ../dts
+  SUPPORTED_DEVICES = $$(BOARD_NAME)
 endef
 
 define Build/dtb
@@ -81,7 +82,7 @@ define Device/meraki_mr24
  check-size $$(KERNEL_SIZE) | \
  MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
  MerakiNAND
-  IMAGE/sysupgrade.tar := sysupgrade-tar
+  IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
   UBINIZE_OPTS := -E 5
 endef
 TARGET_DEVICES += meraki_mr24
@@ -106,7 +107,7 @@ define Device/meraki_mx60
  check-size $$(KERNEL_SIZE) | \
  MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \
  MerakiNAND
-  IMAGE/sysupgrade.tar := sysupgrade-tar
+  

[LEDE-DEV] [PATCH 9/9] apm821xx: convert to device-tree board detection

2017-12-17 Thread Christian Lamparter
This patch converts all apm821xx devices to the device-tree
board-detection method. All instances of the legacy
boardnames (mbl,mr24,...) are converted to "vendor,device"
identifier.

The custom board-detection code in apm821xx.sh is removed as
it no longer serves any purpose.

Signed-off-by: Mathias Kresin 
Signed-off-by: Christian Lamparter 
---
 .../linux/apm821xx/base-files/etc/board.d/01_leds  |  9 +++--
 .../apm821xx/base-files/etc/board.d/02_network |  9 +++--
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  4 +-
 target/linux/apm821xx/base-files/lib/apm821xx.sh   | 43 --
 .../lib/preinit/01_preinit_do_apm821xx.sh  |  9 -
 .../lib/preinit/05_set_iface_mac_apm821xx  |  4 +-
 .../lib/preinit/05_set_preinit_iface_apm821xx  |  2 -
 .../apm821xx/base-files/lib/preinit/79_move_config | 18 ++---
 .../apm821xx/base-files/lib/upgrade/platform.sh| 21 ++-
 target/linux/apm821xx/image/Makefile   |  2 +-
 10 files changed, 39 insertions(+), 82 deletions(-)
 delete mode 100755 target/linux/apm821xx/base-files/lib/apm821xx.sh
 delete mode 100644 
target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh

diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds 
b/target/linux/apm821xx/base-files/etc/board.d/01_leds
index 3b5fb721ae..c218efa49b 100755
--- a/target/linux/apm821xx/base-files/etc/board.d/01_leds
+++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
@@ -7,7 +7,7 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-mr24)
+meraki,mr24)
ucidef_set_led_netdev "wan" "WAN" "mr24:green:wan" "eth0"
ucidef_set_led_wlan "wlan1" "WLAN1" "mr24:green:wifi1" "phy0assoc"
ucidef_set_led_wlan "wlan2" "WLAN2" "mr24:green:wifi2" "phy0assoc"
@@ -15,7 +15,7 @@ mr24)
ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt"
;;
 
-mx60)
+meraki,mx60)
ucidef_set_led_switch "wan" "WAN" "mx60:green:wan" "switch0" "0x20"
ucidef_set_led_switch "lan1" "LAN1" "mx60:green:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "mx60:green:lan2" "switch0" "0x08"
@@ -23,11 +23,12 @@ mx60)
ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02"
;;
 
-mbl)
+wd,mybooklive|\
+wd,mybooklive-duo)
ucidef_set_led_ide "sata" "SATA" "mbl:blue:power"
;;
 
-wndr4700)
+netgear,wndr4700)
ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd"
ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" 
"switch0" "0x20"
ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" 
"eth0.2" "tx rx"
diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network 
b/target/linux/apm821xx/base-files/etc/board.d/02_network
index 03df7cb49f..6f4456e8a1 100755
--- a/target/linux/apm821xx/base-files/etc/board.d/02_network
+++ b/target/linux/apm821xx/base-files/etc/board.d/02_network
@@ -8,13 +8,14 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-mbl|\
-mr24)
+meraki,mr24|\
+wd,mybooklive|\
+wd,mybooklive-duo)
ucidef_set_interface_lan "eth0"
;;
 
-mx60|\
-wndr4700)
+meraki,mx60|\
+netgear,wndr4700)
ucidef_add_switch "switch0" \
"0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan"
;;
diff --git 
a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 4a7e1c0b19..7a13a0afa8 100644
--- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -52,7 +52,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "pci_wmac0.eeprom")
case $board in
-   wndr4700)
+   netgear,wndr4700)
. /lib/upgrade/nand.sh
 
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
@@ -70,7 +70,7 @@ case "$FIRMWARE" in
 
 "pci_wmac1.eeprom")
case $board in
-   wndr4700)
+   netgear,wndr4700)
. /lib/upgrade/nand.sh
 
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh 
b/target/linux/apm821xx/base-files/lib/apm821xx.sh
deleted file mode 100755
index 8f0814b296..00
--- a/target/linux/apm821xx/base-files/lib/apm821xx.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-APM821XX_BOARD_NAME=
-APM821XX_MODEL=
-
-apm821xx_board_detect() {
-   local model
-   local name
-
-   model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo)
-
-   case "$model" in
-   *"Meraki MR24 Access Point")
-   name="mr24"
-   ;;
-
-   *"Meraki MX60/MX60W Security Appliance")
-   name="mx60"
-   ;;
-
-   *"MyBook Live"*)
-   name="mbl"
-   ;;
-
-   *"Netgear WNDR4700/WNDR4720 Series")

[LEDE-DEV] [PATCH 5/9] apm821xx: add product names to the dt compatible for Meraki

2017-12-17 Thread Christian Lamparter
Meraki choose to use their product's codename as the main
compatible string. Mathias Kresin commented that this is
a poor choice as this will confuse the users and devs once
the device-tree compatible is used for board-detection and
possible the image name.

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/dts/MR24.dts | 2 +-
 target/linux/apm821xx/dts/MX60.dts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/apm821xx/dts/MR24.dts 
b/target/linux/apm821xx/dts/MR24.dts
index 8b58ce1991..2c2f8d281b 100644
--- a/target/linux/apm821xx/dts/MR24.dts
+++ b/target/linux/apm821xx/dts/MR24.dts
@@ -16,7 +16,7 @@
 
 / {
model = "Meraki MR24 Access Point";
-   compatible = "meraki,ikarem", "apm,bluestone";
+   compatible = "meraki,mr24", "meraki,ikarem", "apm,bluestone";
 
aliases {
serial0 = 
diff --git a/target/linux/apm821xx/dts/MX60.dts 
b/target/linux/apm821xx/dts/MX60.dts
index 64c8540d4d..32e5c859e8 100644
--- a/target/linux/apm821xx/dts/MX60.dts
+++ b/target/linux/apm821xx/dts/MX60.dts
@@ -16,7 +16,7 @@
 
 / {
model = "Meraki MX60/MX60W Security Appliance";
-   compatible = "meraki,buckminster", "apm,bluestone";
+   compatible = "meraki,mx60", "meraki,buckminster", "apm,bluestone";
 
aliases {
serial0 = 
-- 
2.15.1


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


[LEDE-DEV] [PATCH 3/9] apm821xx: replace DEVICE_{PROFILE|NAME} with BOARD_NAME

2017-12-17 Thread Christian Lamparter
This patch sets the BOARD_NAME variable on each affected
apm821xx device. The existing DEVICE_PROFILE and
DEVICE_NAME assignments are deprecated as they no longer
serve any purpose.

The BOARD_NAME variable is used by the sysupgrade-tar
method to specifiy a directory overwrite for the
sysupgrade-$dir directory in the generated tar file.
Keeping the original boardname in this context will be
necessary for targets that utilize the sysupgrade-tar
method. Otherwise, sysupgrade on an previous installation
will not recognize the newly generated images.

This step is necessary since an upcoming patch realigns
the existing shortname for a device with a proper
"manufacturer_device" identifier.

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/image/Makefile | 16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile 
b/target/linux/apm821xx/image/Makefile
index ebc6a051cc..217bff2c59 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -5,12 +5,11 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += DEVICE_PROFILE IMAGE_SIZE DTB_SIZE
+DEVICE_VARS += IMAGE_SIZE DTB_SIZE
 
 define Device/Default
   PROFILES := Default
   KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
-  DEVICE_PROFILE :=
   DEVICE_DTS :=
   KERNEL_ENTRY := 0x
   KERNEL_LOADADDR := 0x
@@ -61,7 +60,7 @@ endef
 
 define Build/MerakiNAND
-$(STAGING_DIR_HOST)/bin/mkmerakifw \
-   -B $(DEVICE_PROFILE) -s \
+   -B $(BOARD_NAME) -s \
-i $@ \
-o $@.new
@cp $@.new $@
@@ -70,7 +69,7 @@ endef
 define Device/mr24
   DEVICE_TITLE := Cisco Meraki MR24
   DEVICE_PACKAGES := kmod-spi-gpio
-  DEVICE_PROFILE := MR24
+  BOARD_NAME := mr24
   DEVICE_DTS := MR24
   BLOCKSIZE := 63k
   IMAGES := sysupgrade.tar
@@ -91,7 +90,7 @@ define Device/mx60
   DEVICE_TITLE := Cisco Meraki MX60/MX60W
   DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \
   kmod-usb-storage block-mount
-  DEVICE_PROFILE := MX60
+  BOARD_NAME := mx60
   DEVICE_DTS := MX60
   BLOCKSIZE := 63k
   IMAGES := sysupgrade.tar
@@ -145,7 +144,7 @@ define Build/wndr4700-specialImage
 
-$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \
-C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \
-   -n '$(DEVICE_PROFILE) initramfs' -d $@:$@.fakerd:$@.dtb $@.new
+   -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new
mv $@.new $@
rm -rf $@.fakerd
 endef
@@ -157,8 +156,7 @@ define Device/WNDR4700
kmod-md-mod kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-iso8859-15 \
kmod-nls-utf8 kmod-usb3 kmod-usb-dwc2 kmod-usb-storage \
partx-utils
-  DEVICE_NAME := wndr4700
-  DEVICE_PROFILE := wndr4700
+  BOARD_NAME := wndr4700
   DEVICE_DTS := wndr4700
   PAGESIZE := 2048
   SUBPAGESIZE := 512
@@ -228,7 +226,6 @@ define Device/MyBookLiveSingle
 $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live
   DEVICE_DTS := apollo3g
-  DEVICE_PROFILE := apollo3g
 endef
 
 TARGET_DEVICES += MyBookLiveSingle
@@ -238,7 +235,6 @@ $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live Duo
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage 
kmod-fs-vfat wpad-mini
   DEVICE_DTS := apollo3g-duo
-  DEVICE_PROFILE := ap2nc
 endef
 
 TARGET_DEVICES += MyBookLiveDuo
-- 
2.15.1


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


[LEDE-DEV] [PATCH 4/9] apm821xx: dts: append SoC compatible to DTS

2017-12-17 Thread Christian Lamparter
This patch appends the "apm,bluestone" or "amcc,apollo3g"
machine compatible string to the current device tree source.

Please note that unlike other archs the PPC DT code does
not regard the machine's compatible string as a priority
list. This is explained in the kernel's usage-model.txt as follows:
"PowerPC uses a slightly different scheme where it calls the .probe()
hook from each machine_desc, and the first one returning TRUE is used.
However, this approach does not take into account the priority of the
compatible list, and probably should be avoided for new architecture
support."

For this reason, the "apm,bluestone" compatible string can't be
added to the WNDR4700. As otherwise the target specific pci
fix-up code will get ignored and this causes the ath9k WIFI
to not get initialized.

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/dts/MR24.dts | 2 +-
 target/linux/apm821xx/dts/MX60.dts | 2 +-
 target/linux/apm821xx/dts/apollo3g-duo.dts | 1 +
 target/linux/apm821xx/dts/apollo3g.dts | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/apm821xx/dts/MR24.dts 
b/target/linux/apm821xx/dts/MR24.dts
index 75bb32255c..8b58ce1991 100644
--- a/target/linux/apm821xx/dts/MR24.dts
+++ b/target/linux/apm821xx/dts/MR24.dts
@@ -16,7 +16,7 @@
 
 / {
model = "Meraki MR24 Access Point";
-   compatible = "meraki,ikarem";
+   compatible = "meraki,ikarem", "apm,bluestone";
 
aliases {
serial0 = 
diff --git a/target/linux/apm821xx/dts/MX60.dts 
b/target/linux/apm821xx/dts/MX60.dts
index 6c753639b2..64c8540d4d 100644
--- a/target/linux/apm821xx/dts/MX60.dts
+++ b/target/linux/apm821xx/dts/MX60.dts
@@ -16,7 +16,7 @@
 
 / {
model = "Meraki MX60/MX60W Security Appliance";
-   compatible = "meraki,buckminster";
+   compatible = "meraki,buckminster", "apm,bluestone";
 
aliases {
serial0 = 
diff --git a/target/linux/apm821xx/dts/apollo3g-duo.dts 
b/target/linux/apm821xx/dts/apollo3g-duo.dts
index 53459b0cc0..4f6cc506f5 100644
--- a/target/linux/apm821xx/dts/apollo3g-duo.dts
+++ b/target/linux/apm821xx/dts/apollo3g-duo.dts
@@ -14,6 +14,7 @@
 #include "apollo3g.dtsi"
 
 / {
+   compatible = "wd,mybooklive-duo", "amcc,apollo3g";
model = "MyBook Live Duo";
 };
 
diff --git a/target/linux/apm821xx/dts/apollo3g.dts 
b/target/linux/apm821xx/dts/apollo3g.dts
index 4d31edae4a..d841352292 100644
--- a/target/linux/apm821xx/dts/apollo3g.dts
+++ b/target/linux/apm821xx/dts/apollo3g.dts
@@ -12,5 +12,6 @@
 #include "apollo3g.dtsi"
 
 / {
+   compatible = "wd,mybooklive", "amcc,apollo3g";
model = "MyBook Live";
 };
-- 
2.15.1


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


[LEDE-DEV] [PATCH 7/9] apm821xx: align device names with vendor_device format

2017-12-17 Thread Christian Lamparter
Currently, the device name handle does not include the
manufacturer. This can make it hard do differentiate
between products from different vendors that have the
same product name. As the handle is used to derive
the image name.

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/image/Makefile | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile 
b/target/linux/apm821xx/image/Makefile
index 6efd3886d2..bff3947039 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -66,7 +66,7 @@ define Build/MerakiNAND
@cp $@.new $@
 endef
 
-define Device/mr24
+define Device/meraki_mr24
   DEVICE_TITLE := Cisco Meraki MR24
   DEVICE_PACKAGES := kmod-spi-gpio
   BOARD_NAME := mr24
@@ -84,9 +84,9 @@ define Device/mr24
   IMAGE/sysupgrade.tar := sysupgrade-tar
   UBINIZE_OPTS := -E 5
 endef
-TARGET_DEVICES += mr24
+TARGET_DEVICES += meraki_mr24
 
-define Device/mx60
+define Device/meraki_mx60
   DEVICE_TITLE := Cisco Meraki MX60/MX60W
   DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \
   kmod-usb-storage block-mount
@@ -109,7 +109,7 @@ define Device/mx60
   IMAGE/sysupgrade.tar := sysupgrade-tar
   UBINIZE_OPTS := -E 5
 endef
-TARGET_DEVICES += mx60
+TARGET_DEVICES += meraki_mx60
 
 define Build/create-uImage-dtb
# flat_dt target expect FIT image - which WNDR4700's uboot doesn't 
support
@@ -149,7 +149,7 @@ define Build/wndr4700-specialImage
rm -rf $@.fakerd
 endef
 
-define Device/WNDR4700
+define Device/netgear_wndr4700
   DEVICE_TITLE := Netgear Centria N900 WNDR4700/WNDR4720
   DEVICE_PACKAGES := badblocks block-mount e2fsprogs \
kmod-dm kmod-fs-ext4 kmod-fs-vfat kmod-usb-ledtrig-usbport \
@@ -176,7 +176,7 @@ define Device/WNDR4700
   NETGEAR_HW_ID := 29763875+128+256
   UBINIZE_OPTS := -E 5
 endef
-TARGET_DEVICES += WNDR4700
+TARGET_DEVICES += netgear_wndr4700
 
 endif
 
@@ -222,22 +222,22 @@ define Device/MyBookLiveDefault
   IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip
 endef
 
-define Device/MyBookLiveSingle
+define Device/wd_mybooklive
 $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live
   DEVICE_DTS := wd-mybooklive
 endef
 
-TARGET_DEVICES += MyBookLiveSingle
+TARGET_DEVICES += wd_mybooklive
 
-define Device/MyBookLiveDuo
+define Device/wd_mybooklive_duo
 $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live Duo
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage 
kmod-fs-vfat wpad-mini
   DEVICE_DTS := wd-mybooklive-duo
 endef
 
-TARGET_DEVICES += MyBookLiveDuo
+TARGET_DEVICES += wd_mybooklive_duo
 
 endif
 
-- 
2.15.1


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


[LEDE-DEV] [PATCH 2/9] apm821xx: replace whitespace with tabs

2017-12-17 Thread Christian Lamparter
Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/base-files/etc/diag.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/base-files/etc/diag.sh 
b/target/linux/apm821xx/base-files/etc/diag.sh
index e45f2a8522..26c035c6f3 100755
--- a/target/linux/apm821xx/base-files/etc/diag.sh
+++ b/target/linux/apm821xx/base-files/etc/diag.sh
@@ -32,7 +32,7 @@ set_state() {
status_led="$upgrade"
status_led_blink_preinit_regular
}
-;;
+   ;;
done)
status_led_off
[ -n "$running" ] && {
-- 
2.15.1


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


[LEDE-DEV] [PATCH 6/9] apm821xx: dts: rename devices dts files to include the manufacturer

2017-12-17 Thread Christian Lamparter
This patch rename all the DT source files in order to
match upstream's "manufacturer-device.dts" format.

Please note that the DEVICE_DTB isn't changed. This is
because the u-boot of the MyBook Live defines the
fdt_file variable to be "apollo3g/apollo3g.dtb".

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/dts/{MR24.dts => meraki-mr24.dts}|  0
 target/linux/apm821xx/dts/{MX60.dts => meraki-mx60.dts}|  0
 .../linux/apm821xx/dts/{wndr4700.dts => netgear-wndr4700.dts}  |  0
 .../apm821xx/dts/{apollo3g-duo.dts => wd-mybooklive-duo.dts}   |  0
 target/linux/apm821xx/dts/{apollo3g.dts => wd-mybooklive.dts}  |  0
 target/linux/apm821xx/image/Makefile   | 10 +-
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename target/linux/apm821xx/dts/{MR24.dts => meraki-mr24.dts} (100%)
 rename target/linux/apm821xx/dts/{MX60.dts => meraki-mx60.dts} (100%)
 rename target/linux/apm821xx/dts/{wndr4700.dts => netgear-wndr4700.dts} (100%)
 rename target/linux/apm821xx/dts/{apollo3g-duo.dts => wd-mybooklive-duo.dts} 
(100%)
 rename target/linux/apm821xx/dts/{apollo3g.dts => wd-mybooklive.dts} (100%)

diff --git a/target/linux/apm821xx/dts/MR24.dts 
b/target/linux/apm821xx/dts/meraki-mr24.dts
similarity index 100%
rename from target/linux/apm821xx/dts/MR24.dts
rename to target/linux/apm821xx/dts/meraki-mr24.dts
diff --git a/target/linux/apm821xx/dts/MX60.dts 
b/target/linux/apm821xx/dts/meraki-mx60.dts
similarity index 100%
rename from target/linux/apm821xx/dts/MX60.dts
rename to target/linux/apm821xx/dts/meraki-mx60.dts
diff --git a/target/linux/apm821xx/dts/wndr4700.dts 
b/target/linux/apm821xx/dts/netgear-wndr4700.dts
similarity index 100%
rename from target/linux/apm821xx/dts/wndr4700.dts
rename to target/linux/apm821xx/dts/netgear-wndr4700.dts
diff --git a/target/linux/apm821xx/dts/apollo3g-duo.dts 
b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts
similarity index 100%
rename from target/linux/apm821xx/dts/apollo3g-duo.dts
rename to target/linux/apm821xx/dts/wd-mybooklive-duo.dts
diff --git a/target/linux/apm821xx/dts/apollo3g.dts 
b/target/linux/apm821xx/dts/wd-mybooklive.dts
similarity index 100%
rename from target/linux/apm821xx/dts/apollo3g.dts
rename to target/linux/apm821xx/dts/wd-mybooklive.dts
diff --git a/target/linux/apm821xx/image/Makefile 
b/target/linux/apm821xx/image/Makefile
index 217bff2c59..6efd3886d2 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -70,7 +70,7 @@ define Device/mr24
   DEVICE_TITLE := Cisco Meraki MR24
   DEVICE_PACKAGES := kmod-spi-gpio
   BOARD_NAME := mr24
-  DEVICE_DTS := MR24
+  DEVICE_DTS := meraki-mr24
   BLOCKSIZE := 63k
   IMAGES := sysupgrade.tar
   DTB_SIZE := 64512
@@ -91,7 +91,7 @@ define Device/mx60
   DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \
   kmod-usb-storage block-mount
   BOARD_NAME := mx60
-  DEVICE_DTS := MX60
+  DEVICE_DTS := meraki-mx60
   BLOCKSIZE := 63k
   IMAGES := sysupgrade.tar
   DTB_SIZE := 64512
@@ -157,7 +157,7 @@ define Device/WNDR4700
kmod-nls-utf8 kmod-usb3 kmod-usb-dwc2 kmod-usb-storage \
partx-utils
   BOARD_NAME := wndr4700
-  DEVICE_DTS := wndr4700
+  DEVICE_DTS := netgear-wndr4700
   PAGESIZE := 2048
   SUBPAGESIZE := 512
   BLOCKSIZE := 128k
@@ -225,7 +225,7 @@ endef
 define Device/MyBookLiveSingle
 $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live
-  DEVICE_DTS := apollo3g
+  DEVICE_DTS := wd-mybooklive
 endef
 
 TARGET_DEVICES += MyBookLiveSingle
@@ -234,7 +234,7 @@ define Device/MyBookLiveDuo
 $(Device/MyBookLiveDefault)
   DEVICE_TITLE := Western Digital My Book Live Duo
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage 
kmod-fs-vfat wpad-mini
-  DEVICE_DTS := apollo3g-duo
+  DEVICE_DTS := wd-mybooklive-duo
 endef
 
 TARGET_DEVICES += MyBookLiveDuo
-- 
2.15.1


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


[LEDE-DEV] [PATCH 1/9] apm821xx: explicitly build the rootfs.img.gz target

2017-12-17 Thread Christian Lamparter
The commit 87b668765e1
("image: when using the new image build code, gzip ext4 images by default")

forced that all targets that select the ext4 as the root filesystem
to always compress the generated rootfs. This is fine, but this method
doesn't not allow to append the metadata on a per-target base.

Therefore this patch changes the rootfs image production rule to generate
the gzip step manually. This way the metadata can be appended at a later
date.

Signed-off-by: Christian Lamparter 
---
 target/linux/apm821xx/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/apm821xx/image/Makefile 
b/target/linux/apm821xx/image/Makefile
index ee85292d57..ebc6a051cc 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -217,11 +217,11 @@ define Device/MyBookLiveDefault
   KERNEL := kernel-bin | dtb | gzip | uImage gzip
   KERNEL_INITRAMFS := kernel-bin | dtb | gzip | uImage gzip
   BOOT_SIZE := 8
-  IMAGES := rootfs.img kernel.dtb
+  IMAGES := rootfs.img.gz kernel.dtb
   DEVICE_DTB := apollo3g.dtb
   FILESYSTEMS := ext4
   IMAGE/kernel.dtb := export-dtb
-  IMAGE/rootfs.img := boot-script | boot-img | hdd-img
+  IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip
 endef
 
 define Device/MyBookLiveSingle
-- 
2.15.1


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


Re: [LEDE-DEV] [RFC] toolchain: fix GCC version check causing failure on Debian Testing with gcc-7

2017-12-17 Thread Peter Pöschl
Hi Jo,
 
(not subscribed, trying to reply to your mail extracted from the archives)

> > In Debian there were/are gcc-4.2 .. gcc-4.9, gcc-5 .. gcc-7.
> > And what about beauties like 'x86_64-linux-gnu-gcc-7'?
> > Why not ditch the 'gcc* --version' invocations and have people use
> > 'CC=fancy-named-gcc' on the command line if needed?
> ...
> I'm fine with removing the version checks entirely if we find an
> alternative to check for GCC > 4.8 - maybe a feature test of some sort?

Which features do you want to test for?
Alternatively, how about switching from a never-complete whitelist
to a blacklist like this:

Signed-off-by: Peter Pöschl 
---
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 6a423d2c7d..4e63cde56a 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -28,13 +28,8 @@ $(eval $(call TestHostCommand,proper-umask, \
 
 $(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc) 4.8 or later \
-   $(CC) -dumpversion | grep -E 
'(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
-   gcc -dumpversion | grep -E 
'(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
-   gcc48 --version | grep gcc, \
-   gcc49 --version | grep gcc, \
-   gcc5 --version | grep gcc, \
-   gcc6 --version | grep gcc, \
-   gcc7 --version | grep gcc, \
+   $(CC) -dumpversion | grep -Ev '^([1-3]\.|4\.[0-7])', \
+   gcc -dumpversion | grep -Ev '^([1-3]\.|4\.[0-7])', \
gcc --version | grep Apple.LLVM ))
 
 $(eval $(call TestHostCommand,working-gcc, \
@@ -45,13 +40,8 @@ $(eval $(call TestHostCommand,working-gcc, \
 
 $(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++) 4.8 or later \
-   $(CXX) -dumpversion | grep -E 
'(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
-   g++ -dumpversion | grep -E 
'(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
-   g++48 --version | grep g++, \
-   g++49 --version | grep g++, \
-   g++5 --version | grep g++, \
-   g++6 --version | grep g++, \
-   g++7 --version | grep g++, \
+   $(CXX) -dumpversion | grep -Ev '^([1-3]\.|4\.[0-7])', \
+   g++ -dumpversion | grep -Ev '^([1-3]\.|4\.[0-7])', \
g++ --version | grep Apple.LLVM ))
 
 $(eval $(call TestHostCommand,working-g++, \




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