Re: [OpenWrt-Devel] [PATCH] ZRAM: enhacements including /tmp on ZRAM for Barrier Breaker

2014-12-02 Thread John Crispin
i just pushed a an alternate patch that fixes the problem. please test
it and let me know the results

John

On 22/10/2014 09:20, Tomasz Wasiak wrote:
> Devices with less memory are still common so why limit ZRAM usage just to swap
> when it could be very useful as for /tmp storage.
> 
> This patch changes 3 things:
>  - sets default number of ZRAM devices to 2 (1st for /tmp, 2nd for swap)
>  - adds ZRAM (default) support to procd's init (TMPFS is used when ZRAM is not
>available
>  - changes zram-swap so it will use /dev/zram1 for 1st CPU, /dev/zram2 for 2nd
>and so on as /dev/zram0 is in use for /tmp.
> 
> Signed-off-by: Tomasz Wasiak 
> ---
>  package/system/procd/patches/procd-support_for_tmp_on_zram.patch   | 
>  185 ++
>  package/system/zram-swap/files/zram.init   | 
>   15 
>  target/linux/generic/patches-3.10/998_zram_make_2_devices_by_default.patch | 
>   11 
>  3 files changed, 203 insertions(+), 8 deletions(-)
> 
> --- a/package/system/procd/patches/procd-support_for_tmo_on_zram.patch
> +++ b/package/system/procd/patches/procd-support_for_tmp_on_zram.patch
> @@ -0,0 +1,185 @@
> +--- a/initd/early.c
>  b/initd/early.c
> +@@ -12,34 +12,130 @@
> +  * GNU General Public License for more details.
> +  */
> + 
> +-#include 
> +-#include 
> +-#include 
> +-
> +-#include 
> ++#include 
> + #include 
> +-#include 
> ++#include 
> + #include 
> ++#include 
> ++#include 
> ++#include 
> ++#include 
> ++#include 
> ++#include 
> ++#include 
> + 
> + #include "../log.h"
> + #include "init.h"
> + 
> ++static long
> ++check_ramsize(void)
> ++{
> ++FILE *fp;
> ++char line[256];
> ++char *key;
> ++long val = 0;
> ++
> ++fp = fopen("/proc/meminfo", "r");
> ++if(fp == NULL)
> ++{
> ++ERROR("Can't open /proc/meminfo: %s\n", strerror(errno));
> ++return errno;
> ++}
> ++
> ++while(fgets(line, sizeof(line), fp))
> ++{
> ++key = strtok(line, ":");
> ++val = atol(strtok(NULL, " kB\n"));
> ++
> ++if (!key || !val)
> ++continue;
> ++
> ++if (!strcasecmp(key, "MemTotal"))
> ++break;
> ++}
> ++
> ++fclose(fp);
> ++
> ++return val;
> ++}
> ++
> ++static int
> ++mount_zram_on_tmp(void)
> ++{
> ++FILE *fp;
> ++long zramsize = (check_ramsize() / 2);
> ++pid_t pid;
> ++
> ++if(!zramsize)
> ++{
> ++ERROR("Can't read size of RAM. Assuming 16 MB.\n");
> ++zramsize = 8192;
> ++}
> ++
> ++fp = fopen("/sys/block/zram0/disksize", "r+");
> ++if(fp == NULL)
> ++{
> ++ERROR("Can't open /sys/block/zram0/disksize: %s\n", 
> strerror(errno));
> ++return errno;
> ++}
> ++
> ++fprintf(fp, "%ld", (zramsize * 1024));
> ++
> ++fclose(fp);
> ++
> ++pid = fork();
> ++
> ++if (!pid)
> ++{
> ++char *mkfs[] = { "/sbin/mke2fs", "-b", "4096", "-F", "-L", 
> "TEMP", "-m", "0", "/dev/zram0", NULL };
> ++int fd = open("/dev/null", O_RDWR);
> ++
> ++if (fd > -1) {
> ++dup2(fd, STDIN_FILENO);
> ++dup2(fd, STDOUT_FILENO);
> ++dup2(fd, STDERR_FILENO);
> ++if (fd > STDERR_FILENO)
> ++close(fd);
> ++}
> ++
> ++execvp(mkfs[0], mkfs);
> ++ERROR("Can't exec /sbin/mke2fs\n");
> ++exit(-1);
> ++}
> ++
> ++if (pid <= 0)
> ++{
> ++ERROR("Can't exec /sbin/mke2fs\n");
> ++return -1;
> ++} else {
> ++waitpid(pid, NULL, 0);
> ++}
> ++
> ++if(mount("/dev/zram0", "/tmp", "ext2", MS_NOSUID | MS_NODEV | 
> MS_NOATIME, "check=none,errors=continue,noquota") < 0)
> ++{
> ++ERROR("Can't mount /dev/zram0 on /tmp: %s\n", strerror(errno));
> ++return errno;
> ++}
> ++
> ++LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
> ++return 0;
> ++}
> ++
> + static void
> +-early_mounts(void)
> ++mount_tmpfs_on_tmp(void)
> + {
> +-mount("proc", "/proc", "proc", MS_NOATIME, 0);
> +-mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
> ++char line[256];
> ++long tmpfssize = (check_ramsize() / 2);
> + 
> +-mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOATIME, 
> NULL);
> +-mkdir("/tmp/run", 0777);
> +-mkdir("/tmp/lock", 0777);
> +-mkdir("/tmp/state", 0777);
> +-symlink("/tmp", "/var");
> ++if(!tmpfssize)
> ++{
> ++ERROR("Can't read size of RAM. Assuming 16 MB.\n");
> ++tmpfssize = 8192;
> ++}
> + 
> +-mount("tmpfs", "/dev", "tmpfs", MS_NOATIME, "mode=0755,size=512K");
> +-mkdir("/dev/shm", 0755);
> +-mkdir("/dev/pts", 0755);
> +-mount("devpts", "/dev/pts", "devpts", MS_NOATIME, "mode=600");
> ++snprintf(line, 256, "size=%ldk", tmpfssize);
> ++mount("tm

Re: [OpenWrt-Devel] au1000 - 3.14 tested needed

2014-12-02 Thread Bruno Randolf
Hi John,

Thanks!

I just tested it: up & running, PCI got detected, Wifi works, looking
good... :)

