make-mtdsplit-jffs2-endian-agnostic.patch (826B)
1 From 12345790 Tue Sep 26 18:30:44 2023 2 From: Daniel Barlow <dan@telent.net> 3 Date: Tue Sep 26 18:29:47 BST 2023 4 Subject: mtdsplit: find magic of little-endian JFFS2 5 6 On a little-endian CPU, the little-endian JFFS2 magic 7 appears to be word-swapped. 8 9 There is probably a better way to implement this; if you are reading 10 this patch you are probably well-qualified to do that and upstream it 11 to OpenWrt 12 13 14 diff --git a/drivers/mtd/mtdsplit/mtdsplit.c b/drivers/mtd/mtdsplit/mtdsplit.c 15 index b2e51dcfc6..533af0298e 100644 16 --- a/drivers/mtd/mtdsplit/mtdsplit.c 17 +++ b/drivers/mtd/mtdsplit/mtdsplit.c 18 @@ -92,6 +93,6 @@ 19 *type = MTDSPLIT_PART_TYPE_SQUASHFS; 20 return 0; 21 - } else if (magic == 0x19852003) { 22 + } else if ((magic == 0x19852003) || (magic == 0x20031985)) { 23 if (type) 24 *type = MTDSPLIT_PART_TYPE_JFFS2; 25 return 0;