Update OpenWrt base

This commit is contained in:
Matthias Schiffer 2016-02-08 18:38:36 +01:00
parent d45b2def40
commit 43ceba8cb9
44 changed files with 6704 additions and 1264 deletions

View File

@ -1,7 +1,7 @@
GLUON_FEEDS='openwrt gluon routing luci'
OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git
OPENWRT_COMMIT=363508bcabd8e9205f5fffc8ff282439e61d618f
OPENWRT_COMMIT=c698aa66043a151ac76d19849be9ee24dfd78b72
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
PACKAGES_OPENWRT_COMMIT=f8a70fc188673d0ae8739b0a3095f7f61335fc10

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ tested it on my own v5.0 router and it works.
Signed-off-by: Daniel Petre <daniel.petre@posteo.net>
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 013a215..37ce8a4 100644
index 4336697..1fe88d5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -501,6 +501,14 @@ define Device/tl-wr740n-v4

View File

@ -6,7 +6,7 @@ This device is identical to the TL-WR740N v5, it even uses the same HWID (which
wasn't the case for older TL-WR741ND revisions).
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 37ce8a4..8a25832 100644
index 1fe88d5..78d35e1 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -531,6 +531,14 @@ define Device/tl-wr741nd-v4

View File

@ -1,87 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 17 Jul 2015 20:51:23 +0200
Subject: brcm2708: Implement sysupgrade
Implement sysupgrade for Raspberry Pi, similar to the way it is done on x86:
The config files are saved in the boot partition and moved to where they are
normally expected in preinit.
Also add optional gzip compression for the SD card image, since this can save
a lot of space (76M vs 6M), also similar to x86.
Signed-off-by: Bruno Randolf <br1@einfach.org>
diff --git a/target/linux/brcm2708/Makefile b/target/linux/brcm2708/Makefile
index 30f6e1d..015aa9c 100644
--- a/target/linux/brcm2708/Makefile
+++ b/target/linux/brcm2708/Makefile
@@ -19,7 +19,7 @@ SUBTARGETS:=bcm2708 bcm2709
KERNEL_PATCHVER:=3.18
include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835
+DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
define Target/Description
Build firmware image for Broadcom BCM2708/BCM2709 SoC devices.
diff --git a/target/linux/brcm2708/base-files/lib/preinit/79_move_config b/target/linux/brcm2708/base-files/lib/preinit/79_move_config
new file mode 100644
index 0000000..7bcea7b
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/preinit/79_move_config
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+BOOTPART=/dev/mmcblk0p1
+
+move_config() {
+ if [ -b $BOOTPART ]; then
+ insmod nls_cp437
+ insmod nls_iso8859-1
+ insmod fat
+ insmod vfat
+ mount -t vfat -o rw,noatime $BOOTPART /mnt
+ [ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
+ umount /mnt
+ fi
+}
+
+boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000..3e1ee00
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,17 @@
+platform_check_image() {
+ # i know no way to verify the image
+ return 0;
+}
+
+platform_do_upgrade() {
+ sync
+ get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+ sleep 1
+}
+
+platform_copy_config() {
+ mount -t vfat -o rw,noatime /dev/mmcblk0p1 /mnt
+ cp -af "$CONF_TAR" /mnt/
+ sync
+ umount /mnt
+}
diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile
index e70bdd0..2c18baf 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -28,6 +28,9 @@ define Image/Build/RaspberryPi
mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img # Copy OpenWrt built kernel
./gen_rpi_sdcard_img.sh $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img $(KDIR)/boot.img $(KDIR)/root.$(1) \
$(CONFIG_BRCM2708_SD_BOOT_PARTSIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE)
+ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
+ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img
+ endif
endef
define Image/Build

View File

@ -1,26 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 23 Jul 2015 01:31:05 +0200
Subject: ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2
There are a few NETGEAR devices which don't terminate the model name in the
ART with a NUL byte, at least some NETGEAR WNDR3700v2. The current awk
expression doesn't match 0xFF bytes, so AR71XX_MODEL contains lots of
trailing 0xFF garbage in this case.
Fix this by matching for the first non-printable character and explicitly
setting LC_CTYPE=C (probably not strictly necessary on OpenWrt, but will
definitely work like this, even when awk supports locales and LANG is set).
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 839abc7..af92b01 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -38,7 +38,7 @@ wndr3700_board_detect() {
;;
"33373031")
# Use awk to remove everything after the first zero byte
- model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | awk 'BEGIN{FS="[[:cntrl:]]"} {print $1; exit}')"
+ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
case $model in
$'\xff'*)
if [ "${model:24:1}" = 'N' ]; then