root@OpenWrt:/# uname -a
Linux OpenWrt 3.14.25 #1 Mon Dec 1 20:42:17 WET 2014 mips GNU/Linux

bruno

On 12/01/2014 04:55 PM, John Crispin wrote:
> Hi,
> 
> i pushed 3.14 support for au1000. i have no hw for testing so this is
> only compile tested and hence i left 3.10 as default. can someone test
> 3.14 so we can set it as default please.
> 
>   John
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] au1000 - 3.14 tested needed

2014-12-02 Thread John Crispin
ok i will set it as default in that case, thanks for testing



On 02/12/2014 13:19, Bruno Randolf wrote:
> Hi John,
> 
> Thanks!
> 
> I just tested it: up & running, PCI got detected, Wifi works,
> looking good... :)
> 
> root@OpenWrt:/# uname -a Linux OpenWrt 3.14.25 #1 Mon Dec 1
> 20:42:17 WET 2014 mips GNU/Linux
> 
> bruno
> 
> On 12/01/2014 04:55 PM, John Crispin wrote:
>> Hi,
>> 
>> i pushed 3.14 support for au1000. i have no hw for testing so
>> this is only compile tested and hence i left 3.10 as default. can
>> someone test 3.14 so we can set it as default please.
>> 
>> John ___ 
>> openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> 
> ___ openwrt-devel
> mailing list openwrt-devel@lists.openwrt.org 
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] kernel/modules: package gpio-beeper

2014-12-02 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 package/kernel/linux/modules/other.mk | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 5d1c2fb..b1bb76a 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -950,3 +950,22 @@ define KernelPackage/thermal-kirkwood/description
 endef
 
 $(eval $(call KernelPackage,thermal-kirkwood))
+
+
+define KernelPackage/gpio-beeper
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=GPIO beeper support
+  KCONFIG:= \
+   CONFIG_INPUT_MISC=y \
+   CONFIG_INPUT_GPIO_BEEPER
+  FILES:= \
+   $(LINUX_DIR)/drivers/input/misc/gpio-beeper.ko
+  AUTOLOAD:=$(call AutoLoad,50,gpio-beeper)
+  $(call AddDepends/input)
+endef
+
+define KernelPackage/gpio-beeper/description
+ This enables playing beeps through an GPIO-connected buzzer
+endef
+
+$(eval $(call KernelPackage,gpio-beeper))
-- 
2.1.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] oxnas/kd20: add usb-storage to default package set

2014-12-02 Thread Daniel Golle
KD20 got a built-in card-reader wired to the USB-3 root-hub.

Signed-off-by: Daniel Golle 
---
 target/linux/oxnas/profiles/100-Generic.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/oxnas/profiles/100-Generic.mk 
b/target/linux/oxnas/profiles/100-Generic.mk
index d5ec97d..4e53fcb 100644
--- a/target/linux/oxnas/profiles/100-Generic.mk
+++ b/target/linux/oxnas/profiles/100-Generic.mk
@@ -40,7 +40,8 @@ endef
 define Profile/KD20
   NAME:=Shuttle KD20
   PACKAGES:= \
-   uboot-envtools kmod-usb2-oxnas kmod-usb3 kmod-rtc-pcf8563 
kmod-gpio-beeper
+   uboot-envtools kmod-usb2-oxnas kmod-usb3 kmod-usb-storage \
+   kmod-rtc-pcf8563 kmod-gpio-beeper
 endef
 
 define Profile/KD20/Description
-- 
2.1.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] oxnas/kd20: use gpio-beeper

2014-12-02 Thread Daniel Golle
gpio-beeper module was added to the kernel recently.
Make use of it to drive the piezoelectric buzzer of the kd20.

