Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread Chris Blake
Hello,

Alexis is correct, it's to ensure any chance of a random error is
suppressed. 2> /dev/null was just added as a protection.

Regards,
Chris Blake


On Sun, Oct 23, 2016 at 4:46 PM, Alexis Green  wrote:
> I’m guessing it’s because there might some random error message from grep?
> Maybe use -s option for grep instead to suppress error messages?
>
>> On Oct 23, 2016, at 12:30 PM, Bastian Bittorf  wrote:
>>
>> * Chris Blake  [23.10.2016 21:10]:
>>> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"
>>
>> whats the reason for the 2>...?
>>
>> bye, bastian
>>
>> ___
>> Lede-dev mailing list
>> Lede-dev@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/lede-dev
>

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


Re: [LEDE-DEV] DirtyCOW backport

2016-10-23 Thread Stijn Tintel
On 24-10-16 03:10, Stijn Tintel wrote:
> On 24-10-16 02:37, James Feeney wrote:
>> What are thoughts about backporting the DirtyCOW patch to the Lede kernels?  
>> I
>> did not see any mention in the Lede-dev Archives.
>>
> Most targets use kernel 4.4. As the 4.4 kernel has been updated to
> 4.4.26 on Friday [0], these targets are no longer vulnerable. I will
> update 3.18 and 4.1 ASAP, as new versions have been released upstream.
Pushed 3.18.43 and 4.1.34 + CVE-2016-5195 fixes to my staging tree:
https://git.lede-project.org/?p=lede/stintel/staging.git;a=shortlog;h=refs/heads/kernel
If the tarballs for for 3.18.44 and 4.1.35 don't appear on kernel.org by
tomorrow, I'll push this to the main tree as-is.

Stijn

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


Re: [LEDE-DEV] DirtyCOW backport

2016-10-23 Thread Stijn Tintel
On 24-10-16 02:37, James Feeney wrote:
> What are thoughts about backporting the DirtyCOW patch to the Lede kernels?  I
> did not see any mention in the Lede-dev Archives.
>
Most targets use kernel 4.4. As the 4.4 kernel has been updated to
4.4.26 on Friday [0], these targets are no longer vulnerable. I will
update 3.18 and 4.1 ASAP, as new versions have been released upstream.

Stijn

[0] https://git.lede-project.org/32c28a78

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


[LEDE-DEV] DirtyCOW backport

2016-10-23 Thread James Feeney
What are thoughts about backporting the DirtyCOW patch to the Lede kernels?  I
did not see any mention in the Lede-dev Archives.

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


Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread Alexis Green
I’m guessing it’s because there might some random error message from grep?
Maybe use -s option for grep instead to suppress error messages?

> On Oct 23, 2016, at 12:30 PM, Bastian Bittorf  wrote:
> 
> * Chris Blake  [23.10.2016 21:10]:
>> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"
> 
> whats the reason for the 2>...?
> 
> bye, bastian
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


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


Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread edgar . soldin
On 23.10.2016 23:42, edgar.sol...@web.de wrote:
> On 23.10.2016 21:30, Bastian Bittorf wrote:
>> * Chris Blake  [23.10.2016 21:10]:
>>> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"
>>
>> whats the reason for the 2>...?
>>
> 
> for the corner case that the error message might contain ' /overlay' ?
> 
> just a guess.. ede
> 

hmm, right were talking about the grep error here. no clue either ;) please 
ignore my waste precious bandwidth.

..ede

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


Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread edgar . soldin
On 23.10.2016 21:30, Bastian Bittorf wrote:
> * Chris Blake  [23.10.2016 21:10]:
>> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"
> 
> whats the reason for the 2>...?
> 

for the corner case that the error message might contain ' /overlay' ?

just a guess.. ede

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


Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread Bastian Bittorf
* Chris Blake  [23.10.2016 21:10]:
> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"

whats the reason for the 2>...?

bye, bastian

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


Re: [LEDE-DEV] [PATCH v3 3/5] ipq806x/nbg6817: add sysupgrade support

2016-10-23 Thread Felix Fietkau
On 2016-10-23 16:25, André Valentin wrote:
> Add new way of flashing to mmc devices based on rootfs split with loop 
> devices.
> 
> Signed-off-by: André Valentin 
> ---
>  .../ipq806x/base-files/lib/upgrade/platform.sh | 12 +++
>  .../linux/ipq806x/base-files/lib/upgrade/zyxel.sh  | 94 
> ++
>  2 files changed, 106 insertions(+)
>  create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
> 
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh 
> b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
> new file mode 100644
> index 000..d228dab
> --- /dev/null
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
> @@ -0,0 +1,94 @@
> +#
> +# Copyright (C) 2016 lede-project.org
> +#
> +
> +zyxel_get_rootfs() {
> + local rootfsdev
> +
> + if read cmdline < /proc/cmdline; then
> + case "$cmdline" in
> + *block2mtd=*)
> + rootfsdev="${cmdline##*block2mtd=}"
> + rootfsdev="${rootfsdev%%,*}"
> + ;;
You can drop the block2mtd part here.

