[PATCH] ramips: fix partition layout of xiaomi mi router 4a 100mbit

2021-01-08 Thread Alexander Couzens
The partition layout doesn't match the partition layout read out by OEM
version. It's unclear to me if different firmware version have different
partition layouts.
---
 target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts 
b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts
index 37797fc368cb..ea7e99d0b3fc 100644
--- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts
+++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts
@@ -10,13 +10,13 @@
 &partitions {
partition@6 {
label = "overlay";
-   reg = <0x6 0x10>;
+   reg = <0x6 0x20>;
read-only;
};
 
partition@16 {
label = "firmware";
-   reg = <0x16 0xea>;
+   reg = <0x26 0xda>;
compatible = "denx,uimage";
};
 };
-- 
2.29.2


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


[PATCH] wireless: add comments to functions

2021-01-08 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 wireless.c | 42 ++
 1 file changed, 42 insertions(+)

diff --git a/wireless.c b/wireless.c
index 818f7c994da8..4422656065b0 100644
--- a/wireless.c
+++ b/wireless.c
@@ -11,6 +11,21 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+
+/* The wireless configuration is projected on the following objects
+ *
+ * 1. wireless device
+ * 2. wireless interface
+ * 3. wireless vlan
+ * 4. wireless station
+ *
+ * A wireless device is a phy or simplified a wireless card.
+ * A wireless interface is a SSID on a phy.
+ * A wireless vlan can be assigned to a wireless interface. A wireless 
interface can
+ *   have multiple vlans.
+ * A wireless station is a client connected to an wireless interface.
+ */
+
 #include 
 #include "netifd.h"
 #include "wireless.h"
@@ -508,6 +523,7 @@ wireless_device_mark_down(struct wireless_device *wdev)
wdev_handle_config_change(wdev);
 }
 
+/* timeout callback to protect the tear down */
 static void
 wireless_device_setup_timeout(struct uloop_timeout *timeout)
 {
@@ -553,6 +569,7 @@ __wireless_device_set_down(struct wireless_device *wdev)
wireless_device_run_handler(wdev, false);
 }
 
+/* ubus callback network.wireless.notify, command = up */
 static void
 wireless_device_mark_up(struct wireless_device *wdev)
 {
@@ -665,6 +682,7 @@ wdev_create(struct wireless_device *wdev)
wdev->config = blob_memdup(wdev->config);
 }
 
+/* vlist update call for wireless device list */
 static void
 wdev_update(struct vlist_tree *tree, struct vlist_node *node_new,
struct vlist_node *node_old)
@@ -684,6 +702,7 @@ wdev_update(struct vlist_tree *tree, struct vlist_node 
*node_new,
}
 }
 
+/* wireless netifd script handler */
 static void
 wireless_add_handler(const char *script, const char *name, json_object *obj)
 {
@@ -751,6 +770,7 @@ void wireless_init(void)
netifd_init_script_handlers(drv_fd, wireless_add_handler);
 }
 
+/* parse blob config into the wireless interface object */
 static void
 wireless_interface_init_config(struct wireless_interface *vif)
 {
@@ -772,6 +792,7 @@ wireless_interface_init_config(struct wireless_interface 
*vif)
vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
 }
 
+/* vlist update call for wireless interface list */
 static void
 vif_update(struct vlist_tree *tree, struct vlist_node *node_new,
   struct vlist_node *node_old)
@@ -817,6 +838,7 @@ vif_update(struct vlist_tree *tree, struct vlist_node 
*node_new,
wdev_set_config_state(wdev, IFC_RELOAD);
 }
 
+/* parse blob config into the vlan object */
 static void
 wireless_vlan_init_config(struct wireless_vlan *vlan)
 {
@@ -834,6 +856,7 @@ wireless_vlan_init_config(struct wireless_vlan *vlan)
vlan->isolate = blobmsg_get_bool(cur);
 }
 
+/* vlist update call for vlan list */
 static void
 vlan_update(struct vlist_tree *tree, struct vlist_node *node_new,
struct vlist_node *node_old)
@@ -878,6 +901,7 @@ vlan_update(struct vlist_tree *tree, struct vlist_node 
*node_new,
wdev_set_config_state(wdev, IFC_RELOAD);
 }
 
+/* vlist update call for station list */
 static void
 station_update(struct vlist_tree *tree, struct vlist_node *node_new,
   struct vlist_node *node_old)
@@ -944,6 +968,8 @@ done:
wireless_close_script_proc_fd(wdev);
 }
 
+/* watchdog and garbage collector for wireless processes.
+ * It cleans up terminated processes. If a process is a requirement for the 
wireless device, it retries the setup */
 static void
 wireless_device_check_script_tasks(struct uloop_timeout *timeout)
 {
@@ -968,6 +994,7 @@ wireless_device_check_script_tasks(struct uloop_timeout 
*timeout)
uloop_timeout_set(&wdev->script_check, 1000);
 }
 
