• Bullseye on the QNAP TS-220

    From Christian Henz@21:1/5 to All on Sat Sep 4 17:30:01 2021
    Hi.

    I have recently upgraded to bullseye on my TS-220, and ran into the
    problem with the kernel no longer fitting into the allocated flash
    partition that are also documented on Martin's page here: http://www.cyrius.com/debian/kirkwood/qnap/ts-219/upgrade/ (what a great resource btw!)

    I have now managed to install the bullseye kernel into the otherwise
    unused (?) "RootFS2" partition (3MB), so I thought I'd report on the
    steps I went through, in case it might be helpful to someone else.

    - installed libubootenv-tool

    - configured the fw_* tools by copying /usr/share/doc/u-boot-tools/examples/qnap_ts119-219.config to /etc/fw_env.config

    - made a backup of the U-Boot configuration using fw_printenv

    - made a backup of the flash as described on Martin's page

    For testing purposes, I then manually created a uImage of the buster
    kernel already installed and flashed it to "RootFS2", leaving the
    initramfs in "RootFS1" untouched. Then I used a serial cable to manually
    copy and boot the kernel from "RootFS2" in U-Boot, testing the
    bootargs/bootcmd modifications that would have to be made (see below).
    That worked just fine, so I went ahead with setting it up proper:

    - changed the partition that flash-kernel uses for the kernel by adding
    the following lines to /etc/flash-kernel/db:

    Machine: QNAP TS-119/TS-219
    Machine: QNAP TS219 family
    Mtd-Kernel: RootFS2

    - installed the current *-marvell kernel from bullseye, which did now
    succeed:

    Generating kernel u-boot image... done.
    Flashing kernel (using 2456450/3145728 bytes)... done.
    Flashing initramfs (using 4470940/9437184 bytes)... done.

    - modified the U-Boot environment to copy the "RootFS2" partition
    (0xf8d00000, 3MB) instead of "Kernel" (0xf8200000, 2MB). Accordingly,
    initrd also needed to be moved up by 1MB (to 0xb00000 instead of
    0xa00000):

    $ fw_setenv bootargs "console=ttyS0,115200 root=/dev/ram initrd=0xb00000,0x900000"
    $ fw_setenv bootcmd "uart1 0x68;cp.l 0xf8d00000 0x800000
    0xc0000;cp.l 0xf8400000 0xb00000 0x240000;bootm 0x800000"

    - rebooted. It worked :-)

    $ uname -r
    5.10.0-8-marvell

    Cheers,
    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Timo Jyrinki@21:1/5 to All on Sun Sep 5 19:30:01 2021
    Christian Henz kirjoitti 4.9.2021 klo 18.29:
    I have recently upgraded to bullseye on my TS-220, and ran into the
    ...
    I have now managed to install the bullseye kernel into the otherwise
    unused (?) "RootFS2" partition (3MB), so I thought I'd report on the
    steps I went through, in case it might be helpful to someone else.

    Thank you, I was wondering if anyone's upgraded these Kirkwoods to
    bullseye and I guess the answer is "no, not successfully" unless going
    your route.

    The instructions look good and if one day I have time to dig up my
    serial cable from somewhere and have plenty of extra time, I'll try it.
    It seems my QNAP TS-221 just keeps on going so there's a "risk" I'll
    want to use it past buster's support period.

    For testing purposes, I then manually created a uImage of the buster
    kernel

    You don't happen to have the mkimage line handy? Maybe there's nothing
    special about it but it wouldn't hurt to have a reference in this
    thread. OTOH, testing booting from it via serial cable is of course safe.

        $ uname -r
        5.10.0-8-marvell

    \o/

    -Timo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Henz@21:1/5 to Timo Jyrinki on Mon Sep 6 12:30:02 2021
    On 05.09.21 19:19, Timo Jyrinki wrote:
    You don't happen to have the mkimage line handy? Maybe there's nothing special about it but it wouldn't hurt to have a reference in this
    thread. OTOH, testing booting from it via serial cable is of course safe.


    I used something like this (pieced together from /usr/share/flash-kernel/functions):

    kver=4.19.0-17-marvell
    cat /boot/vmlinuz-$kver /boot/dtb-$kver > uImage-$kver.in
    mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "kernel $kver" -d uImage-$kver.in uImage-$kver

    Cheers,
    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Michlmayr@21:1/5 to All on Thu Sep 16 10:20:01 2021
    * Christian Henz <chrhenz@gmx.de> [2021-09-04 17:29]:
    I have recently upgraded to bullseye on my TS-220, and ran into the
    problem with the kernel no longer fitting into the allocated flash
    ...

    Thanks for your detailed write-up. I'm sure this will be useful to
    other users!

    BTW, Karsten Sperling took another approach and changed the u-boot
    config to change the MTD partition layout. Apparently there were
    some problems, but if someone can make this work, I think it's a more
    elegant approach:
    https://lists.debian.org/debian-arm/2021/01/msg00022.html

    --
    Martin Michlmayr
    https://www.cyrius.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Michlmayr@21:1/5 to All on Wed Sep 29 05:40:02 2021
    * Martin Michlmayr <tbm@cyrius.com> [2021-09-16 16:17]:
    BTW, Karsten Sperling took another approach and changed the u-boot
    config to change the MTD partition layout.

    Arnaud Mouiche has taken a similar approach and has written a script
    that will automatically configure QNAP devices.

    I think that's the best approach for those who want to run bullseye on
    their QNAP.

    The script can be found here: https://github.com/amouiche/qnap_mtd_resize_for_bullseye

    If someone uses this script, please post your feedback here.

    --
    Martin Michlmayr
    https://www.cyrius.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)