Signed-off-by: Daniel Golle 
---
 target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts | 9 +
 target/linux/oxnas/profiles/100-Generic.mk| 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts 
b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
index e7ee587..9f52f43 100644
--- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
+++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts
@@ -123,10 +123,11 @@
label = "kd20:blue:usb";
gpios = <&GPIOB 8 0>;
};
-   buzzer {
-   label = "kd20:buzzer";
-   gpios = <&GPIOB 11 0>;
-   };
+   };
+
+   beeper: beeper {
+   compatible = "gpio-beeper";
+   gpios = <&GPIOB 11 0>;
};
 
gpio-fan {
diff --git a/target/linux/oxnas/profiles/100-Generic.mk 
b/target/linux/oxnas/profiles/100-Generic.mk
index 734b123..d5ec97d 100644
--- a/target/linux/oxnas/profiles/100-Generic.mk
+++ b/target/linux/oxnas/profiles/100-Generic.mk
@@ -40,7 +40,7 @@ endef
 define Profile/KD20
   NAME:=Shuttle KD20
   PACKAGES:= \
-   uboot-envtools kmod-usb2-oxnas kmod-usb3 kmod-rtc-pcf8563
+   uboot-envtools kmod-usb2-oxnas kmod-usb3 kmod-rtc-pcf8563 
kmod-gpio-beeper
 endef
 
 define Profile/KD20/Description
-- 
2.1.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] oxnas: switch CRC32 implementation to SLICEBY8

2014-12-02 Thread Daniel Golle
similar to what was observed on kirkwood this significantly accelerates
btrfs write operations.

Signed-off-by: Daniel Golle 
---
 target/linux/oxnas/config-3.18 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/oxnas/config-3.18 b/target/linux/oxnas/config-3.18
index 4997dc1..f66650a 100644
--- a/target/linux/oxnas/config-3.18
+++ b/target/linux/oxnas/config-3.18
@@ -70,6 +70,8 @@ CONFIG_CPU_RMAP=y
 CONFIG_CPU_TLB_V6=y
 CONFIG_CPU_V6K=y
 CONFIG_CRC16=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_XZ=y
-- 
2.1.3
___
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-oxnas: bump to U-Boot 2014.10

2014-12-02 Thread Daniel Golle
A few trivial changes were needed to adapt to upstream framework changes.

Signed-off-by: Daniel Golle 
---
 package/boot/uboot-oxnas/Makefile  |   4 +-
 package/boot/uboot-oxnas/files/board/ox820/Kconfig |  15 +++
 .../boot/uboot-oxnas/files/board/ox820/MAINTAINERS |   6 ++
 package/boot/uboot-oxnas/files/board/ox820/ox820.c |   1 +
 .../boot/uboot-oxnas/files/configs/ox820_defconfig |   3 +
 .../boot/uboot-oxnas/files/include/configs/ox820.h |   5 +-
 .../patches/010-capacity-is-unsigned.patch |  42 
 .../boot/uboot-oxnas/patches/150-spl-block.patch   |   6 +-
 .../uboot-oxnas/patches/300-oxnas-target.patch | 112 +++--
 .../patches/800-fix-bootm-assertion.patch  |   4 +-
 10 files changed, 133 insertions(+), 65 deletions(-)
 create mode 100644 package/boot/uboot-oxnas/files/board/ox820/Kconfig
 create mode 100644 package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS
 create mode 100644 package/boot/uboot-oxnas/files/configs/ox820_defconfig
 create mode 100644 
package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch

diff --git a/package/boot/uboot-oxnas/Makefile 
b/package/boot/uboot-oxnas/Makefile
index aee7808..e233943 100644
--- a/package/boot/uboot-oxnas/Makefile
+++ b/package/boot/uboot-oxnas/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=u-boot
-PKG_VERSION:=2014.04
+PKG_VERSION:=2014.10
 PKG_RELEASE:=1
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
 
