immortalwrt/target/linux
INAGAKI Hiroshi 3ce3c3e65a ramips: use parser_trx for Buffalo WCR-1166DS
Buffalo WCR-1166DS uses trx-fomatted firmware and the custom magic
number (0x5C436F74, "\Cot") is required for OpenWrt installation from
OEM WebUI.
But the current mtdsplit_trx doesn't support the custom magic number and
fail to parse and split to kernel and rootfs when the factory image is
flashed. Then, the kernel fails to mount rootfs automatically and panics.

Before the commit fddc78bc11, mtdsplit_trx
was patched in ramips target and the device-specific magic number was
supported only for WCR-1166DS[1].
But the patch was not inherited to the later version of the kernel and
deleted by the above commit, then, the custom magic number support was
broken.

[1]: 05d6e92594/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch (L27)

log (factory image):

[    1.165312] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.195782] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.205353] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.217938] Creating 7 MTD partitions on "spi0.0":
[    1.227436] 0x000000000000-0x000000030000 : "u-boot"
[    1.238427] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.250123] 0x000000040000-0x000000050000 : "factory"
[    1.261306] 0x000000050000-0x000000810000 : "firmware"
[    1.282051] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.293594] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.304719] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.452424] /dev/root: Can't open blockdev
[    1.460619] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.475434] Please append a correct "root=" boot option; here are the available partitions:
[    1.491986] 1f00             192 mtdblock0
[    1.491989]  (driver?)
[    1.504938] 1f01              64 mtdblock1
[    1.504941]  (driver?)
[    1.517885] 1f02              64 mtdblock2
[    1.517888]  (driver?)
[    1.530831] 1f03            7936 mtdblock3
[    1.530834]  (driver?)
[    1.543777] 1f04            7936 mtdblock4
[    1.543781]  (driver?)
[    1.556724] 1f05              64 mtdblock5
[    1.556727]  (driver?)
[    1.569672] 1f06              64 mtdblock6
[    1.569675]  (driver?)
[    1.582617] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.598976] Rebooting in 1 seconds..

This patch fixes this issue by using parser_trx with specifying custom
magic number in dts instead of mtdsplit_trx.

log (fixed factory image):

[    1.202044] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.225369] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.235015] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.247603] Creating 7 MTD partitions on "spi0.0":
[    1.257106] 0x000000000000-0x000000030000 : "u-boot"
[    1.269447] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.281192] 0x000000040000-0x000000050000 : "factory"
[    1.294208] 0x000000050000-0x000000810000 : "firmware"
[    1.305774] 2 trx partitions found on MTD device firmware
[    1.316540] Creating 2 MTD partitions on "firmware":
[    1.326399] 0x00000000001c-0x000000214754 : "linux"
[    1.336063] mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only
[    1.357070] 0x000000214754-0x0000007c0000 : "rootfs"
[    1.366994] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    1.386368] mtd: device 5 (rootfs) set to be root filesystem
[    1.398700] 1 squashfs-split partitions found on MTD device rootfs
[    1.411027] 0x000000520000-0x0000007c0000 : "rootfs_data"
[    1.422841] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.436282] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.447408] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.611216] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-11 23:38:23 +08:00
..
apm821xx apm821xx: add missing export-dtb 2022-01-07 14:07:28 +08:00
archs38 archs38: update kernel version to 5.10 2021-11-10 23:59:07 +08:00
armvirt armvirt: enable MMIO_CMDLINE_DEVICES for firecracker support 2021-10-14 23:56:43 +08:00
at91 at91: drop /etc/config/firewall 2022-01-17 12:22:11 +08:00
ath25 ath25: disable build for ubnt2/5 2022-01-07 19:40:34 +08:00
ath79 ath79: drop CSAC support 2022-03-08 12:18:14 +08:00
bcm27xx bcm27xx: update distroconfig.txt for faster RPi4 2022-02-10 12:40:18 +08:00
bcm47xx bcm47xx: fix bgmac regression present in 5.10 kernel 2021-11-14 23:56:20 +08:00
bcm53xx kernel: bump 5.10 to 5.10.82 2021-12-20 11:16:13 +08:00
bcm63xx kernel: bump 5.4 to 5.4.162 2021-12-20 11:16:52 +08:00
bcm4908 bcm4908: add uboot-envtools to default packages 2021-12-21 23:55:17 +08:00
bmips kernel: Deactivate B53 symbols in generic configuration 2021-12-03 00:03:50 +08:00
gemini gemini: splash banner on framebuffer console 2021-10-11 23:55:36 +08:00
generic kernel: backport patch to allow using parser_trx from ramips 2022-03-11 23:37:52 +08:00
imx imx: update subtargets default kernel configs for 5.10 2021-12-22 11:32:14 +08:00
ipq40xx ipq40xx: use zImage for Cell-C RTL30VW 2022-02-08 12:38:00 +08:00
ipq806x ipq806x: add support for SURF G-NAT200 2022-02-25 11:36:09 +08:00
ipq807x kernel: Set CONFIG_RCU_CPU_STALL_TIMEOUT=21 2021-09-10 12:26:08 +08:00
kirkwood kirkwood: refresh kernel config 2021-10-06 23:56:13 +08:00
lantiq lantiq: increase fritz-cal-extract output limit 2022-01-17 12:26:45 +08:00
layerscape kernel: refresh kernel 5.4 patches 2021-12-28 14:26:58 +08:00
malta kernel: move two symbols to the generic kconfigs 2021-08-30 12:13:54 +08:00
mediatek kernel: move parser_trx patches of custom magic to generic 2022-03-11 23:37:36 +08:00
mpc85xx kernel: bump 5.10 to 5.10.80 2021-12-08 23:59:43 +08:00
mvebu base-files: rename 'sdcard' to 'legacy-sdcard' 2022-02-12 12:26:08 +08:00
mxs kernel: Set some options in generic configuration 2021-11-12 00:06:18 +08:00
octeon kernel: move two symbols to the generic kconfigs 2021-08-30 12:13:54 +08:00
octeontx octeontx: Refresh kernel configuration 2022-01-29 19:00:08 +08:00
omap omap: make use of 'rootfs-part' feature 2022-02-14 18:25:38 +08:00
oxnas kernel: refresh kernel 5.4 patches 2021-12-28 14:26:58 +08:00
pistachio kernel: bump 5.4 to 5.4.156 2021-12-08 23:56:51 +08:00
qoriq qoriq: add support for WatchGuard Firebox M300 2021-12-24 11:28:40 +08:00
ramips ramips: use parser_trx for Buffalo WCR-1166DS 2022-03-11 23:38:23 +08:00
realtek kernel: bump 5.4 to 5.4.162 2021-12-20 11:16:52 +08:00
rockchip rockchip: motorcomm: fix typo error 2022-02-14 21:47:12 +08:00
sunxi sunxi: make use of 'rootfs-part' feature 2022-02-14 18:28:21 +08:00
tegra kernel: Set CONFIG_RCU_CPU_STALL_TIMEOUT=21 2021-09-10 12:26:08 +08:00
uml uml: make use of 'rootfs-part' feature 2022-02-14 18:29:30 +08:00
x86 treewide: add missing kernel config for 5.10 2021-12-18 00:25:49 +08:00
zynq kernel: Set some options in generic configuration 2021-11-12 00:06:18 +08:00
Makefile