Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bullseye on the QNAP TS-220

77 views
Skip to first unread message

Christian Henz

unread,
Sep 4, 2021, 11:30:02 AM9/4/21
to
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

Timo Jyrinki

unread,
Sep 5, 2021, 1:30:03 PM9/5/21
to
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

Christian Henz

unread,
Sep 6, 2021, 6:30:04 AM9/6/21
to


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

Martin Michlmayr

unread,
Sep 16, 2021, 4:20:03 AM9/16/21
to
* Christian Henz <chr...@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/

Martin Michlmayr

unread,
Sep 28, 2021, 11:40:03 PM9/28/21
to
* Martin Michlmayr <t...@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.

Timo Jyrinki

unread,
Aug 24, 2023, 10:10:04 AM8/24/23
to
Martin Michlmayr kirjoitti 29.9.2021 klo 6.29:
>> 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.

I thought I answered this thread earlier but don't find myself doing so.

Indeed that script worked without a hitch and I've been running Debian
11 on QNAP TS-221 for something like 1.5 years now with zero problems.

-Timo
0 new messages