> + *root=*)
> + rootfsdev="${cmdline##*root=}"
> + rootfsdev="${rootfsdev%% *}"
> + ;;
> + esac
> +
> + echo "${rootfsdev}"
> + fi
> +}
> +
> +zyxel_do_flash() {
> + local tar_file=$1
> + local board=$2
> + local kernel=$3
> + local rootfs=$4
> + local blocksize=65536
> +
> + # keep sure its unbound
> + losetup --detach-all || {
> + echo Failed to detach all loop devices. Skip this try.
> + reboot -f
> + }
> +
> + echo "flashing kernel to /dev/${kernel}"
> + tar xf $tar_file sysupgrade-$board/kernel -O >/dev/$kernel
> +
> + echo "flashing rootfs to ${rootfs}"
> + tar xf $tar_file sysupgrade-$board/root -O >"${rootfs}"
> +
> + local offset=$(tar xf $tar_file sysupgrade-$board/root -O | wc -c)
> + offset=$(( (($offset + $blocksize - 1) / $blocksize) * $blocksize ))
> +
> + # Sanity
> + [ $offset -lt $blocksize ] && {
> + echo Wrong size for rootfs: $offset
> + sleep 10
> + reboot -f
> + }
> +
> + # Mount loop for rootfs_data
> + losetup -o $offset /dev/loop0 "${rootfs}" || {
> + echo "Failed to mount looped rootfs_data."
> + sleep 10
> + reboot -f
> + }
> +
> + echo "Format new rootfs_data at position ${offset}."
> + mkfs.ext4 -F -L rootfs_data /dev/loop0
> + mkdir /tmp/new_root
> + mount -t ext4 /dev/loop0 /tmp/new_root  && {
> + echo "Saving config to rootfs_data at position ${offset}."
> + cp -v /tmp/sysupgrade.tgz /tmp/new_root/
> + umount /tmp/new_root
> + }
> +
> + # Cleanup
> + losetup -d /dev/loop0 >/dev/null 2>&1
I think trying to guesstimate the offset for the ext4 part here, when
fstools already handles some of that is a bit fragile. Things like the
block size might be changed at some point, so I think it would be a good
idea to extend fstools to be able deal with this stuff.

- Felix

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


Re: [LEDE-DEV] [PATCH v3 1/5] ipq806x/nbg6817: add support for ZyXEL NBG6817

2016-10-23 Thread Felix Fietkau
On 2016-10-23 16:38, Felix Fietkau wrote:
> On 2016-10-23 16:25, André Valentin wrote:
>> CPU: 2x1.8GHz ARM, RAM: 512MiB
>> Storage: 4MiB serial Flash, 3.9GiB MMC
>> NIC: 2x1GBit/s, Switch with 5 external and 2 internal ports
>> WiFi: Dualband, ath10k 2.4GHz, 5GHz MU-MIMO
>> 
>> For installation copy xx-mmcblk0p4-kernel.bin and 
>> xx-mmcblk0p5-rootfs-full.bin
>> to device. Then run:
>> cat xx-mmcblk0p4-kernel.bin > /dev/mmc0blk0p4
>> cat xx-mmcblk0p5-rootfs-full.bin > /dev/mmc0blk0p5
>> reboot -f
>> 
>> For debugging serial console is easily visible on board, no soldering needed.
>> 
>> Signed-off-by: André Valentin 
>> ---
>>  .../linux/ipq806x/base-files/etc/board.d/01_leds   |   5 +
>>  .../ipq806x/base-files/etc/board.d/02_network  |   7 +
>>  .../etc/hotplug.d/firmware/11-ath10k-caldata   |   6 +
>>  target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
>>  target/linux/ipq806x/config-4.4|  18 +-
>>  .../arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts | 341 
>> +
>>  target/linux/ipq806x/image/Makefile|  26 +-
>>  .../linux/ipq806x/patches-4.4/800-devicetree.patch |   3 +-
>>  8 files changed, 401 insertions(+), 8 deletions(-)
>>  create mode 100644 
>> target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
>> 
> 
>> diff --git a/target/linux/ipq806x/image/Makefile 
>> b/target/linux/ipq806x/image/Makefile
>> index b74f1a7..e7d4bf2 100644
>> --- a/target/linux/ipq806x/image/Makefile
>> +++ b/target/linux/ipq806x/image/Makefile
>> -TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 R7500 R7500v2 
>> R7800
>> +define Device/NBG6817
>> +DEVICE_DTS := qcom-ipq8065-nbg6817
>> +KERNEL_SIZE := 4194304
>> +ROOTFS_SIZE := 64M
>> +BLOCKSIZE := 64k
>> +BOARD_NAME := nbg6817
>> +DEVICE_TITLE := ZyXEL NBG6817
>> +DEVICE_PACKAGES := ath10k-firmware-qca9984 e2fsprogs losetup
> You can drop losetup, it is not necessary.
Sorry, I missed the fact that you were using it in sysupgrade. Will do a
more detailed review of that.

- Felix


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


Re: [LEDE-DEV] [PATCH v3 1/5] ipq806x/nbg6817: add support for ZyXEL NBG6817

2016-10-23 Thread Felix Fietkau
On 2016-10-23 16:25, André Valentin wrote:
> CPU: 2x1.8GHz ARM, RAM: 512MiB
> Storage: 4MiB serial Flash, 3.9GiB MMC
> NIC: 2x1GBit/s, Switch with 5 external and 2 internal ports
> WiFi: Dualband, ath10k 2.4GHz, 5GHz MU-MIMO
> 
> For installation copy xx-mmcblk0p4-kernel.bin and xx-mmcblk0p5-rootfs-full.bin
> to device. Then run:
> cat xx-mmcblk0p4-kernel.bin > /dev/mmc0blk0p4
> cat xx-mmcblk0p5-rootfs-full.bin > /dev/mmc0blk0p5
> reboot -f
> 
> For debugging serial console is easily visible on board, no soldering needed.
> 
> Signed-off-by: André Valentin 
> ---
>  .../linux/ipq806x/base-files/etc/board.d/01_leds   |   5 +
>  .../ipq806x/base-files/etc/board.d/02_network  |   7 +
>  .../etc/hotplug.d/firmware/11-ath10k-caldata   |   6 +
>  target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
>  target/linux/ipq806x/config-4.4|  18 +-
>  .../arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts | 341 
> +
>  target/linux/ipq806x/image/Makefile|  26 +-
>  .../linux/ipq806x/patches-4.4/800-devicetree.patch |   3 +-
>  8 files changed, 401 insertions(+), 8 deletions(-)
>  create mode 100644 
> target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
> 

> diff --git a/target/linux/ipq806x/image/Makefile 
> b/target/linux/ipq806x/image/Makefile
> index b74f1a7..e7d4bf2 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -90,6 +90,19 @@ define Device/TpSafeImage
>  endef
>  DEVICE_VARS += TPLINK_BOARD_NAME
>  
> +define Device/ZyXELImage
> + PROFILES += $$(DEVICE_NAME)
> + FILESYSTEMS := squashfs
> + KERNEL_SUFFIX := -uImage
> + KERNEL = kernel-bin | append-dtb | uImage none | pad-to $$(KERNEL_SIZE)
> + KERNEL_NAME := zImage
> + IMAGES := sysupgrade.tar mmcblk0p5-rootfs.bin mmcblk0p5-rootfs-full.bin 
> mmcblk0p4-kernel.bin
> + IMAGE/sysupgrade.tar := sysupgrade-tar
> + IMAGE/mmcblk0p5-rootfs.bin := append-rootfs | pad-rootfs | pad-to 
> $$(BLOCKSIZE)
> + IMAGE/mmcblk0p5-rootfs-full.bin := append-rootfs | pad-rootfs | pad-to 
> $$(ROOTFS_SIZE)
Please drop the -full.bin, it wastes space.
Change -rootfs.bin to append-rootfs | pad-extra 128k, similar to how it
is handled on the octeon target. That is enough to ensure that it
re-creates the overlay filesystem on first boot.
Change the sysupgrade.tar image to:

IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | 
sysupgrade-tar rootfs=@

> + IMAGE/mmcblk0p4-kernel.bin := append-kernel
> +endef
> +
>  define Device/AP148
>   $(call Device/FitImage)
>   $(call Device/UbiFit)
> @@ -202,6 +215,17 @@ define Device/R7800
>   DEVICE_PACKAGES := ath10k-firmware-qca9984
>  endef
>  
> -TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 R7500 R7500v2 
> R7800
> +define Device/NBG6817
> + DEVICE_DTS := qcom-ipq8065-nbg6817
> + KERNEL_SIZE := 4194304
> + ROOTFS_SIZE := 64M
> + BLOCKSIZE := 64k
> + BOARD_NAME := nbg6817
> + DEVICE_TITLE := ZyXEL NBG6817
> + DEVICE_PACKAGES := ath10k-firmware-qca9984 e2fsprogs losetup
You can drop losetup, it is not necessary.

- Felix

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


[LEDE-DEV] [PATCH v3 4/5] package/basefiles: add mkfs.ext4 and losetup binaries to ramfs list

2016-10-23 Thread André Valentin
mkfs.ext4 und losetup are needed for sysupgrade support on mmc devices
with automatic rootfs split (loopback device usage).

Signed-off-by: André Valentin 
---
 package/base-files/files/lib/upgrade/common.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/base-files/files/lib/upgrade/common.sh 
b/package/base-files/files/lib/upgrade/common.sh
index bed9c18..4d0e6d5 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -69,6 +69,8 @@ run_ramfs() { #  [...]
install_bin /usr/sbin/ubirmvol
install_bin /usr/sbin/ubimkvol
install_bin /usr/sbin/partx
+   install_bin /usr/sbin/losetup
+   install_bin /usr/sbin/mkfs.ext4
for file in $RAMFS_COPY_BIN; do
install_bin ${file//:/ }
done
-- 
2.1.4


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


[LEDE-DEV] [PATCH v3 3/5] ipq806x/nbg6817: add sysupgrade support

2016-10-23 Thread André Valentin
Add new way of flashing to mmc devices based on rootfs split with loop devices.

Signed-off-by: André Valentin 
---
 .../ipq806x/base-files/lib/upgrade/platform.sh | 12 +++
 .../linux/ipq806x/base-files/lib/upgrade/zyxel.sh  | 94 ++
 2 files changed, 106 insertions(+)
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 8768930..53cdc87 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -9,6 +9,7 @@ platform_check_image() {
ap148 |\
d7800 |\
ea8500 |\
+   nbg6817 |\
r7500 |\
r7500v2 |\
r7800)
@@ -34,6 +35,7 @@ platform_pre_upgrade() {
case "$board" in
ap148 |\
d7800 |\
+   nbg6817 |\
r7500 |\
r7500v2 |\
r7800)
@@ -60,6 +62,16 @@ platform_do_upgrade() {
esac
 }
 
+platform_nand_pre_upgrade() {
+   local board=$(ipq806x_board_name)
+
+   case "$board" in
+   nbg6817)
+   zyxel_do_upgrade "$1"
+   ;;
+   esac
+}
+
 blink_led() {
. /etc/diag.sh; set_state upgrade
 }
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
new file mode 100644
index 000..d228dab
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
@@ -0,0 +1,94 @@
+#
+# Copyright (C) 2016 lede-project.org
+#
+
+zyxel_get_rootfs() {
+   local rootfsdev
+
+   if read cmdline < /proc/cmdline; then
+   case "$cmdline" in
+   *block2mtd=*)
+   rootfsdev="${cmdline##*block2mtd=}"
+   rootfsdev="${rootfsdev%%,*}"
+   ;;
+   *root=*)
+   rootfsdev="${cmdline##*root=}"
+   rootfsdev="${rootfsdev%% *}"
+   ;;
+   esac
+
+   echo "${rootfsdev}"
+   fi
+}
+
+zyxel_do_flash() {
+   local tar_file=$1
+   local board=$2
+   local kernel=$3
+   local rootfs=$4
+   local blocksize=65536
+
+   # keep sure its unbound
+   losetup --detach-all || {
+   echo Failed to detach all loop devices. Skip this try.
+   reboot -f
+   }
+
+   echo "flashing kernel to /dev/${kernel}"
+   tar xf $tar_file sysupgrade-$board/kernel -O >/dev/$kernel
+
+   echo "flashing rootfs to ${rootfs}"
+   tar xf $tar_file sysupgrade-$board/root -O >"${rootfs}"
+
+   local offset=$(tar xf $tar_file sysupgrade-$board/root -O | wc -c)
+   offset=$(( (($offset + $blocksize - 1) / $blocksize) * $blocksize ))
+
+   # Sanity
+   [ $offset -lt $blocksize ] && {
+   echo Wrong size for rootfs: $offset
+   sleep 10
+   reboot -f
+   }
+
+   # Mount loop for rootfs_data
+   losetup -o $offset /dev/loop0 "${rootfs}" || {
+   echo "Failed to mount looped rootfs_data."
+   sleep 10
+   reboot -f
+   }
+
+   echo "Format new rootfs_data at position ${offset}."
+   mkfs.ext4 -F -L rootfs_data /dev/loop0
+   mkdir /tmp/new_root
+   mount -t ext4 /dev/loop0 /tmp/new_root  && {
+   echo "Saving config to rootfs_data at position ${offset}."
+   cp -v /tmp/sysupgrade.tgz /tmp/new_root/
+   umount /tmp/new_root
+   }
+
+   # Cleanup
+   losetup -d /dev/loop0 >/dev/null 2>&1
+   sync
+   umount -a
+   reboot -f
+}
+
+zyxel_do_upgrade() {
+   local tar_file="$1"
+   local board=$(cat /tmp/sysinfo/board_name)
+   local rootfs="$(zyxel_get_rootfs)"
+   local kernel=
+
+   [ -b "${rootfs}" ] || return 1
+   case "$board" in
+   nbg6817)
+   kernel=mmcblk0p4
+   ;;
+   *)
+   return 1
+   esac
+
+   zyxel_do_flash $tar_file $board $kernel $rootfs
+
+   return 0
+}
-- 
2.1.4


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


