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
53 stars 11 forks source link

TS-212P Firmware: 4.3.3.2420 Build 20230621: qnap_mtd_resize.py failed #43

Open bo911 opened 1 year ago

bo911 commented 1 year ago

Python3 on an empty NAS TS-212P is missing, so I install python3.5 via app through GUI ... I copy dnap_mtd_resize.py and start as follows.. [admin@NASDE9EA2 tmp]# ./qnap_mtd_resize.py --dry-run File "./qnap_mtd_resize.py", line 98 raise KeyError(f"No mtd {names} device found.") ^ SyntaxError: invalid syntax

Firmware: 4.3.3.2420 Build 20230621 Any suggestions to proceed ? [admin@NASDE9EA2 tmp]# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00010000 "U-Boot" mtd1: 00200000 00010000 "Kernel" mtd2: 00900000 00010000 "RootFS1" mtd3: 00300000 00010000 "RootFS2" mtd4: 00040000 00010000 "U-Boot Config" mtd5: 00140000 00010000 "NAS Config" So it seems to me as expected

cavokz commented 1 year ago

Python 3.5 does not support f-strings, you need at least Python 3.6 for those.

You could hack the script, replace f"No mtd {names} device found." with "No mtd {} device found.".format(names) but then you would be on your own in testing it, it could be quite a journey. Be careful.

hartkopp commented 1 year ago

You are resizing the flash layout with the original QNAP firmware?? This is probably not a good idea!!

The resize script is intended for systems that already have Debian 10 installed - and then upgrade to Debian 11 and then dist-upgrade to Debian 12.

Please follow the installation procedure for Debian 10 and later do these flash layout resize tweaks to be able to upgrade to newer Linux kernels (Debian11 and up).

bo911 commented 1 year ago

Thank you, for your help My Target is debian 11, so I just do some minimal debian10 installation, and then update to debian 11 ... Are there special packages with needs to be installed (python3 of course, uboot-utils ?, fw_xxx) to run the qnap_mtd_resize.py ? I hoped to go directly to debian 11 to save kernel flashing ...

amouiche commented 1 year ago

On Fri, 2023-07-21 at 05:52 -0700, bo911 wrote:

Thank you, for your help My Target is debian 11, so I just do some minimal deian10 installation, and then debian 11 ... Are the special packages with needs to be installed (python3 of corse, uboot-utils ?, fw_xxx) to run the qnap_mtd_resize.py ?

Hello. Just install Debian 10 (buster) first. Every tools required is installed then. Run qnap_mtd_resize.py and once everyhting is fine, you will be able to upgrade to debian bullseye or wormbook. Regards Arnaud

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.*** m>

bo911 commented 1 year ago

Thanks I installed Debian 10, do qnap_mtd_reisze.py and than upgrade to bullseye => I works like a charm ... I'm not so happy with several calls to flash-kernel (without verify, that the kernel didn't changed) after install some package(s), but that is a debian thing .... I prefer build my own kernel from vanilla LTS, so I have to search for kirkwood Kernel build, from example from 5.15.y, 6.1.x Regards Bernd

hartkopp commented 1 year ago

Thanks I installed Debian 10, do qnap_mtd_reisze.py and than upgrade to bullseye => I works like a charm ...

Good!

I'm not so happy with several calls to flash-kernel (without verify, that the kernel didn't changed) after install some package(s), but that is a debian thing ....

Flashing the kernel is deferred to the end of the upgrade process. This is a normal behaviour and works great. I also had to look at the procedure twice when the kernel upgrade happend ;-)

I prefer build my own kernel from vanilla LTS, so I have to search for kirkwood Kernel build, from example from 5.15.y, 6.1.x

I run the latest Linux kernel from Linus on my development machine - but why don't you rely on the Debian team with the 6.1 LTS kernel? They do a fantastic job with security updates.