-PKG_MD5SUM:=6d2116d1385a66e9a59742caa9d62a54
+PKG_MD5SUM:=3ddcaee2f05b7c464778112ec83664b5
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
diff --git a/package/boot/uboot-oxnas/files/board/ox820/Kconfig 
b/package/boot/uboot-oxnas/files/board/ox820/Kconfig
new file mode 100644
index 000..8f631aa
--- /dev/null
+++ b/package/boot/uboot-oxnas/files/board/ox820/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_OX820
+
+config SYS_CPU
+   default "arm1136"
+
+config SYS_SOC
+   default "nas782x"
+
+config SYS_BOARD
+   default "ox820"
+
+config SYS_CONFIG_NAME
+   default "ox820"
+
+endif
diff --git a/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS 
b/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS
new file mode 100644
index 000..a86ba26
--- /dev/null
+++ b/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS
@@ -0,0 +1,6 @@
+SHEEVAPLUG BOARD
+M: Daniel Golle 
+S: Maintained
+F: board/ox820/
+F: include/configs/ox820.h
+F: configs/ox820_defconfig
diff --git a/package/boot/uboot-oxnas/files/board/ox820/ox820.c 
b/package/boot/uboot-oxnas/files/board/ox820/ox820.c
index 32c91f4..f93cc9c 100644
--- a/package/boot/uboot-oxnas/files/board/ox820/ox820.c
+++ b/package/boot/uboot-oxnas/files/board/ox820/ox820.c
@@ -279,6 +279,7 @@ int board_nand_init(struct nand_chip *chip)
 int board_init(void)
 {
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+   gd->bd->bi_arch_number = MACH_TYPE_OXNAS;
 
/* assume uart is already initialized by SPL */
 
diff --git a/package/boot/uboot-oxnas/files/configs/ox820_defconfig 
b/package/boot/uboot-oxnas/files/configs/ox820_defconfig
new file mode 100644
index 000..48a16d0
--- /dev/null
+++ b/package/boot/uboot-oxnas/files/configs/ox820_defconfig
@@ -0,0 +1,3 @@
+CONFIG_ARM=y
+CONFIG_OX820=y
+CONFIG_TARGET_OX820=y
diff --git a/package/boot/uboot-oxnas/files/include/configs/ox820.h 
b/package/boot/uboot-oxnas/files/include/configs/ox820.h
index 7ade1dc..e3c71e6 100644
--- a/package/boot/uboot-oxnas/files/include/configs/ox820.h
+++ b/package/boot/uboot-oxnas/files/include/configs/ox820.h
@@ -4,6 +4,8 @@
 /* High Level Configuration Options */
 #define CONFIG_ARM1136
 #define CONFIG_OX820
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_BOARD_EARLY_INIT_F
 
 #include   /* get chip and board defs */
 
@@ -50,7 +52,7 @@
 #define CONFIG_SYS_ATA_REG_OFFSET  0
 #define CONFIG_SYS_ATA_ALT_OFFSET  0
 #define CONFIG_IDE_PLX
-#define CONFIG_SYS_IDE_MAXDEVICE   1
+#define CONFIG_SYS_IDE_MAXDEVICE   2
 #define CONFIG_SYS_IDE_MAXBUS  1
 #define CONFIG_IDE_PREINIT
 #define CONFIG_LBA48
@@ -340,7 +342,6 @@
 #define CONFIG_CMD_ZIP
 #define CONFIG_CMD_UNZIP
 #define CONFIG_CMD_TIME
-#define CONFIG_CMD_TERMINAL
 #define CONFIG_CMD_SETEXPR
 #define CONFIG_CMD_MD5SUM
 #define CONFIG_CMD_HASH
diff --git a/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch 
b/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch
new file mode 100644
index 000..3990aa9
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch
@@ -0,0 +1,42 @@
+From df9fb90120423c4c55b66a5dc09af23f605a406b Mon Sep 17 00:00:00 2001
+From: Daniel Golle 
+Date: Mon, 1 Dec 2014 21:37:25 +0100
+Subject: [PATCH] disk/part.c: use unsigned form

[OpenWrt-Devel] [PATCH] kernel/modules: package xhci for kernel>=3.18

2014-12-02 Thread Daniel Golle
xhci-hcd was split into xhci-pci and xhci-platform since 3.18

Signed-off-by: Daniel Golle 
---
 package/kernel/linux/modules/usb.mk | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index 4cd3bf0..5850b2f 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1469,10 +1469,25 @@ define KernelPackage/usb3
   DEPENDS:=+TARGET_omap:kmod-usb-phy-omap-usb3
   KCONFIG:= \
CONFIG_USB_XHCI_HCD \
+   CONFIG_USB_XHCI_PCI \
+   CONFIG_USB_XHCI_PLATFORM \
CONFIG_USB_XHCI_HCD_DEBUGGING=n
   FILES:= \
$(LINUX_DIR)/drivers/usb/host/xhci-hcd.ko
+ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),lt,3.18)),1)
   AUTOLOAD:=$(call AutoLoad,54,xhci-hcd,1)
+else
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/xhci-pci.ko),)
+  FILES+= \
+   $(LINUX_DIR)/drivers/usb/host/xhci-pci.ko
+  AUTOLOAD:=$(call AutoLoad,54,xhci-pci,1)
+  endif
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/xhci-plat.ko),)
+FILES+= \
+   $(LINUX_DIR)/drivers/usb/host/xhci-plat.ko
+AUTOLOAD+=$(call AutoLoad,54,xhci-plat,1)
+  endif
+endif
   $(call AddDepends/usb)
 endef
 
-- 
2.1.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 4/5] oxnas: switch CRC32 implementation to SLICEBY8

2014-12-02 Thread John Crispin
Hi

On 02/12/2014 14:42, Daniel Golle wrote:
> similar to what was observed on kirkwood this significantly accelerates
> btrfs write operations.
> 

can we put the "significantly accelerates" into numbers and then change
it in then generic config ?

John



