DCS-930L - Cannot mount healthy squashfs on 19.07.7

I'm working to get the port to the DCS-930L cameras working again, and have been able to successfully flash these with an older firmware and then sysupgrade from there to get a fully functioning system running on 19.07.7. To support more versions of the camera I've tried to compile a newer version though, and have run into issues getting the kernel to mount the rootfs at boot. On the original firmware (really old 14.07 from 2015 this works just fine:

[    0.500000] number of CFI chips: 1
[    0.510000] 6 ofpart partitions found on MTD device 1f000000.cfi
[    0.520000] Creating 6 MTD partitions on "1f000000.cfi":
[    0.530000] 0x000000000000-0x000000030000 : "u-boot"
[    0.550000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.560000] 0x000000040000-0x000000050000 : "factory"
[    0.580000] 0x000000050000-0x0000001a0000 : "kernel"
[    0.590000] 0x000000150000-0x000000400000 : "rootfs"
[    0.610000] mtd: device 4 (rootfs) set to be root filesystem
[    0.620000] mtd: partition "rootfs_data" created automatically, ofs=0x300000, len=0x100000
[    0.630000] 0x000000300000-0x000000400000 : "rootfs_data"
[    0.650000] 0x000000050000-0x000000400000 : "firmware"
[    0.670000] eth0: done loading
[    0.680000] rt2880_wdt 10000120.watchdog: Initialized
[    0.700000] TCP: cubic registered
[    0.700000] NET: Registered protocol family 17
[    0.710000] 8021q: 802.1Q VLAN Support v1.8
[    0.730000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
root@(none):/# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 00150000 00010000 "kernel"
mtd4: 002b0000 00010000 "rootfs"
mtd5: 00100000 00010000 "rootfs_data"
mtd6: 003b0000 00010000 "firmware"
root@OpenWrt:/# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock5 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

Booting off a freshly compiled kernel mounting the root filesystem at boot does not work though:

number of CFI chips: 1
6 fixed-partitions partitions found on MTD device 1f000000.cfi
Creating 6 MTD partitions on "1f000000.cfi":
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x0000001a0000 : "kernel"
0x000000150000-0x000000400000 : "rootfs"
mtd: device 4 (rootfs) set to be root filesystem
1 squashfs-split partitions found on MTD device rootfs
0x000000300000-0x000000400000 : "rootfs_data"
0x000000050000-0x000000400000 : "firmware"
libphy: Fixed MDIO Bus: probed
rt3050-esw 10110000.esw: link changed 0x01
mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
rt2880_wdt 10000120.watchdog: Initialized
NET: Registered protocol family 17
VFS: Cannot open root device "(null)" or unknown-block(31,4): error -5
Please append a correct "root=" boot option; here are the available partitions:
1f00             192 mtdblock0 
 (driver?)
1f01              64 mtdblock1 
 (driver?)
1f02              64 mtdblock2 
 (driver?)
1f03            1344 mtdblock3 
 (driver?)
1f04            2752 mtdblock4 
 (driver?)
1f05            1024 mtdblock5 
 (driver?)
1f06            3776 mtdblock6 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
Rebooting in 1 seconds..

Booting the same kernel from an initramfs image it seems to detect the partitions correctly:

root@OpenWrt:/# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 00150000 00010000 "kernel"
mtd4: 002b0000 00010000 "rootfs"
mtd5: 00100000 00010000 "rootfs_data"
mtd6: 003b0000 00010000 "firmware"

However when trying to manually mount this it refuses:

root@OpenWrt:/# mount /dev/mtdblock4 /mnt/
mount: mounting /dev/mtdblock4 on /mnt/ failed: I/O error

There is no additional error visible through dmesg or logread. Thinking that the kernel might not be able to properly read the flash I tried copying over unsquashfs to the camera. It can successfully detect and unpack the filesystem, so it does seem uncorrupted and the required drivers to access it appears to work:

root@OpenWrt:/tmp# /tmp/usr/sbin/unsquashfs -s /dev/mtdblock4
Found a valid SQUASHFS 4:0 superblock on /dev/mtdblock4.
Creation or last append time Sat Apr 25 22:59:11 2015
Filesystem size 1756686 bytes (1715.51 Kbytes / 1.68 Mbytes)
Compression xz
xz: error reading stored compressor options from filesystem!
Block size 262144
Filesystem is exportable via NFS
Inodes are compressed
Data is compressed
Fragments are compressed
Always-use-fragments option is not specified
Xattrs are not stored
Duplicates are removed
Number of fragments 16
Number of inodes 644
Number of ids 1

Unpacking from the partition works fine too:

root@OpenWrt:/tmp# /tmp/usr/sbin/unsquashfs /dev/mtdblock4 
Parallel unsquashfs: Using 1 processor
588 inodes (589 blocks) to write



created 404 files
created 56 directories
created 183 symlinks
created 1 devices
created 0 fifos

The files unpacked looks intact, tried accessing some in /etc and nothing there hints at any issues reading the partition. I also tried copying the whole flash partition containing kernel and rootfs out of the camera, and it seems to have the correct layout there as well:

# binwalk /tmp/mtdblock6.data 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             uImage header, header size: 64 bytes, header CRC: 0x74584AF1, created: 2015-04-25 23:00:59, image size: 2805198 bytes, Data Address: 0x80000000, Entry Point: 0x80000000, data CRC: 0x320AC441, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "MIPS OpenWrt Linux-3.10.32"
64            0x40            LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 2880980 bytes
1048576       0x100000        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 1756686 bytes, 644 inodes, blocksize: 262144 bytes, created: 2015-04-25 22:59:11
2818048       0x2B0000        JFFS2 filesystem, little endian

The particular squashfs here is created with the old 2015 14.07 image, but I've had the same results when reflashing with an image of a 19.07.7 version as well.

Would anyone have any tips or pointers on what could be wrong here? I'm thinking that I at a minimum should be able to mount the partition when booting from the initramfs image? I've checked the kernel menuconfig for any options related to squashfs, SPI and any other likely or unlikely option and they seem sound, but I have had to disable a lot of things such as IPv6, iptables, sound and a bunch of other things to get the kernel to be <1MB (this is needed to get it to flash initially through D-Links emergency web interface, once this is done a bigger kernel works fine). The kernel config looks as follows:

cat target/linux/ramips/rt305x/config-4.14
# CONFIG_ADVISE_SYSCALLS is not set
# CONFIG_AIO is not set
CONFIG_ARCH_BINFMT_ELF_STATE=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
CONFIG_ARCH_HAS_RESET_CONTROLLER=y
# CONFIG_ARCH_HAS_SG_CHAIN is not set
# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set
# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_ARCH_MMAP_RND_BITS_MAX=15
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set
# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BPF_JIT is not set
# CONFIG_BPF_SYSCALL is not set
# CONFIG_BRIDGE_IGMP_SNOOPING is not set
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_CEVT_R4K=y
CONFIG_CEVT_SYSTICK_QUIRK=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKEVT_RT3352=y
CONFIG_CLKSRC_MMIO=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CPU_GENERIC_DUMP_TLB=y
CONFIG_CPU_HAS_PREFETCH=y
CONFIG_CPU_HAS_RIXI=y
CONFIG_CPU_HAS_SYNC=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_CPU_MIPS32=y
# CONFIG_CPU_MIPS32_R1 is not set
CONFIG_CPU_MIPS32_R2=y
CONFIG_CPU_MIPSR2=y
CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
CONFIG_CPU_R4K_CACHE_TLB=y
CONFIG_CPU_R4K_FPU=y
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CPU_SUPPORTS_MSA=y
# CONFIG_CRASHLOG is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLKCIPHER is not set
CONFIG_CSRC_R4K=y
# CONFIG_DEBUG_FS is not set
CONFIG_DEBUG_PINCTRL=y
CONFIG_DMA_NONCOHERENT=y
# CONFIG_DTB_RT305X_EVAL is not set
CONFIG_DTB_RT_NONE=y
CONFIG_DTC=y
CONFIG_EARLY_PRINTK=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_FIXED_PHY=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_IO=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_RALINK=y
CONFIG_GPIO_SYSFS=y
# CONFIG_GRO_CELLS is not set
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HARDWARE_WATCHPOINTS=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
# CONFIG_HAVE_ARCH_BITREVERSE is not set
CONFIG_HAVE_ARCH_COMPILER_H=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_HAVE_CBPF_JIT=y
CONFIG_HAVE_CC_STACKPROTECTOR=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_COPY_THREAD_TLS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_HAVE_IDE=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_KVM=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_HIGH_RES_TIMERS is not set
CONFIG_HZ_PERIODIC=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_MULTIPLE_TABLES is not set
# CONFIG_IP_ROUTE_MULTIPATH is not set
# CONFIG_IP_ROUTE_VERBOSE is not set
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_INTC=y
CONFIG_IRQ_MIPS_CPU=y
CONFIG_IRQ_WORK=y
# CONFIG_ISDN is not set
# CONFIG_JFFS2_FS is not set
# CONFIG_LBDAF is not set
CONFIG_LIBFDT=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MFD_SYSCON=y
CONFIG_MIGRATION=y
CONFIG_MIPS=y
CONFIG_MIPS_ASID_BITS=8
CONFIG_MIPS_ASID_SHIFT=0
CONFIG_MIPS_CLOCK_VSYSCALL=y
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set
CONFIG_MIPS_CMDLINE_FROM_DTB=y
# CONFIG_MIPS_ELF_APPENDED_DTB is not set
# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
CONFIG_MIPS_L1_CACHE_SHIFT=5
# CONFIG_MIPS_MACHINE is not set
# CONFIG_MIPS_NO_APPENDED_DTB is not set
CONFIG_MIPS_RAW_APPENDED_DTB=y
CONFIG_MIPS_SPRAM=y
CONFIG_MODULES_USE_ELF_REL=y
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_NETWORK_FILESYSTEMS is not set
# CONFIG_NET_CADENCE is not set
CONFIG_NET_MEDIATEK_ESW_RT3050=y
CONFIG_NET_MEDIATEK_RT3050=y
CONFIG_NET_MEDIATEK_SOC=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_AURORA is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
CONFIG_NET_VENDOR_MEDIATEK=y
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
# CONFIG_NEW_LEDS is not set
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
# CONFIG_NO_IOPORT_MAP is not set
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_MDIO=y
CONFIG_OF_NET=y
CONFIG_PCI_DRIVERS_LEGACY=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_PHYLIB=y
CONFIG_PHY_RALINK_USB=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_RT2880=y
# CONFIG_PINCTRL_SINGLE is not set
CONFIG_RALINK=y
# CONFIG_RALINK_ILL_ACC is not set
CONFIG_RALINK_WDT=y
# CONFIG_RCU_NEED_SEGCBLIST is not set
# CONFIG_RCU_STALL_COMMON is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_RESET_CONTROLLER=y
# CONFIG_SCHED_HRTICK is not set
# CONFIG_SCHED_INFO is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SERIAL_8250_FSL is not set
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SHMEM is not set
# CONFIG_SOC_MT7620 is not set
# CONFIG_SOC_MT7621 is not set
# CONFIG_SOC_RT288X is not set
CONFIG_SOC_RT305X=y
# CONFIG_SOC_RT3883 is not set
CONFIG_SPI=y
# CONFIG_SPI_DYNAMIC is not set
CONFIG_SPI_MASTER=y
# CONFIG_SPI_MT7621 is not set
CONFIG_SPI_RT2880=y
CONFIG_SRCU=y
# CONFIG_STAGING is not set
# CONFIG_SWAP is not set
CONFIG_SWCONFIG=y
CONFIG_SWPHY=y
# CONFIG_SYN_COOKIES is not set
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
CONFIG_SYS_HAS_CPU_MIPS32_R2=y
CONFIG_SYS_HAS_EARLY_PRINTK=y
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
CONFIG_SYS_SUPPORTS_MIPS16=y
# CONFIG_TCP_CONG_ADVANCED is not set
# CONFIG_TEXTSEARCH is not set
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TIMER_OF=y
CONFIG_TIMER_PROBE=y
CONFIG_TINY_SRCU=y
CONFIG_USB_SUPPORT=y
CONFIG_USE_OF=y
# CONFIG_VLAN_8021Q is not set
CONFIG_WATCHDOG_CORE=y
# CONFIG_WIRELESS is not set
# CONFIG_WLAN is not set

1. Edit /target/linux/ramips/rt305x/config-4.14 as in the spoiler:

Part of the config-4.14
CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_SUPPORT=y
CONFIG_MTD_SPLIT_FIT_FW=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_MTD_OF_PARTS=y

2.
And post your files: /target/linux/ramips/image/rt305x.mk from old working and new sources.

Thank you for the pointers, appreciate that! I tried adding these, all but two were actually already in the config it seems, but these two were missing:

CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_SPLIT_SUPPORT=y

Recompiled with these added which yielded a slightly bigger kernel size so something changed. Unfortunately it still does not seem to be able to mount the squashfs partition:

number of CFI chips: 1
6 fixed-partitions partitions found on MTD device 1f000000.cfi
Creating 6 MTD partitions on "1f000000.cfi":
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x0000001a0000 : "kernel"
0x000000150000-0x000000400000 : "rootfs"
mtd: device 4 (rootfs) set to be root filesystem
1 squashfs-split partitions found on MTD device rootfs
0x000000300000-0x000000400000 : "rootfs_data"
0x000000050000-0x000000400000 : "firmware"
libphy: Fixed MDIO Bus: probed
rt3050-esw 10110000.esw: link changed 0x01
mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
rt2880_wdt 10000120.watchdog: Initialized
NET: Registered protocol family 17
VFS: Cannot open root device "(null)" or unknown-block(31,4): error -5
Please append a correct "root=" boot option; here are the available partitions:
1f00             192 mtdblock0 
 (driver?)
1f01              64 mtdblock1 
 (driver?)
1f02              64 mtdblock2 
 (driver?)
1f03            1344 mtdblock3 
 (driver?)
1f04            2752 mtdblock4 
 (driver?)
1f05            1024 mtdblock5 
 (driver?)
1f06            3776 mtdblock6 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
Rebooting in 1 seconds..

Booting the initramfs image over tftp with the new kernel looks like this:

number of CFI chips: 1
6 fixed-partitions partitions found on MTD device 1f000000.cfi
Creating 6 MTD partitions on "1f000000.cfi":
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x0000001a0000 : "kernel"
0x000000150000-0x000000400000 : "rootfs"
mtd: device 4 (rootfs) set to be root filesystem
1 squashfs-split partitions found on MTD device rootfs
0x000000300000-0x000000400000 : "rootfs_data"
0x000000050000-0x000000400000 : "firmware"

But it still refuses to mount the fs:

root@OpenWrt:/# mount /dev/mtdblock4  /mnt/
mount: mounting /dev/mtdblock4 on /mnt/ failed: I/O error

It looks as follows, I have not changed anything in this file for the current kernel build:

$ cat target/linux/ramips/image/rt305x.mk
#
# RT305X Profiles
#
define Build/buffalo-tftp-header
  ( \
    echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \
      dd bs=512 count=1 conv=sync; \
    dd if=$@; \
  ) > $@.tmp && \
  $(STAGING_DIR_HOST)/bin/buffalo-tftp -i $@.tmp -o $@.new
  mv $@.new $@
endef

define Build/dap-header
	$(STAGING_DIR_HOST)/bin/mkdapimg $(1) -i $@ -o $@.new
	mv $@.new $@
endef

define Build/hilink-header
	$(STAGING_DIR_HOST)/bin/mkhilinkfw -e -i $@ -o $@.new
	mv $@.new $@
endef


define Device/3g150b
  DTS := 3G150B
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  UIMAGE_NAME:= Linux Kernel Image
  DEVICE_TITLE := Tenda 3G150B
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += 3g150b

define Device/3g300m
  DTS := 3G300M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  UIMAGE_NAME := 3G150M_SPI Kernel Image
  DEVICE_TITLE := Tenda 3G300M
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += 3g300m

define Device/3g-6200n
  DTS := 3G-6200N
  IMAGE_SIZE := 3648k
  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
	edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \
	append-metadata | check-size $$$$(IMAGE_SIZE)
  DEVICE_TITLE := Edimax 3g-6200n
endef
TARGET_DEVICES += 3g-6200n

define Device/3g-6200nl
  DTS := 3G-6200NL
  IMAGE_SIZE := 3648k
  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
	edimax-header -s CSYS -m 3G62 -f 0x50000 -S 0x01100000 | pad-rootfs | \
	append-metadata | check-size $$$$(IMAGE_SIZE)
  DEVICE_TITLE := Edimax 3g-6200nl
endef
TARGET_DEVICES += 3g-6200nl

define Device/a5-v11
  DTS := A5-V11
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B A5-V11 -F 4M
  DEVICE_TITLE := A5-V11
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
  DEFAULT := n
endef
TARGET_DEVICES += a5-v11

define Device/air3gii
  DTS := AIR3GII
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := AirLive Air3GII
endef
TARGET_DEVICES += air3gii

define Device/all0256n-4M
  DTS := ALL0256N-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Allnet ALL0256N (4MB)
  DEVICE_PACKAGES := rssileds
endef
TARGET_DEVICES += all0256n-4M

define Device/all0256n-8M
  DTS := ALL0256N-8M
  DEVICE_TITLE := Allnet ALL0256N (8MB)
  DEVICE_PACKAGES := rssileds
endef
TARGET_DEVICES += all0256n-8M

define Device/all5002
  DTS := ALL5002
  IMAGE_SIZE := 32448k
  DEVICE_TITLE := Allnet ALL5002
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
          kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x
endef
TARGET_DEVICES += all5002

define Device/all5003
  DTS := ALL5003
  IMAGE_SIZE := 32448k
  DEVICE_TITLE := Allnet ALL5003
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
          kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x
endef
TARGET_DEVICES += all5003

define Device/asl26555-8M
  DTS := ASL26555-8M
  IMAGE_SIZE := 7744k
  SUPPORTED_DEVICES += asl26555
  DEVICE_TITLE := Alpha ASL26555 
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += asl26555-8M

define Device/asl26555-16M
  DTS := ASL26555-16M
  IMAGE_SIZE := 15872k
  SUPPORTED_DEVICES += asl26555
  DEVICE_TITLE := Alpha ASL26555 16M
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += asl26555-16M

define Device/atp-52b
  DTS := ATP-52B
  IMAGE_SIZE := 7808k
  DEVICE_TITLE := Argus ATP-52B
endef
TARGET_DEVICES += atp-52b

define Device/awm002-evb-4M
  DTS := AWM002-EVB-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := AsiaRF AWM002-EVB (4M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-gpio
endef
TARGET_DEVICES += awm002-evb-4M

define Device/awm002-evb-8M
  DTS := AWM002-EVB-8M
  DEVICE_TITLE := AsiaRF AWM002-EVB (8M)/AsiaRF AWM003 EVB
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-gpio
endef
TARGET_DEVICES += awm002-evb-8M

define Device/awapn2403
  DTS := AWAPN2403
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := AsiaRF AWAPN2403
endef
TARGET_DEVICES += awapn2403

define Device/bc2
  DTS := BC2
  DEVICE_TITLE := NexAira BC2
endef
TARGET_DEVICES += bc2

define Device/broadway
  DTS := BROADWAY
  IMAGE_SIZE := 7744k
  UIMAGE_NAME:= Broadway Kernel Image
  DEVICE_TITLE := Hauppauge Broadway
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += broadway

define Device/carambola
  DTS := CARAMBOLA
  DEVICE_TITLE := 8devices Carambola
  DEVICE_PACKAGES :=
endef
TARGET_DEVICES += carambola

define Device/d105
  DTS := D105
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Huawei D105
endef
TARGET_DEVICES += d105

define Device/dap-1350
  DTS := DAP-1350
  IMAGES += factory.bin factory-NA.bin
  IMAGE_SIZE := 7488k
  IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
	dap-header -s RT3052-AP-DAP1350WW-3
  IMAGE/factory-NA.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
	dap-header -s RT3052-AP-DAP1350-3
  DEVICE_TITLE := D-Link DAP-1350
endef
TARGET_DEVICES += dap-1350

define Device/dcs-930
  DTS := DCS-930
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := D-Link DCS-930
  DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-dwc2
endef
TARGET_DEVICES += dcs-930

define Device/dcs-930l-b1
  DTS := DCS-930L-B1
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := D-Link DCS-930L B1
  DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-ohci kmod-usb2
endef
TARGET_DEVICES += dcs-930l-b1

define Device/dir-300-b1
  DTS := DIR-300-B1
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir300b
  DEVICE_TITLE := D-Link DIR-300 B1
  DEFAULT := n
endef
TARGET_DEVICES += dir-300-b1

define Device/dir-300-b7
  DTS := DIR-300-B7
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := D-Link DIR-300 B7
  DEFAULT := n
endef
TARGET_DEVICES += dir-300-b7

define Device/dir-320-b1
  DTS := DIR-320-B1
  DEVICE_TITLE := D-Link DIR-320 B1
endef
TARGET_DEVICES += dir-320-b1

define Device/dir-600-b1
  DTS := DIR-600-B1
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  SUPPORTED_DEVICES := dir-600-b1 dir-600-b2
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir600b
  DEVICE_TITLE := D-Link DIR-600 B1/B2
endef
TARGET_DEVICES += dir-600-b1

define Device/dir-610-a1
  $(Device/seama)
  DTS := DIR-610-A1
  BLOCKSIZE := 4k
  SEAMA_SIGNATURE := wrgn59_dlob.hans_dir610
  KERNEL := $(KERNEL_DTB)
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := D-Link DIR-610 A1 
  DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer
endef
TARGET_DEVICES += dir-610-a1

define Device/dir-615-d
  DTS := DIR-615-D
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | wrg-header wrgn23_dlwbr_dir615d
  DEVICE_TITLE := D-Link DIR-615 D
endef
TARGET_DEVICES += dir-615-d


define Device/dir-615-h1
  DTS := DIR-615-H1
  BLOCKSIZE := 4k
  IMAGES += factory.bin
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | senao-header -r 0x218 -p 0x30 -t 3
  DEVICE_TITLE := D-Link DIR-615 H1
endef
TARGET_DEVICES += dir-615-h1

define Device/dir-620-a1
  DTS := DIR-620-A1
  DEVICE_TITLE := D-Link DIR-620 A1
endef
TARGET_DEVICES += dir-620-a1

define Device/dir-620-d1
  DTS := DIR-620-D1
  DEVICE_TITLE := D-Link DIR-620 D1
endef
TARGET_DEVICES += dir-620-d1

define Device/dwr-512-b
  DTS := DWR-512-B
  IMAGE_SIZE := 7800k
  DEVICE_TITLE := D-Link DWR-512 B
  DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-spi-dev kmod-usb-serial \
			kmod-usb-serial-option kmod-usb-net kmod-usb-net-cdc-ether \
			comgt-ncm
  DLINK_ROM_ID := DLK6E2412001
  DLINK_FAMILY_MEMBER := 0x6E24
  DLINK_FIRMWARE_SIZE := 0x7E0000
  KERNEL := $(KERNEL_DTB)
  IMAGES += factory.bin
  IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
  IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
endef
TARGET_DEVICES += dwr-512-b

define Device/esr-9753
  DTS := ESR-9753
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := EnGenius ESR-9753
endef
TARGET_DEVICES += esr-9753

define Device/f5d8235-v2
  DTS := F5D8235_V2
  IMAGE_SIZE := 7744k
  DEVICE_TITLE := Belkin F5D8235 v2
  DEVICE_PACKAGES := kmod-switch-rtl8366rb
endef
TARGET_DEVICES += f5d8235-v2

define Device/f7c027
  DTS := F7C027
  IMAGE_SIZE := 7616k
  DEVICE_TITLE := Belkin F7C027
endef
TARGET_DEVICES += f7c027

define Device/fonera20n
  DTS := FONERA20N
  IMAGES += factory.bin
  IMAGE/factory.bin := $$(sysupgrade_bin) | \
	edimax-header -s RSDK -m NL1T -f 0x50000 -S 0xc0000
  DEVICE_TITLE := Fonera 2.0N
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += fonera20n

define Device/freestation5
  DTS := FREESTATION5
  DEVICE_TITLE := ARC Wireless FreeStation
  DEVICE_PACKAGES := kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb
endef
TARGET_DEVICES += freestation5

define Device/hg255d
  DTS := HG255D
  IMAGE_SIZE := $(ralink_default_fw_size_16M)
  DEVICE_TITLE := HuaWei HG255D
endef
TARGET_DEVICES += hg255d

define Device/hlk-rm04
  DTS := HLKRM04
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | hilink-header
  DEVICE_TITLE := Hi-Link HLK-RM04
endef
TARGET_DEVICES += hlk-rm04

define Device/ht-tm02
  DTS := HT-TM02
  DEVICE_TITLE := HooToo HT-TM02
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += ht-tm02

define Device/hw550-3g
  DTS := HW550-3G
  DEVICE_TITLE := Aztech HW550-3G
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += hw550-3g

define Device/ip2202
  DTS := IP2202
  DEVICE_TITLE := Poray IP2202
endef
TARGET_DEVICES += ip2202

define Device/jhr-n805r
  DTS := JHR-N805R
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 29.24
  DEVICE_TITLE := JCG JHR-N805R
endef
TARGET_DEVICES += jhr-n805r

define Device/jhr-n825r
  DTS := JHR-N825R
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 23.24
  DEVICE_TITLE := JCG JHR-N825R
endef
TARGET_DEVICES += jhr-n825r

define Device/jhr-n926r
  DTS := JHR-N926R
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 25.24
  DEVICE_TITLE := JCG JHR-N926R
endef
TARGET_DEVICES += jhr-n926r

define Device/m2m
  DTS := M2M
  UIMAGE_NAME:= Linux Kernel Image
  DEVICE_TITLE := Intenso Memory 2 Move
  DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer \
		kmod-usb-core kmod-usb2 kmod-usb-storage kmod-scsi-core \
		kmod-fs-ext4 kmod-fs-vfat block-mount
endef
TARGET_DEVICES += m2m

define Device/m3
  DTS := M3
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M3 -F 4M
  DEVICE_TITLE := Poray M3
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev \
	kmod-ledtrig-timer
endef
TARGET_DEVICES += m3

define Device/m4-4M
  DTS := M4-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 4M
  DEVICE_TITLE := Poray M4 (4MB)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev \
	kmod-ledtrig-timer
endef
TARGET_DEVICES += m4-4M

define Device/m4-8M
  DTS := M4-8M
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B M4 -F 8M
  DEVICE_TITLE := Poray M4 (8MB)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
endef
TARGET_DEVICES += m4-8M

define Device/miniembplug
  DTS := MINIEMBPLUG
  DEVICE_TITLE := Omnima MiniEMBPlug
endef
TARGET_DEVICES += miniembplug

define Device/miniembwifi
  DTS := MINIEMBWIFI
  DEVICE_TITLE := Omnima MiniEMBWiFi
endef
TARGET_DEVICES += miniembwifi

define Device/mofi3500-3gn
  DTS := MOFI3500-3GN
  DEVICE_TITLE := MoFi Network MOFI3500-3GN
endef
TARGET_DEVICES += mofi3500-3gn

define Device/mpr-a1
  DTS := MPRA1
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  UIMAGE_NAME:= Linux Kernel Image
  DEVICE_TITLE := HAME MPR-A1
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev
endef
TARGET_DEVICES += mpr-a1

define Device/mpr-a2
  DTS := MPRA2
  UIMAGE_NAME:= Linux Kernel Image
  DEVICE_TITLE := HAME MPR-A2
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev
endef
TARGET_DEVICES += mpr-a2

define Device/mr-102n
  DTS := MR-102N
  DEVICE_TITLE := AXIMCom MR-102N
endef
TARGET_DEVICES += mr-102n

define Device/mzk-dp150n
  DTS := MZK-DP150N
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Planex MZK-DP150N
  DEVICE_PACKAGES := kmod-spi-dev
endef
TARGET_DEVICES += mzk-dp150n

define Device/mzk-w300nh2
  DTS := MZK-W300NH2
  IMAGE_SIZE := 3648k
  IMAGES += factory.bin
  IMAGE/factory.bin := $$(sysupgrade_bin) | \
	edimax-header -s CSYS -m RN52 -f 0x50000 -S 0xc0000
  DEVICE_TITLE := Planex MZK-W300NH2
endef
TARGET_DEVICES += mzk-w300nh2

define Device/mzk-wdpr
  DTS := MZK-WDPR
  DEVICE_TITLE := Planex MZK-WDPR
endef
TARGET_DEVICES += mzk-wdpr

define Device/nbg-419n
  DTS := NBG-419N
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := ZyXEL NBG-419N
endef
TARGET_DEVICES += nbg-419n

define Device/nbg-419n2
  DTS := NBG-419N2
  IMAGE_SIZE := $(ralink_default_fw_size_8M)
  DEVICE_TITLE := ZyXEL NBG-419N2
endef
TARGET_DEVICES += nbg-419n2

define Device/ncs601w
  DTS := NCS601W
  DEVICE_TITLE := Wansview NCS601W
  DEVICE_PACKAGES := kmod-video-core kmod-video-uvc \
		kmod-usb-core kmod-usb-ohci
endef
TARGET_DEVICES += ncs601w

define Device/nixcore-x1-8M
  DTS := NIXCORE-8M
  IMAGE_SIZE := 7872k
  SUPPORTED_DEVICES += nixcore-x1
  DEVICE_TITLE := NixcoreX1 (8M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
endef
TARGET_DEVICES += nixcore-x1-8M

define Device/nixcore-x1-16M
  DTS := NIXCORE-16M
  IMAGE_SIZE := 16064k
  SUPPORTED_DEVICES += nixcore-x1
  DEVICE_TITLE := NixcoreX1 (16M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
endef
TARGET_DEVICES += nixcore-x1-16M

define Device/nw718
  DTS := NW718
  IMAGE_SIZE := 3712k
  UIMAGE_NAME:= ARA1B4NCRNW718;1
  DEVICE_TITLE := Netcore NW718
endef
TARGET_DEVICES += nw718

define Device/psr-680w
  DTS := PSR-680W
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Petatel PSR-680W Wireless 3G Router
endef
TARGET_DEVICES += psr-680w

define Device/pwh2004
  DTS := PWH2004
  DEVICE_TITLE := Prolink PWH2004
  DEVICE_PACKAGES :=
endef
TARGET_DEVICES += pwh2004

define Device/px-4885-4M
  DTS := PX-4885-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := 7Links PX-4885 (4M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
	kmod-usb-ledtrig-usbport kmod-leds-gpio
endef
TARGET_DEVICES += px-4885-4M

define Device/px-4885-8M
  DTS := PX-4885-8M
  DEVICE_TITLE := 7Links PX-4885 (8M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
	kmod-usb-ledtrig-usbport kmod-leds-gpio
endef
TARGET_DEVICES += px-4885-8M

define Device/rt5350f-olinuxino
  DTS := RT5350F-OLINUXINO
  DEVICE_TITLE := RT5350F-OLinuXino
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-ralink \
		kmod-spi-dev
endef
TARGET_DEVICES += rt5350f-olinuxino

define Device/rt5350f-olinuxino-evb
  DTS := RT5350F-OLINUXINO-EVB
  DEVICE_TITLE := RT5350F-OLinuXino-EVB
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-ralink \
		kmod-spi-dev
endef
TARGET_DEVICES += rt5350f-olinuxino-evb

define Device/rt-g32-b1
  DTS := RT-G32-B1
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Asus RT-G32 B1
endef
TARGET_DEVICES += rt-g32-b1

define Device/rt-n10-plus
  DTS := RT-N10-PLUS
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Asus RT-N10+
  DEFAULT := n
endef
TARGET_DEVICES += rt-n10-plus

define Device/rt-n13u
  DTS := RT-N13U
  DEVICE_TITLE := Asus RT-N13U
  DEVICE_PACKAGES := kmod-leds-gpio kmod-rt2800-pci kmod-usb-dwc2
endef
TARGET_DEVICES += rt-n13u

define Device/rut5xx
  DTS := RUT5XX
  DEVICE_TITLE := Teltonika RUT5XX
  DEVICE_PACKAGES := om-watchdog
endef
TARGET_DEVICES += rut5xx

define Device/sl-r7205
  DTS := SL-R7205
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Skyline SL-R7205 Wireless 3G Router
endef
TARGET_DEVICES += sl-r7205

define Device/tew-638apb-v2
  DTS := TEW-638APB-V2
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGE/sysupgrade.bin := $$(sysupgrade_bin) | umedia-header 0x026382 | \
        append-metadata | check-size $$$$(IMAGE_SIZE)
  DEVICE_TITLE := TRENDnet TEW-638APB v2
endef
TARGET_DEVICES += tew-638apb-v2

define Device/tew-714tru
  DTS := TEW-714TRU
  DEVICE_TITLE := TRENDnet TEW-714TRU
endef
TARGET_DEVICES += tew-714tru

define Device/ur-326n4g
  DTS := UR-326N4G
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := UPVEL UR-326N4G
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += ur-326n4g

define Device/ur-336un
  DTS := UR-336UN
  DEVICE_TITLE := UPVEL UR-336UN
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += ur-336un

define Device/v22rw-2x2
  DTS := V22RW-2X2
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Ralink AP-RT3052-V22RW-2X2
endef
TARGET_DEVICES += v22rw-2x2

define Device/vocore-8M
  DTS := VOCORE-8M
  IMAGE_SIZE := 7872k
  SUPPORTED_DEVICES += vocore
  DEVICE_TITLE := VoCore (8M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-ralink \
		kmod-spi-dev
endef
TARGET_DEVICES += vocore-8M

define Device/vocore-16M
  DTS := VOCORE-16M
  IMAGE_SIZE := 16064k
  SUPPORTED_DEVICES += vocore
  DEVICE_TITLE := VoCore (16M)
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
		kmod-i2c-core kmod-i2c-ralink \
		kmod-spi-dev
endef
TARGET_DEVICES += vocore-16M

define Device/w150m
  DTS := W150M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  UIMAGE_NAME:= W150M Kernel Image
  DEVICE_TITLE := Tenda W150M
endef
TARGET_DEVICES += w150m

define Device/w306r-v20
  DTS := W306R_V20
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  UIMAGE_NAME:= linkn Kernel Image
  DEVICE_TITLE := Tenda W306R V2.0
endef
TARGET_DEVICES += w306r-v20

define Device/w502u
  DTS := W502U
  DEVICE_TITLE := ALFA Networks W502U
endef
TARGET_DEVICES += w502u

define Device/wcr-150gn
  DTS := WCR150GN
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Sparklan WCR-150GN
endef
TARGET_DEVICES += wcr-150gn

define Device/whr-g300n
  DTS := WHR-G300N
  BLOCKSIZE := 64k
  IMAGE_SIZE := 3801088
  DEVICE_TITLE := Buffalo WHR-G300N
  IMAGES += tftp.bin
  IMAGE/tftp.bin := $$(sysupgrade_bin) | \
    check-size $$$$(IMAGE_SIZE) | buffalo-tftp-header
endef
TARGET_DEVICES += whr-g300n

define Device/wizard8800
  DTS := WIZARD8800
  UIMAGE_NAME:= Linux Kernel Image
  DEVICE_TITLE := EasyAcc WIZARD 8800
endef
TARGET_DEVICES += wizard8800

define Device/wizfi630a
  DTS := WIZFI630A
  IMAGE_SIZE := $(ralink_default_fw_size_16M)
  DEVICE_TITLE := WIZnet WizFi630A
endef
TARGET_DEVICES += wizfi630a

define Device/wl-330n
  DTS := WL-330N
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Asus WL-330N
endef
TARGET_DEVICES += wl-330n

define Device/wl-330n3g
  DTS := WL-330N3G
  BLOCKSIZE := 4k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Asus WL-330N3G
  DEVICE_PACKAGES :=
endef
TARGET_DEVICES += wl-330n3g

define Device/wl-351
  DTS := WL-351
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := Sitecom WL-351 v1
  DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig
  DEFAULT := n
endef
TARGET_DEVICES += wl-351

define Device/wnce2001
  DTS := WNCE2001
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin factory-NA.bin
  IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
	dap-header -s RT3052-AP-WNCE2001-3 -r WW -v 1.0.0.99
  IMAGE/factory-NA.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
	dap-header -s RT3052-AP-WNCE2001-3 -r NA -v 1.0.0.99
  DEVICE_TITLE := Netgear WNCE2001
endef
TARGET_DEVICES += wnce2001

define Device/wr512-3gn-4M
  DTS := WR512-3GN-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := WR512-3GN (4M)
  DEFAULT := n
endef
TARGET_DEVICES += wr512-3gn-4M

define Device/wr512-3gn-8M
  DTS := WR512-3GN-8M
  DEVICE_TITLE := WR512-3GN (8M)
endef
TARGET_DEVICES += wr512-3gn-8M

define Device/wr6202
  DTS := WR6202
  DEVICE_TITLE := AWB WR6202
endef
TARGET_DEVICES += wr6202

define Device/wt1520-4M
  DTS := WT1520-4M
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B WT1520 -F 4M
  DEVICE_TITLE := Nexx WT1520 (4MB)
endef
TARGET_DEVICES += wt1520-4M

define Device/wt1520-8M
  DTS := WT1520-8M
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B WT1520 -F 8M
  DEVICE_TITLE := Nexx WT1520 (8MB)
endef
TARGET_DEVICES += wt1520-8M

define Device/x5
  DTS := X5
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B X5 -F 8M
  DEVICE_TITLE := Poray X5/X6
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
endef
TARGET_DEVICES += x5


define Device/x8
  DTS := X8
  IMAGES += factory.bin
  IMAGE/factory.bin := \
	$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | poray-header -B X8 -F 8M
  DEVICE_TITLE := Poray X8
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
endef
TARGET_DEVICES += x8

define Device/xdxrn502j
  DTS := XDXRN502J
  BLOCKSIZE := 64k
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := XDX RN502J
endef
TARGET_DEVICES += xdxrn502j

define Device/kn
  DTS := kn
  BLOCKSIZE := 64k
  IMAGE_SIZE := 7872k
  DEVICE_TITLE := ZyXEL Keenetic
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ehci \
	kmod-usb-ledtrig-usbport kmod-usb-dwc2
endef
TARGET_DEVICES += kn

define Device/zyxel_keenetic-start
  DTS := kn_st
  IMAGE_SIZE := $(ralink_default_fw_size_4M)
  DEVICE_TITLE := ZyXEL Keenetic Start
endef
TARGET_DEVICES += zyxel_keenetic-start

define Device/zorlik_zl5900v2
  DTS := ZL5900V2
  DEVICE_TITLE := Zorlik ZL5900V2
  DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev
endef
TARGET_DEVICES += zorlik_zl5900v2

I previously tried editing this file to generate newer factory images as well but did not get this to work, so reverted back to the original file. The image flashed now was built a long time ago, I tried searching that build directory for the same file but it does not seem to exist there :frowning: There's a Makefile there though, I can try to share that separately (too big for a single post it seems).

One more thing worth mentioning, initially I could not even get the new kernel to find the rootfs and rootfs_data partitions inside the firmware partition. I traced this back to a diff to the device tree file (https://github.com/openwrt/openwrt/commit/53624c1702e6aad5b3e5e442c064dd30f81db2e4#diff-5c762f60808eef6b222800333b6254b6460fedbd5f8df2b63954f8bb165168c2). I edited the dcs-930l dts file to put the two partitions back in, after which they do show up at boot. Here's what the file looks like now:

$ cat  target/linux/ramips/dts/DCS-930.dts
/dts-v1/;

#include "rt3050.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "dlink,dcs-930", "ralink,rt3050-soc";
	model = "D-Link DCS-930";

	aliases {
		led-boot = &led_status;
		led-failsafe = &led_status;
		led-running = &led_status;
		led-upgrade = &led_status;
	};

	cfi@1f000000 {
		compatible = "cfi-flash";
		reg = <0x1f000000 0x400000>;
		bank-width = <2>;
		device-width = <2>;

/*		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x30000>;
				read-only;
			};

			partition@30000 {
				label = "u-boot-env";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				label = "kernel";
				reg = <0x50000 0x150000>;
			};

			partition@150000 {
				label = "rootfs";
				reg = <0x150000 0x2b0000>;
			};

			partition {
				label = "firmware";
				reg = <0x50000 0x3b0000>;
			};

		}; */

                partition@0 {
                        label = "u-boot";
                        reg = <0x0 0x30000>;
                        read-only;
                };

                partition@30000 {
                        label = "u-boot-env";
                        reg = <0x30000 0x10000>;
                        read-only;
                };

                factory: partition@40000 {
                        label = "factory";
                        reg = <0x40000 0x10000>;
                        read-only;
                };

                partition@50000 {
                        label = "kernel";
                        reg = <0x50000 0x150000>;
                };

                partition@150000 {
                        label = "rootfs";
                        reg = <0x150000 0x2b0000>;
                };

                partition {
                        label = "firmware";
                        reg = <0x50000 0x3b0000>;
                };

	};

	leds {
		compatible = "gpio-leds";

		wifi {
			label = "dcs-930:red:alert";
			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
		};

		led_status: status {
			label = "dcs-930:green:status";
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
		};

		wps {
			label = "dcs-930:blue:wps";
			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys-polled";
		poll-interval = <20>;

		wps {
			label = "wps";
			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
			linux,code = <BTN_1>;
		};

		reset {
			label = "reset";
			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
			ralink,function = "gpio";
		};
	};
};

&ethernet {
	mtd-mac-address = <&factory 0x4>;
};

&esw {
	mediatek,portmap = <0x2f>;
};

&wmac {
	ralink,mtd-eeprom = <&factory 0>;
};

&otg {
	status = "okay";
};

It is too big to post here, but here's a link to the image Makefile from 14.07, that should have been used to build the working image.

"kernel, rootfs, rootfs_dat" should not be in the flash partitions.
They are created at boot.

Write this down:

CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_SPLIT_SUPPORT=y

And fix the markup in dts for the 4MB flash.

partition 4mb-flash
			partition@0 {
				label = "u-boot";
				reg = <0x0 0x30000>;
				read-only;
			};

			partition@30000 {
				label = "u-boot-env";
				reg = <0x30000 0x10000>;
				read-only;
			};

			factory: partition@40000 {
				label = "factory";
				reg = <0x40000 0x10000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0x3b0000>;
			};

Or 8MB Flash memory?

I tried reverting back to the stock dts which should be consistent with the suggested changes, see full dts file below. This is 4MB device, so the config in the file should be correct. Rebuilt everything and both CONFIG_MTD_OF_PARTS and CONFIG_MTD_SPLIT_SUPPORT are in the kernel config.

target/linux/ramips/dts/DCS-930.dts

/dts-v1/;

#include "rt3050.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
compatible = "dlink,dcs-930", "ralink,rt3050-soc";
model = "D-Link DCS-930";

aliases {
	led-boot = &led_status;
	led-failsafe = &led_status;
	led-running = &led_status;
	led-upgrade = &led_status;
};

cfi@1f000000 {
	compatible = "cfi-flash";
	reg = <0x1f000000 0x400000>;
	bank-width = <2>;
	device-width = <2>;

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "u-boot";
			reg = <0x0 0x30000>;
			read-only;
		};

		partition@30000 {
			label = "u-boot-env";
			reg = <0x30000 0x10000>;
			read-only;
		};

		factory: partition@40000 {
			label = "factory";
			reg = <0x40000 0x10000>;
			read-only;
		};

		partition@50000 {
			compatible = "denx,uimage";
			label = "firmware";
			reg = <0x50000 0x3b0000>;
		};
	};
};

leds {
	compatible = "gpio-leds";

	wifi {
		label = "dcs-930:red:alert";
		gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
	};

	led_status: status {
		label = "dcs-930:green:status";
		gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
	};

	wps {
		label = "dcs-930:blue:wps";
		gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
	};
};

keys {
	compatible = "gpio-keys-polled";
	poll-interval = <20>;

	wps {
		label = "wps";
		gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
		linux,code = <BTN_1>;
	};

	reset {
		label = "reset";
		gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
		linux,code = <KEY_RESTART>;
	};
};

};

&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "spi", "jtag", "mdio", "rgmii", "uartf";
ralink,function = "gpio";
};
};
};

&ethernet {
mtd-mac-address = <&factory 0x4>;
};

&esw {
mediatek,portmap = <0x2f>;
};

&wmac {
ralink,mtd-eeprom = <&factory 0>;
};

&otg {
status = "okay";
};

Booting of this kernel only the firmware partition is found:

number of CFI chips: 1
4 fixed-partitions partitions found on MTD device 1f000000.cfi
Creating 4 MTD partitions on "1f000000.cfi":
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000400000 : "firmware"
libphy: Fixed MDIO Bus: probed
rt3050-esw 10110000.esw: link changed 0x01
mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
rt2880_wdt 10000120.watchdog: Initialized
NET: Registered protocol family 17
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
1f00             192 mtdblock0 
 (driver?)
1f01              64 mtdblock1 
 (driver?)
1f02              64 mtdblock2 
 (driver?)
1f03            3776 mtdblock3 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Rebooting in 1 seconds..

This is consistent with the issue I had initially as well, which led me to trying to revert the old changes in the dts file to see if that would help. I also tried booting through a initramfs image over TFTP. The kernel cannot find the rootfs partition then either:

number of CFI chips: 1
4 fixed-partitions partitions found on MTD device 1f000000.cfi
Creating 4 MTD partitions on "1f000000.cfi":
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000400000 : "firmware"
libphy: Fixed MDIO Bus: probed
root@OpenWrt:/# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 003b0000 00010000 "firmware"

The data stored on flash was not changed, and I can manually still access the squashfs file system:

root@OpenWrt:/tmp# /tmp/usr/sbin/unsquashfs -s -o 1048576 /dev/mtdblock3 
Found a valid SQUASHFS 4:0 superblock on /dev/mtdblock3.
Creation or last append time Sat Apr 25 22:59:11 2015
Filesystem size 1756686 bytes (1715.51 Kbytes / 1.68 Mbytes)
Compression xz
xz: error reading stored compressor options from filesystem!
Block size 262144
Filesystem is exportable via NFS
Inodes are compressed
Data is compressed
Fragments are compressed
Always-use-fragments option is not specified
Xattrs are not stored
Duplicates are removed
Number of fragments 16
Number of inodes 644
Number of ids 1

Could it be that the old image currently flashed somehow would not be detectable when a more recent kernel boots? What is special about these devices is that the factory image that has to be flashed through the emergency web interface both requires a kernel to be 1MB or smaller, but it also expects the squashfs to start at 1MB, even if the kernel is smaller from what I've understood. Or that is how the old images were generated at least. I've tried manually creating newer images (since the factory image builds don't work) and something equivalent to how these would be generated is the following:

dd if=build_dir/target-mipsel_24kc_musl/linux-ramips_rt305x/dcs-930-kernel.bin of=/tmp/dcs-930.combined bs=1048576 count=1 conv=sync
cat build_dir/target-mipsel_24kc_musl/linux-ramips_rt305x/root.squashfs >> /tmp/dcs-930.combined
staging_dir/host/bin/padjffs2 /tmp/dcs-930.combined 4 8 16 64 128 256

There's more than that required to create the image, but point being that on the firmware partition there will be a gap of a few KB typically between the kernel and the squashfs partitions. I assumed that the scanning of the firmware partition to assemble the kernel, rootfs and rootfs_data partitions would still be able to detect their signatures despite this though?

I did a bit more testing with older initramfs images, to see if the current behavoir was just due to my builds or something more common. Testing the official 19.07.7 gave the same problem, with the kernel, rootfs and rootfs_data partitions not being found. Going back to 18.06.8 as well as 17.01.7 this behaviour changed though:

[    5.765932] 1f000000.cfi: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022a8
[    5.786317] Amd/Fujitsu Extended Query Table at 0x0040
[    5.796768]   Amd/Fujitsu Extended Query version 1.1.
[    5.807018] number of CFI chips: 1
[    5.876526] 6 fixed-partitions partitions found on MTD device 1f000000.cfi
[    5.890564] Creating 6 MTD partitions on "1f000000.cfi":
[    5.901357] 0x000000000000-0x000000030000 : "u-boot"
[    5.913668] 0x000000030000-0x000000040000 : "u-boot-env"
[    5.926646] 0x000000040000-0x000000050000 : "factory"
[    5.938967] 0x000000050000-0x0000001a0000 : "kernel"
[    5.951117] 0x000000150000-0x000000400000 : "rootfs"
[    5.963186] mtd: device 4 (rootfs) set to be root filesystem
[    5.974822] 1 squashfs-split partitions found on MTD device rootfs
[    5.987394] 0x000000300000-0x000000400000 : "rootfs_data"
[    6.000333] 0x000000050000-0x000000400000 : "firmware"

But the rootfs filesystem could still not be mounted:

root@LEDE:/# mount /dev/mtdblock4 /mnt
mount: mounting /dev/mtdblock4 on /mnt failed: I/O error

Going even further back to 15.05.1 it could finally both find the partitions, and allow me to mount them:

[    5.730000] 1f000000.cfi: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022a8
[    5.750000] Amd/Fujitsu Extended Query Table at 0x0040
[    5.760000]   Amd/Fujitsu Extended Query version 1.1.
[    5.770000] number of CFI chips: 1
[    5.790000] 6 ofpart partitions found on MTD device 1f000000.cfi
[    5.800000] Creating 6 MTD partitions on "1f000000.cfi":
[    5.810000] 0x000000000000-0x000000030000 : "u-boot"
[    5.830000] 0x000000030000-0x000000040000 : "u-boot-env"
[    5.840000] 0x000000040000-0x000000050000 : "factory"
[    5.850000] 0x000000050000-0x0000001a0000 : "kernel"
[    5.860000] 0x000000150000-0x000000400000 : "rootfs"
[    5.880000] mtd: device 4 (rootfs) set to be root filesystem
[    5.890000] 1 squashfs-split partitions found on MTD device rootfs
[    5.900000] 0x000000300000-0x000000400000 : "rootfs_data"
[    5.910000] 0x000000050000-0x000000400000 : "firmware"
root@OpenWrt:/# mount /dev/mtdblock4 /mnt/
root@OpenWrt:/# cat /mnt/etc/openwrt_version 
r39854

I've been trying to go through configs for those old versions to try to determine of something changed that would have created a different behaviour in more recent builds, but so far have not found anything obvious. Two things seem to have changed though:

  1. Between 18.06.8 and 19.07.7 the partitions cannot be found anymore, which has consistently worked in all previous versions.
  2. Between 15.05.1 and 17.01.7 it is no longer possible to mount the file system created in 15.05.1. Could there be a version incompatibility between older squashfs versions and newer?

I will try to manually create an 19.07.7 image and see if the official initramfs images can detect those partitions at least. I believe I've tested this previously in the past though without getting it to work. There are no DCS-930L images as part of snapshot builds, so cannot test that at the moment.

After some challenges getting the 19.07 config working on 18.06 I managed to compile a version that properly detects and mounts all partitions. I'll try the latest version at some point (this device has been dropped beyond 19.07, so will need to get it added back to test that) to see if the issue might have been resolved there, but from what I can see 19.07 is broken in how it handles the partition setup on this device at least.