View File

@ -103,25 +103,16 @@ index ae3db4c..ff94e2e 100644
break;
diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index 5041619..403897a 100644
index f3b4446..cf10af3 100644
--- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
config ATH79_NVRAM
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
-@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(vo
+@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(void)
iounmap(dpll_base);
}
@@ -175,6 +175,48 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
soc_is_qca955x()) {
ath79_uart_data[0].uartclk = uart_clk_rate;
platform_device_register(&ath79_uart_device);
+--- a/arch/mips/ath79/dev-usb.c
++++ b/arch/mips/ath79/dev-usb.c
+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void)
+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void
+ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
+ }
+
@ -164,26 +155,6 @@ index 5041619..403897a 100644
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
@@ -101,7 +101,7 @@ static int ar933x_wmac_reset(void)
@@ -186,7 +228,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
{
return ath79_soc_rev;
}
-@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(voi
+@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(void)
ath79_wmac_data.is_clk_25mhz = true;
if (ath79_soc_rev == 1)
@@ -195,8 +237,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
ath79_wmac_data.external_reset = ar933x_wmac_reset;
}
-@@ -149,6 +149,26 @@ static void ar934x_wmac_setup(void)
- ath79_wmac_data.is_clk_25mhz = true;
+@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void)
+ ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
}
+static void qca953x_wmac_setup(void)
@@ -207,8 +249,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+
+ ath79_wmac_resources[0].start = QCA953X_WMAC_BASE;
@ -195,20 +166,11 @@ index 5041619..403897a 100644
+
+ t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
+ if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
@@ -222,7 +264,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
static void qca955x_wmac_setup(void)
{
u32 t;
-@@ -366,6 +386,8 @@ void __init ath79_register_wmac(u8 *cal_
+@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr)
ar933x_wmac_setup();
else if (soc_is_ar934x())
ar934x_wmac_setup();
@@ -244,6 +286,24 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
_prom_putchar = prom_putchar_ar71xx;
--- a/arch/mips/ath79/gpio.c
+++ b/arch/mips/ath79/gpio.c
+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_function_reg(void)
+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func
+ soc_is_ar913x() ||
+ soc_is_ar933x())
+ reg = AR71XX_GPIO_REG_FUNC;
@ -217,7 +179,7 @@ index 5041619..403897a 100644
+ reg = AR934X_GPIO_REG_FUNC;
+ else
+ BUG();
+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val)
+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns
+ unsigned int reg;
+ u32 t, s;
+
@ -229,16 +191,7 @@ index 5041619..403897a 100644
@@ -224,6 +224,8 @@ void __init ath79_gpio_init(void)
ath79_gpio_count = AR933X_GPIO_COUNT;
else if (soc_is_ar934x())
@@ -264,7 +324,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
}
--- a/arch/mips/ath79/irq.c
+++ b/arch/mips/ath79/irq.c
-@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v
+@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(void)
else if (soc_is_ar724x() ||
soc_is_ar933x() ||
soc_is_ar934x() ||
@@ -272,19 +332,80 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
@@ -272,16 +332,77 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
soc_is_qca955x())
ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
else
@ -317,40 +270,9 @@ index 5041619..403897a 100644
+ }
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
-@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
+@@ -60,6 +60,7 @@ static void __init ath79_detect_sys_type(void)
u32 major;
u32 minor;
u32 rev = 0;
@@ -292,7 +413,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID);
major = id & REV_ID_MAJOR_MASK;
-@@ -151,6 +152,16 @@ static void __init ath79_detect_sys_type
+@@ -152,6 +153,16 @@ static void __init ath79_detect_sys_type(void)
rev = id & AR934X_REV_ID_REVISION_MASK;
break;
@@ -309,38 +430,60 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
case REV_ID_MAJOR_QCA9556:
ath79_soc = ATH79_SOC_QCA9556;
chip = "9556";
-@@ -169,9 +180,9 @@ static void __init ath79_detect_sys_type
+@@ -170,7 +181,7 @@ static void __init ath79_detect_sys_type(void)
ath79_soc_rev = rev;
- if (soc_is_qca955x())
-- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
-- chip, rev);
+ if (soc_is_qca953x() || soc_is_qca955x())
-+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
-+ chip, ver, rev);
+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
+ chip, rev);
else
- sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
- pr_info("SoC: %s\n", ath79_sys_type);
@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
@@ -329,23 +450,49 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-@@ -105,6 +105,9 @@
@ -401,7 +323,7 @@ index 5041619..403897a 100644
+#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c
+#define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48
+
@@ -351,7 +494,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
@@ -356,7 +503,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
+#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
@ -410,7 +332,7 @@ index 5041619..403897a 100644
+
+#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
+#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
@@ -378,27 +521,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
@@ -383,27 +530,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define QCA955X_PLL_CPU_CONFIG_REG 0x00
#define QCA955X_PLL_DDR_CONFIG_REG 0x04
#define QCA955X_PLL_CLK_CTRL_REG 0x08
@ -500,7 +422,7 @@ index 5041619..403897a 100644
#define REV_ID_MAJOR_AR9341 0x0120
#define REV_ID_MAJOR_AR9342 0x1120
#define REV_ID_MAJOR_AR9344 0x2120
@@ -407,7 +608,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
@@ -412,7 +617,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define REV_ID_MAJOR_QCA9556 0x0130
#define REV_ID_MAJOR_QCA9558 0x1130
@ -509,7 +431,7 @@ index 5041619..403897a 100644
#define AR934X_REV_ID_REVISION_MASK 0xf
@@ -416,14 +617,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
@@ -421,14 +626,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define QCA955X_REV_ID_REVISION_MASK 0xf
/*
@ -594,7 +516,7 @@ index 5041619..403897a 100644
+++ b/arch/mips/include/asm/mach-ath79/ath79.h
@@ -32,6 +32,7 @@ enum ath79_soc_type {
diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index 491a7aa..2bdc744 100644
index ab2bc38..eecccdc 100644
--- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -142,74 +142,9 @@
@ -743,32 +665,8 @@ index 491a7aa..2bdc744 100644
else if (soc_is_qca955x())
qca955x_irq_init();
+ else if (soc_is_qca956x())
@@ -519,7 +452,7 @@
return -ENODEV;
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
-@@ -175,15 +175,30 @@ static void __init ath79_detect_sys_type
+@@ -175,14 +175,29 @@ static void __init ath79_detect_sys_type
rev = id & QCA955X_REV_ID_REVISION_MASK;
break;
@@ -542,18 +475,18 @@
ath79_soc_rev = rev;
- if (soc_is_qca953x() || soc_is_qca955x())
+- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
+ if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561())
- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
- chip, ver, rev);
++ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
++ chip, ver, rev);
+ else if (soc_is_tp9343())
+ sprintf(ath79_sys_type, "Qualcomm Atheros TP%s rev %u",
-+ chip, rev);
+ chip, rev);
else
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
- pr_info("SoC: %s\n", ath79_sys_type);
@@ -554,7 +487,7 @@
pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-@@ -131,6 +131,23 @@
@ -776,7 +674,7 @@ index 491a7aa..2bdc744 100644
#define QCA955X_NFC_BASE 0x1b800200
#define QCA955X_NFC_SIZE 0xb8
@@ -577,7 +510,7 @@
@@ -578,7 +511,7 @@
#define AR9300_OTP_BASE 0x14000
#define AR9300_OTP_STATUS 0x15f18
#define AR9300_OTP_STATUS_TYPE 0x7
@ -785,7 +683,7 @@ index 491a7aa..2bdc744 100644
#define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
#define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
@@ -627,7 +560,7 @@
@@ -628,7 +561,7 @@
/*
* USB_CONFIG block
*/
@ -794,7 +692,7 @@ index 491a7aa..2bdc744 100644
#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
#define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
@@ -639,7 +572,7 @@
@@ -640,7 +573,7 @@
#define MISC_INT_ETHSW BIT(12)
#define MISC_INT_TIMER4 BIT(10)
#define MISC_INT_TIMER3 BIT(9)
@ -803,7 +701,7 @@ index 491a7aa..2bdc744 100644
#define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
@@ -648,7 +581,7 @@
@@ -649,7 +582,7 @@
#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
#define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1)
#define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
@ -812,7 +710,7 @@ index 491a7aa..2bdc744 100644
QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \
QCA955X_EXT_INT_PCIE_RC2_INT3)
@@ -686,7 +619,7 @@
@@ -687,7 +620,7 @@
#define REV_ID_MAJOR_MASK 0xfff0
#define REV_ID_MAJOR_AR71XX 0x00a0
#define REV_ID_MAJOR_AR913X 0x00b0
@ -821,7 +719,7 @@ index 491a7aa..2bdc744 100644
#define REV_ID_MAJOR_QCA9533_V2 0x0160
#define REV_ID_MAJOR_QCA9556 0x0130
#define REV_ID_MAJOR_QCA9558 0x1130
@@ -695,7 +628,7 @@
@@ -696,7 +629,7 @@
#define AR71XX_REV_ID_MINOR_MASK 0x3
#define AR71XX_REV_ID_MINOR_AR7130 0x0
@ -830,7 +728,7 @@ index 491a7aa..2bdc744 100644
#define QCA955X_REV_ID_REVISION_MASK 0xf
@@ -704,9 +637,9 @@
@@ -705,9 +638,9 @@
/*
* SPI block
*/
@ -843,7 +741,7 @@ index 491a7aa..2bdc744 100644
+#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c
+#define QCA956X_GPIO_REG_OUT_FUNC1 0x30
@@ -724,9 +657,9 @@
@@ -725,9 +658,9 @@
#define AR71XX_GPIO_COUNT 16
#define AR7240_GPIO_COUNT 18
#define AR7241_GPIO_COUNT 20