> Signed-off-by: Daniel Golle 
> ---
>  target/linux/oxnas/config-3.18 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/linux/oxnas/config-3.18 b/target/linux/oxnas/config-3.18
> index 4997dc1..f66650a 100644
> --- a/target/linux/oxnas/config-3.18
> +++ b/target/linux/oxnas/config-3.18
> @@ -70,6 +70,8 @@ CONFIG_CPU_RMAP=y
>  CONFIG_CPU_TLB_V6=y
>  CONFIG_CPU_V6K=y
>  CONFIG_CRC16=y
> +# CONFIG_CRC32_SARWATE is not set
> +CONFIG_CRC32_SLICEBY8=y
>  CONFIG_CRYPTO_DEFLATE=y
>  CONFIG_CRYPTO_LZO=y
>  CONFIG_CRYPTO_XZ=y
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3 1/4] kernel.mk: Refactor LINUX_KARCH affectation

2014-12-02 Thread Maxime Ripard
Hi Jonas,

On Fri, Nov 28, 2014 at 10:19:28PM +0100, Jonas Gorski wrote:
> On Fri, Nov 28, 2014 at 7:20 PM, Maxime Ripard
>  wrote:
> > Switch to a dumber implementation that will be easier to maintain in the 
> > long
> > run, with only if statements instead of having nested subst calls.
> >
> > Signed-off-by: Maxime Ripard 
> > ---
> >  include/kernel.mk | 25 +
> >  1 file changed, 21 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/kernel.mk b/include/kernel.mk
> > index 01fb4dbd8107..97eb1f74f4f7 100644
> > --- a/include/kernel.mk
> > +++ b/include/kernel.mk
> > @@ -64,13 +64,30 @@ endif
> >
> >  ifneq (,$(findstring uml,$(BOARD)))
> >LINUX_KARCH=um
> > +else ifeq ($(ARCH),aarch64)
> > +  LINUX_KARCH := arm64
> > +else ifeq ($(ARCH),aarch64_be)
> > +  LINUX_KARCH := arm64
> > +else ifeq ($(ARCH),armeb)
> > +  LINUX_KARCH := arm
> > +else ifeq ($(ARCH),mipsel)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),mips64)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),mips64el)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),sh2)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),sh3)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),sh4)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),i386)
> > +  LINUX_KARCH := x86
> > +else ifeq ($(ARCH),aarch64_be)
> > +  LINUX_KARCH := arm64
> > +else ifeq ($(ARCH),armeb)
> > +  LINUX_KARCH := arm
> > +else ifeq ($(ARCH),mipsel)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),mips64)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),mips64el)
> > +  LINUX_KARCH := mips
> > +else ifeq ($(ARCH),sh2)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),sh3)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),sh4)
> > +  LINUX_KARCH := sh
> > +else ifeq ($(ARCH),i386)
> > +  LINUX_KARCH := x86
> >  else
> > -  ifeq (,$(LINUX_KARCH))
> > -LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst 
> > mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst 
> > sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(subst aarch64,arm64,$(subst 
> > aarch64_be,arm64,$(ARCH
> > -  endif
> > +  LINUX_KARCH := $(ARCH)
> >  endif
> 
> 
> How about something in the middle, like
> 
> ifneq (,$(findstring uml,$(BOARD)))
>   LINUX_KARCH := um
> else ifneq (,$(findstring $(ARCH),aarch64 aarch64_be))
>   LINUX_KARCH := arm64
> else ifneq (,$(findstring $(ARCH),armeb))
>   LINUX_KARCH := arm
> else ifneq (,$(findstring $(ARCH),mipsel mips64 mips64el))
>   LINUX_KARCH := mips
> else ifneq (,$(findstring $(ARCH),sh2 sh3 sh4))
>   LINUX_KARCH := sh
> else ifneq (,$(findstring $(ARCH),i386))
>   LINUX_KARCH := x86
> else
>   LINUX_KARCH := $(ARCH)
> endif
> 
> merging the common cases. this is a bit more compact, and should be
> easier to extend. (NOTE: completely untested, likely contains
> typos/thinkos).

Yep, it definitely looks better. I'll come up with something similar
(or identical if it works right away) and post a new version.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH uqmi] Add --delete-message for deleting SMS messages

2014-12-02 Thread Sławomir Demeszko
Signed-off-by: Sławomir Demeszko 
---
 commands-wms.c | 27 +++
 commands-wms.h |  2 ++
 2 files changed, 29 insertions(+)

diff --git a/commands-wms.c b/commands-wms.c
index da4aeaf..5f159ce 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -253,6 +253,33 @@ static void wms_decode_address(char *name, unsigned char 
*data, int len)
blobmsg_add_string_buffer(&status);
 }
 
+#define cmd_wms_delete_message_cb no_cb
+static enum qmi_cmd_result
+cmd_wms_delete_message_prepare(struct qmi_dev *qmi, struct qmi_request *req, 
struct qmi_msg *msg, char *arg)
+{
+   char *err;
+   int id;
+
+   id = strtoul(arg, &err, 10);
+   if (err && *err) {
+   uqmi_add_error("Invalid message ID");
+   return QMI_CMD_EXIT;
+   }
+
+   static struct qmi_wms_delete_request mreq = {
+   QMI_INIT(memory_storage, QMI_WMS_STORAGE_TYPE_UIM),
+   QMI_INIT(message_mode, QMI_WMS_MESSAGE_MODE_GSM_WCDMA),
+   };
+
+   mreq.set.memory_index = 1;
+   mreq.data.memory_index = id;
+
+   qmi_set_wms_delete_request(msg, &mreq);
+
+   return QMI_CMD_REQUEST;
+}
+
+
 static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request 
*req, struct qmi_msg *msg)
 {
struct qmi_wms_raw_read_response res;
diff --git a/commands-wms.h b/commands-wms.h
index be27124..07191da 100644
--- a/commands-wms.h
+++ b/commands-wms.h
@@ -1,5 +1,6 @@
 #define __uqmi_wms_commands \
__uqmi_command(wms_list_messages, list-messages, no, QMI_SERVICE_WMS), \
+   __uqmi_command(wms_delete_message, delete-message, required, 
QMI_SERVICE_WMS), \
__uqmi_command(wms_get_message, get-message, required, 
QMI_SERVICE_WMS), \
__uqmi_command(wms_get_raw_message, get-raw-message, required, 
QMI_SERVICE_WMS), \
__uqmi_command(wms_send_message_smsc, send-message-smsc, required, 
CMD_TYPE_OPTION), \
@@ -9,6 +10,7 @@
 
 #define wms_helptext \
"  --list-messages:  List SMS messages\n" \
+   "  --delete-message :Delete SMS message at 
index \n" \
"  --get-message :   Get SMS message at index 
\n" \
"  --get-raw-message :   Get SMS raw message 
contents at index \n" \
"  --send-message :Send SMS message (use 
options below)\n" \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] kernel/modules: package xhci for kernel>=3.18

2014-12-02 Thread Felix Fietkau
On 2014-12-02 14:45, Daniel Golle wrote:
> xhci-hcd was split into xhci-pci and xhci-platform since 3.18
> 
> Signed-off-by: Daniel Golle 
> ---
>  package/kernel/linux/modules/usb.mk | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/package/kernel/linux/modules/usb.mk 
> b/package/kernel/linux/modules/usb.mk
> index 4cd3bf0..5850b2f 100644
> --- a/package/kernel/linux/modules/usb.mk
> +++ b/package/kernel/linux/modules/usb.mk
> @@ -1469,10 +1469,25 @@ define KernelPackage/usb3
>DEPENDS:=+TARGET_omap:kmod-usb-phy-omap-usb3
>KCONFIG:= \
>   CONFIG_USB_XHCI_HCD \
> + CONFIG_USB_XHCI_PCI \
> + CONFIG_USB_XHCI_PLATFORM \
>   CONFIG_USB_XHCI_HCD_DEBUGGING=n
>FILES:= \
>   $(LINUX_DIR)/drivers/usb/host/xhci-hcd.ko
> +ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),lt,3.18)),1)
>AUTOLOAD:=$(call AutoLoad,54,xhci-hcd,1)
> +else
> +  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/xhci-pci.ko),)
> +  FILES+= \
> + $(LINUX_DIR)/drivers/usb/host/xhci-pci.ko
> +  AUTOLOAD:=$(call AutoLoad,54,xhci-pci,1)
> +  endif
> +  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/xhci-plat.ko),)
> +FILES+= \
> + $(LINUX_DIR)/drivers/usb/host/xhci-plat.ko
> +AUTOLOAD+=$(call AutoLoad,54,xhci-plat,1)
> +  endif
> +endif
>$(call AddDepends/usb)
>  endef
I think something like this would be cleaner and simpler:
XHCI_FILES := $(wildcard $(patsubst
%,$(LINUX_DIR)/drivers/usb/host/%.ko,xhci-hcd xhci-pci xhci-plat))
XHCI_AUTOLOAD := $(patsubst
$(LINUX_DIR)/drivers/usb/host/%.ko,%,$(XHCI_FILES))

