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

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

Closed docteurmystere closed 3 years ago

docteurmystere commented 3 years ago

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

amouiche commented 3 years ago

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

docteurmystere commented 3 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 3 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 3 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 3 years ago

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