[LEDE-DEV] [PATCH v3 1/5] ipq806x/nbg6817: add support for ZyXEL NBG6817

2016-10-23 Thread André Valentin
CPU: 2x1.8GHz ARM, RAM: 512MiB
Storage: 4MiB serial Flash, 3.9GiB MMC
NIC: 2x1GBit/s, Switch with 5 external and 2 internal ports
WiFi: Dualband, ath10k 2.4GHz, 5GHz MU-MIMO

For installation copy xx-mmcblk0p4-kernel.bin and xx-mmcblk0p5-rootfs-full.bin
to device. Then run:
cat xx-mmcblk0p4-kernel.bin > /dev/mmc0blk0p4
cat xx-mmcblk0p5-rootfs-full.bin > /dev/mmc0blk0p5
reboot -f

For debugging serial console is easily visible on board, no soldering needed.

Signed-off-by: André Valentin 
---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   5 +
 .../ipq806x/base-files/etc/board.d/02_network  |   7 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   6 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 target/linux/ipq806x/config-4.4|  18 +-
 .../arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts | 341 +
 target/linux/ipq806x/image/Makefile|  26 +-
 .../linux/ipq806x/patches-4.4/800-devicetree.patch |   3 +-
 8 files changed, 401 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts

diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index a7ace1f..53c2a80 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -33,6 +33,11 @@ ea8500)
ucidef_set_led_wlan "wifi" "WIFI" "ea8500:green:wifi" "phy0radio"
ucidef_set_led_default "wps" "WPS" "ea8500:green:wps" "0"
;;
+nbg6817)
+   ucidef_set_led_wlan "wlan2g" "WLAN2g" "$board:amber:wifi" "phy1radio"
+   ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5" "phy0radio"
+   ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1"
+   ;;
 *)