View File

@ -24,7 +24,7 @@ v4 keep it simple and mimic OpenWrt style
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3dd58e1..577b63b 100644
index 170f487..bd008a8 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ '

View File

@ -1,31 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 11 Oct 2015 18:00:27 +0200
Subject: ar71xx: add support for TP-LINK TL-WR841N/ND v10
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8a25832..3a17420 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -562,6 +562,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
+
define Device/tl-wr842n-v2
$(Device/tplink-8mlzma)
BOARDNAME := TL-WR842N-v2
@@ -582,7 +589,7 @@ 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-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
define Device/tl-wr941nd-v5
$(Device/tplink-4mlzma)

View File

@ -1,181 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 22 Oct 2015 00:33:25 +0200
Subject: ar71xx: fix ath79_soc_rev value for QCA9531 ver. 2
ath9k expects to get revision id 2 for the QCA9531 ver. 2 rev. 0. This
fixes the very low TX power on some devices like the TP-LINK
TL-WR841ND v10.
As ath79_soc_rev is only used to get the revision number to ath9k on the
QCA9533, just set it to the expected value on the ver. 2.
diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index 403897a..cf10af3 100644
--- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
config ATH79_NVRAM
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
-@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(void)
+@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(vo
iounmap(dpll_base);
}
@@ -177,7 +177,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
platform_device_register(&ath79_uart_device);
--- a/arch/mips/ath79/dev-usb.c
+++ b/arch/mips/ath79/dev-usb.c
-@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void)
+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void
&ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
}
@@ -228,7 +228,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
{
return ath79_soc_rev;
}
-@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(void)
+@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(voi
ath79_wmac_data.is_clk_25mhz = true;
if (ath79_soc_rev == 1)
@@ -237,8 +237,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
ath79_wmac_data.external_reset = ar933x_wmac_reset;
}
-@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void)
- ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
+@@ -149,6 +149,26 @@ static void ar934x_wmac_setup(void)
+ ath79_wmac_data.is_clk_25mhz = true;
}
+static void qca953x_wmac_setup(void)
@@ -264,7 +264,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
static void qca955x_wmac_setup(void)
{
u32 t;
-@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr)
+@@ -366,6 +386,8 @@ void __init ath79_register_wmac(u8 *cal_
ar933x_wmac_setup();
else if (soc_is_ar934x())
ar934x_wmac_setup();
@@ -286,7 +286,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
_prom_putchar = prom_putchar_ar71xx;
--- a/arch/mips/ath79/gpio.c
+++ b/arch/mips/ath79/gpio.c
-@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_function_reg(void)
+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func
soc_is_ar913x() ||
soc_is_ar933x())
reg = AR71XX_GPIO_REG_FUNC;
@@ -295,7 +295,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
reg = AR934X_GPIO_REG_FUNC;
else
BUG();
-@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val)
+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns
unsigned int reg;
u32 t, s;
@@ -324,7 +324,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
}
--- a/arch/mips/ath79/irq.c
+++ b/arch/mips/ath79/irq.c
-@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(void)
+@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v
else if (soc_is_ar724x() ||
soc_is_ar933x() ||
soc_is_ar934x() ||
@@ -405,7 +405,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
}
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
-@@ -60,6 +60,7 @@ static void __init ath79_detect_sys_type(void)
+@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
u32 major;
u32 minor;
u32 rev = 0;
@@ -413,12 +413,13 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID);
major = id & REV_ID_MAJOR_MASK;
-@@ -152,6 +153,16 @@ static void __init ath79_detect_sys_type(void)
+@@ -151,6 +152,17 @@ static void __init ath79_detect_sys_type
rev = id & AR934X_REV_ID_REVISION_MASK;
break;
+ case REV_ID_MAJOR_QCA9533_V2:
+ ver = 2;
++ ath79_soc_rev = 2;
+ /* drop through */
+
+ case REV_ID_MAJOR_QCA9533:
@@ -430,15 +431,23 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
case REV_ID_MAJOR_QCA9556:
ath79_soc = ATH79_SOC_QCA9556;
chip = "9556";
-@@ -170,7 +181,7 @@ static void __init ath79_detect_sys_type(void)
+@@ -167,11 +179,12 @@ static void __init ath79_detect_sys_type
+ panic("ath79: unknown SoC, id:0x%08x", id);
+ }
- ath79_soc_rev = rev;
+- ath79_soc_rev = rev;
++ if (ver == 1)
++ ath79_soc_rev = rev;
- if (soc_is_qca955x())
+- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
+- chip, rev);
+ if (soc_is_qca953x() || soc_is_qca955x())
- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
- chip, rev);
++ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
++ chip, ver, rev);
else
+ sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
+ pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -105,6 +105,21 @@
diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index 2bdc744..eecccdc 100644
--- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -452,7 +452,7 @@
return -ENODEV;
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
-@@ -175,14 +175,29 @@ static void __init ath79_detect_sys_type
+@@ -176,6 +176,18 @@ static void __init ath79_detect_sys_type
rev = id & QCA955X_REV_ID_REVISION_MASK;
break;
@@ -471,19 +471,20 @@
default:
panic("ath79: unknown SoC, id:0x%08x", id);
}
-
- ath79_soc_rev = rev;
+@@ -183,9 +195,12 @@ static void __init ath79_detect_sys_type
+ if (ver == 1)
+ ath79_soc_rev = rev;
- if (soc_is_qca953x() || soc_is_qca955x())
-- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
+ if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561())
-+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
-+ chip, ver, rev);
+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
+ chip, ver, rev);
+ else if (soc_is_tp9343())
+ sprintf(ath79_sys_type, "Qualcomm Atheros TP%s rev %u",
- chip, rev);
++ chip, rev);
else
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
+ pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -143,6 +143,23 @@

