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

default loop0 risks messing up systems with other loop devices #5

Closed docteurmystere closed 2 years ago

docteurmystere commented 2 years ago

suggesting the use of 'losetup -f' to select the first free loop device

amouiche commented 2 years ago

you are right... I miss the --show option to capture the /dev/loop found

docteurmystere commented 2 years ago

tried this and works.

parser.add_argument("--loop", metavar="DEV", default=subprocess.check_output(["/sbin/losetup","-f"]).strip().decode('ascii'), help="/dev/loopX device to use for 'NAS config' FS resize (default: use the first loop available)")

amouiche commented 2 years ago

Hello. I just create a "dev" branch with changes for all your issues:

I don't have the possibility to fully test since I must downgrade my QNAP test device to buster first. But can you at least check it in dryrun mode ?

docteurmystere commented 2 years ago

hello! unfortunately i have resized all by now and the script rightly refuses to run. by reading the code i notice two things:

i applaud your elegant solution of providing a custom setenv script.

amouiche commented 2 years ago

"losetup -f" feature is now used by the script