and then use those for FILES and AUTOLOAD in the KernelPackage
definition. The package should probably also use AutoProbe instead of
AutoLoad

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


[OpenWrt-Devel] [PATCH v2] kernel/modules: package xhci for kernel>=3.18

2014-12-02 Thread Daniel Golle
xhci-hcd was split into xhci-pci and xhci-platform since 3.18

Signed-off-by: Daniel Golle 
---
 package/kernel/linux/modules/usb.mk | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index 4cd3bf0..4644cbb 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1463,16 +1463,20 @@ endef
 
 $(eval $(call KernelPackage,usbmon))
 
+XHCI_FILES := $(wildcard $(patsubst 
%,$(LINUX_DIR)/drivers/usb/host/%.ko,xhci-hcd xhci-pci xhci-plat))
+XHCI_AUTOLOAD := $(patsubst $(LINUX_DIR)/drivers/usb/host/%.ko,%,$(XHCI_FILES))
 
 define KernelPackage/usb3
   TITLE:=Support for USB3 controllers
   DEPENDS:=+TARGET_omap:kmod-usb-phy-omap-usb3
   KCONFIG:= \
CONFIG_USB_XHCI_HCD \
+   CONFIG_USB_XHCI_PCI \
+   CONFIG_USB_XHCI_PLATFORM \
CONFIG_USB_XHCI_HCD_DEBUGGING=n
   FILES:= \