;;
 esac
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index b720455..a461033 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -35,6 +35,13 @@ ea8500)
ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
;;
+nbg6817)
+   hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
+   ucidef_add_switch "switch0" \
+   "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
+   ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
+   ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
+   ;;
 *)
echo "Unsupported hardware. Network interfaces not intialized"
;;
diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index c7977e6..f95692a 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -56,6 +56,9 @@ case "$FIRMWARE" in
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath10kcal_extract "art" 4096 12064
;;
+   nbg6817)
+   ath10kcal_extract "0:ART" 4096 12064
+   ;;
  r7500v2 |\
  r7800)
ath10kcal_extract "art" 4096 12064
@@ -72,6 +75,9 @@ case "$FIRMWARE" in
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath10kcal_extract "art" 20480 12064
;;
+   nbg6817)
+   ath10kcal_extract "0:ART" 20480 12064
+   ;;
 r7500v2 |\
 r7800)
ath10kcal_extract "art" 20480 12064
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index ea45381..1bd0e2b 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -26,6 +26,9 @@ ipq806x_board_detect() {
*"DB149")
name="db149"
;;
+   *"NBG6817")
+   name="nbg6817"
+   ;;
*"R7500")
name="r7500"
;;
diff --git a/target/linux/ipq806x/config-4.4 b/target/linux/ipq806x/config-4.4
index bc04049..1972e36 100644
--- a/target/linux/ipq806x/config-4.4
+++ b/target/linux/ipq806x/config-4.4
@@ -61,6 +61,7 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
+CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
@@ -197,11 +198,6 @@ CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_HW_BREAKPOINT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_MEMBLOCK=y
 

[LEDE-DEV] [PATCH v3 2/5] linux/mtd: add id for mx25u3235f needed by ZyXEL NBG6817

2016-10-23 Thread André Valentin
Signed-off-by: André Valentin 
---
 .../patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch   | 10 ++
 1 file changed, 10 insertions(+)
 create mode 100644 
target/linux/generic/patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch

diff --git 
a/target/linux/generic/patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch 
b/target/linux/generic/patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch
new file mode 100644
index 000..45533e1
--- /dev/null
+++ b/target/linux/generic/patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch
@@ -0,0 +1,10 @@
+--- a/drivers/mtd/spi-nor/spi-nor.c2016-10-09 00:34:19.206155838 +0200
 b/drivers/mtd/spi-nor/spi-nor.c2016-10-09 00:37:11.048495602 +0200
+@@ -721,6 +721,7 @@ static const struct flash_info spi_nor_i
+   { "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, SECT_4K) },
+   { "mx25l3255e",  INFO(0xc29e16, 0, 64 * 1024,  64, SECT_4K) },
+   { "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
++  { "mx25u3235f",  INFO(0xc22536, 0, 64 * 1024, 64, 0) },
+   { "mx25u6435f",  INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
+   { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
+   { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
-- 
2.1.4


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


[LEDE-DEV] [PATCH v3 5/5] package/uboot-envtools: Add support for ZyXEL NBG6817

2016-10-23 Thread André Valentin
Signed-off-by: André Valentin 
---
 package/boot/uboot-envtools/files/ipq | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ipq 
b/package/boot/uboot-envtools/files/ipq
index 8cf0ddb..369f90f 100755
--- a/package/boot/uboot-envtools/files/ipq
+++ b/package/boot/uboot-envtools/files/ipq
@@ -18,6 +18,9 @@ case "$board" in
 "ea8500")
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x2" "0x2"
;;
+"nbg6817")
+   ubootenv_add_uci_config "/dev/mtdblock9" "0x0" "0x1" "0x1"
+   ;;
 esac
 
 config_load ubootenv
-- 
2.1.4


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


[LEDE-DEV] [PATCH v3 0/5] ipq806x/nbg6817: add support for ZyXEL NBG6817

2016-10-23 Thread André Valentin
Support for NBG6817 comes with several challenges:
-enable mmc support on platform
-use fstools rootfs split on block devices ( creates a loop dev with offset )
-extend sysupgrade support to format the loop fs and save config 

Please comment changes.

André Valentin (5):
  ipq806x/nbg6817: add support for ZyXEL NBG6817
  linux/mtd: add id for mx25u3235f needed by ZyXEL NBG6817
  ipq806x/nbg6817: add sysupgrade support
  package/basefiles: add mkfs.ext4 and losetup binaries to ramfs list
  package/uboot-envtools: Add support for ZyXEL NBG6817

 package/base-files/files/lib/upgrade/common.sh |   2 +
 package/boot/uboot-envtools/files/ipq  |   3 +
 .../477-mtd-add-spi-nor-add-mx25u3235f.patch   |  10 +
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   5 +
 .../ipq806x/base-files/etc/board.d/02_network  |   7 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   6 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |  12 +
 .../linux/ipq806x/base-files/lib/upgrade/zyxel.sh  |  94 ++
 target/linux/ipq806x/config-4.4|  18 +-
 .../arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts | 341 +
 target/linux/ipq806x/image/Makefile|  26 +-
 .../linux/ipq806x/patches-4.4/800-devicetree.patch |   3 +-
 13 files changed, 522 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/generic/patches-4.4/477-mtd-add-spi-nor-add-mx25u3235f.patch
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
 create mode 100644 
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts

-- 
2.1.4


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


[LEDE-DEV] [PATCH] kirkwood: Add RTC driver to kernel for working hctosys

2016-10-23 Thread p . wassi
From: Paul Wassi 

Build the RTC driver into the kernel, (and remove the optional module), in order
to make hctosys working. (Currently the module is loaded after hctosys has 
failed previously)

Signed-off-by: Paul Wassi 
---
It's the same on kirkwood, as it is on imx6 here:
https://patchwork.ozlabs.org/patch/683889/

hctosys fails due to missing RTC driver; the module providing the driver is
loaded too late. Integrating the driver into the kernel resolves this.
Additionally, the afterwards unnecessary kmod-RTC-driver is remove from the 
image.

As a result, the bootlog from a Seagate Dockstar looks like this:
> [0.958105] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
> (...)
> [1.500257] rtc-mv f1010300.rtc: setting system clock to 2016-10-23 
> 11:57:18 UTC (1477223838)

 linux/kirkwood/config-4.4  |2 +-
 linux/kirkwood/profiles/100-generic.mk |2 +-
 linux/kirkwood/profiles/110-nas.mk |8 
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/linux/kirkwood/config-4.4 b/target/linux/kirkwood/config-4.4
--- a/target/linux/kirkwood/config-4.4
+++ b/target/linux/kirkwood/config-4.4
@@ -266,7 +266,7 @@ CONFIG_REGMAP=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_MV is not set
+CONFIG_RTC_DRV_MV=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_SCHED_HRTICK=y
 # CONFIG_SCHED_INFO is not set
diff --git a/target/linux/kirkwood/profiles/100-generic.mk 
b/target/linux/kirkwood/profiles/100-generic.mk
--- a/target/linux/kirkwood/profiles/100-generic.mk
+++ b/target/linux/kirkwood/profiles/100-generic.mk
@@ -11,7 +11,7 @@ define Profile/Generic
kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \
kmod-i2c-core kmod-i2c-mv64xxx \
kmod-ata-core kmod-ata-marvell-sata \
-   kmod-rtc-marvell kmod-thermal-kirkwood \
+   kmod-thermal-kirkwood \
kmod-mwl8k swconfig wpad-mini
 endef
 
diff --git a/target/linux/kirkwood/profiles/110-nas.mk 
b/target/linux/kirkwood/profiles/110-nas.mk
--- a/target/linux/kirkwood/profiles/110-nas.mk
+++ b/target/linux/kirkwood/profiles/110-nas.mk
@@ -8,7 +8,7 @@
 define Profile/DOCKSTAR
   NAME:=Seagate FreeAgent Dockstar
   PACKAGES:= \
-   kmod-rtc-marvell kmod-usb2 kmod-usb-storage
+   kmod-usb2 kmod-usb-storage
 endef
 
 define Profile/DOCKSTAR/Description
@@ -21,7 +21,7 @@ define Profile/GOFLEXHOME
   NAME:=Seagate GoFlexHome
   PACKAGES:= \
kmod-ata-core kmod-ata-marvell-sata \
-   kmod-rtc-marvell kmod-usb2 kmod-usb-storage \
+   kmod-usb2 kmod-usb-storage \
uboot-envtools
 endef
 
@@ -48,7 +48,7 @@ define Profile/IB62X0
   NAME:=RaidSonic ICY BOX IB-NAS62x0
   PACKAGES:= \
kmod-ata-core kmod-ata-marvell-sata \
-   kmod-rtc-marvell kmod-usb2 kmod-usb-storage
+   kmod-usb2 kmod-usb-storage
 endef
 
 define Profile/IB62X0/Description
@@ -86,7 +86,7 @@ define Profile/NSA310S
   NAME:=ZyXEL NSA310S
   PACKAGES:= \
kmod-ata-core kmod-ata-marvell-sata \
-   kmod-rtc-marvell kmod-usb2 kmod-usb-storage
+   kmod-usb2 kmod-usb-storage
 endef
 
 define Profile/NSA310S/Description

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


Re: [LEDE-DEV] [RFC 3/6 v2] x86: Add sp5100_tco as a kernel module

2016-10-23 Thread Felix Fietkau
On 2016-10-22 19:39, Chris Blake wrote:
> This patch enables the kernel sp5100_tco watchdog driver to be built as
> a kernel module.
> 
> Signed-off-by: Chris Blake 
> ---
>  target/linux/x86/modules.mk | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk
> index 1fc5ce5..f6a87ee 100644
> --- a/target/linux/x86/modules.mk
> +++ b/target/linux/x86/modules.mk
> @@ -19,3 +19,18 @@ define KernelPackage/gpio-nct5104d/description
>  endef
> 
>  $(eval $(call KernelPackage,gpio-nct5104d))
> +
> +define KernelPackage/sp5100_tco
> +  SUBMENU:=$(OTHER_MENU)
> +  TITLE:=SP5100 Watchdog Support
> +  DEPENDS:=@TARGET_x86
> +  KCONFIG:=CONFIG_SP5100_TCO
> +  FILES:=$(LINUX_DIR)/drivers/watchdog/sp5100_tco.ko
> +  AUTOLOAD:=$(call AutoLoad,50,sp5100_tco,1)
> +endef
> +
> +define KernelPackage/sp5100_tco/description
> + Kernel module for the SP5100_TCO hardware watchdog.
> +endef
Please enable this in the x86/64 kernel config instead of packaging it.

- Felix


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


Re: [LEDE-DEV] [RFC 2/6 v2] x86: Add LED & GPIO drivers for the PC Engines APU2 board

2016-10-23 Thread Felix Fietkau
On 2016-10-22 19:39, Chris Blake wrote:
> This patch adds the following drivers to the x86 target:
> 
> leds-apu2 - A driver that enables usage of the onboard LEDs and Reset
> button wired to the chipset. This driver uses DMI to only enable on the
> APU2 board.
> gpio-nct5104d - A driver that allows for usage of the SuperIO GPIO chip
> on the PC Engines APU boards.
> 
> Signed-off-by: Chris Blake 
> ---
>  .../linux/x86/files/drivers/gpio/gpio-nct5104d.c   | 432 
> +
>  target/linux/x86/files/drivers/leds/leds-apu2.c| 374 ++
>  target/linux/x86/modules.mk|  21 +
>  .../x86/patches-4.4/800-add-apu2-led-driver.patch  |  29 ++
>  .../patches-4.4/801-add-nct5104d-gpio-driver.patch |  27 ++
>  5 files changed, 883 insertions(+)
>  create mode 100644 target/linux/x86/files/drivers/gpio/gpio-nct5104d.c
>  create mode 100644 target/linux/x86/files/drivers/leds/leds-apu2.c
>  create mode 100644 target/linux/x86/modules.mk
>  create mode 100644 target/linux/x86/patches-4.4/800-add-apu2-led-driver.patch
>  create mode 100644 
> target/linux/x86/patches-4.4/801-add-nct5104d-gpio-driver.patch
> 
> diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk
> new file mode 100644
> index 000..1fc5ce5
> --- /dev/null
> +++ b/target/linux/x86/modules.mk
> @@ -0,0 +1,21 @@
> +#
> +# Copyright (C) 2016 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define KernelPackage/gpio-nct5104d
> +  SUBMENU:=$(OTHER_MENU)
> +  TITLE:=nct5104d GPIO Support
> +  DEPENDS:=@TARGET_x86 @GPIO_SUPPORT
> +  KCONFIG:=CONFIG_GPIO_NCT5104D
> +  FILES:=$(LINUX_DIR)/drivers/gpio/gpio-nct5104d.ko
> +  AUTOLOAD:=$(call AutoLoad,60,gpio-nct5104d)
> +endef
> +
> +define KernelPackage/gpio-nct5104d/description
> + Kernel module for the nct5104d Super I/O chip on PC Engine APU boards.
> +endef
> +
> +$(eval $(call KernelPackage,gpio-nct5104d))
Please enable this in the x86/64 kernel config instead of packaging it.

- Felix

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


Re: [LEDE-DEV] [RFC 1/6 v2] Generic: Backport sp5100_tco patches for AMD platforms

2016-10-23 Thread Felix Fietkau
On 2016-10-22 19:39, Chris Blake wrote:
> This patch adds the following upstream patches to the 4.4 kernel:
> 
> sp5100_tco: Add AMD Mullins platform support
> sp5100_tco: Add AMD Carrizo platform support
> sp5100_tco: fix the device check for SB800 and later chipsets
> watchdog: sp5100_tco: properly check for new register layouts
> 
> These patches are required for sp5100_tco to work correctly on newer AMD
> embedded boards, such as the PC Engines APU2.
> 
> Signed-off-by: Chris Blake 
I think it makes more sense to put these patches in target/linux/x86
instead, since no other target needs them.

- Felix


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


[LEDE-DEV] [PATCH] kirkwood: remove redundant code in etc/board.d/02_network

2016-10-23 Thread p . wassi
From: Paul Wassi 

Remove redundant code: merge boards/cases that share
the same network configuration.

Signed-off-by: Paul Wassi 
---
 linux/kirkwood/base-files/etc/board.d/02_network |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network 
b/target/linux/kirkwood/base-files/etc/board.d/02_network
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -17,13 +17,12 @@ case "$board" in
 "iconnect"|\
 "ib62x0"|\
 "nsa310s"|\
-"pogo_e02")
+"pogo_e02"|\
+"sheevaplug"|\
+"sheevaplug-esata")
ucidef_set_interface_lan "eth0" "dhcp"
;;
-"linksys-audi")
-   ucidef_add_switch "switch0" \
-   "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
-   ;;
+"linksys-audi"|\
 "linksys-viper")
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
@@ -31,10 +30,6 @@ case "$board" in
 "guruplug-server-plus")
ucidef_set_interface_lan "eth0 eth1" "dhcp"
;;
-"sheevaplug" | \
-"sheevaplug-esata")
-   ucidef_set_interface_lan "eth0" "dhcp"
-   ;;
 *)
ucidef_set_interface_lan "eth0"
;;

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


[LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists

2016-10-23 Thread Chris Blake
Currently the reset script will try to run jffs2reset on boards that are
running a rw rootfs, such as ext4. This will cause jffs2reset to fail
and the board to never reboot while the LED blinks until a manual
reboot.

This commit does two different things:
1. Disables reset on boards that do not have an overlay mount
2. Disables the Blinking LED after 5 seconds if the board does not
support reset

Signed-off-by: Chris Blake 
---
 package/base-files/files/etc/rc.button/reset | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/rc.button/reset 
b/package/base-files/files/etc/rc.button/reset
index c6dc7cf..c6a3165 100755
--- a/package/base-files/files/etc/rc.button/reset
+++ b/package/base-files/files/etc/rc.button/reset
@@ -2,8 +2,12 @@

 . /lib/functions.sh

+OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )"
+
 case "$ACTION" in
 pressed)
+   [ -z "$OVERLAY" ] && return 0
+
return 5
 ;;
 timeout)
@@ -16,7 +20,7 @@ released)
echo "REBOOT" > /dev/console
sync
reboot
-   elif [ "$SEEN" -gt 5 ]
+   elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &
--
2.7.4

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


Re: [LEDE-DEV] [PATCH] kirkwood: disable fault LEDs by default

2016-10-23 Thread p . wassi
Hi Mathias,

> status:orange:fault is on after boot because it is used as status_led.
Ah, I see. However, after changing the default value to '0' it is
off after boot (althoug set as status_led !)

> What do you think about using the status:green:health led instead as
> status_led in diag.sh (similar to the power led on other boards)?
Now that I think about it, two other issues come to my mind:
-) some time ago, there was a plan to have the LEDs' names reflect the 
boardname.
  https://lists.infradead.org/pipermail/lede-dev/2016-July/002050.html
  So the LEDs would not be called "status:green:health" but instead 
"dockstar:green:health"
  and so on...
-) currently, the code in etc/diag.sh is kind of broken, the target/board 
'pogo_e02' does
  not have a LED called "status:orange:fault"; indeed it is called 
"pogo_e02:orange:fault"

Hmmm... I'll prepare some patch(es) for the entire kirkwood target.

Best regards,
P. Wassi

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


[LEDE-DEV] [RFC] brcm47xx: bump kernel to 4.4

2016-10-23 Thread p . wassi
Hi there!

As one of LEDE's TODOs is "Bump all kernels to v4.4", I've done
some testing on two brcm47xx devices (brcm47xx is still on kernel 4.1).

The devices I tested on + bootlog:
Linksys WRT54GL - https://pwassi.privatedns.org/lede/brcm47xx/#wrt54gl
ASUS WL500gP V2 - https://pwassi.privatedns.org/lede/brcm47xx/#wl500gpv2

I know, that there are much more devices on brcm47xx which are untested yet.
However, these are the ones I have at home to play with and everything seems
to work fine there. So what do you think about the following 'patch'?

Best regards,
P. Wassi

diff --git a/target/linux/brcm47xx/Makefile b/target/linux/brcm47xx/Makefile
--- a/target/linux/brcm47xx/Makefile
+++ b/target/linux/brcm47xx/Makefile
@@ -13,7 +13,7 @@ FEATURES:=squashfs usb
 SUBTARGETS:=generic mips74k legacy
 MAINTAINER:=Hauke Mehrtens 
 
-KERNEL_PATCHVER:=4.1
+KERNEL_PATCHVER:=4.4
 
 define Target/Description
Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS 
CPU, *not* ARM.

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


Re: [LEDE-DEV] [RFC 4/6 v2] Generic: Crypto - aesni - add ccm(aes) algorithm implementation

2016-10-23 Thread Chris Blake
Christian,

Thanks for the information. This patch will be removed from the next RFC.

- Chris Blake

On Sat, Oct 22, 2016 at 2:12 PM, Christian Lamparter
 wrote:
