Re: [LEDE-DEV] externalizing package management?

2017-01-11 Thread Oswald Buddenhagen
On Wed, Jan 11, 2017 at 11:00:04AM +0100, Jo-Philipp Wich wrote:
> > in my understanding, sysupgrade images (and uimages) are a pretty
> > uniform archive format,
> 
> Actually they're not. There are factory and sysupgrade images which are
> renamed tars, there are trx images, there are FIT images, proprietary
> vendor formats, images containing images and whole lot of other types.
> 
well, that complicates things a bit.
but somehow sysupgrade itself is able to deal with them. so the
worst-case appears to be that the image wouldn't be re-packed, and thus
end up bigger than if it would be actually created from scratch. that's
not worse than if the packages are installed manually.
or am i missing some relevant detail again?

> > a single generic tool should be able to work with all targets, over
> > extended periods of time, and would need to support a rather limited
> > number of features to accomplish the goal of building images from the
> > "regular" image+package downloads that are already available.
> 
> The only real solution is something GNU make based in order to be able
> to re-use the image format knowledge encoded in the per target
> Makefiles. Anything else requires duplication of the image build logic
> which can, and will, quickly diverge from whats in Master.
> 
actually, not the only solution: it's also possible to use a yet
higher-level description, and generate makefile fragments from that.
if this was abstract enough, it could be used as a recipe for unpacking
the images as well, without specifying it separately. obviously, the
backends would need to duplicate the available transforms, but the
amount of work required doesn't seem _extraordinary_ if the goal is
deemed worthwhile.

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


Re: [LEDE-DEV] how to make sysupgrade not drop user-installed packages

2017-01-11 Thread Oswald Buddenhagen
On Wed, Jan 11, 2017 at 10:54:10AM +0100, Jo-Philipp Wich wrote:
> > there doesn't appear to be anything hard about having the build bots
> > include a file into /etc which contains the _current_ repository
> > url, subdirectory, and image name.
> 
> you forget that up until very recently the same kernel and rootfs was
> used for many different images only varying in filename, image header
> and kernel command line.
>
well, i didn't forget it, i never knew it. ;)

> The squashfs was not repacked for each individual device image, which
> made it impossible to add an individual file into /etc/ for each
> device specific image.
> 
even that wouldn't have been an obstacle, as the image name could be
passed on the command line as well.

not that this would be relevant at this time. my point is simply that
embedding the required meta-data isn't the hard part.

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


[LEDE-DEV] [PATCH] ath10k-firmware: Update QCA988X firmware to latest version

2017-01-11 Thread Timo Sigurdsson
This patch updates the QCA988X firmware to the latest revision
  firmware-5.bin_10.2.4-1.0-00016
found in the official ath10k-firmware repository.

Tested on TP-Link Archer C7 v2.

Signed-off-by: Timo Sigurdsson 
---
 package/firmware/ath10k-firmware/Makefile | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index 5091663..e441700 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ath10k-firmware
-PKG_SOURCE_DATE:=2016-12-15
-PKG_SOURCE_VERSION:=fead2ed867af4e107265059b9f578179d7409867
-PKG_MIRROR_HASH:=87fb1998a728b3182d208b978185232decf49d1c72d1ec37c529fa9139354dcb
+PKG_SOURCE_DATE:=2017-01-11
+PKG_SOURCE_VERSION:=ab432c60437931a165f0aff1a6e3371f358b75dd
+PKG_MIRROR_HASH:=e3188ecd4d7470d3cdde89fefa6258f9ec4f404b23558d1474e5014679b28101
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -220,7 +220,7 @@ define Package/ath10k-firmware-qca988x/install
$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
-   
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4.70/firmware-5.bin_10.2.4.70.59-2 \
+   
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00016 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
 endef
 
-- 
2.1.4


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


Re: [LEDE-DEV] Branching LEDE 17.01

2017-01-11 Thread Jo-Philipp Wich
Hi Ted,

so no one else objected and you want to hold of until after the weekend;
therefor I propose to branch on Monday, the 16th.

~ Jo



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


Re: [LEDE-DEV] [OpenWrt-Devel] Data_Model_Structure_Proposal_for_OpenWRT

2017-01-11 Thread Sukru Senli
Hi Weedy,

Thank you for forwarding the email to LEDE dev list.

I was under the impression that OpenWrt and LEDE dev lists were subscribed to 
each other, but I think it was a misjudgement.

Thanks again.

Regards,
Sukru


From: Weedy [weedy2...@gmail.com]
Sent: Wednesday, January 11, 2017 6:26 PM
To: LEDE Development List
Cc: Sukru Senli
Subject: Fwd: [OpenWrt-Devel] Data_Model_Structure_Proposal_for_OpenWRT

For exposure

-- Forwarded message --
From: "Sukru Senli" >
Date: 9 Jan 2017 6:22 a.m.
Subject: [OpenWrt-Devel] Data_Model_Structure_Proposal_for_OpenWRT
To: "open...@lists.prplfoundation.org
"
>
Cc: "openwrt-de...@lists.openwrt.org
"
>

Dear OpenWrt community,

As we know OpenWrt is gaining popularity among industry players,
especially in residential gateway world. Being one of these industry
player who has been developing OpenWrt based software for over five
years now and being a devoted user of the two core components, UBUS and
UCI, as Inteno, we see two obstacles in OpenWRT on its’ way to be the
undisputed choice for the majority of the gateway vendors:

Configuration of an entity and data collection from the same entity
cannot be achieved via single object:
-
For any on-top applications Inteno or third party developers build
(WebGUI, remote applications etc.) we have to interact with both UBUS
and UCI (libuci or uci object on ubus) to be able to control a single
entity. This makes it more difficult for developers as they have to know
not only what ubus objects but also what uci files and sections they
must interact with, and interacting with two components increases the
number of the code they have to write. It also makes it quite
complicated in terms of access control towards an entity of the software.

There are no ubus data models defined for controlling the entities:

If there were data models defined for how to configure/control the
different entities of the software (network, wireless. voice etc.), any
application built on top of this data model would seamlessly work across
different platforms and OpenWRT based systems as long as the
applications controlling these entities were following the data model.
Moreover, a defined data model for ubus based on a data model structure
which addresses the first problem, UCI would no longer be mandatory
which makes OpenWRT much easier to adapt to for many vendors out there.

We believe the solution to these problems would be developing a data
model structure towards OpenWRT's ubus with features such as:
- JSON based, well formatted, easy to use/understand
- supports auto code and document generation
- contains version, properties (configuration), methods, valid data
types/ranges, error codes per object
- allows configuration, data collection and actions within the same
object as opposed to OpenWRT today where ubus methods + UCI (using ubus
uci object or libuci or /sbin/uci directly) are used.