View File

@ -37,7 +37,7 @@ index 5241db2..11b3fa0 100644
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link: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 5c38c54..2f0855c 100755
index 8143d2d..5a74461 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -226,6 +226,7 @@ tl-mr3420-v2 |\
@ -49,10 +49,10 @@ index 5c38c54..2f0855c 100755
wnr2000-v4 |\
wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index af92b01..9c7c139 100755
index 0b2857d..46af69a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -799,6 +799,9 @@ ar71xx_board_detect() {
@@ -800,6 +800,9 @@ ar71xx_board_detect() {
*"TL-WR941N/ND v5")
name="tl-wr941nd-v5"
;;
@ -75,7 +75,7 @@ index f11ea8c..fd337e1 100644
wnr2200 |\
wnr612-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ab69e4f..f181a63 100755
index 8dea48f..2fc1d10 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -354,6 +354,7 @@ platform_check_image() {
@ -254,7 +254,7 @@ index 0000000..8c788e2
+MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
+ tl_wr941nd_v6_setup);
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 3a17420..cc25be7 100644
index 78d35e1..11fb568 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -600,7 +600,7 @@ endef

View File

@ -3,7 +3,7 @@ Date: Thu, 5 Nov 2015 15:48:09 +0100
Subject: ar71xx: add support for TP-Link TL-WR1043ND v3
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index cc25be7..4b29d9c 100644
index 11fb568..dd224d4 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2023,6 +2023,7 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,tt

View File

@ -6,10 +6,10 @@ The hwid check was wrong, causing the AR71XX_MODEL value to end with a
space (as $hwver was unset).
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 9c7c139..388cf38 100755
index 46af69a..d0abf42 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -122,7 +122,7 @@ tplink_board_detect() {
@@ -123,7 +123,7 @@ tplink_board_detect() {
"3C0002"*)
model="MINIBOX_V1"
;;

View File

@ -11,7 +11,7 @@ of OpenSSL to avoid breaking the build whenever OpenSSL releases a new
version.
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 7f0da8b..039e1ab 100644
index ad93678..9a16599 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -16,6 +16,7 @@ PKG_BUILD_PARALLEL:=1
@ -21,4 +21,4 @@ index 7f0da8b..039e1ab 100644
+ http://www.openssl.org/source/old/1.0.2/ \
ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
PKG_MD5SUM:=38dd619b2e77cbac69b99f52a053d25a
PKG_MD5SUM:=b3bf73f507172be9292ea2a8c28b659d

View File

@ -1,46 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 20 Nov 2015 15:09:03 +0100
Subject: ar71xx: fix wndr3700_board_detect for some NETGEAR WNDR3700v2 (again)
When fixing the model string for WNDR3700v2 which contain a model string
followed by 0xff in r46455, the match for other versions of the WNDR3700v2
which just contain lots of 0xff broke (as the 0xff $model is checked for
is stripped off).
Fix by stripping off non-printable characters only for the actual output
string, but not for the internal matching.
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 388cf38..daebaa4 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -37,8 +37,9 @@ wndr3700_board_detect() {
machine="NETGEAR WNDR3700"
;;
"33373031")
- # Use awk to remove everything after the first zero byte
- model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
+ model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
+ # Use awk to remove everything unprintable
+ model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
case $model in
$'\xff'*)
if [ "${model:24:1}" = 'N' ]; then
@@ -48,14 +49,14 @@ wndr3700_board_detect() {
fi
;;
'29763654+16+64'*)
- machine="NETGEAR ${model:14}"
+ machine="NETGEAR ${model_stripped:14}"
;;
'29763654+16+128'*)
- machine="NETGEAR ${model:15}"
+ machine="NETGEAR ${model_stripped:15}"
;;
*)
# Unknown ID
- machine="NETGEAR $model"
+ machine="NETGEAR ${model_stripped}"
esac
esac

