Package: linux-image-5.2.0-0.bpo.2-marvell
Version: 5.2.9-2~bpo10+1

With Debian Buster installed on my QNAP TS-219P II, "aptitude -t 
buster-backports" offers an upgrade to linux-image-5.2.0-0.bpo.2-marvell, which 
fails to install when it comes to flashing the kernel, since the kernel image 
exceeds the available space on the mtd1 partition (2MB). While this is in fact 
documented in the changelog for this package:

  * [armel/marvell] Increase maximum image size (fixes FTBFS):
    - This removes support for QNAP TS-109, TS-119, TS-209, TS-219, TS-409,
      and HP Media Vault mv2120
    - This may be reverted if we can disable or modularise some features

I would have expected that this upgrade would not be made available on the 
affected devices instead of "wrecking" the installation.

Moreover, I would actually prefer to have this issue fixed so that my QNAP 
TS-219P-II may continue to be supported. Aside from reducing the kernel image 
size, I see at least on my model another possibility:

The QNAP TS219P-II has 16MB of flash in total, which is (AFAIK 
"soft"-)partitioned as:

mtd0: 0.5 MB U-Boot partition
mtd1: 2   MB Kernel partition (vmlinuz)
mtd2: 9   MB RootFS1 partition (initrd.img)
mtd3: 3   MB RootFS2 partition
mtd4: 0.25MB U-Boot Config partition
mtd5: 1.25MB NAS Config partition

I see two possibilities to get more space for the Kernel:

1. Resize mtd1 and mtd2 to 3 and 8 MB, respectively. All the initrd.img's I've 
had were less than 7 MB in size, so mtd2 can give up 1 MB without ill effects. 
This would require changing the device tree which AFAIK defines the partitions 
and sizes, and the U-Boot Config (which can be modified with fw_setenv) to 
change the bootcmd from:

bootcmd=uart1 0x68;cp.l 0xf8200000 0x800000 0x80000;cp.l 0xf8400000 0xa00000 
0x240000;bootm 0x800000

(the first cp.l copies the kernel image from flash to RAM, the second the 
initrd image, with the parameters sourceaddr, destaddr, # of 32-bit words to 
copy)

to:

bootcmd=uart1 0x68;cp.l 0xf8200000 0x800000 0xc0000;cp.l 0xf8500000 0xb00000 
0x200000;bootm 0x800000

2. Keep the partitions as they are, but use mtd3 instead of mtd1 for the kernel 
image. This would require changing the kernel flashing tool and the U-Boot 
Config to change the bootcmd to:

bootcmd=uart1 0x68;cp.l 0xf8d00000 0x800000 0xc0000;cp.l 0xf8400000 0xb00000 
0x240000;bootm 0x800000

Both solutions would provide 3 MB space for the kernel image, which should 
suffice for some time...

Reply via email to