1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-02-23 06:34:42 +02:00

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.


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33935 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
hauke 2012-10-25 19:49:20 +00:00
parent 9fe205eb78
commit 0cddb5e96a

View File

@ -26,7 +26,7 @@
obj-$(CONFIG_MTD_CHAR) += mtdchar.o obj-$(CONFIG_MTD_CHAR) += mtdchar.o
--- /dev/null --- /dev/null
+++ b/drivers/mtd/bcm47xxpart.c +++ b/drivers/mtd/bcm47xxpart.c
@@ -0,0 +1,542 @@ @@ -0,0 +1,548 @@
+/* +/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@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 */ + 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 +/* for Edimax Print servers which use an additional header
+ * then the firmware on flash looks like : + * then the firmware on flash looks like :
+ * EDIMAX HEADER | TRX HEADER + * EDIMAX HEADER | TRX HEADER
@ -149,7 +154,8 @@
+ } + }
+ +
+ /* found a TRX header */ + /* 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; + goto found;
+ } + }
+ +