+/* creates a wireless device object. Called by config */
 void
 wireless_device_create(struct wireless_driver *drv, const char *name, struct 
blob_attr *data)
 {
@@ -1019,6 +1046,7 @@ wireless_device_create(struct wireless_driver *drv, const 
char *name, struct blo
vlist_add(&wireless_devices, &wdev->node, wdev->name);
 }
 
+/* creates a wireless station object. Called by config */
 void
 wireless_station_create(struct wireless_device *wdev, char *vif, struct 
blob_attr *data, const char *section)
 {
@@ -1048,6 +1076,7 @@ wireless_station_create(struct wireless_device *wdev, 
char *vif, struct blob_att
vlist_add(&wdev->stations, &sta->node, sta->name);
 }
 
+/* ubus callback network.wireless.status, runs for every interface, encode the 
station */
 static void
 wireless_station_status(struct wireless_station *sta, struct blob_buf *b)
 {
@@ -1060,6 +1089,7 @@ wireless_station_status(struct wireless_station *sta, 
struct blob_buf *b)
blobmsg_close_table(b, i);
 }
 
+/* create a vlan object. Ca

[OpenWrt-Devel] [PATCH] ar71xx/image: move TPLINK-LZMA image to new build code v2

2015-05-01 Thread Alexander Couzens
There are 2 images missing: TLWR2543 TLWR1043V2 which have special properties.
v2: set correct DEVICE_PROFILES for all images.
v2: migrate TP-LINK TL-WR710N v2 which was committed after v1.
v2: split very very long line `TARGET_DEVICES +=` into smaller parts

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 427 +++--
 1 file changed, 361 insertions(+), 66 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index e4f6c71..28453e7 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -206,6 +206,355 @@ $(Device/tl-wdr4300-v1)
 endef
 TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il 
tl-wdr4310-v1 mw4530r-v1
 
+define Device/archer-c5
+$(Device/tplink-16mlzma)
+BOARDNAME := ARCHER-C5
+DEVICE_PROFILE := ARCHERC7
+TPLINK_HWID := 0xc501
+endef
+
+define Device/archer-c7-v1
+$(Device/tplink-8mlzma)
+BOARDNAME := ARCHER-C7
+DEVICE_PROFILE := ARCHERC7
+TPLINK_HWID := 0x7501
+endef
+
+define Device/archer-c7-v2
+$(Device/tplink-16mlzma)
+BOARDNAME := ARCHER-C7
+DEVICE_PROFILE := ARCHERC7
+TPLINK_HWID := 0xc702
+endef
+TARGET_DEVICES += archer-c5 archer-c7-v1 archer-c7-v2
+
+define Device/el-m150
+$(Device/tplink-8mlzma)
+BOARDNAME := EL-M150
+DEVICE_PROFILE := ELM150
+TPLINK_HWID := 0x01500101
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/el-mini
+$(Device/tplink-8mlzma)
+BOARDNAME := EL-MINI
+DEVICE_PROFILE := ELMINI
+TPLINK_HWID := 0x01530001
+CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += el-m150 el-mini
+
+define Device/gl-inet-6408A-v1
+$(Device/tplink-8mlzma)
+BOARDNAME := GL-INET
+DEVICE_PROFILE := GLINET
+TPLINK_HWID := 0x0801
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/gl-inet-6416A-v1
+$(Device/tplink-16mlzma)
+BOARDNAME := GL-INET
+DEVICE_PROFILE := GLINET
+TPLINK_HWID := 0x0801
+CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
+
+define Device/mc-mac1200r
+$(Device/tplink-8mlzma)
+BOARDNAME := MC-MAC1200R
+DEVICE_PROFILE := MAC1200R
+TPLINK_HWID := 0x1201
+endef
+TARGET_DEVICES += mc-mac1200r
+
+define Device/tl-mr10u-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR10U
+DEVICE_PROFILE := TLMR10U
+TPLINK_HWID := 0x00100101
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr11u-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR11U
+DEVICE_PROFILE := TLMR11U
+TPLINK_HWID := 0x00110101
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr11u-v2
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR11U
+DEVICE_PROFILE := TLMR11U
+TPLINK_HWID := 0x00110102
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr12u-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR13U
+DEVICE_PROFILE := TLMR12U
+TPLINK_HWID := 0x00120101
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr13u-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR13U
+DEVICE_PROFILE := TLMR13U
+TPLINK_HWID := 0x00130101
+CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1
+
+define Device/tl-mr3020-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR3020
+DEVICE_PROFILE := TLMR3020
+TPLINK_HWID := 0x3021
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr3040-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR3040
+DEVICE_PROFILE := TLMR3040
+TPLINK_HWID := 0x3041
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr3040-v2
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR3040-v2
+DEVICE_PROFILE := TLMR3040
+TPLINK_HWID := 0x3042
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr3220-v2
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR3220-v2
+DEVICE_PROFILE := TLMR3220V2
+TPLINK_HWID := 0x3222
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-mr3420-v2
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-MR3420-v2
+DEVICE_PROFILE := TLMR3420
+TPLINK_HWID := 0x3422
+endef
+TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v2 
tl-mr3420-v2
+
+define Device/tl-wr703n-v1
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-WR703N
+DEVICE_PROFILE := TLWR703
+TPLINK_HWID := 0x07030101
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-wr710n-v1
+$(Device/tplink-8mlzma)
+BOARDNAME := TL-WR710NV1
+DEVICE_PROFILE := TLWR710
+TPLINK_HWID := 0x0711
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-wr710n-v2
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-WR710NV2
+DEVICE_PROFILE := TLWR710
+TPLINK_HWID := 0x0711
+CONSOLE := ttyATH0,115200
+endef
+
+define Device/tl-wr720n-v3
+$(Device/tplink-4mlzma)
+BOARDNAME := TL-WR720N-v3

[OpenWrt-Devel] [PATCH 0/5] ar71xx: move ubnt images to new build code

2015-06-07 Thread Alexander Couzens
Hi,

I've tested these images for some models, but not all.
The most important missing target is the UAP PRO or Unifi outdoor plus,
because they uses a different format and build step than the others.

Tested:
- nanostation XM
- nanostation XW
- routerstation pro

Test includes:
- flash via rescue tftp
- sysupgrade from openwrt to openwrt

Best,
lynxis

Alexander Couzens (5):
  image.mk: add Build step combined-image
  image.mk: add Build step pad-to
  ar71xx/image: new build step Build/mkubntimage for ubnt factory images
  ar71xx/image: add build step mkubntimage2 mkubntkernelimage for unifi
boards
  ar71xx/image: move ubnt images to new BuildCode

 include/image.mk   |  12 ++
 target/linux/ar71xx/image/Makefile | 315 ++---
 2 files changed, 238 insertions(+), 89 deletions(-)

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


[OpenWrt-Devel] [PATCH 1/5] image.mk: add Build step combined-image

2015-06-07 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 include/image.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 020418d..287c679 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -326,6 +326,13 @@ define Build/check-size
}
 endef
 
+define Build/combined-image
+   -sh $(TOPDIR)/scripts/combined-image.sh \
+   "$(word 1,$^)" \
+   "$@" \
+   "$@.new"
+   @mv $@.new $@
+endef
 
 define Device/Init
   PROFILES := $(PROFILE)
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] image.mk: add Build step pad-to

2015-06-07 Thread Alexander Couzens
pad-to can be used in a pipe to pad the image to a specific chunk-size.
Signed-off-by: Alexander Couzens 
---
 include/image.mk | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 287c679..814e7dc 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -304,6 +304,11 @@ define Build/append-rootfs
dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
 endef
 
+define Build/pad-to
+   dd if=$@ of=$@.new bs=$(1) conv=sync
+   mv $@.new $@
+endef
+
 define Build/pad-rootfs
$(call prepare_generic_squashfs,$@ $(1))
 endef
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] ar71xx/image: new build step Build/mkubntimage for ubnt factory images

2015-06-07 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 29 +
 1 file changed, 29 insertions(+)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 580a640..750de9c 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -104,6 +104,35 @@ endef
 
 DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT
 
+# UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
+# UBNT_TYPE e.g. one of (BZ, XM, XW)
+# UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
+
+# mkubntimage is using the kernel image direct
+# routerboard creates partitions out of the ubnt header
+define Build/mkubntimage
+   $(STAGING_DIR_HOST)/bin/mkfwimage \
+   -B $(UBNT_BOARD) -v 
$(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
+   -k $(word 1,$^) \
+   -r $@ \
+   -o $@
+endef
+
+# all UBNT XM device expect the kernel image to have 1024k while flash, when
+# booting the image, the size doesn't matter.
+define Build/mkubntimage-split
+   dd if=$@ of=$@.old1 bs=1024k count=1
+   dd if=$@ of=$@.old2 bs=1024k skip=1
+   $(STAGING_DIR_HOST)/bin/mkfwimage \
+   -B $(UBNT_BOARD) -v 
$(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
+   -k $@.old1 \
+   -r $@.old2 \
+   -o $@
+   rm $@.old1 $@.old2
+endef
+
+DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
+
 define Device/Default
   BOARDNAME :=
   DEVICE_PROFILE = $$(BOARDNAME)
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] ar71xx/image: add build step mkubntimage2 mkubntkernelimage for unifi boards

2015-06-07 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 750de9c..6662672 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -131,8 +131,30 @@ define Build/mkubntimage-split
rm $@.old1 $@.old2
 endef
 
+define Build/mkubntimage2
+   $(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f00 \
+   -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
+   -p jffs2:0x5:0xf6:0:0:$@ \
+   -o $@.new
+   @mv $@.new $@
+endef
+
 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
 
+define Build/mkubntkernelimage
+   rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
+   mkdir -p $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
+   cp $@ $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image/kernel0 && \
+   $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
+   --pad --big-endian --squash-uids -v -e 64KiB \
+   -o $@.new \
+   -d $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image \
+   2>&1 && \
+   $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J 64
+   -rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image
+   @mv $@.new $@
+endef
+
 define Device/Default
   BOARDNAME :=
   DEVICE_PROFILE = $$(BOARDNAME)
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/5] ar71xx/image: move ubnt images to new BuildCode

2015-06-07 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 264 -
 1 file changed, 175 insertions(+), 89 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 6662672..21d0d66 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -671,6 +671,180 @@ define Device/oolite
 endef
 TARGET_DEVICES += oolite
 
+# UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
+# UBNT_TYPE e.g. one of (BZ, XM, XW)
+# UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
+define Device/ubnt-xm
+  DEVICE_PROFILE := UBNT
+  IMAGE_SIZE := 7552k
+  MTDPARTS = 
spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
+  UBNT_TYPE := XM
+  UBNT_BOARD := XM
+  UBNT_CHIP := ar7240
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
+  IMAGE/sysupgrade.bin = append-kernel (BLOCKSIZE) | append-rootfs | 
pad-rootfs | check-size (IMAGE_SIZE)
+endef
+
+define Device/ubnt-xw
+  DEVICE_PROFILE := UBNT
+  IMAGE_SIZE := 7552k
+  MTDPARTS = 
spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
+  UBNT_TYPE := XW
+  UBNT_BOARD := XM
+  UBNT_CHIP := ar934x
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
+  IMAGE/sysupgrade.bin = append-kernel (BLOCKSIZE) | append-rootfs | 
pad-rootfs | check-size (IMAGE_SIZE)
+endef
+
+define Device/ubnt-bz
+  DEVICE_PROFILE := UBNT
+  IMAGE_SIZE := 7552k
+  MTDPARTS = 
spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
+  UBNT_TYPE := BZ
+  UBNT_BOARD := XM
+  UBNT_CHIP := ar934x
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
+  IMAGE/sysupgrade.bin = append-kernel (BLOCKSIZE) | append-rootfs | 
pad-rootfs | check-size (IMAGE_SIZE)
+endef
+
+define Device/rw2458n
+  $(Device/ubnt-xm)
+  BOARDNAME := RW2458N
+endef
+
+define Device/ubnt-airrouter
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-AR
+endef
+
+define Device/ubnt-bullet-m
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-BM
+endef
+
+define Device/ubnt-rocket-m
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-RM
+endef
+
+define Device/ubnt-nano-m
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-NM
+endef
+TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m 
ubnt-nano-m
+
+define Device/ubnt-unifi
+  $(Device/ubnt-bz)
+  BOARDNAME := UBNT-UF
+  DEVICE_PROFILE := UBNT UBNTUNIFI
+endef
+
+define Device/ubnt-unifi-outdoor
+  $(Device/ubnt-bz)
+  BOARDNAME := UBNT-U20
+  DEVICE_PROFILE := UBNT UBNTUNIFIOUTDOOR
+endef
+TARGET_DEVICES += ubnt-unifi ubnt-unifi-outdoor
+
+define Device/ubnt-nano-m-xw
+  $(Device/ubnt-xw)
+  BOARDNAME := UBNT-NM-XW
+endef
+
+define Device/ubnt-loco-m-xw
+  $(Device/ubnt-xw)
+  BOARDNAME := UBNT-LOCO-XW
+endef
+
+define Device/ubnt-rocket-m-xw
+  $(Device/ubnt-xw)
+  BOARDNAME := UBNT-RM-XW
+endef
+TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw
+
+define Device/ubnt-air-gateway
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-AGW
+  UBNT_BOARD := XM
+  UBNT_TYPE := AirGW
+  UBNT_CHIP := ar933x
+  CONSOLE = ttyATH0,115200
+endef
+TARGET_DEVICES += ubnt-air-gateway
+
+define Device/ubdev01
+  $(Device/ubnt-xm)
+  MTDPARTS := 
spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
+  BOARDNAME := UBNT-UF
+  UBNT_BOARD := XM
+  UBNT_TYPE := XM
+  UBNT_CHIP := ar7240
+endef
+
+TARGET_DEVICES += ubdev01
+
+define Device/ubnt-routerstation
+  IMAGE_SIZE := 16128k
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/factory.bin = append-rootfs | pad-rootfs | mkubntimage
+  IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | combined-image | 
check-size (IMAGE_SIZE)
+  KERNEL := kernel-bin | patch-cmdline | lzma | pad-to $$(BLOCKSIZE)
+endef
+
+define Device/ubnt-rs
+$(Device/ubnt-routerstation)
+  BOARDNAME := UBNT-RS
+  DEVICE_PROFILE := Madwifi UBNT UBNTRS
+  UBNT_BOARD := RS
+  UBNT_TYPE := RSx
+  UBNT_CHIP := ar7100
+endef
+
+define Device/ubnt-rspro
+$(Device/ubnt-routerstation)
+  BOARDNAME := UBNT-RSPRO
+  DEVICE_PROFILE := Madwifi UBNT UBNTRSPRO
+  UBNT_BOARD := RSPRO
+  UBNT_TYPE := RSPRO
+  UBNT_CHIP := ar7100pro
+endef
+
+define Device/ubnt-ls-sr71
+$(Device/ubnt-routerstation)
+  BOARDNAME := UBNT-LS-SR71
+  DEVICE_PROFILE := Madwifi UBNT
+  UBNT_BOARD := LS-SR71
+  UBNT_TYPE := LS-SR71
+  UBNT_CHIP := ar7100
+endef
+
+TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71
+
+define Device/ubnt-uap-pro
+  IMAGE_SIZE := 15744k
+  MTDPARTS := 
spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1536k(kernel),14208k(rootfs),256k(cfg)ro,64k(EEPROM)ro,15744k@0x5(firmware)
+  UBNT_TYPE := BZ
+  UBNT_CHIP := ar934x
+  BOARD_NAME := UAP-PRO
+  DEVICE_PROFILE := UBNT UAPPRO
+  KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | mkubntkernelimage
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE

[OpenWrt-Devel] [PATCH 1/3] phy/at803x: fix null-pointer access when platform data isn't set

2015-06-20 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 .../patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
index d046ede..462a63e 100644
--- 
a/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
+++ 
b/target/linux/ar71xx/patches-3.18/425-net-phy-at803x-allow-to-configure-via-pdata.patch
@@ -142,7 +142,7 @@
priv->phy_reset = false;
}
 +  }
-+  if (pdata->fixup_rgmii_tx_delay &&
++  if (pdata && pdata->fixup_rgmii_tx_delay &&
 +  phydev->speed != priv->prev_speed) {
 +  switch (phydev->speed) {
 +  case SPEED_10:
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] ar71xx: allow pci calibration fixup to work with ar9344

2015-06-20 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/files/arch/mips/ath79/pci-ath9k-fixup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/pci-ath9k-fixup.c 
b/target/linux/ar71xx/files/arch/mips/ath79/pci-ath9k-fixup.c
index fcca1d2..2202351 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/pci-ath9k-fixup.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/pci-ath9k-fixup.c
@@ -73,6 +73,9 @@ static void ath9k_pci_fixup(struct pci_dev *dev)
case ATH79_SOC_AR7242:
pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x1000);
break;
+   case ATH79_SOC_AR9344:
+   pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x1000);
+   break;
 
default:
BUG();
-- 
2.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] ar71xx: add support for ubnt rocket-m ti

2015-06-20 Thread Alexander Couzens
rocket-m titanium is a device based on ar9344 with 802.11af poe.
It doesn't use the SoC wifi, instead it's using an ar9280 connected to
the pci bus. The gps version of the rocket-m ti is working, but
gps is untested. The gps is connected to the first serial port.

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   9 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/image/Makefile |   9 +-
 .../904-MIPS-ath79-ubnt-rocket-m-ti-supprt.patch   | 139 +
 7 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ar71xx/patches-3.18/904-MIPS-ath79-ubnt-rocket-m-ti-supprt.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 0553251..fefe4d1 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -37,6 +37,9 @@ get_status_led() {
bullet-m | rocket-m | rocket-m-xw | nano-m | nanostation-m | 
nanostation-m-xw | loco-m-xw)
status_led="ubnt:green:link4"
;;
+   rocket-m-ti)
+   status_led="ubnt:green:link6"
+   ;;
bxu2000n-2-a1)
status_led="bhu:green:status"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 41b..a6e53ed 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -47,6 +47,15 @@ loco-m-xw)
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" 
"76" "100" "-75" "13"
;;
 
+rocket-m-ti)
+   ucidef_set_led_rssi "rssiverylow"   "RSSIVERYLOW"   
"ubnt:green:link1" "wlan0" "1" "100" "0" "13"
+   ucidef_set_led_rssi "rssilow"   "RSSILOW"   
"ubnt:green:link2" "wlan0" "26" "100" "-25" "13"
+   ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" 
"ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
+   ucidef_set_led_rssi "rssimediumhigh""RSSIMEDIUMHIGH"
"ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
+   ucidef_set_led_rssi "rssihigh"  "RSSIHIGH"  
"ubnt:green:link5" "wlan0" "76" "100" "-75" "13"
+   ucidef_set_led_rssi "rssiveryhigh"  "RSSIVERYHIGH"  
"ubnt:green:link4" "wlan0" "76" "100" "-75" "13"
+   ;;
+
 bxu2000n-2-a1)
ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index f5c6865..f7ae983 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -18,6 +18,7 @@ case "$board" in
 all0315n |\
 all0258n |\
 ja76pf2|\
+rocket-m-ti |\
 ubnt-unifi-outdoor)
ucidef_set_interface_lan "eth0 eth1"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b13be1e..fe08a50 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -631,6 +631,9 @@ ar71xx_board_detect() {
*"Rocket M")
name="rocket-m"
;;
+   *"Rocket M TI")
+   name="rocket-m-ti"
+   ;;
*"Rocket M XW")
name="rocket-m-xw"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 3dbd91c..5c91801 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -227,6 +227,7 @@ platform_check_image() {
nanostation-m | \
rocket-m | \
rocket-m-xw | \
+   rocket-m-ti | \
nanostation-m-xw | \
rw2458n | \
wndap360 | \
diff --git a/target/linux/ar71xx/image/M

Re: [OpenWrt-Devel] [PATCH] ar71xx: fix kernel Oops in at803x_link_change_notify

2015-06-30 Thread Alexander Couzens
Hi Sven,

I sent the same patch a week ago.
See https://patchwork.ozlabs.org/patch/486993/

Best
lynxis


pgpqL79L7qJSJ.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: fix UAP-PRO images

2015-07-05 Thread Alexander Couzens
Thanks a lot for fixing this.
Do you tested your changes?

Best,
lynxis


pgpLuBc_lN78A.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] ar71xx: spi difference between internal chip select and gpios as chip select

2015-07-23 Thread Alexander Couzens
Hi,

I would like to integrate the upstream devicetree ath79-spi patches into the 
ar71xx tree.
But there are some improvements upstream which conflicts to use, they dropped 
the spi_controller_data,
which is used by some boards to define the type of chip select. The type is 
internal
or gpio. The internal chip selects are routed to gpios in the end.

Is there a notable difference between the internal chip select and the direct 
accessed gpio variant?
Did someone any performance tests on this?

Best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@jabber.ccc.de
mobile: +4915123277221


pgpcDGUH9dgV7.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-07-23 Thread Alexander Couzens
On Thu, 23 Jul 2015 23:51:33 +0200
Martin Blumenstingl  wrote:

> Hi Andre,
> 
> On Thu, Jul 23, 2015 at 11:32 PM, Andre Heider  wrote:
> > The dsl line never syncs, and letting 'vdsl_cpe_control --c' just sit
> > there spits out repeatedly:
> > 'DSL_CPE: Wrong combination of DSL PHY Firmware and hybrid type used!
> > Please change one of it.'.
> At some point during my tests I got a second device (an Arcadyan
> VGV7510KW22 - which came as "Annex B" device from the factory). Using
> the very same config made this device sync fine.
> 
> > This sounds like an annex incompability? Was I wrong and there is a
> > hardware difference and I cannot use the non B model with annex b?
> Indeed, I have read multiple times that the DSL modem should support
> all annexes - but as our tests have shown: it doesn't (at least for
> ADSL). My guess is that the modem physically supports it but there's a
> bootstrap pin (to which a resistor is soldered... or not) which
> configures it to be Annex A *or* B only.
> The interesting part: VDSL is not affected by this (all ISPs in all
> countries seem to use VDSL over ISDN). I am using an Annex A device on
> a German VDSL line and this is working fine.
> 
> bottom line: it seems that the modems are bound to a specific annex
> for ADSL operation.
I've seen the same. With annex b device, same firmware, the modem syncs to 
adsl, with annex a not. vdsl is working unrelated to the annex (B on A and vice 
versa is working).
If someone would like to search for differences on the pcb, I can make photos 
of both pcbs.

best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@jabber.ccc.de
mobile: +4915123277221


pgpZF9K5gPTCo.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-08-03 Thread Alexander Couzens
I've took a look on 2 devices.
They differ a lot, there might be different revisions.
I'll take some photos tomorrow.

> PS: by poking around I found
> target/linux/lantiq/patches-3.18/0007-MIPS-lantiq-add-basic-tffs-driver.patch
> which looks like it reads the annex version off a mtd part I don't
> have. Any idea what that is about?
good question... no idea


-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@jabber.ccc.de
mobile: +4915123277221


pgp6Z4oFAceW1.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ustream-ssl: make ustream_ssl.server_name const

2015-08-06 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 ustream-ssl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi Felix,

can you please update CC too? BB would be also nice, if 
it still maintained.
Follow-up patch for uclient-fetch will fix SNI.

Best,
lynxis

diff --git a/ustream-ssl.h b/ustream-ssl.h
index 0c55344..7787788 100644
--- a/ustream-ssl.h
+++ b/ustream-ssl.h
@@ -34,7 +34,7 @@ struct ustream_ssl {
void *ssl;
 
char *peer_cn;
-   char *server_name;
+   const char *server_name;
 
int error;
bool connected;
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uclient-fetch: set server_name of the ssl context to support SNI

2015-08-06 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 uclient-http.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/uclient-http.c b/uclient-http.c
index d96094d..4300d05 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -826,6 +826,7 @@ static int uclient_setup_https(struct uclient_http *uh)
uh->ussl.notify_error = uclient_ssl_notify_error;
uh->ussl.notify_verify_error = uclient_ssl_notify_verify_error;
uh->ussl.notify_connected = uclient_ssl_notify_connected;
+   uh->ussl.server_name = uh->uc.url->host;
uh->ssl_ops->init(&uh->ussl, &uh->ufd.stream, uh->ssl_ctx, false);
uh->ssl_ops->set_peer_cn(&uh->ussl, uh->uc.url->host);
 
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] busybox: lock: implement -n "Fail rather than wait"

2015-08-06 Thread Alexander Couzens
lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
echo lock exits.
else
echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

Signed-off-by: Alexander Couzens 
---
 package/utils/busybox/patches/220-add_lock_util.patch | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch 
b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..08f489a 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -33,9 +33,11 @@
  lib-$(CONFIG_MAKEDEVS)+= makedevs.o
  lib-$(CONFIG_MAN) += man.o
  lib-$(CONFIG_MICROCOM)+= microcom.o
+Index: busybox-1.23.2/miscutils/lock.c
+===
 --- /dev/null
-+++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
 busybox-1.23.2/miscutils/lock.c
+@@ -0,0 +1,145 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau 
 + *
@@ -56,6 +58,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int failinsteadwait = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +68,7 @@
 +  "   -s  Use shared locking\n"
 +  "   -u  Unlock\n"
 +  "   -w  Wait for the lock to become free, don't 
acquire lock\n"
++  "   -n  Fail rather than wait\n"
 +  "\n", name);
 +  exit(1);
 +}
@@ -95,6 +99,8 @@
 +static int do_lock(void)
 +{
 +  int pid;
++  int ret;
++  int flags;
 +  char pidstr[8];
 +
 +  if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +110,10 @@
 +  }
 +  }
 +
-+  if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++  flags = shared ? LOCK_SH : LOCK_EX;
++  flags |= failinsteadwait ? LOCK_NB : 0;
++
++  if ((ret = flock(fd, flags)) < 0) {
 +  fprintf(stderr, "Can't lock %s\n", file);
 +  return 1;
 +  }
@@ -156,6 +165,9 @@
 +  case 'u':
 +  unlock = 1;
 +  break;
++  case 'n':
++  failinsteadwait = 1;
++  break;
 +  }
 +  }
 +  c--;
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail rather than wait"

2015-08-07 Thread Alexander Couzens
lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
echo lock exits.
else
echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

v1: implement feature
v2: rename variable failinsteadwait into try_lock
extend description of -n
run make package/utils/busybox/refresh

Signed-off-by: Alexander Couzens 
---
 package/utils/busybox/patches/220-add_lock_util.patch | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch 
b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..c261a9e 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,6 +1,6 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, 
+@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
  IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
@@ -35,7 +35,7 @@
  lib-$(CONFIG_MICROCOM)+= microcom.o
 --- /dev/null
 +++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,145 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau 
 + *
@@ -56,6 +56,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int try_lock = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +66,7 @@
 +  "   -s  Use shared locking\n"
 +  "   -u  Unlock\n"
 +  "   -w  Wait for the lock to become free, don't 
acquire lock\n"
++  "   -n  Don't wait for the lock to become free. 
Fail with exit code\n"
 +  "\n", name);
 +  exit(1);
 +}
@@ -95,6 +97,8 @@
 +static int do_lock(void)
 +{
 +  int pid;
++  int ret;
++  int flags;
 +  char pidstr[8];
 +
 +  if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +108,10 @@
 +  }
 +  }
 +
-+  if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++  flags = shared ? LOCK_SH : LOCK_EX;
++  flags |= try_lock ? LOCK_NB : 0;
++
++  if ((ret = flock(fd, flags)) < 0) {
 +  fprintf(stderr, "Can't lock %s\n", file);
 +  return 1;
 +  }
@@ -156,6 +163,9 @@
 +  case 'u':
 +  unlock = 1;
 +  break;
++  case 'n':
++  try_lock = 1;
++  break;
 +  }
 +  }
 +  c--;
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] busybox: lock: implement -n "Fail rather than wait"

2015-08-23 Thread Alexander Couzens
lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
echo lock exits.
else
echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

Signed-off-by: Alexander Couzens 
---
v1: implement feature
v2: rename variable failinsteadwait into try_lock
extend description of -n
run make package/utils/busybox/refresh
v3: drop changelog from commit message
remove ret variable

 package/utils/busybox/patches/220-add_lock_util.patch | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch 
b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..9cac9e6 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,6 +1,6 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, 
+@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
  IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
@@ -35,7 +35,7 @@
  lib-$(CONFIG_MICROCOM)+= microcom.o
 --- /dev/null
 +++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,144 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau 
 + *
@@ -56,6 +56,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int try_lock = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +66,7 @@
 +  "   -s  Use shared locking\n"
 +  "   -u  Unlock\n"
 +  "   -w  Wait for the lock to become free, don't 
acquire lock\n"
++  "   -n  Don't wait for the lock to become free. 
Fail with exit code\n"
 +  "\n", name);
 +  exit(1);
 +}
@@ -95,6 +97,7 @@
 +static int do_lock(void)
 +{
 +  int pid;
++  int flags;
 +  char pidstr[8];
 +
 +  if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +107,10 @@
 +  }
 +  }
 +
-+  if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++  flags = shared ? LOCK_SH : LOCK_EX;
++  flags |= try_lock ? LOCK_NB : 0;
++
++  if (flock(fd, flags) < 0) {
 +  fprintf(stderr, "Can't lock %s\n", file);
 +  return 1;
 +  }
@@ -156,6 +162,9 @@
 +  case 'u':
 +  unlock = 1;
 +  break;
++  case 'n':
++  try_lock = 1;
++  break;
 +  }
 +  }
 +  c--;
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uci: add import call

2015-08-26 Thread Alexander Couzens
similiar to import from uci cli.
import removes all old configs and import the new config.

example:
ubus call uci import \
  '{"config": "dhcp", "values": { "srv": { ".type": "host", ".name": "srv", 
"mac": "00:11:22:33:44:55", "ip": "192.168.1.2" } } }'
---
 uci.c | 152 ++
 1 file changed, 152 insertions(+)

diff --git a/uci.c b/uci.c
index 8b5dafd..86c3b6e 100644
--- a/uci.c
+++ b/uci.c
@@ -32,6 +32,21 @@ static struct ubus_context *apply_ctx;
 static char apply_sid[RPC_SID_LEN + 1];
 
 enum {
+  RPC_ADD_TYPE,
+  RPC_ADD_NAME,
+  RPC_ADD_ANONYMOUS,
+  RPC_ADD_INDEX,
+  __RPC_ADD_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_add_section_policy[__RPC_ADD_MAX] = 
{
+  [RPC_ADD_TYPE]  = { .name = ".type",   .type = BLOBMSG_TYPE_STRING },
+  [RPC_ADD_NAME]  = { .name = ".name",   .type = BLOBMSG_TYPE_STRING },
+  [RPC_ADD_ANONYMOUS] = { .name = ".anonymous",  .type = BLOBMSG_TYPE_BOOL   },
+  [RPC_ADD_INDEX] = { .name = ".index",  .type = BLOBMSG_TYPE_INT32  },
+};
+
+enum {
RPC_G_CONFIG,
RPC_G_SECTION,
RPC_G_OPTION,
@@ -90,6 +105,20 @@ static const struct blobmsg_policy 
rpc_uci_set_policy[__RPC_S_MAX] = {
 };
 
 enum {
+   RPC_I_CONFIG,
+   RPC_I_VALUES,
+   RPC_I_SESSION,
+   __RPC_I_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_import_policy[__RPC_I_MAX] = {
+   [RPC_I_CONFIG]  = { .name = "config",   .type = BLOBMSG_TYPE_STRING },
+   [RPC_I_VALUES]  = { .name = "values",   .type = BLOBMSG_TYPE_TABLE  },
+   [RPC_I_SESSION] = { .name = "ubus_rpc_session",
+   .type = BLOBMSG_TYPE_STRING },
+};
+
+enum {
RPC_D_CONFIG,
RPC_D_SECTION,
RPC_D_TYPE,
@@ -179,6 +208,9 @@ static const struct blobmsg_policy 
rpc_uci_rollback_policy[__RPC_B_MAX] = {
.type = BLOBMSG_TYPE_STRING },
 };
 
+static void
+rpc_uci_merge_delete(struct blob_attr *opt, struct uci_ptr *ptr);
+
 /*
  * Turn uci error state into ubus return code
  */
@@ -729,6 +761,125 @@ rpc_uci_merge_set(struct blob_attr *opt, struct uci_ptr 
*ptr)
 }
 
 static int
+rpc_uci_add_section(struct uci_package *p, struct blob_attr *msg)
+{
+  struct uci_section *s;
+  struct uci_ptr ptr = { 0 };
+  struct blob_attr *cur, *elem;
+  struct blob_attr *tb[__RPC_ADD_MAX];
+  int rem, rem2;
+
+  blobmsg_parse(rpc_uci_add_section_policy, __RPC_ADD_MAX, tb,
+  blobmsg_data(msg), blobmsg_len(msg));
+
+  ptr.package = p->e.name;
+
+  if (!tb[RPC_ADD_TYPE])
+goto out;
+
+  /* add named section */
+  if (tb[RPC_ADD_NAME])
+  {
+ptr.section = blobmsg_data(tb[RPC_ADD_NAME]);
+ptr.value   = blobmsg_data(tb[RPC_ADD_TYPE]);
+ptr.option  = NULL;
+
+if (rpc_uci_lookup(&ptr) || uci_set(cursor, &ptr))
+  goto out;
+  } else {
+if (uci_add_section(cursor, p, blobmsg_data(tb[RPC_ADD_TYPE]), &s) || !s)
+  goto out;
+
+ptr.section = s->e.name;
+  }
+
+  blobmsg_for_each_attr(cur, msg, rem)
+  {
+if (!strcmp(blobmsg_name(cur), ".type") ||
+!strcmp(blobmsg_name(cur), ".anonymous") ||
+!strcmp(blobmsg_name(cur), ".name") ||
+!strcmp(blobmsg_name(cur), ".index"))
+  continue;
+ptr.o = NULL;
+ptr.option = blobmsg_name(cur);
+
+if (rpc_uci_lookup(&ptr) || !ptr.s)
+  continue;
+
+switch (blobmsg_type(cur))
+{
+case BLOBMSG_TYPE_ARRAY:
+  blobmsg_for_each_attr(elem, cur, rem2)
+if (rpc_uci_format_blob(elem, &ptr.value))
+  uci_add_list(cursor, &ptr);
+  break;
+
+default:
+  if (rpc_uci_format_blob(cur, &ptr.value))
+uci_set(cursor, &ptr);
+  break;
+}
+  }
+
+  return 0;
+
+out:
+  return 1;
+}
+
+/* blobmsg example: { "wan": { ".type": "interface", ".name":"wan", 
".anonymous": false }, .. } */
+static int
+rpc_uci_import(struct ubus_context *ctx, struct ubus_object *obj,
+struct ubus_request_data *req, const char *method,
+struct blob_attr *msg)
+{
+  struct blob_attr *tb[__RPC_I_MAX];
+   struct blob_attr *cur;
+   struct uci_package *p = NULL;
+  struct uci_element *e, *tmp;
+   struct uci_ptr ptr = { 0 };
+  int rem;
+
+
+   blobmsg_parse(rpc_uci_import_policy, __RPC_I_MAX, tb,
+   blob_data(msg), blob_len(msg));
+
+   if (!tb[RPC_I_CONFIG] || !tb[RPC_I_VALUES])
+   return UBUS_STATUS_INVALID_ARGUMENT;
+
+   if (!rpc_uci_write_access(tb[RPC_I_SESSION], tb[RPC_I_CONFIG]))
+   return UBUS_STATUS_PERMISSION_DENIED;
+
+   ptr.package = blobmsg_data(tb[RPC_I_CONFIG]);
+
+   if (uci_load(cursor, ptr.package, &p))
+   return rpc_uci_status();
+
+  /* delete all section within package */
+  uci_foreach_element_safe(&p->sections, tmp, e)
+  {
+ptr.s = NULL;
+ptr.section = e->name;
+rpc_uci_merge_delete(NULL, &ptr);
+  }
+
+  /* add new sections */
+  blobm

Re: [OpenWrt-Devel] [PATCH] uci: add import call

2015-08-26 Thread Alexander Couzens
Sorry I forgot an rpcd prefix in the subject. This is a patch for rpcd.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uci: add import call

2015-09-01 Thread Alexander Couzens
similiar to import from uci cli.
import removes all old configs and import the new config.

example:
ubus call uci import \
  '{"config": "dhcp", "values": { "srv": { ".type": "host", ".name": "srv", 
"mac": "00:11:22:33:44:55", "ip": "192.168.1.2" } } }'
---
 uci.c | 152 ++
 1 file changed, 152 insertions(+)

changelog:
- cleanup whitespace/tab indention
- add {} around to make it more readable
- implement same coding style than file.c

