aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-10-25 19:49:20 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-10-25 19:49:20 +0000
commit6a699a8ae80b5b6ff6559bad1297242c8daf8934 (patch)
tree23b007787793d847f6c8770d73b80d86e6ff454f /target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch
parentb69b9c5328e19057833ff4ea3aa26c5b7b6844c3 (diff)
downloadupstream-6a699a8ae80b5b6ff6559bad1297242c8daf8934.tar.gz
upstream-6a699a8ae80b5b6ff6559bad1297242c8daf8934.tar.bz2
upstream-6a699a8ae80b5b6ff6559bad1297242c8daf8934.zip
brcm47xx: check for .ELF header in partition parser
The image format for the wgt634u is different from the normal format. Without this patch the partition parser detects a 128kb bigger partition after every update. This closes #11420 Thank you b.sander for the patch. SVN-Revision: 33935
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch10
1 files changed, 8 insertions, 2 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch b/target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch
index 5381e2f6cc..0c66603f2e 100644
--- a/target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch
+++ b/target/linux/brcm47xx/patches-3.3/050-mtd-add-bcm47xx-part-parser.patch
@@ -26,7 +26,7 @@
obj-$(CONFIG_MTD_CHAR) += mtdchar.o
--- /dev/null
+++ b/drivers/mtd/bcm47xxpart.c
-@@ -0,0 +1,542 @@
+@@ -0,0 +1,548 @@
+/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
@@ -96,6 +96,11 @@
+ u32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions from start of header */
+};
+
++/* for WGT634U search the ELF-header of
++ * the kernel decompressor instead of TRX
++ */
++#define WGT634U_ELF_MAGIC 0x464c457f /* ".ELF" */
++
+/* for Edimax Print servers which use an additional header
+ * then the firmware on flash looks like :
+ * EDIMAX HEADER | TRX HEADER
@@ -149,7 +154,8 @@
+ }
+
+ /* found a TRX header */
-+ if (le32_to_cpu(trx->magic) == TRX_MAGIC)
++ if (le32_to_cpu(trx->magic) == TRX_MAGIC ||
++ le32_to_cpu(trx->magic) == WGT634U_ELF_MAGIC)
+ goto found;
+ }
+