forked from Mirror/pmbootstrap
pmb.flasher: fix "flasher boot" crash if cmdline is empty
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2575
This commit is contained in:
parent
0ab75cfe2b
commit
15d9516c8d
1 changed files with 7 additions and 0 deletions
|
@ -103,6 +103,13 @@ def run(
|
|||
check_partition_blacklist(deviceinfo, key, value)
|
||||
command[i] = command[i].replace(key, value)
|
||||
|
||||
# Remove cmdline if it's empty
|
||||
if "--cmdline" in command:
|
||||
i = command.index("--cmdline")
|
||||
if i + 1 < len(command) and not command[i + 1]:
|
||||
command.pop(i) # "--cmdline"
|
||||
command.pop(i) # ""
|
||||
|
||||
# Remove empty strings
|
||||
command = [x for x in command if x != ""]
|
||||
# Run the action
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue