1 mtd: bcm47xxpart: detect block aligned Squashfs partition
3 Most of the bcm47xx devices use TRX format for storing kernel and some
4 partition like Squashfs or JFFS2. This is pretty flexible solution, CFE
5 (the bootloader) just writes (and later boots) TRX at some hardcoded
6 place and paritions can vary in the size.
8 However some devices don't use TRX format. Very recently we have
9 discovered ZTE H218N that has kernel and rootfs partitions at some
12 This patch allows Linux find a rootfs partition after installing custom
13 image with a CFE bootloader.
15 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
17 --- a/drivers/mtd/bcm47xxpart.c
18 +++ b/drivers/mtd/bcm47xxpart.c
20 #define ML_MAGIC1 0x39685a42
21 #define ML_MAGIC2 0x26594131
22 #define TRX_MAGIC 0x30524448
23 +#define SQSH_MAGIC 0x71736873 /* shsq */
27 @@ -170,6 +171,13 @@ static int bcm47xxpart_parse(struct mtd_
28 offset = rounddown(offset + trx->length, blocksize);
32 + /* Squashfs on devices not using TRX */
33 + if (buf[0x000 / 4] == SQSH_MAGIC) {
34 + bcm47xxpart_add_part(&parts[curr_part++], "rootfs",
40 /* Look for NVRAM at the end of the last block. */