Supporting such a data model structure, the ultimate goal would be to
create an OpenWrt data model to be standardized (ubus objects for
controlling network, wireless, voice etc.) in order to achieve
compatibility across different OpenWrt based systems.

IN THE ATTACHMENT, you will find the proposal in PDF format with more
technical details and examples.

We believe this is a crucial step, when taken, will facilitate the
adaptation of OpenWrt for the device vendors who are hesitant to it now
as well as for application developers who depends on the availability of
certain objects because they will not have to maintain different
versions for different OpenWrt based systems.

Thank you for your attention and looking forward to your feedback.

Regards,
Sukru Senli
___
openwrt-devel mailing list
openwrt-de...@lists.openwrt.org 
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



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


[LEDE-DEV] [PATCH] ar71xx: add Abicom SC300M support

2017-01-11 Thread Conor O'Gorman
Support Abicom International Scorpion SC300M Module

QCA9550 700MHz Extended Temperature Range
256MB DDR2
256MB Nand Flash
16MB SPI Flash
802.11a/na/b/g/ng
GPIO x 22, USB x2, PCIe x2
10/100/1000 Ethernet
23dBm, Optional Onboard Antenna
DC Input, 8-20V DC
85 x 55 mm

Signed-off-by: Conor O'Gorman 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   1 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +-
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-sc300m.c | 132 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk   |  10 ++
 11 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-sc300m.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 5a2bf0c..5be9d4a 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -279,6 +279,7 @@ gl-mifi)
esac
;;
 gl-domino|\
+sc300m|\
 wrt160nl)
ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
;;
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 66274db..54069ce 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -93,6 +93,7 @@ ar71xx_setup_interfaces()
rb-sxt5n|\
re450|\
rocket-m-xw|\
+   sc300m |\
tl-mr10u|\
tl-mr11u|\
tl-mr12u|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index d060ccf..36f2c43 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -295,7 +295,8 @@ get_status_led() {
rb-sxt5n)
status_led="rb:green:power"
;;
-   re450)
+   re450|\
+   sc300m)
status_led="$board:blue:power"
;;
routerstation|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1b30f4d..a8bdc67 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -881,6 +881,9 @@ ar71xx_board_detect() {
*RW2458N)
name="rw2458n"
;;
+   *SC300M)
+   name="sc300m"
+   ;;
*"SMART-300")
name="smart-300"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6341a31..74808ef 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -226,6 +226,7 @@ platform_check_image() {
rocket-m-xw|\
rocket-m|\
rw2458n|\
+   sc300m|\
sr3200|\
tew-632brp|\
tew-712br|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 4b2f736..daffdea 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -147,6 +147,7 @@ CONFIG_ATH79_MACH_R6100=y
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
 CONFIG_ATH79_MACH_RE450=y
 CONFIG_ATH79_MACH_RW2458N=y
+CONFIG_ATH79_MACH_SC300M=y
 CONFIG_ATH79_MACH_SMART_300=y
 CONFIG_ATH79_MACH_SOM9331=y
 CONFIG_ATH79_MACH_SR3200=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 21d6b51..56889d7 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1,3 +1,14 @@
+config ATH79_MACH_SC300M
+   bool "Abicom SC300M board support"
+   select SOC_QCA955X
+   select ATH79_DEV_AP9X_PCI if PCI
+   select ATH79_DEV_ETH
+   select ATH79_DEV_GPIO_BUTTONS
+   select ATH79_DEV_LEDS_GPIO
+   select ATH79_DEV_M25P80
+   select ATH79_DEV_USB
+   select ATH79_DEV_WMAC
+
 config ATH79_MACH_ALFA_AP120C
bool "ALFA Network AP120C board support"
select ATH79_DEV_AP9X_PCI if PCI
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile 
b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 6384c06..915b34e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
@@ -151,6 +151,7 @@ obj-$(CONFIG_ATH79_MACH_RB95X)  += 

[LEDE-DEV] Support for tplink 710 v2.1

2017-01-11 Thread Ufo
when using tplink 710v2.1 there is some strange behaviuor with filenames 
and system-infos:

That dot "." is evil, better use "-".

The hardware is same as 710v1 (8MB flash) but when flashing v2.1 
Firmware the system think its v2 (the dot and 1 might be ignored by 
/tmp/sysinfo/*) which only has 4MB flash.


my workaround for that problem since 8 months is to flash 710v1 (8mb 
flash) firmware right after the initial v.2.1 "factory" flash, with -F 
option :-/
Also the Meshkit (webfrontend for imagebuilder) shows wrong 
hardware-name for 2.1 Router.


i think, best solution would be to rename the model (modify the . into - 
) to 710 v2-1. i cant see such versionnumbering on other devices from 
tplink. :-/


cheers ufo

p.s.
problem is also mentioned here, with screenshot: 
https://plan.leipzig.freifunk.net/issues/260
i was mentioning it at gluon firmware ticketsystem already, but 
neoraider were not able to help me, because gluon isnt using normal 
openwrt/lede stuff like /tmp/sysinfo/*, but libplatforminfo & 
autoupdater are only gluon-specific things. 
https://github.com/freifunk-gluon/gluon/issues/691


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


Re: [LEDE-DEV] [PATCH] mtd: Fix the soft reboot problem found on MediaTek devices with 32M Flash.

2017-01-11 Thread Mathias Kresin
2017-01-11 14:25 GMT+01:00 L. D. Pinney :
> This patch resets the spi to 3 byte mode needed for devices with more than 
> 16M Flash.
> Tested on the Onion Omega2+ (MT7688)
>
> Signed-off-by: L. D. Pinney 
> Tested-by: Nita Vesa 
>
> ---
>
> diff --git 
> a/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch 
> b/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch
> new file mode 100644
> index 000..b126411
> --- /dev/null
> +++ b/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch
> @@ -0,0 +1,24 @@
> +Index: linux-4.4.40/drivers/mtd/devices/m25p80.c
> +===
> +--- linux-4.4.40.orig/drivers/mtd/devices/m25p80.c
>  linux-4.4.40/drivers/mtd/devices/m25p80.c
> +@@ -261,6 +261,11 @@ static int m25p_remove(struct spi_device
> + {
> +   struct m25p *flash = spi_get_drvdata(spi);
> +
> ++  flash->command[0] = 0x66;
> ++  spi_write(flash->spi, flash->command, 1);
> ++  flash->command[0] = 0x99;
> ++  spi_write(flash->spi, flash->command, 1);
> ++
> +   /* Clean up MTD stuff. */
> +   return mtd_device_unregister(>spi_nor.mtd);
> + }
> +@@ -328,6 +333,7 @@ static struct spi_driver m25p80_driver =
> +   .id_table   = m25p_ids,
> +   .probe  = m25p_probe,
> +   .remove = m25p_remove,
> ++  .shutdown = m25p_remove,
> +
> +   /* REVISIT: many of these chips have deep power-down modes, which
> +* should clearly be entered on suspend() to minimize power use.

NAK!

This patch was already send as Github PR and dropped in favour of
backporting a patch that was send to linux-mtd. Have a look at
https://github.com/lede-project/source/pull/620 for details.

Mathias

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


[LEDE-DEV] [PATCH] mtd: Fix the soft reboot problem found on MediaTek devices with 32M Flash.

2017-01-11 Thread L. D. Pinney
This patch resets the spi to 3 byte mode needed for devices with more than 16M 
Flash.
Tested on the Onion Omega2+ (MT7688)

Signed-off-by: L. D. Pinney 
Tested-by: Nita Vesa 

---

diff --git a/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch 
b/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch
new file mode 100644
index 000..b126411
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/101-spi-reset-to-3-byte-mode.patch
@@ -0,0 +1,24 @@
+Index: linux-4.4.40/drivers/mtd/devices/m25p80.c
+===
+--- linux-4.4.40.orig/drivers/mtd/devices/m25p80.c
 linux-4.4.40/drivers/mtd/devices/m25p80.c
+@@ -261,6 +261,11 @@ static int m25p_remove(struct spi_device
+ {
+   struct m25p *flash = spi_get_drvdata(spi);
+ 
++  flash->command[0] = 0x66;
++  spi_write(flash->spi, flash->command, 1);
++  flash->command[0] = 0x99;
++  spi_write(flash->spi, flash->command, 1);
++
+   /* Clean up MTD stuff. */
+   return mtd_device_unregister(>spi_nor.mtd);
+ }
+@@ -328,6 +333,7 @@ static struct spi_driver m25p80_driver =
+   .id_table   = m25p_ids,
+   .probe  = m25p_probe,
+   .remove = m25p_remove,
++  .shutdown = m25p_remove,
+ 
+   /* REVISIT: many of these chips have deep power-down modes, which
+* should clearly be entered on suspend() to minimize power use.

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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Felix Fietkau
On 2017-01-11 12:59, Cezary Jackiewicz wrote:
> Dnia 2017-01-11, o godz. 12:27:48
> Felix Fietkau  napisał(a):
> 
>> Seems that the upstream spi-rb4xx.c driver does not work as-is. I've
>> pushed a less intrusive fix now.
> 
> Looks good:
> 
> [7.785083] m25p80 spi0.0: pm25lv512 (64 Kbytes)
> [7.840505] Creating 4 MTD partitions on "spi0.0":
> [7.897972] 0x-0xb000 : "routerboot"
> [7.966301] 0xb000-0xc000 : "hard_config"
> [8.033912] 0xd000-0xf000 : "bios"
> [8.094198] 0xf000-0x0001 : "soft_config"
> [8.161987] NAND flash driver for RouterBoard 4xx series version 0.2.0
> [8.240717] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
> [8.316902] nand: Samsung NAND 128MiB 3,3V 8-bit
> [8.372244] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB 
> size: 64
> [8.463047] Scanning device for bad blocks
> [8.999658] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
> [9.073823] 0x-0x0004 : "booter"
> [9.135610] 0x0004-0x0040 : "kernel"
> [9.197817] 0x0040-0x0800 : "ubi"
> 
> Sysupgrade works fine - from initramfs and again after boot
> from flash. (rb411u)
Thanks for testing. I've pushed the driver fixes to master now.

- Felix


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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Cezary Jackiewicz
Dnia 2017-01-11, o godz. 12:27:48
Felix Fietkau  napisał(a):

> Seems that the upstream spi-rb4xx.c driver does not work as-is. I've
> pushed a less intrusive fix now.

Looks good:

[7.785083] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[7.840505] Creating 4 MTD partitions on "spi0.0":
[7.897972] 0x-0xb000 : "routerboot"
[7.966301] 0xb000-0xc000 : "hard_config"
[8.033912] 0xd000-0xf000 : "bios"
[8.094198] 0xf000-0x0001 : "soft_config"
[8.161987] NAND flash driver for RouterBoard 4xx series version 0.2.0
[8.240717] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[8.316902] nand: Samsung NAND 128MiB 3,3V 8-bit
[8.372244] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB 
size: 64
[8.463047] Scanning device for bad blocks
[8.999658] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
[9.073823] 0x-0x0004 : "booter"
[9.135610] 0x0004-0x0040 : "kernel"
[9.197817] 0x0040-0x0800 : "ubi"

Sysupgrade works fine - from initramfs and again after boot
from flash. (rb411u)


-- 
Pozdrawiam,
 Cezary Jackiewicz

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


[LEDE-DEV] [PATCH 1/2] ubox: install kernel module utilities to /sbin directory

2017-01-11 Thread Yousong Zhou
This is how other Linux distributions are doing and kernel
modprobe_path[] of request_module() also has a default value of
/sbin/modprobe

Signed-off-by: Yousong Zhou 
---
 package/system/ubox/Makefile | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile
index 8900c67..8edfe6e 100644
--- a/package/system/ubox/Makefile
+++ b/package/system/ubox/Makefile
@@ -34,11 +34,11 @@ define Package/ubox/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib
 
-   $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod
-   $(LN) ../../sbin/kmodloader $(1)/usr/sbin/insmod
-   $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod
-   $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo
-   $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe
+   $(LN) kmodloader $(1)/sbin/rmmod
+   $(LN) kmodloader $(1)/sbin/insmod
+   $(LN) kmodloader $(1)/sbin/lsmod
+   $(LN) kmodloader $(1)/sbin/modinfo
+   $(LN) kmodloader $(1)/sbin/modprobe
 
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{logd,logread} $(1)/sbin/
$(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log
-- 
2.6.4


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


[LEDE-DEV] [PATCH 2/2] generic: keep module aliases inside .modinfo

2017-01-11 Thread Yousong Zhou
It seems module aliases are actually essential info.  E.g. other modules
may call xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1) and the
kernel will request user mode modprobe helper for ipt_hashlimit and
ip6t_hashlimit respectively which are aliases of xt_hashlimit.ko

Compile-tested for armvirt, there is nearly no size impact.

Before

-rw-r--r-- 1 yousong yousong 304 Jan 10 17:37 config.seed
-rw-r--r-- 1 yousong yousong1634 Jan 11 11:07 
lede-armvirt-default.manifest
-rw-r--r-- 1 yousong yousong 1533647 Jan 11 11:07 
lede-armvirt-default-rootfs.tar.gz
-rw-r--r-- 1 yousong yousong 1802711 Jan 11 11:07 lede-armvirt-root.ext4.gz
-rw-r--r-- 1 yousong yousong 1544597 Jan 11 11:07 
lede-armvirt-rootfs.cpio.gz
-rw-r--r-- 1 yousong yousong 1174984 Jan 11 11:07 
lede-armvirt-root.squashfs.gz
-rwxr-xr-x 1 yousong yousong 1654712 Jan 11 11:07 lede-armvirt-zImage
-rwxr-xr-x 1 yousong yousong 2738296 Jan 11 11:07 
lede-armvirt-zImage-initramfs
drwxr-xr-x 2 yousong yousong4096 Jan 10 17:35 packages
-rw-r--r-- 1 yousong yousong 739 Jan 10 17:37 sha256sums

After

-rw-r--r-- 1 yousong yousong 304 Jan 10 17:37 config.seed
-rw-r--r-- 1 yousong yousong1634 Jan 11 11:10 
lede-armvirt-default.manifest
-rw-r--r-- 1 yousong yousong 1533646 Jan 11 11:10 
lede-armvirt-default-rootfs.tar.gz
-rw-r--r-- 1 yousong yousong 1802711 Jan 11 11:10 lede-armvirt-root.ext4.gz
-rw-r--r-- 1 yousong yousong 1544593 Jan 11 11:10 
lede-armvirt-rootfs.cpio.gz
-rw-r--r-- 1 yousong yousong 1174984 Jan 11 11:10 
lede-armvirt-root.squashfs.gz
-rwxr-xr-x 1 yousong yousong 1654736 Jan 11 11:10 lede-armvirt-zImage
-rwxr-xr-x 1 yousong yousong 2738144 Jan 11 11:10 
lede-armvirt-zImage-initramfs
drwxr-xr-x 2 yousong yousong4096 Jan 10 17:35 packages
-rw-r--r-- 1 yousong yousong 739 Jan 10 17:37 sha256sums

Signed-off-by: Yousong Zhou 
---
 target/linux/generic/patches-3.18/204-module_strip.patch | 8 ++--
 target/linux/generic/patches-4.1/204-module_strip.patch  | 8 ++--
 target/linux/generic/patches-4.4/204-module_strip.patch  | 8 ++--
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/target/linux/generic/patches-3.18/204-module_strip.patch 
b/target/linux/generic/patches-3.18/204-module_strip.patch
index dab7799..844c3b5 100644
--- a/target/linux/generic/patches-3.18/204-module_strip.patch
+++ b/target/linux/generic/patches-3.18/204-module_strip.patch
@@ -5,18 +5,14 @@ Signed-off-by: Felix Fietkau 
 ---
 --- a/include/linux/module.h
 +++ b/include/linux/module.h
-@@ -84,9 +84,10 @@ void trim_init_extable(struct module *m)
+@@ -84,6 +84,7 @@ void trim_init_extable(struct module *m)
  
  /* Generic info of form tag = "info" */
  #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 +#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info)
  
  /* For userspace: you can also call me... */
--#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
-+#define MODULE_ALIAS(_alias) MODULE_INFO_STRIP(alias, _alias)
- 
- /* Soft module dependencies. See man modprobe.d for details.
-  * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz")
+ #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
 @@ -127,12 +128,12 @@ void trim_init_extable(struct module *m)
   * Author(s), use "Name " or just "Name", for multiple
   * authors use multiple MODULE_AUTHOR() statements/lines.
diff --git a/target/linux/generic/patches-4.1/204-module_strip.patch 
b/target/linux/generic/patches-4.1/204-module_strip.patch
index 4f5f647..6b5f878 100644
--- a/target/linux/generic/patches-4.1/204-module_strip.patch
+++ b/target/linux/generic/patches-4.1/204-module_strip.patch
@@ -5,18 +5,14 @@ Signed-off-by: Felix Fietkau 
 ---
 --- a/include/linux/module.h
 +++ b/include/linux/module.h
-@@ -84,9 +84,10 @@ void trim_init_extable(struct module *m)
+@@ -84,6 +84,7 @@ void trim_init_extable(struct module *m)
  
  /* Generic info of form tag = "info" */
  #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 +#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info)
  
  /* For userspace: you can also call me... */
--#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
-+#define MODULE_ALIAS(_alias) MODULE_INFO_STRIP(alias, _alias)
- 
- /* Soft module dependencies. See man modprobe.d for details.
-  * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz")
+ #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
 @@ -127,12 +128,12 @@ void trim_init_extable(struct module *m)
   * Author(s), use "Name " or just "Name", for multiple
   * authors use multiple MODULE_AUTHOR() statements/lines.
diff --git a/target/linux/generic/patches-4.4/204-module_strip.patch 
b/target/linux/generic/patches-4.4/204-module_strip.patch
index 8b807da..85805b3 100644
--- a/target/linux/generic/patches-4.4/204-module_strip.patch
+++ 

[LEDE-DEV] [PATCH ubox 3/6] kmodloader: modprobe: skip possible command line arguments

2017-01-11 Thread Yousong Zhou
The kernel may invocate user mode modprobe with the following scheme

modprobe -q -- 

Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/kmodloader.c b/kmodloader.c
index b20de6e..b5dc4d1 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -719,8 +719,17 @@ static int main_modprobe(int argc, char **argv)
 {
struct module *m;
char *name;
+   char *mod = NULL;
+   int i;
 
-   if (argc != 2)
+   if (argc < 2)
+   return print_usage("modprobe");
+   for (i = 1; i < argc; i++)
+   if (argv[i][0] != '-') {
+   mod = argv[i];
+   break;
+   }
+   if (!mod)
return print_usage("modprobe");
 
if (scan_loaded_modules())
@@ -729,7 +738,7 @@ static int main_modprobe(int argc, char **argv)
if (scan_module_folders())
return -1;
 
-   name = get_module_name(argv[1]);
+   name = get_module_name(mod);
m = find_module(name);
if (m && m->state == LOADED) {
ULOG_ERR("%s is already loaded\n", name);
-- 
2.6.4


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


[LEDE-DEV] [PATCH ubox 0/6] kmodloader: add module alias support

2017-01-11 Thread Yousong Zhou
Aliases are essential information for working with kernel modules.  Netfilter
subsystem will request for ipt_hashlimit and ip6t_hashlimit respectively when
called with

xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1)

The kernel __request_module() will then invoke user mode modprobe to load them

/sbin/modprobe -q -- ipt_hashlimit
/sbin/modprobe -q -- ip6t_hashlimit

where ipt_hashlimit and ip6t_hashlimit are aliases of xt_hashlimit

The patch depends on another patch in the build system to restore alias info
to kernel modules.

Yousong Zhou (6):
  kmodloader: remove redundant glob wildcard char
  kmodloader: log to kmsg when loading directories of modules
  kmodloader: modprobe: skip possible command line arguments
  kmodloader: fix out-of-bound access when parsing .modinfo
  kmodloader: add module alias awareness
  kmodloader: make insert_module() idempotent

 kmodloader.c | 185 +--
 1 file changed, 154 insertions(+), 31 deletions(-)

-- 
2.6.4


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


[LEDE-DEV] [PATCH ubox 6/6] kmodloader: make insert_module() idempotent

2017-01-11 Thread Yousong Zhou
To fix spurious error messages in the following situation

 1. scan loaded modules
 2. load wireguard.ko and the module itself will request xt_hashlimit to
be loaded
 3. xt_hashlimit is still in PROBE state here so we also try to load it,
but init_module() returns EEXIST

Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kmodloader.c b/kmodloader.c
index e1e4e68..036213e 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -574,8 +574,11 @@ static int insert_module(char *path, const char *options)
}
 
data = malloc(s.st_size);
-   if (read(fd, data, s.st_size) == s.st_size)
+   if (read(fd, data, s.st_size) == s.st_size) {
ret = syscall(__NR_init_module, data, (unsigned long) 
s.st_size, options);
+   if (errno == EEXIST)
+   ret = 0;
+   }
else
ULOG_ERR("failed to read full module %s\n", path);
 
-- 
2.6.4


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


[LEDE-DEV] [PATCH ubox 5/6] kmodloader: add module alias awareness

2017-01-11 Thread Yousong Zhou
To achieve this, the following changes are made

 - scan module folders before scaning loaded modules
 - struct module was splited into struct module_node for the avl tree
   and struct module for storing actual info about modules

The other minor fix is that module.opts is now freed in free_modules()
when appliable

Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 151 ++-
 1 file changed, 128 insertions(+), 23 deletions(-)

diff --git a/kmodloader.c b/kmodloader.c
index 7ea5544..e1e4e68 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -45,22 +45,31 @@ enum {
 };
 
 struct module {
-   struct avl_node avl;
-
char *name;
char *depends;
char *opts;
+   char **aliases;
+   int naliases;
 
int size;
int usage;
int state;
int error;
+   int refcnt; /* number of references from 
module_node.m */
+};
+
+struct module_node {
+   struct avl_node avl;
+   struct module *m;
+   bool is_alias;
 };
 
 static struct avl_tree modules;
 
 static char **module_folders = NULL;
 
+static void free_module(struct module *m);
+
 static int init_module_folders(void)
 {
int n = 0;
@@ -106,16 +115,26 @@ static int init_module_folders(void)
 
 static struct module *find_module(const char *name)
 {
-   struct module *m;
-   return avl_find_element(, name, m, avl);
+   struct module_node *mn;
+   mn = avl_find_element(, name, mn, avl);
+   if (mn)
+   return mn->m;
+   else
+   return NULL;
 }
 
 static void free_modules(void)
 {
-   struct module *m, *tmp;
+   struct module_node *mn, *tmp;
+
+   avl_remove_all_elements(, mn, avl, tmp) {
+   struct module *m = mn->m;
 
-   avl_remove_all_elements(, m, avl, tmp)
-   free(m);
+   m->refcnt -= 1;
+   if (m->refcnt == 0)
+   free_module(m);
+   free(mn);
+   }
 }
 
 static char* get_module_path(char *name)
@@ -208,19 +227,43 @@ static int elf_find_section(char *map, const char 
*section, unsigned int *offset
return -1;
 }
 
+static struct module_node *
+alloc_module_node(const char *name, struct module *m, bool is_alias)
+{
+   struct module_node *mn;
+   char *_name;
+
+   mn = calloc_a(sizeof(*mn),
+   &_name, strlen(name) + 1);
+   if (mn) {
+   mn->avl.key = strcpy(_name, name);
+   mn->m = m;
+   mn->is_alias = is_alias;
+   avl_insert(, >avl);
+   m->refcnt += 1;
+   }
+   return mn;
+}
+
 static struct module *
-alloc_module(const char *name, const char *depends, int size)
+alloc_module(const char *name, const char * const *aliases, int naliases, 
const char *depends, int size)
 {
struct module *m;
char *_name, *_dep;
+   char **_aliases;
+   int i, len_aliases;
 
+   len_aliases = naliases * sizeof(aliases[0]);
+   for (i = 0; i < naliases; i++)
+   len_aliases += strlen(aliases[i]) + 1;
m = calloc_a(sizeof(*m),
&_name, strlen(name) + 1,
-   &_dep, depends ? strlen(depends) + 2 : 0);
+   &_dep, depends ? strlen(depends) + 2 : 0,
+   &_aliases, len_aliases);
if (!m)
return NULL;
 
-   m->avl.key = m->name = strcpy(_name, name);
+   m->name = strcpy(_name, name);
m->opts = 0;
 
if (depends) {
@@ -231,13 +274,40 @@ alloc_module(const char *name, const char *depends, int 
size)
_dep++;
}
}
-
m->size = size;
-   avl_insert(, >avl);
+   m->naliases = naliases;
+   if (naliases == 0)
+   m->aliases = NULL;
+   else {
+   char *ptr = (char *)_aliases + naliases * sizeof(_aliases[0]);
+   int len;
+
+   i = 0;
+   do {
+   len = strlen(aliases[i]) + 1;
+   memcpy(ptr, aliases[i], len);
+   _aliases[i] = ptr;
+   ptr += len;
+   i++;
+   } while (i < naliases);
+   m->aliases = _aliases;
+   }
+
+   m->refcnt = 0;
+   alloc_module_node(m->name, m, false);
+   for (i = 0; i < m->naliases; i++)
+   alloc_module_node(m->aliases[i], m, true);
 
return m;
 }
 
+static void free_module(struct module *m)
+{
+   if (m->opts)
+   free(m->opts);
+   free(m);
+}
+
 static int scan_loaded_modules(void)
 {
size_t buf_len = 0;
@@ -262,7 +332,11 @@ static int scan_loaded_modules(void)
if (!m.name || !m.depends)
continue;
 
-   n = alloc_module(m.name, m.depends, m.size);
+   n = find_module(m.name);
+   if (!n) {
+   

[LEDE-DEV] [PATCH ubox 1/6] kmodloader: remove redundant glob wildcard char

2017-01-11 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kmodloader.c b/kmodloader.c
index f80835a..9fe7d7f 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -762,7 +762,7 @@ static int main_modprobe(int argc, char **argv)
 static int main_loader(int argc, char **argv)
 {
int gl_flags = GLOB_NOESCAPE | GLOB_MARK;
-   char *dir = "/etc/modules.d/*";
+   char *dir = "/etc/modules.d/";
struct module *m;
glob_t gl;
char *path;
-- 
2.6.4


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


[LEDE-DEV] [PATCH ubox 4/6] kmodloader: fix out-of-bound access when parsing .modinfo

2017-01-11 Thread Yousong Zhou
Fixes output of "modinfo nf_conntrack_ipv4"

module: /lib/modules/4.4.40/nf_conntrack_ipv4.ko
license:GPL
alias:  ip_conntrack
alias:  nf_conntrack-2
depends:nf_conntrack,nf_defrag_ipv4
src:%pI4 dst=%pI4

Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kmodloader.c b/kmodloader.c
index b5dc4d1..7ea5544 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -302,12 +302,14 @@ static struct module* get_module_info(const char *module, 
const char *name)
}
 
strings = map + offset;
-   while (strings && (strings < map + offset + size)) {
+   while (true) {
char *sep;
int len;
 
while (!strings[0])
strings++;
+   if (strings >= map + offset + size)
+   break;
sep = strstr(strings, "=");
if (!sep)
break;
@@ -410,12 +412,14 @@ static int print_modinfo(char *module)
 
strings = map + offset;
printf("module:\t\t%s\n", module);
-   while (strings && (strings < map + offset + size)) {
+   while (true) {
char *dup = NULL;
char *sep;
 
while (!strings[0])
strings++;
+   if (strings >= map + offset + size)
+   break;
sep = strstr(strings, "=");
if (!sep)
break;
-- 
2.6.4


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


[LEDE-DEV] [PATCH ubox 2/6] kmodloader: log to kmsg when loading directories of modules

2017-01-11 Thread Yousong Zhou
syslog may not be ready yet before PREINIT

Signed-off-by: Yousong Zhou 
---
 kmodloader.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kmodloader.c b/kmodloader.c
index 9fe7d7f..b20de6e 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -785,7 +784,7 @@ static int main_loader(int argc, char **argv)
return -1;
}
 
-   syslog(LOG_INFO, "kmodloader: loading kernel modules from %s\n", path);
+   ULOG_INFO("loading kernel modules from %s\n", path);
 
if (glob(path, gl_flags, NULL, ) < 0)
goto out;
@@ -836,6 +835,8 @@ static int main_loader(int argc, char **argv)
avl_for_each_element(, m, avl)
if ((m->state == PROBE) || (m->error))
ULOG_ERR("- %s - %d\n", m->name, 
deps_available(m, 1));
+   } else {
+   ULOG_INFO("done loading kernel modules from %s\n", path);
}
 
 out:
@@ -881,5 +882,6 @@ int main(int argc, char **argv)
if (!strcmp(exec, "modprobe"))
return main_modprobe(argc, argv);
 
+   ulog_open(ULOG_KMSG, LOG_USER, "kmodloader");
return main_loader(argc, argv);
 }
-- 
2.6.4


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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Cezary Jackiewicz
Dnia 2017-01-11, o godz. 12:00:17
Felix Fietkau  napisał(a):

> Pushed another fix, please test the latest version again.

Still nothing. Now I have reboot:

RouterBOOT backup booter 3.22

RouterBoard 411U

CPU frequency: 300 MHz
  Memory size:  32 MiB
NAND size: 128 MiB

Press any key within 2 seconds to enter setup
trying bootp protocol... OK
Got IP address: 192.168.1.134
resolved mac address E8:11:32:99:3D:A0
Gateway: 192.168.1.166
transfer started  transfer ok, 
time=2.83s
setting up elf image... OK
jumping to kernel code
[0.00] Linux version 4.4.40 (cezary@samsung) (gcc version 5.4.0 (LEDE 
GCC 5.4.0 r2900-e5aeb4a) ) #0 Wed Jan 11 11:01:07 2017
[0.00] bootconsole [early0] enabled
[0.00] CPU0 revision is: 00019374 (MIPS 24Kc)
[0.00] SoC: Atheros AR7130 rev 2
[0.00] Determined physical RAM map:
[0.00]  memory: 0200 @  (usable)
[0.00] User-defined physical RAM map:
[0.00]  memory: 0200 @  (usable)
[0.00] Initrd not found or empty - disabling initrd
[0.00] No valid device tree found, continuing without
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x-0x01ff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x-0x01ff]
[0.00] Initmem setup node 0 [mem 0x-0x01ff]
[0.00] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[0.00] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 
bytes
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 8128
[0.00] Kernel command line: parts=1 boot_part_size=4194304 gpio=3903 
HZ=15000 mem=32M kmac=4C:5E:0C:31:B3:F5 board=411U hw_opt= boot=0 
mlc=8 rootfstype=squashfs noinitrd
[0.00] PID hash table entries: 128 (order: -3, 512 bytes)
[0.00] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[0.00] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[0.00] Writing ErrCtl register=
[0.00] Readback ErrCtl register=
[0.00] Memory: 25568K/32768K available (3181K kernel code, 171K rwdata, 
788K rodata, 2124K init, 198K bss, 7200K reserved, 0K cma-reserved)
[0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[0.00] NR_IRQS:51
[0.00] Clocks: CPU:300.000MHz, DDR:300.000MHz, AHB:150.000MHz, 
Ref:40.000MHz
[0.00] clocksource: MIPS: mask: 0x max_cycles: 0x, 
max_idle_ns: 12741736309 ns
[0.16] sched_clock: 32 bits at 150MHz, resolution 6ns, wraps every 
14316557820ns
[0.007903] Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
[0.090555] pid_max: default: 32768 minimum: 301
[0.095378] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.101992] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.113543] clocksource: jiffies: mask: 0x max_cycles: 0x, 
max_idle_ns: 1911260446275 ns
[0.124671] NET: Registered protocol family 16
[0.131666] MIPS: machine is MikroTik RouterBOARD 411U
[0.656484] registering PCI controller with io_map_base unset
[2.570685] PCI host bridge to bus :00
[2.574901] pci_bus :00: root bus resource [mem 0x1000-0x16ff]
[2.581763] pci_bus :00: root bus resource [io  0x]
[2.587346] pci_bus :00: root bus resource [??? 0x flags 0x0]
[2.594120] pci_bus :00: No busn resource found for root bus, will use 
[bus 00-ff]
[2.603605] clocksource: Switched to clocksource MIPS
[2.610806] NET: Registered protocol family 2
[2.616679] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[2.623737] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[2.630119] TCP: Hash tables configured (established 1024 bind 1024)
[2.636670] UDP hash table entries: 256 (order: 0, 4096 bytes)
[2.642526] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[2.649242] NET: Registered protocol family 1
[7.501764] futex hash table entries: 256 (order: -1, 3072 bytes)
[7.508099] Crashlog allocated RAM at address 0x1f0
[7.536157] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[7.544143] io scheduler noop registered
[7.548089] io scheduler deadline registered (default)
[7.553781] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[7.560837] console [ttyS0] disabled
[7.584499] serial8250.0: ttyS0 at MMIO 0x1802 (irq = 11, base_baud = 
9375000) is a 16550A


RouterBOOT booter 3.22

RouterBoard 411U

CPU frequency: 300 MHz
  Memory size:  32 MiB
NAND size: 128 MiB

Press any key within 2 seconds to enter setup.

-- 
Pozdrawiam,
 Cezary Jackiewicz


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Felix Fietkau
On 2017-01-11 11:17, Cezary Jackiewicz wrote:
> Dnia 2017-01-11, o godz. 10:45:35
> Felix Fietkau  napisał(a):
> 
>> Cezary, please try the latest version from my staging tree, I just
>> pushed a fix for this regression that should hopefully make it work again.
> 
> 
> 
> [8.001462] m25p80 spi0.0: pm25lv512 (64 Kbytes)
> [8.056892] Creating 4 MTD partitions on "spi0.0":
> [8.114276] 0x-0xb000 : "routerboot"
> [8.182444] 0xb000-0xc000 : "hard_config"
> [8.249876] 0xd000-0xf000 : "bios"
> [8.310003] 0xf000-0x0001 : "soft_config"
> [8.377657] NAND flash driver for RouterBoard 4xx series version 0.2.0
> [8.456069] rb4xx-nand rb4xx-nand: unable to request gpio 37
Pushed another fix, please test the latest version again.

Thanks,

- Felix


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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Cezary Jackiewicz
Dnia 2017-01-11, o godz. 10:45:35
Felix Fietkau  napisał(a):

> Cezary, please try the latest version from my staging tree, I just
> pushed a fix for this regression that should hopefully make it work again.



[8.001462] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[8.056892] Creating 4 MTD partitions on "spi0.0":
[8.114276] 0x-0xb000 : "routerboot"
[8.182444] 0xb000-0xc000 : "hard_config"
[8.249876] 0xd000-0xf000 : "bios"
[8.310003] 0xf000-0x0001 : "soft_config"
[8.377657] NAND flash driver for RouterBoard 4xx series version 0.2.0
[8.456069] rb4xx-nand rb4xx-nand: unable to request gpio 37
...
[   10.031008] NAND flash driver for RouterBoard 4xx series version 0.2.0
[   10.109408] rb4xx-nand rb4xx-nand: unable to request gpio 37
[   10.182162] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   10.263224] ehci-platform: EHCI generic platform driver

from:

commit e3b288aecf4794ba20cc08a10aa544f40237
Author: Felix Fietkau 
Date:   Wed Jan 11 10:42:04 2017 +0100

ar71xx: fix RB4xx CPLD SPI device mode setup

Commit af79fdbe4af3 changed the code to use tx_nbits for dual SPI tx
transfers, however the SPI stack only allows this when the device mode
includes the relevant bit as well

Signed-off-by: Felix Fietkau 



-- 
Pozdrawiam,
 Cezary Jackiewicz

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


Re: [LEDE-DEV] externalizing package management?

2017-01-11 Thread Jo-Philipp Wich
Hi,

> anyway, specifically regarding the existing imagebuilder, i'm not really
> satisfied. it's a big download which is specific to each target, and
> requires pretty much a complete build environment.

It does not require a complete build environment. All it actually needs
is a DTC compiler and the ./staging_dir/host/bin executables.

> of course, it's the
> obvious choice to minimize development effort, but as a user i'd expect
> something ... nicer.
> 
> in my understanding, sysupgrade images (and uimages) are a pretty
> uniform archive format,

Actually they're not. There are factory and sysupgrade images which are
renamed tars, there are trx images, there are FIT images, proprietary
vendor formats, images containing images and whole lot of other types.

> a single generic tool should be able to work with all targets, over
> extended periods of time, and would need to support a rather limited
> number of features to accomplish the goal of building images from the
> "regular" image+package downloads that are already available.

The only real solution is something GNU make based in order to be able
to re-use the image format knowledge encoded in the per target
Makefiles. Anything else requires duplication of the image build logic
which can, and will, quickly diverge from whats in Master.

~ Jo



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


Re: [LEDE-DEV] per-cpu IRQ stack on MIPS

2017-01-11 Thread Felix Fietkau
On 2017-01-11 00:34, Jason A. Donenfeld wrote:
> Hey folks,
> 
> You might considering backporting this patchset to the LEDE/OpenWRT kernel:
> 
> http://www.spinics.net/lists/mips/msg65937.html
> 
> It prevents crashes when lots of different networking drivers are
> stacked on top of eachother, like gre+l2tp+somethingelse.
I've pushed the backport of these changes to my staging tree at
https://git.lede-project.org/?p=lede/nbd/staging.git;a=summary

I've already tested it on a MT7621 board and it works fine, please test
it on more devices.

- Felix


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


Re: [LEDE-DEV] how to make sysupgrade not drop user-installed packages

2017-01-11 Thread Jo-Philipp Wich
Hi,

> i actually had that typed out already, but deleted it because it seems
> like a complete no-brainer to me. there doesn't appear to be anything
> hard about having the build bots include a file into /etc which contains
> the _current_ repository url, subdirectory, and image name.

you forget that up until very recently the same kernel and rootfs was
used for many different images only varying in filename, image header
and kernel command line. The squashfs was not repacked for each
individual device image, which made it impossible to add an individual
file into /etc/ for each device specific image.

~ Jo



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


Re: [LEDE-DEV] externalizing package management?

2017-01-11 Thread Felix Fietkau
On 2017-01-11 00:22, Oswald Buddenhagen wrote:
> On Sun, Jan 08, 2017 at 08:42:25PM +0100, Jo-Philipp Wich wrote:
>> the imagebuilder should support all that already and it likely fills the
>> "powerful desktop tools" part your concept requires.
>> 
> i answered that in my other mail already.
> 
> anyway, specifically regarding the existing imagebuilder, i'm not really
> satisfied. it's a big download which is specific to each target, and
> requires pretty much a complete build environment. of course, it's the
> obvious choice to minimize development effort, but as a user i'd expect
> something ... nicer.
> 
> in my understanding, sysupgrade images (and uimages) are a pretty
> uniform archive format, just like the feed packages are. that means that
> a single generic tool should be able to work with all targets, over
> extended periods of time, and would need to support a rather limited
> number of features to accomplish the goal of building images from the
> "regular" image+package downloads that are already available.
sysupgrade images are really not uniform in any way. Different targets
use wildly different formats, sometimes different filesystems as well.