diff --git a/uci.c b/uci.c
index 8b5dafd..c59f24d 100644
--- a/uci.c
+++ b/uci.c
@@ -32,6 +32,21 @@ static struct ubus_context *apply_ctx;
 static char apply_sid[RPC_SID_LEN + 1];
 
 enum {
+   RPC_ADD_TYPE,
+   RPC_ADD_NAME,
+   RPC_ADD_ANONYMOUS,
+   RPC_ADD_INDEX,
+   __RPC_ADD_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_add_section_policy[__RPC_ADD_MAX] = 
{
+   [RPC_ADD_TYPE]  = { .name = ".type",   .type = 
BLOBMSG_TYPE_STRING },
+   [RPC_ADD_NAME]  = { .name = ".name",   .type = 
BLOBMSG_TYPE_STRING },
+   [RPC_ADD_ANONYMOUS] = { .name = ".anonymous",  .type = 
BLOBMSG_TYPE_BOOL   },
+   [RPC_ADD_INDEX] = { .name = ".index",  .type = 
BLOBMSG_TYPE_INT32  },
+};
+
+enum {
RPC_G_CONFIG,
RPC_G_SECTION,
RPC_G_OPTION,
@@ -90,6 +105,20 @@ static const struct blobmsg_policy 
rpc_uci_set_policy[__RPC_S_MAX] = {
 };
 
 enum {
+   RPC_I_CONFIG,
+   RPC_I_VALUES,
+   RPC_I_SESSION,
+   __RPC_I_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_import_policy[__RPC_I_MAX] = {
+   [RPC_I_CONFIG]  = { .name = "config",   .type = BLOBMSG_TYPE_STRING },
+   [RPC_I_VALUES]  = { .name = "values",   .type = BLOBMSG_TYPE_TABLE  },
+   [RPC_I_SESSION] = { .name = "ubus_rpc_session",
+   .type = BLOBMSG_TYPE_STRING },
+};
+
+enum {
RPC_D_CONFIG,
RPC_D_SECTION,
RPC_D_TYPE,
@@ -179,6 +208,9 @@ static const struct blobmsg_policy 
rpc_uci_rollback_policy[__RPC_B_MAX] = {
.type = BLOBMSG_TYPE_STRING },
 };
 
+static void
+rpc_uci_merge_delete(struct blob_attr *opt, struct uci_ptr *ptr);
+
 /*
  * Turn uci error state into ubus return code
  */
@@ -659,8 +691,10 @@ rpc_uci_add(struct ubus_context *ctx, struct ubus_object 
*obj,
{
case BLOBMSG_TYPE_ARRAY:
blobmsg_for_each_attr(elem, cur, rem2)
+   {
if (rpc_uci_format_blob(elem, 
&ptr.value))
uci_add_list(cursor, &ptr);
+   }
break;
 
default:
@@ -729,6 +763,123 @@ rpc_uci_merge_set(struct blob_attr *opt, struct uci_ptr 
*ptr)
 }
 
 static int
+rpc_uci_add_section(struct uci_package *p, struct blob_attr *msg)
+{
+   struct uci_section *s;
+   struct uci_ptr ptr = { 0 };
+   struct blob_attr *cur, *elem;
+   struct blob_attr *tb[__RPC_ADD_MAX];
+   int rem, rem2;
+
+   blobmsg_parse(rpc_uci_add_section_policy, __RPC_ADD_MAX, tb,
+ blobmsg_data(msg), blobmsg_len(msg));
+
+   ptr.package = p->e.name;
+
+   if (!tb[RPC_ADD_TYPE])
+   goto out;
+
+   /* add named section */
+   if (tb[RPC_ADD_NAME])
+   {
+   ptr.section = blobmsg_data(tb[RPC_ADD_NAME]);
+   ptr.value = blobmsg_data(tb[RPC_ADD_TYPE]);
+   ptr.option = NULL;
+
+   if (rpc_uci_lookup(&ptr) || uci_set(cursor, &ptr))
+   goto out;
+   } else {
+   if (uci_add_section(cursor, p, blobmsg_data(tb[RPC_ADD_TYPE]), 
&s) || !s)
+   goto out;
+
+   ptr.section = s->e.name;
+   }
+
+   blobmsg_for_each_attr(cur, msg, rem)
+   {
+   if (!strcmp(blobmsg_name(cur), ".type") ||
+   !strcmp(blobmsg_name(cur), ".anonymous") ||
+   !strcmp(blobmsg_name(cur), ".name") ||
+   !strcmp(blobmsg_name(cur), ".index"))
+   continue;
+   ptr.o = NULL;
+   ptr.option = blobmsg_name(cur);
+
+   if (rpc_uci_lookup(&ptr) || !ptr.s)
+   continue;
+
+   switch (blobmsg_type(cur))
+   {
+   case BLOBMSG_TYPE_ARRAY:
+   blobmsg_for_each_attr(elem, cur, rem2)
+   if (rpc_uci_format_blob(elem, 
&ptr.value))
+   uci_add_list(cursor, &ptr);
+   break;
+
+   default:
+   if (rpc_uci_format_blob(cur, &ptr.value))
+   uci_set(cursor, &ptr);
+ 

Re: [OpenWrt-Devel] [PATCH 2/9] ar71xx: PowerCloud CAP324 image generation

2015-09-07 Thread Alexander Couzens

> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile index 8f609de..15bb6a3 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile

Could you migrate to the new image Makefile format?
Like the tplink wdr4300 is using.

IMHO: I'm not sure if we need 2 builds for the devices, when only the
layout is the difference.
When using the nocloud layout is it possible to go back to the OEM
firmware?

Best,
lynxis


pgpfvbCnk8ffz.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 8/9] ar71xx: PowerCloud CR5000 image generation

2015-09-07 Thread Alexander Couzens
same as for CAP324


pgpVmONdjKf6J.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 5/9] ar71xx: PowerCloud CR3000 image generation

2015-09-07 Thread Alexander Couzens
same as for CAP324
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 01/13] Makefile: set timezone to UTC

2016-01-25 Thread Alexander Couzens
From: bryan newbold 

This is necessary for reproducible image builds.

Signed-off-by: bryan newbold 
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a12e3ea..8ba2bfc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@
 TOPDIR:=${CURDIR}
 LC_ALL:=C
 LANG:=C
-export TOPDIR LC_ALL LANG
+TZ:=UTC
+export TOPDIR LC_ALL LANG TZ
 
 empty:=
 space:= $(empty) $(empty)
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 00/13] improve reproducible builds

2016-01-25 Thread Alexander Couzens
Hi,

the following patches improve the reproducible builds of openwrt.
Monthly test build to track the state of reproducibility can be found on
https://tests.reproducible-builds.org/openwrt/openwrt.html

Best,
lynxis

Alexander Couzens (8):
  busybox: disable timestamp in version
  include/image: introduce SOURCE_DATE_EPOCH variable in image context
  include/kernel: set build timestamp to SOURCE_DATE_EPOCH if available
  package/Makefile: override opkg installation time when
SOURCE_DATE_EPOCH set
  include/image: don't save gzip name/timestamp metadata
  include/image: use SOURCE_DATE_EPOCH if set for squashfs + ext4 images
  ar71xx/image: use SOURCE_DATE_EPOCH for mksquashfs-lzma
  Makefile: fix --mtime usage with SOURCE_DATE_EPOCH fixup

bryan newbold (5):
  Makefile: set timezone to UTC
  include/kernel: sort module lists for reproducibility
  include/kernel: add custom USER/DOMAIN config options
  tools/mkimage: backport SOURCE_DATE_EPOCH for reproducible builds
  build system: have tar use $SOURCE_DATE_EPOCH for --mtime

 Makefile   |   3 +-
 config/Config-kernel.in|  16 
 include/image.mk   |  11 ++-
 include/kernel-build.mk|   6 +-
 include/kernel-defaults.mk |   2 +
 include/kernel.mk  |  10 +-
 package/Makefile   |   3 +
 package/utils/busybox/Makefile |   3 +
 scripts/getsource_date_epoch.sh|  31 +++
 scripts/sysupgrade-nand.sh |   7 +-
 target/linux/ar71xx/image/Makefile |   7 +-
 .../090-reproducible-SOURCE_DATE_EPOCH.patch   | 102 +
 12 files changed, 191 insertions(+), 10 deletions(-)
 create mode 100755 scripts/getsource_date_epoch.sh
 create mode 100644 
tools/mkimage/patches/090-reproducible-SOURCE_DATE_EPOCH.patch

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


[OpenWrt-Devel] [PATCH 02/13] busybox: disable timestamp in version

2016-01-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 package/utils/busybox/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 5ca4363..95e785b 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -57,6 +57,9 @@ endef
 
 BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
 
+# don't create a version string containing the actual timestamp
+export KCONFIG_NOTIMESTAMP=1
+
 define Build/Configure
rm -f $(PKG_BUILD_DIR)/.configured*
grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# 
\)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > 
$(PKG_BUILD_DIR)/.config
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/13] include/image: introduce SOURCE_DATE_EPOCH variable in image context

2016-01-25 Thread Alexander Couzens
SOURCE_DATE_EPOCH is the date of the last modified file using git/svn
as date source.
See https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Alexander Couzens 
---
 include/image.mk|  1 +
 scripts/getsource_date_epoch.sh | 31 +++
 2 files changed, 32 insertions(+)
 create mode 100755 scripts/getsource_date_epoch.sh

diff --git a/include/image.mk b/include/image.mk
index 4eee4ad..a53bea8 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -14,6 +14,7 @@ include $(INCLUDE_DIR)/version.mk
 override MAKE:=$(_SINGLE)$(SUBMAKE)
 override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
 
+export SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/getsource_date_epoch.sh)
 KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
 DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
diff --git a/scripts/getsource_date_epoch.sh b/scripts/getsource_date_epoch.sh
new file mode 100755
index 000..bfe9c4b
--- /dev/null
+++ b/scripts/getsource_date_epoch.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+export LANG=C
+export LC_ALL=C
+[ -n "$TOPDIR" ] && cd $TOPDIR
+
+try_version() {
+   [ -f version.date ] || return 1
+   SOURCE_DATE_EPOCH="$(cat version.date)"
+   [ -n "$SOURCE_DATE_EPOCH" ]
+}
+
+try_svn() {
+   [ -d .svn ] || return 1
+   SOURCE_DATE_EPOCH="$(date -d "$(svn info svn://svn.openwrt.org/openwrt/ 
--show-item last-changed-date)" +%s)"
+   [ -n "$SOURCE_DATE_EPOCH" ]
+}
+
+try_git() {
+   [ -e .git ] || return 1
+   SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
+   [ -n "$SOURCE_DATE_EPOCH" ]
+}
+
+try_hg() {
+   [ -d .hg ] || return 1
+   SOURCE_DATE_EPOCH=""
+   [ -n "$SOURCE_DATE_EPOCH" ]
+}
+
+try_version || try_svn || try_git || try_hg || SOURCE_DATE_EPOCH=""
+echo "$SOURCE_DATE_EPOCH"
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 06/13] tools/mkimage: backport SOURCE_DATE_EPOCH for reproducible builds

2016-01-25 Thread Alexander Couzens
From: bryan newbold 

This pulls in Paul Kocialkowski's SOURCE_DATE_EPOCH support patch for u-boot,
which landed upstream circa July 2015. Note that this "host" u-boot repo is
only used to compile the 'mkimage' utility, and isn't used to actually compile
a bootloader for any target.

This patch could be removed if/when the host u-boot package is updated to a
contemporary version (but there doesn't seem to be any motivation/need to do
so).

Signed-off-by: bryan newbold 
---
 .../090-reproducible-SOURCE_DATE_EPOCH.patch   | 102 +
 1 file changed, 102 insertions(+)
 create mode 100644 
tools/mkimage/patches/090-reproducible-SOURCE_DATE_EPOCH.patch

diff --git a/tools/mkimage/patches/090-reproducible-SOURCE_DATE_EPOCH.patch 
b/tools/mkimage/patches/090-reproducible-SOURCE_DATE_EPOCH.patch
new file mode 100644
index 000..f9c6360
--- /dev/null
+++ b/tools/mkimage/patches/090-reproducible-SOURCE_DATE_EPOCH.patch
@@ -0,0 +1,102 @@
+From f3f431a712729a1af94d01bd1bfde17a252ff02c Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski 
+Date: Sun, 26 Jul 2015 18:48:15 +0200
+Subject: [PATCH] Reproducible U-Boot build support, using SOURCE_DATE_EPOCH
+
+In order to achieve reproducible builds in U-Boot, timestamps that are defined
+at build-time have to be somewhat eliminated. The SOURCE_DATE_EPOCH environment
+variable allows setting a fixed value for those timestamps.
+
+Simply by setting SOURCE_DATE_EPOCH to a fixed value, a number of targets can 
be
+built reproducibly. This is the case for e.g. sunxi devices.
+
+However, some other devices might need some more tweaks, especially regarding
+the image generation tools.
+
+Signed-off-by: Paul Kocialkowski 
+---
+ Makefile  |  7 ---
+ README| 12 
+ tools/default_image.c | 21 -
+ 3 files changed, 36 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5e33043..394ed09 100644
+--- a/Makefile
 b/Makefile
+@@ -1110,8 +1110,9 @@ define filechk_version.h
+ endef
+ 
+ define filechk_timestamp.h
+-  (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
+-  LC_ALL=C date +'#define U_BOOT_TIME "%T"')
++  (SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
++  LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d 
%C%y"'; \
++  LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"')
+ endef
+ 
+ $(version_h): include/config/uboot.release FORCE
+diff --git a/README b/README
+index 4e0ff9f..1bcb63c 100644
+--- a/README
 b/README
+@@ -5081,6 +5081,18 @@ This firmware often needs to be loaded during U-Boot 
booting.
+ - CONFIG_SYS_MEM_TOP_HIDE_MIN
+   Define minimum DDR size to be hided from top of the DDR memory
+ 
++Reproducible builds
++---
++
++In order to achieve reproducible builds, timestamps used in the U-Boot build
++process have to be set to a fixed value.
++
++This is done using the SOURCE_DATE_EPOCH environment variable.
++SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a 
configuration
++option for U-Boot or an environment variable in U-Boot.
++
++SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in 
UTC.
++
+ Building the Software:
+ ==
+ 
+diff --git a/tools/default_image.c b/tools/default_image.c
+index cf5c0d4..18940af 100644
+--- a/tools/default_image.c
 b/tools/default_image.c
+@@ -88,6 +88,9 @@ static void image_set_header(void *ptr, struct stat *sbuf, 
int ifd,
+   struct image_tool_params *params)
+ {
+   uint32_t checksum;
++  char *source_date_epoch;
++  struct tm *time_universal;
++  time_t time;
+ 
+   image_header_t * hdr = (image_header_t *)ptr;
+ 
+@@ -100,9 +103,25 @@ static void image_set_header(void *ptr, struct stat 
*sbuf, int ifd,
+   sizeof(image_header_t)),
+   sbuf->st_size - sizeof(image_header_t));
+ 
++  source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++  if (source_date_epoch != NULL) {
++  time = (time_t) strtol(source_date_epoch, NULL, 10);
++
++  time_universal = gmtime(&time);
++  if (time_universal == NULL) {
++  fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
++  __func__);
++  time = 0;
++  } else {
++  time = mktime(time_universal);
++  }
++  } else {
++  time = sbuf->st_mtime;
++  }
++
+   /* Build new header */
+   image_set_magic(hdr, params->magic);
+-  image_set_time(hdr, sbuf->st_mtime);
++  image_set_time(hdr, time);
+   image_set_size(hdr, sbuf->st_size - sizeof(image_header_t));
+   image_set_load(hdr, params->addr);
+   image_set_ep(hdr, params->ep);
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.or

[OpenWrt-Devel] [PATCH 03/13] include/kernel: sort module lists for reproducibility

2016-01-25 Thread Alexander Couzens
From: bryan newbold 

This is to get reproducible builds of, eg, the kmod-sched ipkg.

Locale preferences can change build order, but the locale is already been
defined for the entire build process, so it doesn't need to be specified here.

Signed-off-by: bryan newbold 
---
 include/kernel.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index bb3c972..432e8ce 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -90,7 +90,7 @@ define ModuleAutoLoad
mods="1"; \
boot="2"; \
shift 2; \
-   for mod in mods; do \
+   for mod in $(sort mods); do \
mkdir -p $(2)/etc/modules.d; \
echo "mod" >> $(2)/etc/modules.d/$(1); \
done; \
@@ -107,7 +107,7 @@ define ModuleAutoLoad
mods="2"; \
boot="3"; \
shift 3; \
-   for mod in mods; do \
+   for mod in $(sort mods); do \
mkdir -p $(2)/etc/modules.d; \
echo "mod" >> 
$(2)/etc/modules.d/priority-$(1); \
done; \
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 07/13] include/kernel: set build timestamp to SOURCE_DATE_EPOCH if available

2016-01-25 Thread Alexander Couzens
There is no additional information in the build timestamp.
As long we have no information on the kernel timestamp,
use as constant base for this timestamp the OpenWrt repository.

Signed-off-by: Alexander Couzens 
---
 include/kernel.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/kernel.mk b/include/kernel.mk
index 432e8ce..2f477cf 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -5,6 +5,8 @@
 # See /LICENSE for more information.
 #
 
+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/getsource_date_epoch.sh)
+
 ifeq ($(__target_inc),)
   include $(INCLUDE_DIR)/target.mk
 endif
@@ -21,6 +23,10 @@ else
 
   LINUX_KMOD_SUFFIX=ko
 
+  ifneq (,$(SOURCE_DATE_EPOCH))
+export KBUILD_BUILD_TIMESTAMP=$(shell date -d @$(SOURCE_DATE_EPOCH))
+  endif
+
   ifneq (,$(findstring uml,$(BOARD)))
 KERNEL_CC?=$(HOSTCC)
 KERNEL_CROSS?=
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/13] package/Makefile: override opkg installation time when SOURCE_DATE_EPOCH set

2016-01-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 package/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/Makefile b/package/Makefile
index 12bd0ae..0c93607 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -7,6 +7,8 @@
 
 curdir:=package
 
+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/getsource_date_epoch.sh)
+
 include $(INCLUDE_DIR)/feeds.mk
 
 -include $(TMP_DIR)/.packagedeps
@@ -117,6 +119,7 @@ $(curdir)/install: $(TMP_DIR)/.build 
$(curdir)/system/opkg/host/install
IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) 
./etc/rc.common $$script enable; \
done || true \
)
+   $(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: 
$(SOURCE_DATE_EPOCH)/" $(TARGET_DIR)/usr/lib/opkg/status)
@-find $(TARGET_DIR) -name CVS   | $(XARGS) rm -rf
@-find $(TARGET_DIR) -name .svn  | $(XARGS) rm -rf
@-find $(TARGET_DIR) -name '.#*' | $(XARGS) rm -f
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 09/13] build system: have tar use $SOURCE_DATE_EPOCH for --mtime

2016-01-25 Thread Alexander Couzens
From: bryan newbold 

The --mtime argument to 'tar' sets the modification time for all files within
the archive, which determines the timestamp files will get when they are
extracted. In this case, rootfs and other tarballs will get mtimes which
correspond to the last commit timestamp of the build system, as reported by
git/subversion.

This is a step towards reproducible image builds.

Signed-off-by: bryan newbold 
Signed-off-by: Alexander Couzens 
---
 include/image.mk   | 8 ++--
 include/kernel-build.mk| 6 +-
 scripts/sysupgrade-nand.sh | 7 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index a53bea8..d471788 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -187,7 +187,8 @@ ifneq ($(CONFIG_NAND_SUPPORT),)
[ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" 
"$(KDIR_TMP)/sysupgrade-$(1)/root"
[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
(cd "$(KDIR_TMP)"; $(TAR) cvf \
-   "$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" 
sysupgrade-$(1))
+   "$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" 
sysupgrade-$(1) \
+   $(if 
$(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)")
endef
 
 # $(1) board name
@@ -249,7 +250,10 @@ define Image/mkfs/cpiogz
 endef
 
 define Image/mkfs/targz
-   $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz --numeric-owner 
--owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
+   $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz \
+   --numeric-owner --owner=0 --group=0 --sort=name \
+   $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+   -C $(TARGET_DIR)/ .
 endef
 
 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 9abfd54..39bdd01 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -18,6 +18,8 @@ include $(INCLUDE_DIR)/download.mk
 include $(INCLUDE_DIR)/quilt.mk
 include $(INCLUDE_DIR)/kernel-defaults.mk
 
+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/getsource_date_epoch.sh)
+
 define Kernel/Prepare
$(call Kernel/Prepare/Default)
 endef
@@ -54,7 +56,9 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
$(STAGING_DIR_ROOT)/lib/modules/$(LINUX_VERSION)/* \
$(KERNEL_BUILD_DIR)/debug/modules/
$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) 
$(KERNEL_CROSS)strip --only-keep-debug
-   $(TAR) c -C $(KERNEL_BUILD_DIR) debug | bzip2 -c -9 > 
$(BIN_DIR)/kernel-debug.tar.bz2
+   $(TAR) c -C $(KERNEL_BUILD_DIR) debug \
+   $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+   | bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2
   endef
 endif
 
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
index 92b326c..73881e0 100755
--- a/scripts/sysupgrade-nand.sh
+++ b/scripts/sysupgrade-nand.sh
@@ -56,7 +56,12 @@ echo "BOARD=${board}" > 
"${tmpdir}/sysupgrade-${board}/CONTROL"
 [ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
 [ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
 
-(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board})
+mtime=""
+if [ -n "$SOURCE_DATE_EPOCH" ]; then
+   mtime="--mtime=${SOURCE_DATE_EPOCH}"
+fi
+
+(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
 err="$?"
 if [ -e "$tmpdir/sysupgrade.tar" ]; then
cp "$tmpdir/sysupgrade.tar" "$outfile"
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 04/13] include/kernel: add custom USER/DOMAIN config options

2016-01-25 Thread Alexander Couzens
From: bryan newbold 

These allow the generated kernel's build metadata to be defined explicitly.
This metadata is reported, eg, at boot time and in `uname -a` on running
systems. If the variables aren't configured, the current build system username
and hostname are used as normal.

The motivation for this option is to achive reproducible (bit-for-bit
identical) kernel builds of official openwrt releases.

Signed-off-by: bryan newbold 
---
 config/Config-kernel.in| 16 
 include/kernel-defaults.mk |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 6e79bae..c93bbde 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -4,6 +4,22 @@
 # See /LICENSE for more information.
 #
 
+config KERNEL_BUILD_USER
+   string "Custom Kernel Build User Name"
+   default ""
+   help
+ Sets the Kernel build user string, which for example will be returned
+ by 'uname -a' on running systems.
+ If not set, uses system user at build time.
+
+config KERNEL_BUILD_DOMAIN
+   string "Custom Kernel Build Domain Name"
+   default ""
+   help
+ Sets the Kernel build domain string, which for example will be
+ returned by 'uname -a' on running systems.
+ If not set, uses system hostname at build time.
+
 config KERNEL_PRINTK
bool "Enable support for printk"
default y
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 052b2b3..63f996a 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -10,6 +10,8 @@ KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
CROSS_COMPILE="$(KERNEL_CROSS)" \
ARCH="$(LINUX_KARCH)" \
KBUILD_HAVE_NLS=no \
+   KBUILD_BUILD_USER="$(CONFIG_KERNEL_BUILD_USER)" \
+   KBUILD_BUILD_HOST="$(CONFIG_KERNEL_BUILD_DOMAIN)" \
CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
$(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID))
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 11/13] include/image: use SOURCE_DATE_EPOCH if set for squashfs + ext4 images

2016-01-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 include/image.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index bf400f4..044dd1a 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -174,7 +174,7 @@ $(eval $(foreach S,$(JFFS2_BLOCKSIZE),$(call 
Image/mkfs/jffs2/template,$(S
 $(eval $(foreach S,$(NAND_BLOCKSIZE),$(call 
Image/mkfs/jffs2-nand/template,$(S
 
 define Image/mkfs/squashfs
-   $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs 
-nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors 
$(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1)
+   $(STAGING_DIR_HOST)/bin/mksquashfs4 $(TARGET_DIR) $(KDIR)/root.squashfs 
-nopad -noappend -root-owned -comp $(SQUASHFSCOMP) $(SQUASHFSOPT) -processors 
$(if $(CONFIG_PKG_BUILD_JOBS),$(CONFIG_PKG_BUILD_JOBS),1) $(if 
$(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
 endef
 
 # $(1): board name
@@ -263,6 +263,7 @@ define Image/mkfs/ext4
-i $(CONFIG_TARGET_EXT4_MAXINODE) \
-m $(CONFIG_TARGET_EXT4_RESERVED_PCT) \
$(if $(CONFIG_TARGET_EXT4_JOURNAL),,-J) \
+   $(if $(SOURCE_DATE_EPOCH),-t $(SOURCE_DATE_EPOCH)) \
$(KDIR)/root.ext4 $(TARGET_DIR)/
 endef
 
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 10/13] include/image: don't save gzip name/timestamp metadata

2016-01-25 Thread Alexander Couzens
Signed-off-by: bryan newbold 
---
 include/image.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index d471788..bf400f4 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -250,10 +250,9 @@ define Image/mkfs/cpiogz
 endef
 
 define Image/mkfs/targz
-   $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz \
-   --numeric-owner --owner=0 --group=0 --sort=name \
+   $(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
$(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
-   -C $(TARGET_DIR)/ .
+   -C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
 endef
 
 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 12/13] ar71xx/image: use SOURCE_DATE_EPOCH for mksquashfs-lzma

2016-01-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 080d960..5768cbd 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -22,7 +22,9 @@ define Build/netgear-squashfs
cp $@ $@.fs/image/uImage
$(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
$@.fs $@.squashfs \
-   -noappend -root-owned -be -b 65536
+   -noappend -root-owned -be -b 65536 \
+   $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
+
dd if=/dev/zero bs=1k count=1 >> $@.squashfs
mkimage \
-A mips -O linux -T filesystem -C none \
@@ -2064,7 +2066,8 @@ define Image/Build/Netgear/buildkernel
cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
$(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
$(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
-   -noappend -root-owned -be -b 65536
+   -noappend -root-owned -be -b 65536 \
+   $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
( \
cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
dd if=/dev/zero bs=1k count=1 \
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 13/13] Makefile: fix --mtime usage with SOURCE_DATE_EPOCH fixup

2016-01-25 Thread Alexander Couzens
---
 include/image.mk   | 4 ++--
 include/kernel-build.mk| 2 +-
 scripts/sysupgrade-nand.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 044dd1a..bfdfab9 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -188,7 +188,7 @@ ifneq ($(CONFIG_NAND_SUPPORT),)
[ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel"
(cd "$(KDIR_TMP)"; $(TAR) cvf \
"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" 
sysupgrade-$(1) \
-   $(if 
$(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)")
+   $(if 
$(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)")
endef
 
 # $(1) board name
@@ -251,7 +251,7 @@ endef
 
 define Image/mkfs/targz
$(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
-   $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+   $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
 endef
 
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 39bdd01..7b951ba 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -57,7 +57,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
$(KERNEL_BUILD_DIR)/debug/modules/
$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) 
$(KERNEL_CROSS)strip --only-keep-debug
$(TAR) c -C $(KERNEL_BUILD_DIR) debug \
-   $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \
+   $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
| bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2
   endef
 endif
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
index 73881e0..45b17da 100755
--- a/scripts/sysupgrade-nand.sh
+++ b/scripts/sysupgrade-nand.sh
@@ -58,7 +58,7 @@ echo "BOARD=${board}" > 
"${tmpdir}/sysupgrade-${board}/CONTROL"
 
 mtime=""
 if [ -n "$SOURCE_DATE_EPOCH" ]; then
-   mtime="--mtime=${SOURCE_DATE_EPOCH}"
+   mtime="--mtime=@${SOURCE_DATE_EPOCH}"
 fi
 
 (cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] kernel/gpio_keys: load module on pre-init

2016-02-25 Thread Alexander Couzens
fix rescue mode on wdr4900

Signed-off-by: Alexander Couzens 
---
 package/kernel/linux/modules/input.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/input.mk 
b/package/kernel/linux/modules/input.mk
index 539d270..23ead51 100644
--- a/package/kernel/linux/modules/input.mk
+++ b/package/kernel/linux/modules/input.mk
@@ -75,7 +75,7 @@ define KernelPackage/input-gpio-keys
CONFIG_KEYBOARD_GPIO \
CONFIG_INPUT_KEYBOARD=y
   FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys.ko
-  AUTOLOAD:=$(call AutoProbe,gpio_keys)
+  AUTOLOAD:=$(call AutoProbe,gpio_keys,1)
 endef
 
 define KernelPackage/input-gpio-keys/description
-- 
2.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] mpc85xx/tl-wdr4900: correct address of the gpio controller

2016-02-25 Thread Alexander Couzens
since linux 3.19 the address of the gpio-controller changed

Signed-off-by: Alexander Couzens 
---
 target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts 
b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 322273e..2ad58d3 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -82,7 +82,7 @@
};
};
 
-   gpio0: gpio-controller@f000 {
+   gpio0: gpio-controller@fc00 {
};
 
usb@22000 {
-- 
2.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] hotplug-preinit: remove superfluous `and`

2016-02-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 package/system/procd/files/hotplug-preinit.json | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/system/procd/files/hotplug-preinit.json 
b/package/system/procd/files/hotplug-preinit.json
index 614b104..58afc6c 100644
--- a/package/system/procd/files/hotplug-preinit.json
+++ b/package/system/procd/files/hotplug-preinit.json
@@ -12,9 +12,7 @@
],
}, ],
[ "if",
-   [ "and",
-   [ "eq", "SUBSYSTEM", "button" ],
-   ],
+   [ "eq", "SUBSYSTEM", "button" ],
[ "exec", "/etc/rc.button/failsafe" ]
],
 ]
-- 
2.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [RFC] ar71xx: migrate cpe510 to new build steps

2016-02-28 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 92 ++
 1 file changed, 44 insertions(+), 48 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index cb11104..b7b24df 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -73,6 +73,32 @@ define Build/mktplinkfw-initramfs
@mv $@.new $@
 endef
 
+define Build/tplink-safeloader
+   -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
+   -B $(TPLINK_BOARD_NAME) \
+   -V $(REVISION) \
+   -k $(word 1,$^) \
+   -r $@ \
+   -o $@.new \
+   $2 \
+   -j \
+   $(if $(findstring sysupgrade,$1),-S) && mv $@.new $@ || rm -f $@
+endef
+
+# using the CMDLINE here would bloat the loader with 512kb
+# models like the cpe510 doesn't support such big kernels
+define Build/loader-elf
+   rm -rf $@.src
+   $(MAKE) -C lzma-loader \
+   PKG_BUILD_DIR="$@.src" \
+   TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
+   BOARD="$(BOARDNAME)" \
+   LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
+   $(1) compile loader.elf
+   mv "$@.elf" "$@"
+   rm -rf $@.src
+endef
+
 define Build/loader-common
rm -rf $@.src
$(MAKE) -C lzma-loader \
@@ -93,6 +119,10 @@ define Build/loader-kernel
$(call Build/loader-common,LOADER_DATA="$@")
 endef
 
+define Build/loader-kernel-elf
+   $(call Build/loader-elf,LOADER_DATA="$@")
+endef
+
 define Build/loader-okli
dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
cat "$@" >> "$@.new"
@@ -103,7 +133,7 @@ define Build/copy-file
cat "$(1)" > "$@"
 endef
 
-DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
TPLINK_HEADER_VERSION
+DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
TPLINK_HEADER_VERSION TPLINK_BOARD_NAME
 
 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
 # UBNT_TYPE e.g. one of (BZ, XM, XW)
@@ -310,6 +340,19 @@ $(Device/tplink)
   IMAGE_SIZE := 15872k
 endef
 
+define Device/cpe210-220-510-520
+  MTDPARTS := 
spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x4(firmware)
+  IMAGE_SIZE := 7680k
+  BOARDNAME := CPE510
+  TPLINK_BOARD_NAME := CPE510
+  KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel-elf
+  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | 
loader-kernel-elf
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
+TARGET_DEVICES += cpe210-220-510-520
+
 define Device/tl-wdr4300-v1
 $(Device/tplink-8mlzma)
   BOARDNAME = TL-WDR4300
@@ -1491,28 +1534,6 @@ define Image/BuildLoader
 endef
 
 #
-# Embed patched lzma-compressed kernel inside lzma-loader.
-#
-# Specifying the command line via the lzma-loader doesn't work with some
-# models (like the TP-LINK CPE series), so this version first patches the
-# command line in the image and then builds the loader around it.
-#
-# $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
-# $(2), suffix of target file to build, e.g. bin, gz, elf
-# $(3), kernel command line to pass from lzma-loader to kernel
-# $(4), unused here
-# $(5), suffix of kernel filename, e.g. -initramfs, or empty
-define Image/BuildLoaderPatched
-   $(call PatchKernelLzma,$(1),$(3))
-   -rm -rf $(KDIR)/lzma-loader
-   $(LOADER_MAKE) LOADER=loader-$(1).$(2) \
-   LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
-   LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" 
BOARD="$(1)" \
-   compile loader.$(2)
-   -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
-endef
-
-#
 # Build lzma-loader alone which will search for lzma-compressed kernel 
identified by
 # uImage header with magic "OKLI" at boot time.
 #
@@ -1561,7 +1582,6 @@ 
cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmwa
 
cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 
cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
 
cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa(firmware)
-cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x4(firmware)
 
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),

Re: [OpenWrt-Devel] [PATCH v2 05/11] ltq-vdsl-app: make the dsl_control application stop cleanly

2016-02-28 Thread Alexander Couzens
On Sun, 28 Feb 2016 19:44:28 +0100
Hauke Mehrtens  wrote:

> I am not calling dsl_cmd because I want to ignore the lock, quit
> should also be send when someone else is accessing it. I saw that some
> other call was stuck here and all following calls were stuck in the
> dsl_cmd lock.
> 
> Signed-off-by: Hauke Mehrtens 
> ---
>  package/network/config/ltq-vdsl-app/files/dsl_control | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control
> b/package/network/config/ltq-vdsl-app/files/dsl_control index
> d7ba622..9c8dbad 100644 ---
> a/package/network/config/ltq-vdsl-app/files/dsl_control +++
> b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -219,6
> +219,7 @@ start_service() { }
>  
>  stop_service() {

why not adding a comment about the lock?

> + echo quit > /tmp/pipe/dsl_cpe0_cmd 
>   DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
>   DSL_INTERFACE_STATUS="DOWN" \
>   /sbin/dsl_notify.sh



-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpXyWIZX1X9s.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] current state of kirkwood target in trunk?

2016-03-01 Thread Alexander Couzens
On Mon, 29 Feb 2016 22:57:46 +0100
Martin Mueller  wrote:

> So my question is, what is the supposed way to get openwrt on the
> goflex? In case the ubifs is correct, in which direction do I need to
> search to get it running.

Hi,

I got similiar problems and migrated the dockstar to ubi(kernel,squashfs,ubifs).
It boots on my dockstar with a fresh compiled and flashed first stage 
bootloader.

Is there a better solution than installing the factory image through an 
initramfs?


tftpboot 0x8000 openwrt-kirkwood-dockstar-initramfs-kernel.bin
bootz 0x8000

# if ubidriver already found an ubi, detach first
ubidetach -p /dev/mtd3
# format it
ubiformat -f /tmp/openwrt-kirkwood-dockstar-squashfs-factory.bin /dev/mtd3

The goflex is coming next.
Sending the patch series for the dockstar later.

Best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpvBRYr7VFca.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] kirkwood: add feature devicetree

2016-03-02 Thread Alexander Couzens
this platform already uses devicetree

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/kirkwood/Makefile b/target/linux/kirkwood/Makefile
index 2db7e39..4f9fa4f 100644
--- a/target/linux/kirkwood/Makefile
+++ b/target/linux/kirkwood/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=kirkwood
 BOARDNAME:=Marvell Kirkwood
-FEATURES:=targz usb jffs2_nand nand ubifs squashfs
+FEATURES:=targz usb jffs2_nand nand ubifs squashfs dt
 CPU_TYPE:=xscale
 MAINTAINER:=Luka Perkov 
 
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] kirkwood: add DEVICE_VAR KERNEL_IN_UBI for kernel as volume in ubi images

2016-03-02 Thread Alexander Couzens
depending on KERNEL_IN_UBI, the image.mk will create a ubi volume for the kernel

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/image/Makefile | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index 24cb317..9a2c2e4 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -10,7 +10,7 @@ NAND_BLOCKSIZE := 2048-128k
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE
+DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE 
KERNEL_IN_UBI
 KERNEL_LOADADDR:=0x8000
 TARGET_DEVICES = linksys-audi linksys-viper
 
@@ -18,6 +18,21 @@ define Device/Default
   KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
   KERNEL := kernel-bin | append-dtb | uImage none
   KERNEL_NAME := zImage
+  KERNEL_IN_UBI :=
+endef
+
+define Device/dockstar
+  DEVICE_DTS := kirkwood-dockstar
+  PAGESIZE := 2048
+  SUBPAGESIZE := 512
+  BLOCKSIZE := 128KiB
+  FILESYSTEMS := squashfs
+  PROFILES := Generic DOCKSTAR
+  IMAGES := factory.bin sysupgrade.tar
+  IMAGE/factory.bin := append-ubi
+  IMAGE/sysupgrade.tar := sysupgrade-nand
+  KERNEL_IN_UBI := 1
+  KERNEL := kernel-bin | append-dtb
 endef
 
 define Device/linksys-audi
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] kirkwood/dockstar: rename partition into ubi to use auto detection of target mtd

2016-03-02 Thread Alexander Couzens
the kernel tries to use "ubi" or "data" labeled partition to find it's root 
filesystem.
dockstar don't need anymore mtdparts= nor root= bootarguments

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/patches-3.18/140-dockstar.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/kirkwood/patches-3.18/140-dockstar.patch 
b/target/linux/kirkwood/patches-3.18/140-dockstar.patch
index b1ad669..f66e19d 100644
--- a/target/linux/kirkwood/patches-3.18/140-dockstar.patch
+++ b/target/linux/kirkwood/patches-3.18/140-dockstar.patch
@@ -25,7 +25,7 @@
 -  label = "data";
 -  reg = <0x050 0xfb0>;
 +  partition@20 {
-+  label = "root";
++  label = "ubi";
 +  reg = <0x20 0xfe0>;
};
  };
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/5] uboot/kirkwood: correct mtdparts + cmdline for new ubifs on dockstar

2016-03-02 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 package/boot/uboot-kirkwood/patches/110-dockstar.patch | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch 
b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
index 4c9ccdf..469dfcd 100644
--- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch
+++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
@@ -32,7 +32,7 @@
  #include 
  #define CONFIG_CMD_DHCP
  #define CONFIG_CMD_ENV
-@@ -38,55 +43,58 @@
+@@ -38,55 +43,52 @@
  #define CONFIG_CMD_NAND
  #define CONFIG_CMD_PING
  #define CONFIG_CMD_USB
@@ -83,20 +83,16 @@
 -  "bootm 0x80 0x110"
 -
 -#define CONFIG_MTDPARTS   
"mtdparts=orion_nand:1m(uboot),-(root)\0"
-+  "ubi part root; "   \
-+  "ubifsmount ubi:rootfs; "   \
-+  "ubifsload 0x80 ${kernel}; "\
-+  "ubifsload 0x70 ${fdt}; "   \
-+  "ubifsumount; " \
-+  "fdt addr 0x70; fdt resize; fdt chosen; "   \
-+  "bootz 0x80 - 0x70"
++  "ubi part ubi; "\
++  "ubi read 0x80 kernel; "\
++  "bootz 0x80"
 +
 +#define CONFIG_MTDPARTS \
 +  "mtdparts=orion_nand:"  \
 +  "0xe@0x0(uboot),"   \
 +  "0x2@0xe(uboot_env),"   \
 +  "0x10@0x10(second_stage_uboot),"\
-+  "-@0x20(root)\0"
++  "-@0x20(ubi)\0"
  
  #define CONFIG_EXTRA_ENV_SETTINGS \
 -  "console=console=ttyS0,115200\0" \
@@ -108,9 +104,7 @@
 +  "console=console=ttyS0,115200\0"\
 +  "mtdids=nand0=orion_nand\0" \
 +  "mtdparts="CONFIG_MTDPARTS  \
-+  "kernel=/boot/zImage\0" \
-+  "fdt=/boot/dockstar.dtb\0"  \
-+  "bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw\0"
++  "bootargs_root=\0"
  
  /*
 - * Ethernet Driver configuration
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] kirkwood/dockstar: use ubi(kernel, squashfs, ubifs) images

2016-03-02 Thread Alexander Couzens
The new image requires `bootz` because of devicetree appending.
To flash a new image boot initramfs:

  tftpboot 0x80 openwrt-kirkwood-dockstar-initramfs-kernel.bin
  bootz 0x80

  # detach if already attached
  ubidetach -p /dev/$(grep ubi /proc/mtd|awk -F: '{print $1}')
  # scp openwrt-kirkwood-dockstar-squashfs-factory.bin /tmp
  ubiformat -f /tmp/openwrt-kirkwood-dockstar-squashfs-factory.bin
  # attach is important to resize rootfs_data otherwise it wont boot
  ubiattach -p /dev/$(grep ubi /proc/mtd|awk -F: '{print $1}')

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/base-files/lib/upgrade/platform.sh | 14 ++
 target/linux/kirkwood/image/Makefile |  5 +
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh 
b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
index c33229a..be5f101 100644
--- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
+++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh
@@ -14,6 +14,10 @@ platform_check_image() {
}
return 0
;;
+   "dockstar")
+   nand_do_platform_check $board $1
+   return $?
+   ;;
esac
 
echo "Sysupgrade is not yet supported on $board."
@@ -30,3 +34,13 @@ platform_do_upgrade() {
;;
esac
 }
+
+platform_pre_upgrade() {
+   local board=$(kirkwood_board_name)
+
+   case "$board" in
+   "dockstar")
+   nand_do_upgrade $1
+   ;;
+   esac
+}
diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index 9a2c2e4..bc42bef 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/image.mk
 
 DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE 
KERNEL_IN_UBI
 KERNEL_LOADADDR:=0x8000
-TARGET_DEVICES = linksys-audi linksys-viper
+TARGET_DEVICES = linksys-audi linksys-viper dockstar
 
 define Device/Default
   KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
@@ -161,9 +161,6 @@ endef
 Image/BuildKernel/Template/Generic=$(call Image/BuildKernel/Template)
 Image/InstallKernel/Template/Generic=$(call Image/InstallKernel/Template)
 
-Image/BuildKernel/Template/DOCKSTAR=$(call Image/BuildKernel/Template,dockstar)
-Image/InstallKernel/Template/DOCKSTAR=$(call 
Image/InstallKernel/Template,dockstar)
-
 Image/BuildKernel/Template/GOFLEXHOME=$(call 
Image/BuildKernel/Template,goflexhome)
 Image/InstallKernel/Template/GOFLEXHOME=$(call 
Image/InstallKernel/Template,goflexhome)
 
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/7] kirkwood 4.4

2016-03-07 Thread Alexander Couzens
Based on previous patch series ubi for dockstar.

To install the new ubi style on goflexnet:
- update bootloader (use the same bootloader as of goflexhome)
The goflexnet has a not as old SoC like the dockstar,
which means a recovery of a broken bootloader is easy using
uart recovery via kwboot
mw 0x80 0x 0x8
tftpboot 0x80 openwrt-kirkwood-goflexhome-u-boot.kwb
nand erase 0x00 0x10
nand write.e 0x80 0x00 0x8

- install openwrt using initramfs
tftpboot 0x80 openwrt-kirkwood-goflexnet-initramfs-kernel.bin
bootz 0x80

ubidetach -p /dev/mtd1
ubiformat -f /tmp/openwrt-kirkwood-goflexnet-squashfs-factory.bin /dev/mtd1
ubiattach -p /dev/mtd1
# ubiattach is important to expand the ubi, otherwise uboot have 
problems with it

Should I depend on CONFIG_TARGET_ROOTFS_INITRAMFS for this target, because you 
need it to install the image?

Alexander Couzens (7):
  linux/kirkwood: migrate goflexhome/goflexnet to new ubi style
  kirkwood/goflexhome/goflexnet: merge "root" and unused mtd partitions
into one volume "ubi"
  kirkwood/goflexnet/goflexhome: change mtd layout to use the last 3 mb
  uboot-kirkwood/goflexhome: update bootargs to use new ubi style
  uboot-kirkwood/goflexhome: add forgotten include
openwrt-kirkwood-common.h"
  uboot-kirkwood/goflexhome: explicit define the size of the last
partition
  kirkwood: switch to kernel 4.4

 .../uboot-kirkwood/patches/150-goflexhome.patch|  30 ++
 .../patches/200-openwrt-config.patch   |   9 +
 target/linux/kirkwood/Makefile |   2 +-
 target/linux/kirkwood/config-4.4   | 315 +
 target/linux/kirkwood/image/Makefile   |  20 +-
 .../kirkwood/patches-3.18/180-goflexhome.patch |  26 +-
 .../kirkwood/patches-3.18/181-goflexnet.patch  |  25 ++
 .../patches-4.4/100-find_active_root.patch |  61 
 target/linux/kirkwood/patches-4.4/110-ib62x0.patch |  20 ++
 .../linux/kirkwood/patches-4.4/130-iconnect.patch  |  41 +++
 .../linux/kirkwood/patches-4.4/140-dockstar.patch  |  32 +++
 target/linux/kirkwood/patches-4.4/160-ea4500.patch | 200 +
 target/linux/kirkwood/patches-4.4/170-ea3500.patch | 192 +
 .../kirkwood/patches-4.4/180-goflexhome.patch  | 130 +
 .../linux/kirkwood/patches-4.4/181-goflexnet.patch |  25 ++
 .../linux/kirkwood/patches-4.4/190-nsa310s.patch   | 300 
 .../kirkwood/patches-4.4/200-disable-tso.patch |  35 +++
 17 files changed, 1439 insertions(+), 24 deletions(-)
 create mode 100644 package/boot/uboot-kirkwood/patches/150-goflexhome.patch
 create mode 100644 target/linux/kirkwood/config-4.4
 create mode 100644 target/linux/kirkwood/patches-3.18/181-goflexnet.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/100-find_active_root.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/110-ib62x0.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/130-iconnect.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/140-dockstar.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/160-ea4500.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/170-ea3500.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/180-goflexhome.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/181-goflexnet.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/190-nsa310s.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/200-disable-tso.patch

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


[OpenWrt-Devel] [PATCH 3/7] kirkwood/goflexnet/goflexhome: change mtd layout to use the last 3 mb

2016-03-07 Thread Alexander Couzens
Previous the uboot was overwriting the device-tree's mtd layout to use
the last 3 mb.

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/patches-3.18/180-goflexhome.patch | 2 +-
 target/linux/kirkwood/patches-3.18/181-goflexnet.patch  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/kirkwood/patches-3.18/180-goflexhome.patch 
b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
index e30a8b1..95e67b9 100644
--- a/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
+++ b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
@@ -114,7 +114,7 @@ Index: 
linux-3.18.27/arch/arm/boot/dts/kirkwood-goflexhome.dts
 +
 +  partition@10 {
 +  label = "ubi";
-+  reg = <0x10 0xfc0>;
++  reg = <0x10 0x0ff0>;
 +  };
 +};
 +
diff --git a/target/linux/kirkwood/patches-3.18/181-goflexnet.patch 
b/target/linux/kirkwood/patches-3.18/181-goflexnet.patch
index 9fe62d1..fc19e39 100644
--- a/target/linux/kirkwood/patches-3.18/181-goflexnet.patch
+++ b/target/linux/kirkwood/patches-3.18/181-goflexnet.patch
@@ -19,7 +19,7 @@ Index: linux-4.4.4/arch/arm/boot/dts/kirkwood-goflexnet.dts
 -  label = "root";
 -  reg = <0x0250 0xd80>;
 +  label = "ubi";
-+  reg = <0x010 0xfc0>;
++  reg = <0x010 0x0ff0>;
};
  };
  
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/7] linux/kirkwood: migrate goflexhome/goflexnet to new ubi style

2016-03-07 Thread Alexander Couzens
Also using the new image build step format

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/image/Makefile | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index bc42bef..d38ee71 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/image.mk
 
 DEVICE_VARS += DEVICE_DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE 
KERNEL_IN_UBI
 KERNEL_LOADADDR:=0x8000
-TARGET_DEVICES = linksys-audi linksys-viper dockstar
+TARGET_DEVICES = linksys-audi linksys-viper dockstar goflexnet goflexhome
 
 define Device/Default
   KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
@@ -35,6 +35,18 @@ define Device/dockstar
   KERNEL := kernel-bin | append-dtb
 endef
 
+define Device/goflexnet
+$(Device/dockstar)
+  PROFILES := Generic GOFLEXNET
+  DEVICE_DTS := kirkwood-goflexnet
+endef
+
+define Device/goflexhome
+$(Device/dockstar)
+  PROFILES := Generic GOFLEXHOME
+  DEVICE_DTS := kirkwood-goflexhome
+endef
+
 define Device/linksys-audi
   DEVICE_DTS := kirkwood-linksys-audi
   PAGESIZE := 512
@@ -161,12 +173,6 @@ endef
 Image/BuildKernel/Template/Generic=$(call Image/BuildKernel/Template)
 Image/InstallKernel/Template/Generic=$(call Image/InstallKernel/Template)
 
-Image/BuildKernel/Template/GOFLEXHOME=$(call 
Image/BuildKernel/Template,goflexhome)
-Image/InstallKernel/Template/GOFLEXHOME=$(call 
Image/InstallKernel/Template,goflexhome)
-
-Image/BuildKernel/Template/GOFLEXNET=$(call 
Image/BuildKernel/Template,goflexnet)
-Image/InstallKernel/Template/GOFLEXNET=$(call 
Image/InstallKernel/Template,goflexnet)
-
 Image/BuildKernel/Template/IB62X0=$(call Image/BuildKernel/Template,ib62x0)
 Image/InstallKernel/Template/IB62X0=$(call Image/InstallKernel/Template,ib62x0)
 
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/7] uboot-kirkwood/goflexhome: update bootargs to use new ubi style

2016-03-07 Thread Alexander Couzens
Since switching to new ubi(kernel,squashfs,ubifs) layout, the kernel lies in a
ubi volume. Dropping the mtd parts because the mtd layout is saved in the
device-tree, which is appended to the zImage.

Signed-off-by: Alexander Couzens 
---
 .../uboot-kirkwood/patches/150-goflexhome.patch| 30 ++
 1 file changed, 30 insertions(+)
 create mode 100644 package/boot/uboot-kirkwood/patches/150-goflexhome.patch

diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch 
b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
new file mode 100644
index 000..76daddf
--- /dev/null
+++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
@@ -0,0 +1,30 @@
+Index: u-boot-2014.10/include/configs/goflexhome.h
+===
+--- u-boot-2014.10.orig/include/configs/goflexhome.h
 u-boot-2014.10/include/configs/goflexhome.h
+@@ -96,20 +96,18 @@
+  */
+ #define CONFIG_BOOTCOMMAND \
+   "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
+-  "ubi part root; " \
+-  "ubifsmount ubi:root; " \
+-  "ubifsload 0x80 ${kernel}; " \
+-  "bootm 0x80"
++  "ubi part ubi; "\
++  "ubi read 0x80 kernel; "\
++  "bootz 0x80"
+ 
+ #define CONFIG_MTDPARTS \
+-  "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0"
++  "mtdparts=orion_nand:1m(uboot),-(ubi)\0"
+ 
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+   "console=console=ttyS0,115200\0" \
+   "mtdids=nand0=orion_nand\0" \
+   "mtdparts="CONFIG_MTDPARTS \
+-  "kernel=/boot/uImage\0" \
+-  "bootargs_root=ubi.mtd=root root=ubi0:root rootfstype=ubifs ro\0"
++  "bootargs_root=\0"
+ 
+ /*
+  * Ethernet Driver configuration
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/7] kirkwood/goflexhome/goflexnet: merge "root" and unused mtd partitions into one volume "ubi"

2016-03-07 Thread Alexander Couzens
The kernel will automatic attach mtd partitions named 'ubi' to ubi0.
Renaming the "root" partition into "ubi" will safe arguments
from the kernel cmdline.

Signed-off-by: Alexander Couzens 
---
 .../kirkwood/patches-3.18/180-goflexhome.patch | 26 +-
 .../kirkwood/patches-3.18/181-goflexnet.patch  | 25 +
 2 files changed, 35 insertions(+), 16 deletions(-)
 create mode 100644 target/linux/kirkwood/patches-3.18/181-goflexnet.patch

diff --git a/target/linux/kirkwood/patches-3.18/180-goflexhome.patch 
b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
index 0560073..e30a8b1 100644
--- a/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
+++ b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
@@ -1,5 +1,7 @@
 a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
+Index: linux-3.18.27/arch/arm/boot/dts/Makefile
+===
+--- linux-3.18.27.orig/arch/arm/boot/dts/Makefile
 linux-3.18.27/arch/arm/boot/dts/Makefile
 @@ -120,6 +120,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
kirkwood-ds411.dtb \
kirkwood-ds411j.dtb \
@@ -8,9 +10,11 @@
kirkwood-goflexnet.dtb \
kirkwood-guruplug-server-plus.dtb \
kirkwood-ib62x0.dtb \
+Index: linux-3.18.27/arch/arm/boot/dts/kirkwood-goflexhome.dts
+===
 --- /dev/null
-+++ b/arch/arm/boot/dts/kirkwood-goflexhome.dts
-@@ -0,0 +1,127 @@
 linux-3.18.27/arch/arm/boot/dts/kirkwood-goflexhome.dts
+@@ -0,0 +1,117 @@
 +/dts-v1/;
 +
 +#include "kirkwood.dtsi"
@@ -109,18 +113,8 @@
 +  };
 +
 +  partition@10 {
-+  label = "uImage";
-+  reg = <0x010 0x40>;
-+  };
-+
-+  partition@50 {
-+  label = "pogoplug";
-+  reg = <0x050 0x200>;
-+  };
-+
-+  partition@250 {
-+  label = "root";
-+  reg = <0x0250 0xd80>;
++  label = "ubi";
++  reg = <0x10 0xfc0>;
 +  };
 +};
 +
diff --git a/target/linux/kirkwood/patches-3.18/181-goflexnet.patch 
b/target/linux/kirkwood/patches-3.18/181-goflexnet.patch
new file mode 100644
index 000..9fe62d1
--- /dev/null
+++ b/target/linux/kirkwood/patches-3.18/181-goflexnet.patch
@@ -0,0 +1,25 @@
+Index: linux-4.4.4/arch/arm/boot/dts/kirkwood-goflexnet.dts
+===
+--- linux-4.4.4.orig/arch/arm/boot/dts/kirkwood-goflexnet.dts
 linux-4.4.4/arch/arm/boot/dts/kirkwood-goflexnet.dts
+@@ -158,18 +158,8 @@
+   };
+ 
+   partition@10 {
+-  label = "uImage";
+-  reg = <0x010 0x40>;
+-  };
+-
+-  partition@50 {
+-  label = "pogoplug";
+-  reg = <0x050 0x200>;
+-  };
+-
+-  partition@250 {
+-  label = "root";
+-  reg = <0x0250 0xd80>;
++  label = "ubi";
++  reg = <0x010 0xfc0>;
+   };
+ };
+ 
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/7] uboot-kirkwood/goflexhome: explicit define the size of the last partition

2016-03-07 Thread Alexander Couzens
Explicit sets the size of the mtdparts, because the kernel has also an explicit 
value.
If they have diffent sizes the ubi won't be detected.

Signed-off-by: Alexander Couzens 
---
 package/boot/uboot-kirkwood/patches/150-goflexhome.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch 
b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
index 76daddf..f9b26cf 100644
--- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
+++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
@@ -16,7 +16,7 @@ Index: u-boot-2014.10/include/configs/goflexhome.h
  
  #define CONFIG_MTDPARTS \
 -  "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0"
-+  "mtdparts=orion_nand:1m(uboot),-(ubi)\0"
++  "mtdparts=orion_nand:1m(uboot),255m(ubi)\0"
  
  #define CONFIG_EXTRA_ENV_SETTINGS \
"console=console=ttyS0,115200\0" \
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 7/7] kirkwood: switch to kernel 4.4

2016-03-07 Thread Alexander Couzens
dropped patches because they applied upstream:
- 120-iomega_ix2_200.patch
- 150-pogoplug_e02.patch

Tested on dockstar and goflexnet

Signed-off-by: Alexander Couzens 
---
 target/linux/kirkwood/Makefile |   2 +-
 target/linux/kirkwood/config-4.4   | 315 +
 .../patches-4.4/100-find_active_root.patch |  61 
 target/linux/kirkwood/patches-4.4/110-ib62x0.patch |  20 ++
 .../linux/kirkwood/patches-4.4/130-iconnect.patch  |  41 +++
 .../linux/kirkwood/patches-4.4/140-dockstar.patch  |  32 +++
 target/linux/kirkwood/patches-4.4/160-ea4500.patch | 200 +
 target/linux/kirkwood/patches-4.4/170-ea3500.patch | 192 +
 .../kirkwood/patches-4.4/180-goflexhome.patch  | 130 +
 .../linux/kirkwood/patches-4.4/181-goflexnet.patch |  25 ++
 .../linux/kirkwood/patches-4.4/190-nsa310s.patch   | 300 
 .../kirkwood/patches-4.4/200-disable-tso.patch |  35 +++
 12 files changed, 1352 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/kirkwood/config-4.4
 create mode 100644 target/linux/kirkwood/patches-4.4/100-find_active_root.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/110-ib62x0.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/130-iconnect.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/140-dockstar.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/160-ea4500.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/170-ea3500.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/180-goflexhome.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/181-goflexnet.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/190-nsa310s.patch
 create mode 100644 target/linux/kirkwood/patches-4.4/200-disable-tso.patch

diff --git a/target/linux/kirkwood/Makefile b/target/linux/kirkwood/Makefile
index 4f9fa4f..e0cdf66 100644
--- a/target/linux/kirkwood/Makefile
+++ b/target/linux/kirkwood/Makefile
@@ -13,7 +13,7 @@ FEATURES:=targz usb jffs2_nand nand ubifs squashfs dt
 CPU_TYPE:=xscale
 MAINTAINER:=Luka Perkov 
 
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.4
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/kirkwood/config-4.4 b/target/linux/kirkwood/config-4.4
new file mode 100644
index 000..95a96ce
--- /dev/null
+++ b/target/linux/kirkwood/config-4.4
@@ -0,0 +1,315 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_CPU_AUTO=y
+# CONFIG_ARCH_MULTI_V4 is not set
+# CONFIG_ARCH_MULTI_V4T is not set
+CONFIG_ARCH_MULTI_V4_V5=y
+CONFIG_ARCH_MULTI_V5=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_ARM=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_HAS_SG_CHAIN=y
+# CONFIG_ARM_KIRKWOOD_CPUIDLE is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+# CONFIG_ARM_MVEBU_V7_CPUIDLE is not set
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+# CONFIG_ARM_THUMB is not set
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CACHE_FEROCEON_L2=y
+# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootdelay=1 root=/dev/mmcblk0p1 noinitrd console=ttyS0,115200"
+CONFIG_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_COMMON_CLK=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_FEROCEON=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FEROCEON=y
+# CONFIG_CPU_FEROCEON_OLD_ID is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_TLB_FEROCEON=y
+CONFIG_CPU_USE_DOMAINS=y
+CONFIG_CRC16=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
+CONFIG_DEBUG_MVEBU_UART0=y
+# CONFIG_DEBUG_MVEBU_UART0_

[OpenWrt-Devel] [PATCH 5/7] uboot-kirkwood/goflexhome: add forgotten include openwrt-kirkwood-common.h"

2016-03-07 Thread Alexander Couzens
otherwise the uboot is missing important commands like bootz

Signed-off-by: Martin Mueller 
Signed-off-by: Alexander Couzens 
---
 package/boot/uboot-kirkwood/patches/200-openwrt-config.patch | 9 +
 1 file changed, 9 insertions(+)

diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch 
b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
index 0e84d3b..92e2b75 100644
--- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
+++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
@@ -108,3 +108,12 @@
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_SHEEVAPLUG_H */
+--- a/include/configs/goflexhome.h
 b/include/configs/goflexhome.h
+@@ -133,4 +133,6 @@
+ #define CONFIG_RTC_MV
+ #endif /* CONFIG_CMD_DATE */
+ 
++#include "openwrt-kirkwood-common.h"
++
+ #endif /* _CONFIG_GOFLEXHOME_H */
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 0/3] ar71xx: migrate cpe510 to new build steps

2016-03-07 Thread Alexander Couzens
v2:
- split commit into smaller pieces.
- refactor loader modifcations and reduce duplications
- tested sysupgrade on 1043nd to ensure loader doesn't break for other platforms
- introduce LOADER_TYPE variable to select what kind of a loader version you 
want to use (elf or gz)

Alexander Couzens (3):
  ar71xx/image: introduce LOADER_TYPE to support elf loaders
  ar71xx/image: allow builds of loader without cmdline injecting
  ar71xx: migrate tplink cpe510 to new build steps

 target/linux/ar71xx/image/Makefile | 91 --
 1 file changed, 37 insertions(+), 54 deletions(-)

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


[OpenWrt-Devel] [PATCH v2 1/3] ar71xx/image: introduce LOADER_TYPE to support elf loaders

2016-03-07 Thread Alexander Couzens
The loader decompress a lzma compressed kernel. Some bootloaders
only support elf files like the tplink cpe510

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index cb11104..068d293 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -14,7 +14,7 @@ IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
 
 KERNEL_LOADADDR = 0x8006
 
-DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE 
CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
+DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE 
CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS LOADER_TYPE
 
 define Build/netgear-squashfs
rm -rf $@.fs $@.squashfs
@@ -80,8 +80,8 @@ define Build/loader-common
TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
-   $(1) compile loader.gz
-   mv "$@.gz" "$@"
+   $(1) compile loader.$(LOADER_TYPE)
+   mv "$@.$(LOADER_TYPE)" "$@"
rm -rf $@.src
 endef
 
@@ -264,6 +264,7 @@ TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch 
wndrmac wndrmacv2
 define Device/tplink
   TPLINK_HWREV := 0x1
   TPLINK_HEADER_VERSION := 1
+  LOADER_TYPE := gz
   KERNEL := kernel-bin | patch-cmdline | lzma
   KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
   IMAGES := sysupgrade.bin factory.bin
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 3/3] ar71xx: migrate tplink cpe510 to new build steps

2016-03-07 Thread Alexander Couzens
cpe510: Tested sysupgrade and initramfs.
Untested: webIf w/ factory.bin & recovery.bin

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 74 ++
 1 file changed, 26 insertions(+), 48 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 723ce9d..1bca5d1 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -73,6 +73,18 @@ define Build/mktplinkfw-initramfs
@mv $@.new $@
 endef
 
+define Build/tplink-safeloader
+   -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
+   -B $(TPLINK_BOARD_NAME) \
+   -V $(REVISION) \
+   -k $(word 1,$^) \
+   -r $@ \
+   -o $@.new \
+   $2 \
+   -j \
+   $(if $(findstring sysupgrade,$1),-S) && mv $@.new $@ || rm -f $@
+endef
+
 define Build/loader-common
rm -rf $@.src
$(MAKE) -C lzma-loader \
@@ -107,7 +119,7 @@ define Build/copy-file
cat "$(1)" > "$@"
 endef
 
-DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
TPLINK_HEADER_VERSION
+DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
TPLINK_HEADER_VERSION TPLINK_BOARD_NAME
 
 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
 # UBNT_TYPE e.g. one of (BZ, XM, XW)
@@ -315,6 +327,19 @@ $(Device/tplink)
   IMAGE_SIZE := 15872k
 endef
 
+define Device/cpe210-220-510-520
+  MTDPARTS := 
spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x4(firmware)
+  IMAGE_SIZE := 7680k
+  BOARDNAME := CPE510
+  TPLINK_BOARD_NAME := CPE510
+  LOADER_TYPE := elf
+  KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
+TARGET_DEVICES += cpe210-220-510-520
+
 define Device/tl-wdr4300-v1
 $(Device/tplink-8mlzma)
   BOARDNAME = TL-WDR4300
@@ -1496,28 +1521,6 @@ define Image/BuildLoader
 endef
 
 #
-# Embed patched lzma-compressed kernel inside lzma-loader.
-#
-# Specifying the command line via the lzma-loader doesn't work with some
-# models (like the TP-LINK CPE series), so this version first patches the
-# command line in the image and then builds the loader around it.
-#
-# $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
-# $(2), suffix of target file to build, e.g. bin, gz, elf
-# $(3), kernel command line to pass from lzma-loader to kernel
-# $(4), unused here
-# $(5), suffix of kernel filename, e.g. -initramfs, or empty
-define Image/BuildLoaderPatched
-   $(call PatchKernelLzma,$(1),$(3))
-   -rm -rf $(KDIR)/lzma-loader
-   $(LOADER_MAKE) LOADER=loader-$(1).$(2) \
-   LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
-   LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" 
BOARD="$(1)" \
-   compile loader.$(2)
-   -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
-endef
-
-#
 # Build lzma-loader alone which will search for lzma-compressed kernel 
identified by
 # uImage header with magic "OKLI" at boot time.
 #
@@ -1566,7 +1569,6 @@ 
cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmwa
 
cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 
cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
 
cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa(firmware)
-cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x4(firmware)
 
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 
dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2024,28 +2026,6 @@ define Image/Build/Senao
$(call sysupname,$(1),$(2))
 endef
 
-Image/Build/TPLINK-SAFELOADER/loader = $(call 
Image/BuildLoaderPatched,$(1),elf,$(2) $(3))
-
-define Image/Build/TPLINK-SAFELOADER
-   [ -e "$(KDIR)/loader-$(2).elf" ]
-
-   -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-   -B $(5) \
-   -k $(KDIR)/loader-$(2).elf \
-   -r $(KDIR)/root.$(1) \
-   -V $(REVISION) \
-   -j \
-   -o $(call factoryname,$(1),$(2))
-   -$(STAGING_DIR_HOST)/bin/tplink-s

[OpenWrt-Devel] [PATCH v2 2/3] ar71xx/image: allow builds of loader without cmdline injecting

2016-03-07 Thread Alexander Couzens
On most platforms the cmdline is supplied by the loader to the kernel.
When using an elf loader with cmdline the size is bloated by 512k.
For loader-elf platforms like the cpe510 better use loader-elf but patch
the cmdline into the kernel.

wdr1043: Tested loader still works using sysupgade image.

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 068d293..723ce9d 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -78,7 +78,7 @@ define Build/loader-common
$(MAKE) -C lzma-loader \
PKG_BUILD_DIR="$@.src" \
TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
-   KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
+   BOARD="$(BOARDNAME)" \
LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
$(1) compile loader.$(LOADER_TYPE)
mv "$@.$(LOADER_TYPE)" "$@"
@@ -86,13 +86,17 @@ define Build/loader-common
 endef
 
 define Build/loader-okli-compile
-   $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
+   $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 
KERNEL_CMDLINE="$(CMDLINE)")
 endef
 
 define Build/loader-kernel
$(call Build/loader-common,LOADER_DATA="$@")
 endef
 
+define Build/loader-kernel-cmdline
+   $(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
+endef
+
 define Build/loader-okli
dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
cat "$@" >> "$@.new"
@@ -278,7 +282,7 @@ $(Device/tplink)
   COMPILE := loader-$(1).gz
   COMPILE/loader-$(1).gz := loader-okli-compile
   KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | 
loader-okli $(1)
-  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | 
loader-kernel | mktplinkfw-initramfs
+  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | 
loader-kernel-cmdline | mktplinkfw-initramfs
 endef
 
 define Device/tplink-4m
-- 
2.7.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 5/7] uboot-kirkwood/goflexhome: add forgotten include openwrt-kirkwood-common.h"

2016-03-07 Thread Alexander Couzens
On Mon, 7 Mar 2016 21:18:21 +0100
Daniel Golle  wrote:
 
> as you are switching to a different boot_cmd, any previously existing
> u-boot environment has to be migrated to the new default environment.
> As the u-boot environment can itself be stored in an ubi-volume (or
> ideally two, for redundancy), this is a good chance to switch to
> ENV_IS_IN_UBI as well.

Hi Daniel,

thanks! Didn't knew that. I would like to do that
in a patch after my 2 patch series are applied, as it looks
like a simple thing to do.

Best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpp7yFWioIcZ.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 1/3] ar71xx/image: introduce LOADER_TYPE to support elf loaders

2016-03-08 Thread Alexander Couzens
On Tue, 8 Mar 2016 07:21:26 +0100
John Crispin  wrote:

> does this not need some defaults for when loader_type is not set ?
right. it must set. Should I set gz as default?

-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgptMa8BCSOmW.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 2/3] ar71xx/image: allow builds of loader without cmdline injecting

2016-03-10 Thread Alexander Couzens
On Wed, 9 Mar 2016 06:15:50 +0100
John Crispin  wrote:

> >  target/linux/ar71xx/image/Makefile | 10 +++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/target/linux/ar71xx/image/Makefile
> > b/target/linux/ar71xx/image/Makefile index 068d293..723ce9d 100644
> > --- a/target/linux/ar71xx/image/Makefile
> > +++ b/target/linux/ar71xx/image/Makefile
> > @@ -78,7 +78,7 @@ define Build/loader-common
> > $(MAKE) -C lzma-loader \
> > PKG_BUILD_DIR="$@.src" \
> > TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
> > -   KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
> > +   BOARD="$(BOARDNAME)" \
> > LZMA_TEXT_START=0x80a0 LOADADDR=0x8006 \
> > $(1) compile loader.$(LOADER_TYPE)
> > mv "$@.$(LOADER_TYPE)" "$@"
> > @@ -86,13 +86,17 @@ define Build/loader-common
> >  endef
> >  
> >  define Build/loader-okli-compile
> > -   $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS)
> > FLASH_MAX=0)
> > +   $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS)
> > FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)") endef
> >  
> >  define Build/loader-kernel
> > $(call Build/loader-common,LOADER_DATA="$@")
> >  endef  
> 
> 
> the above will break. did not check if there are more invocations of
> loader-common. you really should check all of them. please mae sure
> the patch generates no regressions
why that?

tested against the 1043nd 


-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpyuI8OgjLLu.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 1/3] ar71xx/image: introduce LOADER_TYPE to support elf loaders

2016-03-10 Thread Alexander Couzens
On Tue, 8 Mar 2016 16:36:41 +0100
John Crispin  wrote:

> >> does this not need some defaults for when loader_type is not
> >> set ?  
> > right. it must set. Should I set gz as default?
> >   
> 
> you tell me, what was the default before your patch ?
There wasn't a real default before, but the loader built gz before.
I set it for all device which uses the Loader in the Device/tplink
Template to := gz.

Ok, I could setting it under Device/Default. But wouldn't that overflow
that Default/Device? Like LOADER_FLASH_OFFSET isn't set either. It's
only set for these device which uses the LOADER.

Best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpkVBzWXV0YE.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Heightened sensitivity; a solution

2016-03-13 Thread Alexander Couzens
The freifunker has a similiar project
https://github.com/freifunk-berlin/firmware

Best,
lynxis

-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpbbRSDvVxUx.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/4] omap 4.4, ehci, sdcard

2016-04-25 Thread Alexander Couzens
I'm using the beaglebone black as development tool for coreboot.
The bbb can receive debug output via ehci debug and flash
spi chips via spi-omap-24xx.
I'm not quite sure about the config-4.4 config. I copied over the omap 
config-4.1
and did make kernel_oldconfig. Is there a better way to create the config for a 
kernel?

Everthing was tested with kernel 4.4 on a bbb. The sdcard image can
be used as stand-alone image or flashed to the eMMC. If the image was
flashed to the eMMC, don't use a sdcard, because the kernel tries
to boot the external sdcard. Aka floppy inserted bug ;).

Alexander Couzens (4):
  omap: add sdcard creation script
  [RFC] omap: switch to 4.4
  kernel/spi: add kernel package for spi-omap-24xx
  add usb gadget ehci debug driver

 package/kernel/linux/modules/spi.mk|  17 +
 package/kernel/linux/modules/usb.mk|  17 +
 target/linux/omap/Makefile |   2 +-
 target/linux/omap/config-4.4   | 525 -
 target/linux/omap/image/Config.in  |   5 +
 target/linux/omap/image/Makefile   |  34 +-
 target/linux/omap/image/gen_omap_sdcard_img.sh |  33 ++
 target/linux/omap/image/uEnv.txt   |   6 +
 tools/Makefile |   2 +-
 9 files changed, 283 insertions(+), 358 deletions(-)
 create mode 100644 target/linux/omap/image/Config.in
 create mode 100755 target/linux/omap/image/gen_omap_sdcard_img.sh
 create mode 100644 target/linux/omap/image/uEnv.txt

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


[OpenWrt-Devel] [PATCH 1/4] omap: add sdcard creation script

2016-04-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/omap/image/Config.in  |  5 
 target/linux/omap/image/Makefile   | 34 +-
 target/linux/omap/image/gen_omap_sdcard_img.sh | 33 +
 target/linux/omap/image/uEnv.txt   |  6 +
 tools/Makefile |  2 +-
 5 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/omap/image/Config.in
 create mode 100755 target/linux/omap/image/gen_omap_sdcard_img.sh
 create mode 100644 target/linux/omap/image/uEnv.txt

diff --git a/target/linux/omap/image/Config.in 
b/target/linux/omap/image/Config.in
new file mode 100644
index 000..08b88eb
--- /dev/null
+++ b/target/linux/omap/image/Config.in
@@ -0,0 +1,5 @@
+config OMAP_SD_BOOT_PARTSIZE
+   int "Boot (SD Card) filesystem partition size (in MB)"
+   depends on TARGET_omap
+   default 20
+
diff --git a/target/linux/omap/image/Makefile b/target/linux/omap/image/Makefile
index 3fa2848..10b07a7 100644
--- a/target/linux/omap/image/Makefile
+++ b/target/linux/omap/image/Makefile
@@ -6,12 +6,43 @@
 #
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
+include $(INCLUDE_DIR)/host.mk
+
+FAT32_BLOCK_SIZE=1024
+FAT32_BLOCKS=$(shell echo 
$$(($(CONFIG_OMAP_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE
 
 UBIFS_OPTS = -F -m 2048 -e 124KiB -c 4096 -U
 UBI_OPTS = -m 2048 -p 128KiB -s 512 -O 2048
 
+# $1 - name of bootloader directory under BIN_DIR
+# $2 - output filename part
+define Image/Build/SDCard
+   rm -f $(KDIR)/boot-$(2).img
+   mkdosfs $(KDIR)/boot-$(2).img -C $(FAT32_BLOCKS)
+   mcopy -i $(KDIR)/boot-$(2).img $(BIN_DIR)/uboot-omap-$(1)/MLO ::MLO
+   mcopy -i $(KDIR)/boot-$(2).img $(BIN_DIR)/uboot-omap-$(1)/u-boot.img 
::u-boot.img
+   mcopy -i $(KDIR)/boot-$(2).img -s $(BIN_DIR)/dtbs/ ::dtbs
+   mcopy -i $(KDIR)/boot-$(2).img $(KDIR)/zImage ::zImage
+   mcopy -i $(KDIR)/boot-$(2).img $(KDIR)/uImage ::uImage
+   mcopy -i $(KDIR)/boot-$(2).img ./uEnv.txt ::uEnv.txt
+   chmod 755 ./gen_omap_sdcard_img.sh
+   ./gen_omap_sdcard_img.sh \
+   $(BIN_DIR)/$(IMG_PREFIX)-$(2)-sdcard-vfat-$(1).img \
+   $(KDIR)/boot-$(2).img \
+   $(KDIR)/root.ext4 \
+   $(CONFIG_OMAP_SD_BOOT_PARTSIZE) \
+   $(CONFIG_TARGET_ROOTFS_PARTSIZE)
+endef
+
 define Image/BuildKernel
+   mkimage -A arm -O linux -T kernel -C none \
+   -a 0x40008000 -e 0x40008000 \
+   -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
+   -d $(KDIR)/zImage $(KDIR)/uImage
+
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
+   $(CP) $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+
  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
  endif
@@ -26,7 +57,7 @@ define Image/BuildKernel
$(CP) $(DTS_DIR)/omap3*.dtb $(TARGET_DIR)/boot/
$(CP) $(DTS_DIR)/omap4*.dtb $(TARGET_DIR)/boot/
  endif
-   -mkdir $(BIN_DIR)/dtbs
+   -mkdir -p $(BIN_DIR)/dtbs
-$(CP) $(DTS_DIR)/am335x*.dtb $(BIN_DIR)/dtbs/
-$(CP) $(DTS_DIR)/omap3*.dtb $(BIN_DIR)/dtbs/
-$(CP) $(DTS_DIR)/omap4*.dtb $(BIN_DIR)/dtbs/
@@ -34,6 +65,7 @@ endef
 
 define Image/Build
$(call Image/Build/$(1),$(1))
+   $(call Image/Build/SDCard,am335x_evm,beagleboneblack)
 endef
 
 define Image/Build/jffs2-64k
diff --git a/target/linux/omap/image/gen_omap_sdcard_img.sh 
b/target/linux/omap/image/gen_omap_sdcard_img.sh
new file mode 100755
index 000..c2f2aad
--- /dev/null
+++ b/target/linux/omap/image/gen_omap_sdcard_img.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+set -x
+[ $# -eq 5 ] || {
+echo "SYNTAX: $0 
"
+exit 1
+}
+
+OUTPUT="$1"
+BOOTFS="$2"
+ROOTFS="$3"
+BOOTFSSIZE="$4"
+ROOTFSSIZE="$5"
+
+head=4
+sect=63
+
+set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 
-p ${ROOTFSSIZE}M`
+
+BOOTOFFSET="$(($1 / 512))"
+BOOTSIZE="$(($2 / 512))"
+ROOTFSOFFSET="$(($3 / 512))"
+ROOTFSSIZE="$(($4 / 512))"
+
+dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc
+dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc
diff --git a/target/linux/omap/image/uEnv.txt b/target/linux/omap/image/uEnv.txt
new file mode 100644
index 000..9776ab5
--- /dev/null
+++ b/target/linux/omap/image/uEnv.txt
@@ -0,0 +1,6 @@
+bootdir=/
+fdtdir=/dtbs
+uenvcmd=setenv bootpart ${mmcdev}:1 ; run loadfdt; run loadimage; run mmcargs; 
 bootz ${loadaddr} - ${fdtaddr}
+mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 root

[OpenWrt-Devel] [PATCH 3/4] kernel/spi: add kernel package for spi-omap-24xx

2016-04-25 Thread Alexander Couzens
spi-omap-24xx can be found in TI based SoC like the beaglebone black

Signed-off-by: Alexander Couzens 
---
 package/kernel/linux/modules/spi.mk | 17 +
 1 file changed, 17 insertions(+)

diff --git a/package/kernel/linux/modules/spi.mk 
b/package/kernel/linux/modules/spi.mk
index 1c2a789..1d70138 100644
--- a/package/kernel/linux/modules/spi.mk
+++ b/package/kernel/linux/modules/spi.mk
@@ -89,3 +89,20 @@ define KernelPackage/spi-dev/description
 endef
 
 $(eval $(call KernelPackage,spi-dev))
+
+define KernelPackage/spi-omap-24xx
+  SUBMENU:=$(SPI_MENU)
+  TITLE:=SPI omap 24xx
+  KCONFIG:=CONFIG_SPI_OMAP24XX \
+  CONFIG_SPI=y \
+  CONFIG_SPI_MASTER=y
+  FILES:=$(LINUX_DIR)/drivers/spi/spi-omap2-mcspi.ko
+  AUTOLOAD:=$(call AutoProbe,spi-omap2-mcspi)
+endef
+
+define KernelPackage/spi-dev/description
+ This package contains the user mode SPI device driver
+endef
+
+$(eval $(call KernelPackage,spi-omap-24xx))
+
-- 
2.8.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] [RFC] omap: switch to 4.4

2016-04-25 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/omap/Makefile   |   2 +-
 target/linux/omap/config-4.4 | 525 ++-
 2 files changed, 171 insertions(+), 356 deletions(-)

diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile
index 20f7517..d7054e9 100644
--- a/target/linux/omap/Makefile
+++ b/target/linux/omap/Makefile
@@ -13,7 +13,7 @@ FEATURES:=usb usbgadget ext4 targz fpu audio display nand 
ubifs
 CPU_TYPE:=cortex-a9
 CPU_SUBTYPE:=vfpv3
 
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.4
 
 MAINTAINER:=Imre Kaloz 
 
diff --git a/target/linux/omap/config-4.4 b/target/linux/omap/config-4.4
index fddf1b2..5d4f6f5 100644
--- a/target/linux/omap/config-4.4
+++ b/target/linux/omap/config-4.4
@@ -6,13 +6,15 @@ CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
 CONFIG_ARCH_MULTIPLATFORM=y
 # CONFIG_ARCH_MULTI_CPU_AUTO is not set
-CONFIG_ARCH_MULTI_V7=y
 CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
 CONFIG_ARCH_NR_GPIO=0
 CONFIG_ARCH_OMAP=y
 CONFIG_ARCH_OMAP2PLUS=y
@@ -30,49 +32,30 @@ CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
-# CONFIG_ARCH_WM8750 is not set
 CONFIG_ARM=y
-CONFIG_ARM_APPENDED_DTB=y
-CONFIG_ARM_ATAG_DTB_COMPAT=y
-# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
-CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
-# CONFIG_ARM_CPU_SUSPEND is not set
-CONFIG_ARM_ERRATA_411920=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_ARM_ERRATA_775420=y
+CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
-CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
-# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set
+CONFIG_ARM_OMAP2PLUS_CPUFREQ=y
 CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_ARM_THUMB=y
-CONFIG_ARM_THUMBEE=y
-CONFIG_ASSOCIATIVE_ARRAY=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-CONFIG_ATA=y
-# CONFIG_ATH_CARDS is not set
-CONFIG_AUDIT=y
-# CONFIG_AUDITSYSCALL is not set
-CONFIG_AUDIT_GENERIC=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
-# CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_BACKLIGHT_PM8941_WLED is not set
-# CONFIG_BACKLIGHT_PWM is not set
+CONFIG_BACKLIGHT_PWM=y
 # CONFIG_BACKLIGHT_TPS65217 is not set
 CONFIG_BCH=y
-CONFIG_BINFMT_MISC=y
-CONFIG_BLK_CGROUP=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=16384
-CONFIG_BLK_DEV_SD=y
-CONFIG_BMP085=y
-CONFIG_BMP085_I2C=y
 CONFIG_BOUNCE=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_BUILD_BIN2C=y
 CONFIG_CACHE_L2X0=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_MMIO=y
@@ -81,130 +64,115 @@ CONFIG_CLKSRC_PROBE=y
 CONFIG_CLKSRC_TI_32K=y
 # CONFIG_CLK_TWL6040 is not set
 CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMA=y
-CONFIG_CMA_ALIGNMENT=8
-CONFIG_CMA_AREAS=7
-# CONFIG_CMA_DEBUG is not set
-# CONFIG_CMA_DEBUGFS is not set
-CONFIG_CMA_SIZE_MBYTES=16
-# CONFIG_CMA_SIZE_SEL_MAX is not set
-CONFIG_CMA_SIZE_SEL_MBYTES=y
-# CONFIG_CMA_SIZE_SEL_MIN is not set
-# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
-CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200"
+CONFIG_CMDLINE="console=ttyO0,115200n8"
 CONFIG_COMMON_CLK=y
-# CONFIG_COMMON_CLK_PALMAS is not set
-CONFIG_CONFIGFS_FS=y
-CONFIG_CONNECTOR=y
-CONFIG_CPUFREQ_DT=y
-CONFIG_CPUSETS=y
-CONFIG_CPU_32v6=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+# CONFIG_CPUFREQ_DT is not set
 CONFIG_CPU_32v6K=y
-CONFIG_CPU_ABRT_EV6=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
 # CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CPU_CACHE_V6=y
+CONFIG_CPU_CACHE_V7=y
 CONFIG_CPU_CACHE_VIPT=y
 CONFIG_CPU_COPY_V6=y
 CONFIG_CPU_CP15=y
 CONFIG_CPU_CP15_MMU=y
 CONFIG_CPU_FREQ=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
 CONFIG_CPU_FREQ_GOV_COMMON=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
 CONFIG_CPU_FREQ_STAT=y
-CONFIG_CPU_FREQ_STAT_DETAILS=y
 CONFIG_CPU_HAS_ASID=y
 # CONFIG_CPU_ICACHE_DISABLE is not set
 CONFIG_CPU_IDLE=y
 CONFIG_CPU_IDLE_GOV_LADDER=y
 CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_PABRT_V6=y
+CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_PM=y
-CONFIG_CPU_THERMAL=y
-CONFIG_CPU_TLB_V6=y
-CONFIG_CPU_V6

[OpenWrt-Devel] [PATCH 4/4] add usb gadget ehci debug driver

2016-04-25 Thread Alexander Couzens
This gadget driver allow you to debug other devices via EHCI Debug Port
capability.

Signed-off-by: Alexander Couzens 
---
 package/kernel/linux/modules/usb.mk | 17 +
 1 file changed, 17 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index 8c5a2ab..7857d44 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -234,6 +234,23 @@ endef
 
 $(eval $(call KernelPackage,usb-lib-composite))
 
+define KernelPackage/usb-ehci-debug-gadget
+  TITLE:=USB EHCI debug port Gadget support
+  KCONFIG:=\
+CONFIG_USB_G_DBGP \
+   CONFIG_USB_G_DBGP_SERIAL=y \
+   CONFIG_USB_G_DBGP_PRINTK=n
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-serial-gadget
+  FILES:=$(LINUX_DIR)/drivers/usb/gadget/legacy/g_dbgp.ko
+  AUTOLOAD:=$(call AutoLoad,52,g_dbgp)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-ehci-debug-gadget/description
+  Kernel support for USB EHCI debug port Gadget.
+endef
+
+$(eval $(call KernelPackage,usb-ehci-debug-gadget))
 
 define KernelPackage/usb-eth-gadget
   TITLE:=USB Ethernet Gadget support
-- 
2.8.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/4] omap 4.4, ehci, sdcard

2016-04-26 Thread Alexander Couzens
> The following patches (submitted by you) have been updated in
> patchwork:
> 
>  * openwrt: [OpenWrt-Devel,1/4] omap: add sdcard creation script
>  - http://patchwork.ozlabs.org/patch/614748/
>  - for: OpenWrt development
> was: New
> now: Not Applicable
> 
>  * openwrt: [OpenWrt-Devel,2/4,RFC] omap: switch to 4.4
>  - http://patchwork.ozlabs.org/patch/614749/
>  - for: OpenWrt development
> was: New
> now: Not Applicable
> 
>  * openwrt: [OpenWrt-Devel,3/4] kernel/spi: add kernel package for
> spi-omap-24xx
>  - http://patchwork.ozlabs.org/patch/614750/
>  - for: OpenWrt development
> was: New
> now: Not Applicable
> 
>  * openwrt: [OpenWrt-Devel,4/4] add usb gadget ehci debug driver
>  - http://patchwork.ozlabs.org/patch/614751/
>  - for: OpenWrt development
> was: New
> now: Not Applicable


Any comment why those patches aren't applicable?


pgprB4hnZe_Fg.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] latency on PPPoA ADSL Annex A on using Lantiq

2016-08-02 Thread Alexander Couzens
On Tue, 2 Aug 2016 13:38:55 +
Daniel Niasoff  wrote:

> I can provide remote ssh access if required. When using SSH you will
> notice it feels sluggish due to this issue.
> 
> Any ideas plase, I am really stuck here?

I can confirm your problem with PPPoE on ADSL. Also noticed high
latency on ssh connection through the router.
I guess it's not in the DSL part, because when using the TD8970 as
modem with pass through everything is fine.

best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpm6ZcaS70qL.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] latency on PPPoA ADSL Annex A on using Lantiq

2016-08-20 Thread Alexander Couzens
Hey,

I created a bug ticket on this issue and put everything I know and
tested into it.

https://bugs.lede-project.org/index.php?do=details&task_id=105

best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpQeIPoVIhPR.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] latency on PPPoA ADSL Annex A on using Lantiq

2016-08-25 Thread Alexander Couzens
On Thu, 25 Aug 2016 06:19:31 +
Daniel Niasoff  wrote:

> Hi All,
> 
> What can I  do next?
I would recommend doing tracing the kernel using ftrace.

a wild guess:

reverting 45b52d458168adc31b15248380419c17d0586c63 
kernel: remove lantiq specific ATM API hacks and their kernel space
users (fixes #20523)

best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpxtHAViwrI_.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH procd] system: fix undefined behavior in wdt offline check

2015-09-23 Thread Alexander Couzens
watchdog_fd() is returning a char* and not a int. checking against < 0 could
lead in undefined behaviour.

Signed-off-by: Alexander Couzens 
---
 system.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system.c b/system.c
index 82c672e..fb7fbe4 100644
--- a/system.c
+++ b/system.c
@@ -282,7 +282,7 @@ static int watchdog_set(struct ubus_context *ctx, struct 
ubus_object *obj,
if (tb[WDT_STOP])
watchdog_set_stopped(blobmsg_get_bool(tb[WDT_STOP]));
 
-   if (watchdog_fd() < 0)
+   if (watchdog_fd() == NULL)
status = "offline";
else if (watchdog_get_stopped())
status = "stopped";
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH procd] watchdog: shutdown the kernel watchdog when stopping

2015-09-27 Thread Alexander Couzens
The kernel wdt counting down even when not pinged.
Shutdown the filehandler to /dev/watchdog with magic cookie
to prevent this.

Signed-off-by: Alexander Couzens 
---
 watchdog.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)


I'm not certainly clear, the previous behaviour was a bug or feature.
If stop=True should really only stop the pinging thread, I really would like
to shutdown the watchdog gracefully on another way. E.g. with another argument
shutdown.

Best lynxis

diff --git a/watchdog.c b/watchdog.c
index 592ae7e..025942b 100644
--- a/watchdog.c
+++ b/watchdog.c
@@ -45,11 +45,23 @@ static void watchdog_timeout_cb(struct uloop_timeout *t)
uloop_timeout_set(t, wdt_frequency * 1000);
 }
 
+static void watchdog_stop()
+{
+   if (wdt_fd >= 0 && write(wdt_fd, "V", 1) < 0)
+   ERROR("WDT failed to write magic close sequence: %s\n"
+ "WDT may not stopped properly.\n", strerror(errno));
+   if (close(wdt_fd) < 0)
+   ERROR("WDT failed to close watchdog fd: %s\n"
+ "WDT may not stopped properly.\n", strerror(errno));
+   wdt_fd = -1;
+}
+
 void watchdog_set_stopped(bool val)
 {
-   if (val)
+   if (val) {
uloop_timeout_cancel(&wdt_timeout);
-   else
+   watchdog_stop();
+   } else
watchdog_timeout_cb(&wdt_timeout);
 }
 
@@ -125,7 +137,6 @@ void watchdog_init(int preinit)
DEBUG(4, "Opened watchdog with timeout %ds\n", watchdog_timeout(0));
 }
 
-
 void watchdog_no_cloexec(void)
 {
if (wdt_fd < 0)
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH netifd] netifd-proto.sh: add table argument to proto_add_ipv4_route()

2015-09-28 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 scripts/netifd-proto.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/netifd-proto.sh b/scripts/netifd-proto.sh
index 447f0f6..1cbf4fb 100644
--- a/scripts/netifd-proto.sh
+++ b/scripts/netifd-proto.sh
@@ -122,8 +122,9 @@ proto_add_ipv4_route() {
local gw="$3"
local source="$4"
local metric="$5"
+   local table="$6"
 
-   append PROTO_ROUTE "$target/$mask/$gw/$metric///$source"
+   append PROTO_ROUTE "$target/$mask/$gw/$metric//$table/$source"
 }
 
 proto_add_ipv6_route() {
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] netifd: add table argument to dhcp(v4)

2015-09-28 Thread Alexander Couzens
table defines the specific routing table to modify.

Signed-off-by: Alexander Couzens 
---
 package/network/config/netifd/files/lib/netifd/dhcp.script   | 8 
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 6 --
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script 
b/package/network/config/netifd/files/lib/netifd/dhcp.script
index b3a61e2..fe0972c 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -7,7 +7,7 @@
 set_classless_routes() {
local max=128
while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
-   proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2" "$ip"
+   proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2" "$ip" "" 
"$ROUTING_TABLE"
max=$(($max-1))
shift 2
done
@@ -19,11 +19,11 @@ setup_interface () {
# TODO: apply $broadcast
 
for i in $router; do
-   proto_add_ipv4_route "$i" 32 "" "$ip"
-   proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
+   proto_add_ipv4_route "$i" 32 "" "$ip" "" "$ROUTING_TABLE"
+   proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" "" "$ROUTING_TABLE"
 
for r in $CUSTOMROUTES; do
-   proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip"
+   proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip" 
"" "$ROUTING_TABLE"
done
done
 
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh 
b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..6aa0cda 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -20,14 +20,15 @@ proto_dhcp_init_config() {
proto_config_add_string zone
proto_config_add_string mtu6rd
proto_config_add_string customroutes
+   proto_config_add_string table
 }
 
 proto_dhcp_setup() {
local config="$1"
local iface="$2"
 
-   local ipaddr hostname clientid vendorid broadcast reqopts iface6rd 
sendopts delegate zone6rd zone mtu6rd customroutes
-   json_get_vars ipaddr hostname clientid vendorid broadcast reqopts 
iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
+   local ipaddr hostname clientid vendorid broadcast reqopts iface6rd 
sendopts delegate zone6rd zone mtu6rd customroutes table
+   json_get_vars ipaddr hostname clientid vendorid broadcast reqopts 
iface6rd sendopts delegate zone6rd zone mtu6rd customroutes table
 
local opt dhcpopts
for opt in $reqopts; do
@@ -46,6 +47,7 @@ proto_dhcp_setup() {
[ -n "$zone" ] && proto_export "ZONE=$zone"
[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
+   [ -n "$table" ] && proto_export "ROUTING_TABLE=$table"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
 
proto_export "INTERFACE=$config"
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH netifd] netifd-proto.sh: add table argument to proto_add_ipv4_route()

2015-09-29 Thread Alexander Couzens
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Steven,

you rejected this patch as well.

Why would you not allow to define a specific table for ipv4, but for
ipv6?

> cy...@openwrt.org

> NAK. Use "option ip4table" and "option ip6table" which works with
> all protocols already.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWClv2AAoJEMKenaag34YEpGUP/1j+pipA5j9C7vkfAMyYqkkU
ZzDR3k/rEXK9JeAXVABagSG3SRmfOGOCkgFMShW4vxapO7beKViAFU/tUroSB69K
+hdCFMqkUcKtAa9AMm0JDkA5tkNxQ3uBPNAnj/PTxNMFFRDk2+qX7Do05Y4KbB2g
FWeialu1K5pJydPFeu2fP1ajID05phOlJPHjalLyDjYLtPU2KDDSiGICmldGo18J
0RDgy4/9GVxGkU8v3+3S5szQWZxns2M/CJSJ0T182cHpLRzP2qOFvt802q+hdm1i
latOWvVJ6+qsX0rMJh3SlSMF75vWo6FkAkld4vpiWtF0KT718v1+xEF+DDou9pw4
QLhb/OO52Ic2Qv81St7kkknVQU45jcOA3JNQsB9UpDxRSng0QnTZyX507B8iHfJh
XfHOz5ZBgZ1J+OW/RgPf889ChUtGWYlFU31snZWPfBcSVsHuKpZ396SoKyqDWOZI
GuSnNQViYrgBQAba98Y0UlYQ+lFxHs4+Vivd2qzGE/9RxhR4wuSWbiI5vKic2S1r
anEklRrDpv0zo8tyaEKKetMyE9K2l2k3zEJ54jJhALC9vldX+cEnYnvqt5zN3ImE
hHO8BtlrjcdUGOu9xHyWG4Igsra23wGZ0UGAuGVDGyED3oBFX4kJlv3JF4g9DEiV
6xqiqLeAcZ/f5+gVaua3
=Xe6x
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng

2015-09-30 Thread Alexander Couzens
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

what's the state of this patch?

I'm unbreaking sparc for OpenWrt and uclibc is broken as already
mentioned. musl doesn't support sparc :(.

Best,
lynxis

On Wed, 26 Aug 2015 21:11:22 +0300
Alexey Brodkin  wrote:

> uClibc-ng is a spin-off of original uClibc, see
> http://www.uclibc-ng.org/
> 
> We try to regularly add changes from uClibc to uClibc-ng.
> We even sent patches and bug reports to the uClibc mailing list.
> The config file is compatible between uClibc-ng 1.0 and uClibc git
> master. This might change in the future.
> 
> Our main goal is to provide regularly a stable and tested release
> to make embedded system developers happy.
> 
> The main advantage of uClibc-ng over olde good uClibc is regular
> releases so there's no need to keep tons of patches on top of years
> old 0.9.33.2
> 
> Build-tested for
>  [1] ARM: Sunxi generic
>  [2] MIPS: Netgear WNDR3600/3700/3800
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWDEgLAAoJEMKenaag34YEMlgP/2JIh87oijV/8E+Jx8zZ7vmd
W2D4aJxsHY0el7KSEANlKD1fkhXAvWrCz0uV3VS8mbrHHQyuuoA6pbR57QKSTrmz
ovyDNQtA7WLKJH9OQGJitMYsaNXGE+GbMo1X+WVuqBQ2G+fsoZ7QM/dEV/jnGOce
HmpaHKk4hUVE2PKvN2GYa/rm4AlTXQoNNyjBloZ5U1MjxG5l/if82YDwCxhk7M/z
PGMiZlezgPhNMlwfn+VF3pS16SqFGb7M9mEOn5dCxm32Zxx421K7WgU9bdvRHdkU
+xYSCOfD2JcTIIHABKcyzBb9sKcUFoaOppiqdnf68+jUbo9LyWpcvtPu7wxhm5Qc
8ww1nIaDSamQPNd44Zou4XpDDtNxQeBaXXiVI70OEY+pXRl0Ilytt/zIoT1LSoYY
RFd3TZPkswSNLE+eia8lztU6wjmsmO6vz1Do0BmGhCWiD1E9EtgG0T3B+r7YDp9o
m1cqeOjD6e+BAMp/BCPe4N3R8C0BP1lo2ARa/ZxlzYywp8qL4BjFsVeZb1TmFmMb
jRBuuKlBRQDn/cYDGQK4c8ct8kqgAWT5IAA2DYTErzOCxQra5Z4fuJzXHCtRsFQO
qqvHZ2brmryCSgqmqcdzo6t7fxtoeMqCSfbvLHloRQszCHV9AbJ3gfWIBlTesVHv
iWHy84BSs+1zfvKbjA8m
=r+Rc
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/6] ar71xx/image: migrate tplink images

2015-10-09 Thread Alexander Couzens
Hi,

the following patches migrate (old) tplink images to new build code.
I haven't tested these images, so I invite everybody to test
these images.

I uploaded the images to http://repo.fe80.eu/newtplink/

Best
lynxis

modified devices:
rnx-n360rt
tl-mr3220-v1
tl-mr3420-v1

tl-wa701n-v1
tl-wa730rev1
tl-wa7510n
tl-wa801nd-v1
tl-wa830re-v1
tl-wa901nd-v1
tl-wa901nd-v2

tl-wdr3320-v2

tl-wr740n-v1
tl-wr740n-v3
tl-wr743nd-v1
tl-wr841nd-v3
tl-wr841nd-v5
tl-wr841nd-v7
tl-wr842n-v1
tl-wr941nd-v2
tl-wr941nd-v3
tl-wr941nd-v4
tl-wr1043nd-v1
tl-wr1043nd-v2
tl-wr2543-v1

Alexander Couzens (6):
  ar71xx/image: remove unused multiprofile definitons
  ar71xx/image: add options argument to mktplinkfw step
  ar71xx/image: refactor tplink-chn-v2 devices
  ar71xx/image: migrate last TPLINK-LZMA images to new build system
  ar71xx/image: remove old build step TPLINK-LZMA
  ar71xx/image: migrate all images based on macro TPLINK

 target/linux/ar71xx/image/Makefile | 298 -
 1 file changed, 191 insertions(+), 107 deletions(-)

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


[OpenWrt-Devel] [PATCH 2/6] ar71xx/image: add options argument to mktplinkfw step

2015-10-09 Thread Alexander Couzens
Allow to pass extra arguments to mktplinkfw step. Some board requires
an extra argument to create a valid image.

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index c908917..2dd7798 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -38,13 +38,16 @@ define Build/netgear-uImage
 endef
 
 # combine kernel and rootfs into one image
+# mktplinkfw  
+#  is "sysupgrade" or "factory"
+#
 # -a align the rootfs start on an  bytes boundary
 # -j add jffs2 end-of-filesystem markers
 # -s strip padding from end of the image
 # -X reserve  bytes in the firmware image (hexval prefixed with 0x)
 define Build/mktplinkfw
-$(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) \
+   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) $2 \
-k $(word 1,$^) \
-r $@ \
-o $@.new \
@@ -64,10 +67,12 @@ define Build/mktplinkfw-chn-v2
$(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
 endef
 
+# mktplinkfw-initramfs 
+#
 # -c combined image
 define Build/mktplinkfw-initramfs
$(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) \
+   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) $2 \
-k $@ \
-o $@.new \
-s -S \
-- 
2.6.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/6] ar71xx/image: remove unused multiprofile definitons

2015-10-09 Thread Alexander Couzens
These profiles covered by new image/Makefile descriptions. Only the old format 
uses
MultiProfile macro

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index ae398d9..c908917 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2311,13 +2311,11 @@ $(eval $(call MultiProfile,TLWA830,TLWA830RV1))
 $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
 $(eval $(call MultiProfile,TLWA7510,TLWA7510NV1))
 $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3))
-$(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2))
 $(eval $(call MultiProfile,TLWR743,TLWR743NV1))
 $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 
TLWR841NV7))
 $(eval $(call MultiProfile,TLWR842,TLWR842V1))
 $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
 $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
-$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 
TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
 $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
 $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
-- 
2.6.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/6] ar71xx/image: migrate last TPLINK-LZMA images to new build system

2015-10-09 Thread Alexander Couzens
Migrate TLWR1043V2 TLWR2543

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 1fece37..6c84a39 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -675,6 +675,24 @@ define Device/tl-wr1041n-v2
 endef
 TARGET_DEVICES += tl-wr1041n-v2
 
+define Device/tl-wr1043nd-v2
+$(Device/tplink-8mlzma)
+BOARDNAME := TL-WR1043ND-v2
+DEVICE_PROFILE := TLWR1043
+TPLINK_HWID := 0x10430002
+endef
+TARGET_DEVICES += tl-wr1043nd-v2
+
+define Device/tl-wr2543-v1
+$(Device/tplink-8mlzma)
+BOARDNAME := TL-WR2543N
+DEVICE_PROFILE := TLWR2543
+TPLINK_HWID := 0x25430001
+IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade "-v 3.13.99"
+IMAGE/factory.bin := append-rootfs | mktplinkfw factory "-v 3.13.99"
+endef
+TARGET_DEVICES += tl-wr2543-v1
+
 define Device/tl-wdr4900-v2
 $(Device/tplink-8mlzma)
 BOARDNAME := TL-WDR4900-v2
@@ -2248,9 +2266,6 @@ $(eval $(call 
SingleProfile,TPLINK,64kraw,TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,tt
 $(eval $(call 
SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,4M))
 $(eval $(call 
SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M))
 
-$(eval $(call 
SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
-$(eval $(call 
SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v
 3.13.99))
-
 $(eval $(call 
SingleProfile,TPLINK-64K,64kraw,TLWDR6500V2,tl-wdr6500-v2,TL-WDR6500-v2,ttyS0,115200,0x6502,1,8Mlzma))
 
 $(eval $(call 
SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
@@ -2296,7 +2311,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1))
 $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 
TLWR841NV7))
 $(eval $(call MultiProfile,TLWR842,TLWR842V1))
 $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
-$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
+$(eval $(call MultiProfile,TLWR1043,TLWR1043V1))
 $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
 $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
-- 
2.6.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/6] ar71xx/image: refactor tplink-chn-v2 devices

2015-10-09 Thread Alexander Couzens
* use build step mktplinkfw with extra arguments
* remove now unused mktplinkfw-chn-v2
* use Device/tplink

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 34 +-
 1 file changed, 5 insertions(+), 29 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 2dd7798..1fece37 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -56,17 +56,6 @@ define Build/mktplinkfw
$(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
 endef
 
-define Build/mktplinkfw-chn-v2
-   -$(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) -m 2 \
-   -k $(word 1,$^) \
-   -r $@ \
-   -o $@.new \
-   -j -X 0x4 \
-   -a $(call rootfs_align,$(FILESYSTEM)) \
-   $(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
-endef
-
 # mktplinkfw-initramfs 
 #
 # -c combined image
@@ -80,16 +69,6 @@ define Build/mktplinkfw-initramfs
@mv $@.new $@
 endef
 
-define Build/mktplinkfw-initramfs-chn-v2
-   $(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) -m 2 \
-   -k $@ \
-   -o $@.new \
-   -s -S \
-   -c
-   @mv $@.new $@
-endef
-
 define Build/loader-common
rm -rf $@.src
$(MAKE) -C lzma-loader \
@@ -278,12 +257,9 @@ define Device/tplink
 endef
 
 define Device/tplink-chn-v2
-  TPLINK_HWREV := 0x1
-  KERNEL := kernel-bin | patch-cmdline | lzma
-  KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | 
mktplinkfw-initramfs-chn-v2
-  IMAGES := sysupgrade.bin factory.bin
-  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw-chn-v2 sysupgrade
-  IMAGE/factory.bin := append-rootfs | mktplinkfw-chn-v2 factory
+$(Device/tplink)
+  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade "-m 2"
+  IMAGE/factory.bin := append-rootfs | mktplinkfw factory "-m 2"
 endef
 
 define Device/tplink-nolzma
@@ -363,6 +339,7 @@ define Device/mw4530r-v1
 $(Device/tl-wdr4300-v1)
   TPLINK_HWID := 0x4531
 endef
+TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il 
tl-wdr4310-v1 mw4530r-v1
 
 define Device/tl-wdr3320-v2
 $(Device/tplink-chn-v2-4mlzma)
@@ -370,8 +347,7 @@ $(Device/tplink-chn-v2-4mlzma)
   DEVICE_PROFILE = TLWDR3320V2
   TPLINK_HWID := 0x3322
 endef
-
-TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il 
tl-wdr4310-v1 mw4530r-v1 tl-wdr3320-v2
+TARGET_DEVICES += tl-wdr3320-v2
 
 define Device/archer-c5
 $(Device/tplink-16mlzma)
-- 
2.6.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/6] ar71xx/image: remove old build step TPLINK-LZMA

2015-10-09 Thread Alexander Couzens
all boards has been migrated to the new build step

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 29 +
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 6c84a39..f63c734 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1002,7 +1002,7 @@ endef
 
 SINGLE_PROFILES:=
 
-# $(1)  : name of image build method to be used, e.g., TPLINK-LZMA, 
AthLzma.
+# $(1)  : name of image build method to be used, e.g., AthLzma.
 # $(2)  : name of the build template to be used, e.g. 64k, 64kraw, 128k, 
etc.
 # $(3)  : name of the profile to be defined.
 # $(4)  : board name.
@@ -1780,33 +1780,6 @@ define Image/Build/TPLINK/initramfs
 endef
 
 
-Image/Build/TPLINK-LZMA/buildkernel=$(call PatchKernelLzma,$(2),$(3))
-
-define Image/Build/TPLINK-LZMA
-   -$(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \
-   -X 0x4 \
-   -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
-   -r $(KDIR)/root.$(1) \
-   -a $(call rootfs_align,$(1)) -j \
-   -o $(call factoryname,$(1),$(2))
-   -$(STAGING_DIR_HOST)/bin/mktplinkfw \
-   -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
-   -X 0x4 \
-   -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
-   -r $(KDIR)/root.$(1) \
-   -a $(call rootfs_align,$(1)) -j \
-   -o $(call sysupname,$(1),$(2))
-endef
-
-define Image/Build/TPLINK-LZMA/initramfs
-   $(call PatchKernelLzma,$(2),$(3),,-initramfs)
-   -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
-   -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
-   -k $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
-   -o $(call imgname,$(1),$(2))-uImage.bin
-endef
-
 Image/Build/TPLINK-64K/buildkernel=$(call PatchKernelLzma,$(2),$(3))
 
 define Image/Build/TPLINK-64K
-- 
2.6.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/6] ar71xx/image: migrate all images based on macro TPLINK

2015-10-09 Thread Alexander Couzens
Includes images for
rnx-n360rt
tl-mr3220-v1
tl-mr3420-v1
tl-wa701n-v1
tl-wa730rev1
tl-wa7510n
tl-wa801nd-v1
tl-wa830re-v1
tl-wa901nd-v1
tl-wa901nd-v2
tl-wr740n-v1
tl-wr740n-v3
tl-wr743nd-v1
tl-wr841nd-v3
tl-wr841nd-v5
tl-wr841nd-v7
tl-wr842n-v1
tl-wr941nd-v2
tl-wr941nd-v3
tl-wr941nd-v4
tl-wr1043nd-v1
---
 target/linux/ar71xx/image/Makefile | 205 +
 1 file changed, 161 insertions(+), 44 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index f63c734..9bb761e 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -421,6 +421,15 @@ define Device/gl-inet-6416A-v1
 endef
 TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
 
+define Device/rnx-n360rt
+$(Device/tplink-4m)
+BOARDNAME := TL-WR941ND
+DEVICE_PROFILE := RNXN360RT
+TPLINK_HWID := 0x09410002
+TPLINK_HWREV := 0x00420001
+endef
+TARGET_DEVICES += rnx-n360rt
+
 define Device/mc-mac1200r
 $(Device/tplink-8mlzma)
 BOARDNAME := MC-MAC1200R
@@ -503,6 +512,13 @@ define Device/tl-mr3040-v2
 CONSOLE := ttyATH0,115200
 endef
 
+define Device/tl-mr3220-v1
+$(Device/tplink-4m)
+BOARDNAME := TL-MR3220
+DEVICE_PROFILE := TLMR3220
+TPLINK_HWID := 0x3221
+endef
+
 define Device/tl-mr3220-v2
 $(Device/tplink-4mlzma)
 BOARDNAME := TL-MR3220-v2
@@ -511,13 +527,20 @@ define Device/tl-mr3220-v2
 CONSOLE := ttyATH0,115200
 endef
 
+define Device/tl-mr3420-v1
+$(Device/tplink-4m)
+BOARDNAME := TL-MR3420
+DEVICE_PROFILE := TLMR3420
+TPLINK_HWID := 0x3421
+endef
+
 define Device/tl-mr3420-v2
 $(Device/tplink-4mlzma)
 BOARDNAME := TL-MR3420-v2
 DEVICE_PROFILE := TLMR3420
 TPLINK_HWID := 0x3422
 endef
-TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v2 
tl-mr3420-v2
+TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 
tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2
 
 define Device/tl-wr703n-v1
 $(Device/tplink-4mlzma)
@@ -560,6 +583,20 @@ define Device/tl-wr720n-v4
 endef
 TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 
tl-wr720n-v4
 
+define Device/tl-wr740n-v1
+$(Device/tplink-4m)
+BOARDNAME := TL-WR741ND
+DEVICE_PROFILE := TLWR740
+TPLINK_HWID := 0x0741
+endef
+
+define Device/tl-wr740n-v3
+$(Device/tplink-4m)
+BOARDNAME := TL-WR741ND
+DEVICE_PROFILE := TLWR740
+TPLINK_HWID := 0x0743
+endef
+
 define Device/tl-wr740n-v4
 $(Device/tplink-4mlzma)
 BOARDNAME := TL-WR741ND-v4
@@ -606,6 +643,13 @@ define Device/tl-wr741nd-v5
 CONSOLE := ttyATH0,115200
 endef
 
+define Device/tl-wr743nd-v1
+$(Device/tplink-4m)
+BOARDNAME := TL-WR741ND
+DEVICE_PROFILE := TLWR743
+TPLINK_HWID := 0x07430001
+endef
+
 define Device/tl-wr743nd-v2
 $(Device/tplink-4mlzma)
 BOARDNAME := TL-WR741ND-v4
@@ -613,7 +657,29 @@ define Device/tl-wr743nd-v2
 TPLINK_HWID := 0x07430002
 CONSOLE := ttyATH0,115200
 endef
-TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 
tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v2
+TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 
tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 
tl-wr743nd-v2
+
+define Device/tl-wr841nd-v3
+$(Device/tplink-4m)
+BOARDNAME := TL-WR941ND
+DEVICE_PROFILE := TLWR841
+TPLINK_HWID := 0x08410003
+TPLINK_HWREV := 3
+endef
+
+define Device/tl-wr841nd-v5
+$(Device/tplink-4m)
+BOARDNAME := TL-WR741ND
+DEVICE_PROFILE := TLWR841
+TPLINK_HWID := 0x08410005
+endef
+
+define Device/tl-wr841nd-v7
+$(Device/tplink-4m)
+BOARDNAME := TL-WR841N-v7
+DEVICE_PROFILE := TLWR841
+TPLINK_HWID := 0x08410007
+endef
 
 define Device/tl-wr841n-v8
 $(Device/tplink-4mlzma)
@@ -629,6 +695,13 @@ define Device/tl-wr841n-v9
 TPLINK_HWID := 0x08410009
 endef
 
+define Device/tl-wr842n-v1
+$(Device/tplink-8m)
+BOARDNAME := TL-MR3420
+DEVICE_PROFILE := TLWR842
+TPLINK_HWID := 0x08420001
+endef
+
 define Device/tl-wr842n-v2
 $(Device/tplink-8mlzma)
 BOARDNAME := TL-WR842N-v2
@@ -649,7 +722,30 @@ define Device/tl-wr847n-v8
 DEVICE_PROFILE := TLWR841
 TPLINK_HWID := 0x08470008
 endef
-TARGET_DEVICES += tl-wr841n-v8 tl-wr841n-v9 tl-wr842n-v2 tl-wr843nd-v1 
tl-wr847n-v8
+TARGET_DEVICES += tl-wr841nd-v3 tl-wr841nd-v5 tl-wr841nd-v7 tl-wr841n-v8 
tl-wr841n-v9 tl-wr842n-v1 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
+
+define Device/tl-wr941nd-v2
+$(Device/tplink-4m)
+BOARDNAME := TL-WR941ND
+DEVICE_PROFILE := TLWR941
+TPLINK_HWID := 0x09410002
+TPLINK_HWREV := 2
+endef
+
+define Device/tl-wr941nd-v3
+$(Device/tplink-4m)
+BOARDNAME := TL-WR941ND
+DEVICE_PROFILE := TLWR941
+TPLINK_HWID := 0x09410002
+TPLINK_HWREV := 2
+endef
+
+define Device/tl-wr941nd-v4
+$(Device/tplink-4m)
+BOARDNAME := TL-WR741ND
+DEVICE_PROFILE := TLWR941
+TPLINK_HW

[OpenWrt-Devel] [PATCH] omap/Beagleboard: remove FEATURES override

2015-10-10 Thread Alexander Couzens
It overrides the feature list of the whole target.

Signed-off-by: Alexander Couzens 
---
 target/linux/omap/profiles/beagleboard.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/omap/profiles/beagleboard.mk 
b/target/linux/omap/profiles/beagleboard.mk
index 4658287..3cf51d4 100644
--- a/target/linux/omap/profiles/beagleboard.mk
+++ b/target/linux/omap/profiles/beagleboard.mk
@@ -7,7 +7,6 @@
 
 define Profile/BEAGLEBOARD
NAME:=EBV BeagleBoard
-   FEATURES:= usb ext4 targz
DEFAULT_PACKAGES += kmod-usb2 kmod-usb2-omap \
kmod-usb-net kmod-usb-net-asix \
kmod-usb-net-asix-ax88179 kmod-usb-net-hso \
-- 
2.5.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] proto 'none' overwriting tun interfaces

2015-10-12 Thread Alexander Couzens
hi Adam,

I can confirm this bug.
You may open a ticket on dev.openwrt.org

best,
lynxis


pgpLsloA4JMqy.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] ar71xx: add support for TP-LINK TL-WR841N/ND v10

2015-10-25 Thread Alexander Couzens
Hi Matthias,

as long you can not flash the exact same image as v9,
you have to create a mips machine, but you can use the same setup
function as v9.

Many parts of openwrt use the mips machine to detect the board, like
sysupgrade.

Add your machine id to
target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
and use the MIPS_MACHINE macro in 
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c

Best
lynxis

PS. Nice catch on the revision/version fix for ar9533. The problem why
v9 didn't work in the first time was quite similiar.

On Thu, 22 Oct 2015 14:01:40 +0200
Matthias Schiffer  wrote:

> The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some
> minor changes, it contains a newer revision of the QCA9533 SoC and
> the CPU clock is significantly higher.
> 
> Signed-off-by: Matthias Schiffer 
> ---
>  target/linux/ar71xx/image/Makefile | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile index 7759a0d..a659af9 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -704,6 +704,13 @@ define Device/tl-wr841n-v9
>  TPLINK_HWID := 0x08410009
>  endef
>  
> +define Device/tl-wr841n-v10
> +$(Device/tplink-4mlzma)
> +BOARDNAME := TL-WR841N-v9
> +DEVICE_PROFILE := TLWR841
> +TPLINK_HWID := 0x08410010
> +endef
> +
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpgHUvyqxe1a.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] ar71xx: add support for TP-LINK TL-WR841N/ND v10

2015-10-26 Thread Alexander Couzens
On Mon, 26 Oct 2015 01:21:58 +0100
Matthias Schiffer  wrote:

> Thanks, but I know what I'm doing. The hardware is similar enough to
> boot with the exact same initialization routines as the v9, thus
> reusing the BOARDNAME is fine (it is done like this for other
> hardware as well - OpenWrt has a distinction between "board" and
> "model", where multiple models can have the same board, but still
> each model has its own images)
> 
> On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
> against the one in the flash, the BOARDNAME doesn't matter (except to
> determine that it is a TP-LINK device).

Sorry, no offensive. I forgot the tplink specific check within
sysupgrade.


pgpWoicOvHEwn.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] ar71xx: add support for TP-LINK TL-WR841N/ND v10

2015-10-26 Thread Alexander Couzens
After taking some time to think about this.

Wouldn't luci tell the user it's running on a 841 v9?
This could confuse them because a v9 sysupgrade wouldn't work.
sysupgrade fails then. Also an automatic upgrade based on system info
wouldn't work either.

As long we don't have dts support, I see here two solution. Add another
mips machine or change the board detection to detect this difference.

Best,
lynxis

On Mon, 26 Oct 2015 15:28:09 +0100
Alexander Couzens  wrote:

> On Mon, 26 Oct 2015 01:21:58 +0100
> Matthias Schiffer  wrote:
> 
> > Thanks, but I know what I'm doing. The hardware is similar enough to
> > boot with the exact same initialization routines as the v9, thus
> > reusing the BOARDNAME is fine (it is done like this for other
> > hardware as well - OpenWrt has a distinction between "board" and
> > "model", where multiple models can have the same board, but still
> > each model has its own images)
> > 
> > On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
> > against the one in the flash, the BOARDNAME doesn't matter (except
> > to determine that it is a TP-LINK device).  
> 
> Sorry, no offensive. I forgot the tplink specific check within
> sysupgrade.



-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpnPCcVPhvn6.pgp
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/7] migrate tl-wr841nd-v1.5 tl-wdr6500-v2

2015-10-30 Thread Alexander Couzens
Hi,

it would be nice if somebody who has these boards
can test it.

- tl-wdr6500-v2
- tl-wr841nd-v1.5

Best
lynxis

Alexander Couzens (7):
  ar71xx/image: introduce TPLINK_HEADER_VERSION variable for tplink
image
  ar71xx/image: refactor templates tplink-chn-v2
  ar71xx/image: migrate tl-wdr6500-v2 to new image build steps
  ar71xx/image: remove old unused build step TPLINK-64K
  ar71xx/image: migrate tl-wr841nd-v1.5 to new build step using
squashfs+jffs2 instead of squashfs-only
  ar71xx/image: remove old unused build code for TPLINKOLD
  ar71xx/image: remove old unused build code for TPLINK

 target/linux/ar71xx/image/Makefile | 142 +++--
 1 file changed, 24 insertions(+), 118 deletions(-)

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


[OpenWrt-Devel] [PATCH 1/7] ar71xx/image: introduce TPLINK_HEADER_VERSION variable for tplink image

2015-10-30 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/image/Makefile | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index a659af9..8cfad76 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -48,6 +48,7 @@ endef
 define Build/mktplinkfw
-$(STAGING_DIR_HOST)/bin/mktplinkfw \
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) $2 \
+   -m $(TPLINK_HEADER_VERSION) \
-k $(word 1,$^) \
-r $@ \
-o $@.new \
@@ -62,6 +63,7 @@ endef
 define Build/mktplinkfw-initramfs
$(STAGING_DIR_HOST)/bin/mktplinkfw \
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) 
-N OpenWrt -V $(REVISION) $2 \
+   -m $(TPLINK_HEADER_VERSION) \
-k $@ \
-o $@.new \
-s -S \
@@ -99,7 +101,7 @@ define Build/copy-file
cat "$(1)" > "$@"
 endef
 
-DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT
+DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT 
TPLINK_HEADER_VERSION
 
 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
 # UBNT_TYPE e.g. one of (BZ, XM, XW)
@@ -249,6 +251,7 @@ TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch 
wndrmac wndrmacv2
 
 define Device/tplink
   TPLINK_HWREV := 0x1
+  TPLINK_HEADER_VERSION := 1
   KERNEL := kernel-bin | patch-cmdline | lzma
   KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
   IMAGES := sysupgrade.bin factory.bin
@@ -258,8 +261,9 @@ endef
 
 define Device/tplink-chn-v2
 $(Device/tplink)
-  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade "-m 2"
-  IMAGE/factory.bin := append-rootfs | mktplinkfw factory "-m 2"
+  TPLINK_HEADER_VERSION := 2
+  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
+  IMAGE/factory.bin := append-rootfs | mktplinkfw factory
 endef
 
 define Device/tplink-nolzma
-- 
2.6.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/7] ar71xx/image: refactor templates tplink-chn-v2

2015-10-30 Thread Alexander Couzens
---
 target/linux/ar71xx/image/Makefile | 16 ++--
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 8cfad76..f0c3a66 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -259,13 +259,6 @@ define Device/tplink
   IMAGE/factory.bin := append-rootfs | mktplinkfw factory
 endef
 
-define Device/tplink-chn-v2
-$(Device/tplink)
-  TPLINK_HEADER_VERSION := 2
-  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
-  IMAGE/factory.bin := append-rootfs | mktplinkfw factory
-endef
-
 define Device/tplink-nolzma
 $(Device/tplink)
   LOADER_FLASH_OFFS := 0x22000
@@ -305,12 +298,6 @@ $(Device/tplink)
   IMAGE_SIZE := 15872k
 endef
 
-define Device/tplink-chn-v2-4mlzma
-$(Device/tplink-chn-v2)
-  TPLINK_FLASHLAYOUT := 4Mlzma
-  IMAGE_SIZE := 3904k
-endef
-
 define Device/tl-wdr4300-v1
 $(Device/tplink-8mlzma)
   BOARDNAME = TL-WDR4300
@@ -346,10 +333,11 @@ endef
 TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il 
tl-wdr4310-v1 mw4530r-v1
 
 define Device/tl-wdr3320-v2
-$(Device/tplink-chn-v2-4mlzma)
+$(Device/tplink-4mlzma)
   BOARDNAME = TL-WDR3320-v2
   DEVICE_PROFILE = TLWDR3320V2
   TPLINK_HWID := 0x3322
+  TPLINK_HEADER_VERSION := 2
 endef
 TARGET_DEVICES += tl-wdr3320-v2
 
-- 
2.6.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


  1   2   3   >