-   $(LINUX_DIR)/drivers/usb/host/xhci-hcd.ko
-  AUTOLOAD:=$(call AutoLoad,54,xhci-hcd,1)
+   $(XHCI_FILES)
+  AUTOLOAD:=$(call AutoLoad,54,$(XHCI_AUTOLOAD),1)
   $(call AddDepends/usb)
 endef
 
-- 
2.1.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2] kernel/modules: package xhci for kernel>=3.18

2014-12-02 Thread Felix Fietkau
On 2014-12-02 20:15, Daniel Golle wrote:
> xhci-hcd was split into xhci-pci and xhci-platform since 3.18
> 
> Signed-off-by: Daniel Golle 
Applied in r43502, thanks.

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


[OpenWrt-Devel] [PATCH RFC] broadcom-wl: use CCMP by default for WPA (version 1)

2014-12-02 Thread Rafał Miłecki
It follows OpenWrt's global logic in netifd-wireless.sh. We should use
CCMP unless TKIP was really requested.

Signed-off-by: Rafał Miłecki 
---
 package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh 
b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
index 65179a5..7f38464 100644
--- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -292,7 +292,7 @@ enable_broadcom() {
case "$enc" in
*mixed*|*psk+psk2*) auth=132; wsec=6;;
*psk2*) auth=128; wsec=4;;
-   *) auth=4; wsec=2;;
+   *) auth=4; wsec=4;;
esac
 
# cipher override
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC] broadcom-wl: use CCMP by default for WPA (version 1)

2014-12-02 Thread Hauke Mehrtens
On 12/02/2014 08:39 PM, Rafał Miłecki wrote:
> It follows OpenWrt's global logic in netifd-wireless.sh. We should use
> CCMP unless TKIP was really requested.
> 
> Signed-off-by: Rafał Miłecki 
> ---
>  package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I think broadcom-wl has the same behavior as hostapd in this part. In
the hostapd file in package/network/services/hostapd/files/hostapd.sh it
also uses wpa1 + tkip as default.

How would you explicitly set tkip only with your change?

> diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh 
> b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> index 65179a5..7f38464 100644
> --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> @@ -292,7 +292,7 @@ enable_broadcom() {
>   case "$enc" in
>   *mixed*|*psk+psk2*) auth=132; wsec=6;;
>   *psk2*) auth=128; wsec=4;;
> - *) auth=4; wsec=2;;
> + *) auth=4; wsec=4;;
>   esac
>  
>   # cipher override
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ZRAM: enhacements including /tmp on ZRAM for Barrier Breaker

2014-12-02 Thread Fernando Frediani

Hi all,

It would be great if someone could port ZRAM to AA so it can be used on 
16MB devices too.
Despite the kernel version doesn't have it, it had several ports that 
work on that version.


By the way. As BB has it natively (I suppose), has anyone used BB with 
ZRAM stably on 16MB devices (e.g: WRT54GL) ?


Thanks
Regards,
Fernando


On 02/12/2014 11:16, John Crispin wrote:

i just pushed a an alternate patch that fixes the problem. please test
it and let me know the results

John

On 22/10/2014 09:20, Tomasz Wasiak wrote:

Devices with less memory are still common so why limit ZRAM usage just to swap
when it could be very useful as for /tmp storage.

This patch changes 3 things:
  - sets default number of ZRAM devices to 2 (1st for /tmp, 2nd for swap)
  - adds ZRAM (default) support to procd's init (TMPFS is used when ZRAM is not
available
  - changes zram-swap so it will use /dev/zram1 for 1st CPU, /dev/zram2 for 2nd
and so on as /dev/zram0 is in use for /tmp.

Signed-off-by: Tomasz Wasiak 
---
  package/system/procd/patches/procd-support_for_tmp_on_zram.patch   |  
185 ++
  package/system/zram-swap/files/zram.init   |  
 15
  target/linux/generic/patches-3.10/998_zram_make_2_devices_by_default.patch |  
 11
  3 files changed, 203 insertions(+), 8 deletions(-)

--- a/package/system/procd/patches/procd-support_for_tmo_on_zram.patch
+++ b/package/system/procd/patches/procd-support_for_tmp_on_zram.patch
@@ -0,0 +1,185 @@
+--- a/initd/early.c
 b/initd/early.c