View File

@ -1,17 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 21 Nov 2015 18:35:49 +0100
Subject: CC: base-files: add missing public key
Add the secondary package signature key to the 15.05 sources so that people
building the release have the same keys as people using precompiled images.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
diff --git a/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07 b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07
new file mode 100644
index 0000000..5e3088c
--- /dev/null
+++ b/package/base-files/files/etc/opkg/keys/de98a2dd1d0f8a07
@@ -0,0 +1,2 @@
+untrusted comment: openwrt.org 15.05 release key
+RWTemKLdHQ+KBxOILy8gyk+5PaDVdfyJ32TFnY/jnQOrBAd1wobbLNYz

View File

@ -1,23 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 8 Dec 2015 19:51:05 +0100
Subject: Revert "bzip2: extend/fix the Host/Install rule to install libbz2.so files"
This reverts commit f5ebfb02fc5f539e89393b8186f7ecd768402f12.
diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile
index ba47cfb..e1c7b97 100644
--- a/package/utils/bzip2/Makefile
+++ b/package/utils/bzip2/Makefile
@@ -97,10 +97,9 @@ HOST_CONFIGURE_ARGS+= \
--prefix=$(STAGING_DIR_HOST)
define Host/Install
- $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(STAGING_DIR_HOST)/usr/lib
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
$(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOST)/usr/ install
- $(CP) $(HOST_BUILD_DIR)/libbz2.so* $(STAGING_DIR_HOST)/usr/lib/
- $(CP) $(HOST_BUILD_DIR)/libbz2.so.1.0 $(STAGING_DIR_HOST)/usr/lib/libbz2.so
+# $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen2
endef
$(eval $(call HostBuild))