> On Saturday, October 22, 2016 12:39:26 PM CEST Chris Blake wrote:
>> This patch was provided by Ben at http://lists.infradead.org/pipermail
>> /lede-dev/2016-October/003332.html and adds ccm(aes) support to the AES-NI
>> acceleration. Currently it is not submitted upstream, but has been confirmed
>> working on the PC Engines APU2 using openssl.
> Well, I might be able to provide a bit of context for that patch
> and why it was never for upstream.
>
> First, the original version can be found here:
> "Re: Looking for non-NIC hardware-offload for wpa2 decrypt."
> 
>
> And it wasn't about openssl at all (In fact, openssl could just use
> AES-NI directly instead of bothering the kernel, since it's part of
> the x86 ISA). Instead it was a PoC that improved the performance of
> the software encryption/decryption in mac80211's aes_ccm.c code-path.
>
> In order to get mac80211 to pick it up as a viable aead cipher, it
> had to support the synchronous crypto reguests from mac80211. So most
> of the special code deals with setting up aes-ccm fallback (for
> !irq_fpu_usable() cases - used by ICMP) and the other is just the AESNI
> aes-ctr with parts from ccm.c.
>
> I don't think this will ever fly by the crypto folks in this form due
> to the CRYPTO_ALGO_ASYNC fallback parts which are  necessary to get it
> to work with mac80211. And in case CRYPTO_ALGO_ASYNC is possible, the
> crypto framework will already pick up AESNI aes-ctr anyway.
>
> The real solution here would be: make mac80211 support asynchronous
> software encryption/decryption. This has the added benefit that it
> would work with other ciphers and also allow for hardware crypto
> devices (like the ppc4xx-crypto). And not supporting this patch.
> (Note: crypto API changes are a pain and "expensive").
>
> Regards,
> Christian
>
> [...]
>> ++struct ccm_async_ctx {
>> ++struct crypto_aes_ctx ctx;
>> ++struct crypto_aead *fallback;
>> ++};
>> ++[...]
>> ++
>> ++static int ccm_init(struct crypto_aead *tfm)
>> ++{
>> ++struct crypto_aead *crypto_tfm;
>> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *)
>> ++PTR_ALIGN((u8 *)crypto_aead_ctx(tfm), AESNI_ALIGN);
>> ++
>> ++crypto_tfm = crypto_alloc_aead("ccm(aes)", 0,
>> ++CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK);
>> ++if (IS_ERR(crypto_tfm))
>> ++return PTR_ERR(crypto_tfm);
>> ++
>> ++ctx->fallback = crypto_tfm;
>> ++return 0;
>> ++}
>> ++
>> ++static void ccm_exit(struct crypto_aead *tfm)
>> ++{
>> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *)
>> ++PTR_ALIGN((u8 *)crypto_aead_ctx(tfm), AESNI_ALIGN);
>> ++
>> ++if (!IS_ERR_OR_NULL(ctx->fallback))
>> ++crypto_free_aead(ctx->fallback);
>> ++}
>> ++
>> ++static int ccm_setkey(struct crypto_aead *aead, const u8 *in_key,
>> ++  unsigned int key_len)
>> ++{
>> ++struct crypto_tfm *tfm = crypto_aead_tfm(aead);
>> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *)
>> ++PTR_ALIGN((u8 *)crypto_aead_ctx(aead), AESNI_ALIGN);
>> ++int err;
>> ++
>> ++err = __ccm_setkey(aead, in_key, key_len);
>> ++if (err)
>> ++return err;
>> ++
>> ++/*
>> ++ * Set the fallback transform to use the same request flags as
>> ++ * the hardware transform.
>> ++ */
>> ++ctx->fallback->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
>> ++ctx->fallback->base.crt_flags |=
>> ++tfm->crt_flags & CRYPTO_TFM_REQ_MASK;
>> ++return crypto_aead_setkey(ctx->fallback, in_key, key_len);
>> ++}
>> ++
>> ++static int ccm_setauthsize(struct crypto_aead *aead, unsigned int authsize)
>> ++{
>> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *)
>> ++PTR_ALIGN((u8 *)crypto_aead_ctx(aead), AESNI_ALIGN);
>> ++int err;
>> ++
>> ++err = __ccm_setauthsize(aead, authsize);
>> ++if (err)
>> ++return err;
>> ++
>> ++return crypto_aead_setauthsize(ctx->fallback, authsize);
>> ++}
>> ++
>> ++static int ccm_encrypt(struct aead_request *req)
>> ++{
>> ++int ret;
>> ++
>> ++if (!irq_fpu_usable()) {
>> ++struct crypto_aead *aead = crypto_aead_reqtfm(req);
>> ++struct ccm_async_ctx *ctx = get_ccm_ctx(aead);
>> ++struct crypto_aead *fallback = ctx->fallback;
>> ++
>> ++char aead_req_data[sizeof(struct aead_request) +
>> ++   crypto_aead_reqsize(fallback)]
>> ++__aligned(__alignof__(struct aead_request));
>> ++struct aead_request *aead_req = (void *) aead_req_data;
>> ++
>> ++memset(aead_req, 0, sizeof(aead_req_data));
>> ++aead_request_set_tfm(aead_req, fallback);
>> ++

Re: [LEDE-DEV] [RFC 0/6 v2] Add the PC Engines APU2 to LEDE

2016-10-23 Thread Chris Blake
Hello,

In regards to the usb-serial-kmod decision, this goes back to the
issue in the coverletter around what should be considered "acceptable"
for this image or not. If we are going for full functionality, then we
could add every package available to the image. The goal is to support
things the PC Engines, out of box, supports, unless I hear otherwise
from any of the maintainers.

As the board has a SIM slot I can see how usb-serial-kmod may be
acceptable, but with so many serial/modem kmods, where is the line
drawn? With that said, I am open to any critizism as I just want to
make sure this image meets the communites, and maintainers, requests.

I will go ahead and add usb-serial-kmod to the next RFC.

Regards,
Chris Blake

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


Re: [LEDE-DEV] regulatory domain information

2016-10-23 Thread Charles
on 2016-10-19 Charles wrote:

> Questions:
> 
> 1. Why does LEDE show four regulatory domain blocks while OpenWrt shows
>only one?
> 
> 2. What does the "country US: DFS-FCC" blocks tell me when radio is set
>to an ETSI region country (DE) according to uci?
> 
> 3. What does AUTO-BW mean?

If this is the wrong place to ask regulation related questions, could
you please point me to a better one?  Where is upstream - iw, driver or
kernel?

tnx, Charles



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