pmb.flasher: Fix passing command line flags (MR 2543)

Commit 37ec73c dropped the use of args to access command line arguments,
but did not add another way to pass command line arguments; thus,
optional flags to flash_kernel, flash_rootfs, flash_lk2nd, sideload and
list_devices were ignored.

Fix this by making sure the relevant arguments are passed for all
frontend methods.

Fixes #2522.
This commit is contained in:
knuxify 2025-02-01 22:33:13 +01:00
parent b5f14e2b94
commit 00c670ffda
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 128 additions and 14 deletions

View file

@ -40,9 +40,25 @@ class Flasher(commands.Command):
return
if action in ["boot", "flash_kernel"]:
kernel(deviceinfo, method, action == "boot", self.autoinstall)
kernel(
deviceinfo,
method,
action == "boot",
self.autoinstall,
cmdline=self.cmdline,
no_reboot=self.no_reboot,
partition=self.partition,
resume=self.resume,
)
elif action == "flash_rootfs":
rootfs(deviceinfo, method)
rootfs(
deviceinfo,
method,
cmdline=self.cmdline,
no_reboot=self.no_reboot,
partition=self.partition,
resume=self.resume,
)
elif action == "flash_vbmeta":
logging.info("(native) flash vbmeta.img with verity disabled flag")
pmb.flasher.run(
@ -66,7 +82,14 @@ class Flasher(commands.Command):
resume=self.resume,
)
elif action == "flash_lk2nd":
flash_lk2nd(deviceinfo, method)
flash_lk2nd(
deviceinfo,
method,
cmdline=self.cmdline,
no_reboot=self.no_reboot,
partition=self.partition,
resume=self.resume,
)
elif action == "list_flavors":
list_flavors(device)
elif action == "list_devices":
@ -80,4 +103,11 @@ class Flasher(commands.Command):
resume=self.resume,
)
elif action == "sideload":
sideload(deviceinfo, method)
sideload(
deviceinfo,
method,
cmdline=self.cmdline,
no_reboot=self.no_reboot,
partition=self.partition,
resume=self.resume,
)