amouiche / qnap_mtd_resize_for_bullseye

Script for resizing MTD partitions on a QNAP device in order to be able to upgrade from buster to bullseye
GNU General Public License v2.0
54 stars 11 forks source link

Not enough space for kernel in MTD 'Kernel' (need 2464464 but is actually 2097152). qnap_mtd_resize.py --dry-run failed #50

Closed Conan179 closed 1 year ago

Conan179 commented 1 year ago

Due to a mistake on my part, I crashed my Debian and had to reinstall it. Debian buster then reinstalled https://www.cyrius.com/debian/kirkwood/qnap/ts-41x/deinstall/. Then I went to https://github.com/amouiche/qnap_mtd_resize_for_bullseye/blob/master/bullseye_upgrade.md and that's where I ran into problems.

When upgrading apt I get this error message: Setting up initramfs-tools (0.140)... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools (0.140)... update-initramfs: Generating /boot/initrd.img-5.10.0-25-marvell kirkwood-qnap: machine: QNAP TS419 family Using DTB: kirkwood-ts419-6282.dtb Installing /usr/lib/linux-image-5.10.0-25-marvell/kirkwood-ts419-6282.dtb into /boot/dtbs/5.10.0-25-marvell/./kirkwood-ts419-6282.dtb Taking backup of kirkwood-ts419-6282.dtb. Installing new kirkwood-ts419-6282.dtb. Installing /usr/lib/linux-image-5.10.0-25-marvell/kirkwood-ts419-6282.dtb into /boot/dtbs/5.10.0-25-marvell/./kirkwood-ts419-6282.dtb Taking backup of kirkwood-ts419-6282.dtb. Installing new kirkwood-ts419-6282.dtb. flash kernel: installing version 5.10.0-25-marvell Not enough space for kernel in MTD 'Kernel' (need 2464464 but is actually 2097152). run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1 dpkg: Error editing package initramfs-tools (--configure): "installed initramfs-tools script of package post-installation" subprocess returned error value 1 Errors occurred while editing: initramfs tools E: Sub-process /usr/bin/dpkg returned an error code (1)

The dry run spits out the following: [Check of the QNAP model and see if supported] kirkwood-qnap: machine: QNAP TS419 family DTB file: kirkwood-ts419-6282.dtb Checking: flashcp -V Checking: flash_erase --version Using 'libubootenv-tool' package

[find on which MTD device partitions are currently mounted] spi0.0

[Dump current U-boot config'] Current U-boot bootcmd: uart1 0x68;cp.l 0xf8100000 0x800000 0xc0000;cp.l 0xf8400000 0xb00000 0x300000;bootm 0x800000;echo Kernel_legacy layout fallback;bootm 0x900000 Current U-boot bootargs: console=ttyS0,115200=root=/dev/ram initrd=0xb00000,0xc00000 ramdisk=34816 mem=768M

[Prepare new 'bootcmd'] "'cp.l 0xf8200000 0x800000 0x0*80000' not found in 'uart1 0x68;cp.l 0xf8100000 0x800000 0xc0000;cp.l 0xf8400000 0xb00000 0x300000;bootm 0x 800000;echo Kernel_legacy layout fallback;bootm 0x900000'" Don't know how to patch 'bootcmd' for this model. Please report this log.

Who can help me?

Conan179 commented 1 year ago

I solved the problem, restored an mtd4 backup using "sudo dd if=mtd4_resized of=/dev/mtdblock4", restarted and then the qnap_mtd_resize.py script ran without an error message and apt upgrade ran without errors. The whole thing is strange...