+@@ -12,34 +12,130 @@
+  * GNU General Public License for more details.
+  */
+
+-#include 
+-#include 
+-#include 
+-
+-#include 
++#include 
+ #include 
+-#include 
++#include 
+ #include 
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
+
+ #include "../log.h"
+ #include "init.h"
+
++static long
++check_ramsize(void)
++{
++  FILE *fp;
++  char line[256];
++  char *key;
++  long val = 0;
++
++  fp = fopen("/proc/meminfo", "r");
++  if(fp == NULL)
++  {
++  ERROR("Can't open /proc/meminfo: %s\n", strerror(errno));
++  return errno;
++  }
++
++  while(fgets(line, sizeof(line), fp))
++  {
++  key = strtok(line, ":");
++  val = atol(strtok(NULL, " kB\n"));
++
++  if (!key || !val)
++  continue;
++
++  if (!strcasecmp(key, "MemTotal"))
++  break;
++  }
++
++  fclose(fp);
++
++  return val;
++}
++
++static int
++mount_zram_on_tmp(void)
++{
++  FILE *fp;
++  long zramsize = (check_ramsize() / 2);
++  pid_t pid;
++
++  if(!zramsize)
++  {
++  ERROR("Can't read size of RAM. Assuming 16 MB.\n");
++  zramsize = 8192;
++  }
++
++  fp = fopen("/sys/block/zram0/disksize", "r+");
++  if(fp == NULL)
++  {
++  ERROR("Can't open /sys/block/zram0/disksize: %s\n", 
strerror(errno));
++  return errno;
++  }
++
++  fprintf(fp, "%ld", (zramsize * 1024));
++
++  fclose(fp);
++
++  pid = fork();
++
++  if (!pid)
++  {
++  char *mkfs[] = { "/sbin/mke2fs", "-b", "4096", "-F", "-L", "TEMP", "-m", 
"0", "/dev/zram0", NULL };
++  int fd = open("/dev/null", O_RDWR);
++
++  if (fd > -1) {
++  dup2(fd, STDIN_FILENO);
++  dup2(fd, STDOUT_FILENO);
++  dup2(fd, STDERR_FILENO);
++  if (fd > STDERR_FILENO)
++  close(fd);
++  }
++
++  execvp(mkfs[0], mkfs);
++  ERROR("Can't exec /sbin/mke2fs\n");
++  exit(-1);
++  }
++
++  if (pid <= 0)
++  {
++  ERROR("Can't exec /sbin/mke2fs\n");
++  return -1;
++  } else {
++  waitpid(pid, NULL, 0);
++  }
++
++  if(mount("/dev/zram0", "/tmp", "ext2", MS_NOSUID | MS_NODEV | MS_NOATIME, 
"check=none,errors=continue,noquota") < 0)
++  {
++  ERROR("Can't mount /dev/zram0 on /tmp: %s\n", strerror(errno));
++  return errno;
++  }
++
++  LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
++  return 0;
++}
++
+ static void
+-early_mounts(void)
++mount_tmpfs_on_tmp(void)
+ {
+-  mount("proc", "/proc", "proc", MS_NOATIME, 0);
+-  mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
++  char line[256];
++  long tmpfssize = (check_ramsize() / 2);
+
+-  mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOATIME, 
NULL);
+-  mkdir("/tmp/run", 0777);
+-  mkdir("/tmp/lock", 0777);
+-  mkdir("/tmp/state", 0777);
+-  symlink("/tmp", "/var");
++  if(!tmpfssize)
++  {
++  ERROR("Can't read size of RAM. Assuming 16 MB.\n");
++  tmpfssize = 8192;
++  }
+
+-  mount("tmpfs", "/dev", "tmpfs", MS_NOATIME, "mode=0755,size=51

Re: [OpenWrt-Devel] [PATCH RFC] broadcom-wl: use CCMP by default for WPA (version 1)

2014-12-02 Thread Rafał Miłecki
On 2 December 2014 at 23:48, Hauke Mehrtens  wrote:
> On 12/02/2014 08:39 PM, Rafał Miłecki wrote:
>> It follows OpenWrt's global logic in netifd-wireless.sh. We should use
>> CCMP unless TKIP was really requested.
>>
>> Signed-off-by: Rafał Miłecki 
>> ---
>>  package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I think broadcom-wl has the same behavior as hostapd in this part. In
> the hostapd file in package/network/services/hostapd/files/hostapd.sh it
> also uses wpa1 + tkip as default.

Honestly, I don't know what is this file for. I don't understand
netifd & wireless well at all. I asked for help in the
Request for any netifd wireless documentation
e-mail thread, but ppl who know /things/ ignored me.

In my case /var/run/hostapd-phy0.conf is getting generated by the
netifd-wireless.sh from the following place:
http://git.openwrt.org/?p=project/netifd.git;a=blob;f=scripts/netifd-wireless.sh;hb=HEAD
In the above you can see that "psk" uses CCMP by default. This is how
Felix decided to implement it.

Felix: could you help me/us this time, please? Could you describe how
this hostapd config helpers work? Which of them are used and which are
not?


> How would you explicitly set tkip only with your change?

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