- Felix


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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Felix Fietkau
On 2017-01-11 09:17, Cezary Jackiewicz wrote:
> Dnia 2017-01-08, o godz. 14:54:33
> Felix Fietkau  napisał(a):
> 
>> Hi all,
>> 
>> I've just pushed the code for converting ar71xx routerboard support to
>> UBI + sysupgrade to my staging tree at:
>> https://git.lede-project.org/?p=lede/nbd/staging.git;a=summary
>> 
>> So far I've only managed to test it on RB 912UAG-5HPnD, other devices
>> are still untested. If you have any affected hardware, please test the
>> new code with a fresh build from that tree (make sure you reset your
>> config) and let me know if it works.
>> 
>> Installation is now done only over sysupgrade (from the initramfs
>> image), the old wget2nand script and rootfs tarballs are gone.
> 
> Boot from initramfs:
> 
> RouterBoard 411U
> 
> CPU frequency: 300 MHz
>   Memory size:  32 MiB
> NAND size: 128 MiB
> 
> Press any key within 2 seconds to enter setup
> trying bootp protocol... OK
> Got IP address: 192.168.1.134
> resolved mac address E8:11:32:99:3D:A0
> Gateway: 192.168.1.10
> transfer started  transfer 
> ok, time=2.79s
> setting up elf image... OK
> jumping to kernel code
> [0.00] Linux version 4.4.40 (cez...@eko.one.pl) (gcc version 5.4.0 
> (LEDE GCC 5.4.0 r2900-e5aeb4a) ) #0 Tue Jan 10 17:18:04 2017
> [0.00] bootconsole [early0] enabled
> 
> [0.00] Kernel command line: parts=1 boot_part_size=4194304 gpio=1855 
> HZ=15000 mem=32M kmac=4C:5E:0C:31:B3:F5 board=411U hw_opt= boot=0 
> mlc=8 rootfstype=squashfs noinitrd
> 
> 
> [7.784959] m25p80 spi0.0: pm25lv512 (64 Kbytes)
> [7.840380] Creating 4 MTD partitions on "spi0.0":
> [7.897848] 0x-0xb000 : "routerboot"
> [7.966111] 0xb000-0xc000 : "hard_config"
> [8.033665] 0xd000-0xf000 : "bios"
> [8.093852] 0xf000-0x0001 : "soft_config"
> [8.161543] NAND flash driver for RouterBoard 4xx series version 0.2.0
> [8.239896] rb4xx_nand: write cmd failed, err=-22
> [8.296268] rb4xx_nand: write cmd failed, err=-22
> [8.352640] rb4xx_nand: write cmd failed, err=-22
> [8.409041] rb4xx_nand: write cmd failed, err=-22
> [8.465399] rb4xx_nand: write cmd failed, err=-22
> [8.521847] nand: second ID read did not match ec,f1 against 41,ec
> [8.595962] nand: No NAND device found
> [8.655044] libphy: ag71xx_mdio: probed
This does not look like it something caused by changes in my staging
tree, it may already be present in LEDE master. Could you please verify
that and if it's the case, use git bisect to track down the issue to an
individual commit?

Thanks,

- Felix


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


Re: [LEDE-DEV] MikroTik RouterBoard ar71xx changes

2017-01-11 Thread Cezary Jackiewicz
Dnia 2017-01-08, o godz. 14:54:33
Felix Fietkau  napisał(a):

> Hi all,
> 
> I've just pushed the code for converting ar71xx routerboard support to
> UBI + sysupgrade to my staging tree at:
> https://git.lede-project.org/?p=lede/nbd/staging.git;a=summary
> 
> So far I've only managed to test it on RB 912UAG-5HPnD, other devices
> are still untested. If you have any affected hardware, please test the
> new code with a fresh build from that tree (make sure you reset your
> config) and let me know if it works.
> 
> Installation is now done only over sysupgrade (from the initramfs
> image), the old wget2nand script and rootfs tarballs are gone.

Boot from initramfs:

RouterBoard 411U

CPU frequency: 300 MHz
  Memory size:  32 MiB
NAND size: 128 MiB

Press any key within 2 seconds to enter setup
trying bootp protocol... OK
Got IP address: 192.168.1.134
resolved mac address E8:11:32:99:3D:A0
Gateway: 192.168.1.10
transfer started  transfer ok, 
time=2.79s
setting up elf image... OK
jumping to kernel code
[0.00] Linux version 4.4.40 (cez...@eko.one.pl) (gcc version 5.4.0 
(LEDE GCC 5.4.0 r2900-e5aeb4a) ) #0 Tue Jan 10 17:18:04 2017
[0.00] bootconsole [early0] enabled

[0.00] Kernel command line: parts=1 boot_part_size=4194304 gpio=1855 
HZ=15000 mem=32M kmac=4C:5E:0C:31:B3:F5 board=411U hw_opt= boot=0 
mlc=8 rootfstype=squashfs noinitrd


[7.784959] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[7.840380] Creating 4 MTD partitions on "spi0.0":
[7.897848] 0x-0xb000 : "routerboot"
[7.966111] 0xb000-0xc000 : "hard_config"
[8.033665] 0xd000-0xf000 : "bios"
[8.093852] 0xf000-0x0001 : "soft_config"
[8.161543] NAND flash driver for RouterBoard 4xx series version 0.2.0
[8.239896] rb4xx_nand: write cmd failed, err=-22
[8.296268] rb4xx_nand: write cmd failed, err=-22
[8.352640] rb4xx_nand: write cmd failed, err=-22
[8.409041] rb4xx_nand: write cmd failed, err=-22
[8.465399] rb4xx_nand: write cmd failed, err=-22
[8.521847] nand: second ID read did not match ec,f1 against 41,ec
[8.595962] nand: No NAND device found
[8.655044] libphy: ag71xx_mdio: probed

 $ ./scripts/diffconfig.sh 
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_mikrotik=y
CONFIG_TARGET_ar71xx_mikrotik_Default=y

$ git log -1
commit e5aeb4ad918081c5df19e7b48e4e73604465f5f3
Author: Felix Fietkau 
Date:   Tue Jan 10 18:09:22 2017 +0100

ar71xx: fix up the kernel config for the mikrotik subtarget

Limit enabled devices to routerboards, disable all other devices

Signed-off-by: Felix Fietkau 


From "old" CC:

[2.69] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[2.72] Creating 4 MTD partitions on "spi0.0":
[2.73] 0x-0xb000 : "routerboot"
[2.74] 0xb000-0xc000 : "hard_config"
[2.74] 0xd000-0xf000 : "bios"
[2.75] 0xf000-0x0001 : "soft_config"
[2.76] NAND flash driver for RouterBoard 4xx series version 0.2.0
[2.76] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[2.77] nand: Samsung NAND 128MiB 3,3V 8-bit
[2.77] nand: 128MiB, SLC, page size: 2048, OOB size: 64
[2.78] Scanning device for bad blocks
[3.26] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
[3.27] 0x-0x0004 : "booter"
[3.28] 0x0004-0x0040 : "kernel"
[3.28] 0x0040-0x0800 : "rootfs"
[3.29] mtd: device 6 (rootfs) set to be root filesystem
[3.30] mtdsplit: no squashfs found in "rootfs"
[3.30] mtdsplit: no squashfs found in "NAND 128MiB 3,3V 8-bit"


-- 
Pozdrawiam,
 Cezary Jackiewicz

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