Browse Source

uvol: yet another small compatibility hack

Shift ARGV until actual parameters start to compensate for older
versions of ucode passing the complete cmdline.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 31f02d5c1e)
lilik-openwrt-22.03
Daniel Golle 3 years ago
parent
commit
33e89f46a0
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      utils/uvol/files/uvol

+ 12
- 1
utils/uvol/files/uvol View File

@ -64,7 +64,18 @@ if (!backend) {
exit(2);
}
let cmd = shift(ARGV);
// The below code is needed as older versions of ucode pass the complete cmdline via ARGV
// Once we can rely in more recent ucode the while loop can be replaced by simply
// let cmd = shift(ARGV);
let skip = null;
let cmd = null;
let skip_argv = ["/usr/bin/ucode", "-R", "/usr/sbin/uvol"];
while (skip = shift(ARGV)) {
if (skip != shift(skip_argv)) {
cmd = skip;
break;
}
}
if (!cmd || cmd == "-h" || cmd == "help") {
printf("%s", help_output);


Loading…
Cancel
Save