View File

@ -1,29 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 2 Jan 2016 23:36:25 +0100
Subject: ar71xx: another fix to wndr3700_board_detect
My last bugfix (r47538) introduced a new bug in wndr3700_board_detect
(again...).
Assigning the result of ar71xx_get_mtd_offset_size_format to the model
variable before stripping of garbage using awk will cause all NUL bytes to
be removed before awk is applied, leading to model strings like
"NETGEAR WNDRMACv2NETGEAR", where a NUL byte after the v2 is supposed to
terminate the string.
Fix by calling ar71xx_get_mtd_offset_size_format twice, once piping to awk
directly.
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index daebaa4..d0abf42 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -39,7 +39,7 @@ wndr3700_board_detect() {
"33373031")
model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
# Use awk to remove everything unprintable
- model_stripped="$(echo -n "$model" | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
+ model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
case $model in
$'\xff'*)
if [ "${model:24:1}" = 'N' ]; then

View File

@ -1,87 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 6 Feb 2016 07:35:33 +0100
Subject: kernel: fix keyring reference leak (CVE-2016-0728)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
diff --git a/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch
new file mode 100644
index 0000000..9c6a969
--- /dev/null
+++ b/target/linux/generic/patches-3.18/010-KEYS-Fix-keyring-ref-leak-in-join_session_keyring.patch
@@ -0,0 +1,75 @@
+From 7ca88764d45c209791e8813131c1457c2e9e51e7 Mon Sep 17 00:00:00 2001
+From: Yevgeny Pats <yevgeny@perception-point.io>
+Date: Mon, 11 Jan 2016 12:05:28 +0000
+Subject: KEYS: Fix keyring ref leak in join_session_keyring()
+
+If a thread is asked to join as a session keyring the keyring that's already
+set as its session, we leak a keyring reference.
+
+This can be tested with the following program:
+
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <keyutils.h>
+
+ int main(int argc, const char *argv[])
+ {
+ int i = 0;
+ key_serial_t serial;
+
+ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
+ "leaked-keyring");
+ if (serial < 0) {
+ perror("keyctl");
+ return -1;
+ }
+
+ if (keyctl(KEYCTL_SETPERM, serial,
+ KEY_POS_ALL | KEY_USR_ALL) < 0) {
+ perror("keyctl");
+ return -1;
+ }
+
+ for (i = 0; i < 100; i++) {
+ serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
+ "leaked-keyring");
+ if (serial < 0) {
+ perror("keyctl");
+ return -1;
+ }
+ }
+
+ return 0;
+ }
+
+If, after the program has run, there something like the following line in
+/proc/keys:
+
+3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty
+
+with a usage count of 100 * the number of times the program has been run,
+then the kernel is malfunctioning. If leaked-keyring has zero usages or
+has been garbage collected, then the problem is fixed.
+
+Reported-by: Yevgeny Pats <yevgeny@perception-point.io>
+Signed-off-by: David Howells <dhowells@redhat.com>
+---
+ security/keys/process_keys.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
+index a3f85d2..e6d50172 100644
+--- a/security/keys/process_keys.c
++++ b/security/keys/process_keys.c
+@@ -794,6 +794,7 @@ long join_session_keyring(const char *name)
+ ret = PTR_ERR(keyring);
+ goto error2;
+ } else if (keyring == new->session_keyring) {
++ key_put(keyring);
+ ret = 0;
+ goto error2;
+ }
+--
+2.7.0.rc3
+