mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
fix issue where large lists of apps break signing key specifier mechanism
now to specify a signing key you add it after a "--" which delimits the list of apps
This commit is contained in:
parent
b22e3a1b43
commit
44afbd7697
1 changed files with 32 additions and 4 deletions
|
|
@ -43,7 +43,15 @@ impl std::error::Error for BuildError {}
|
||||||
fn get_packages() -> Vec<String> {
|
fn get_packages() -> Vec<String> {
|
||||||
let mut args = env::args();
|
let mut args = env::args();
|
||||||
args.nth(1);
|
args.nth(1);
|
||||||
args.filter(|x| !x.starts_with("-")).collect()
|
// skip everything past --
|
||||||
|
let mut pkgs = Vec::<String>::new();
|
||||||
|
for arg in args {
|
||||||
|
if arg == "--" {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pkgs.push(arg);
|
||||||
|
}
|
||||||
|
pkgs.into_iter().filter(|x| !x.starts_with("-")).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
@ -172,8 +180,28 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let aestest_pkgs = ["ticktimer-server", "log-server", "aes-test"];
|
let aestest_pkgs = ["ticktimer-server", "log-server", "aes-test"];
|
||||||
let mut args = env::args();
|
let mut args = env::args();
|
||||||
let task = args.nth(1);
|
let task = args.nth(1);
|
||||||
let lkey = args.nth(3);
|
// extract lkey/kkey args only after a "--" separator
|
||||||
let kkey = args.nth(4);
|
let mut next_is_lkey = false;
|
||||||
|
let mut next_is_kkey = false;
|
||||||
|
let mut lkey: Option<String> = None;
|
||||||
|
let mut kkey: Option<String> = None;
|
||||||
|
for arg in args {
|
||||||
|
if next_is_kkey {
|
||||||
|
kkey = Some(arg);
|
||||||
|
next_is_kkey = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if next_is_lkey {
|
||||||
|
lkey = Some(arg);
|
||||||
|
next_is_lkey = false;
|
||||||
|
next_is_kkey = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if arg == "--" {
|
||||||
|
next_is_lkey = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
match task.as_deref() {
|
match task.as_deref() {
|
||||||
Some("install-toolkit") | Some("install-toolchain") => {
|
Some("install-toolkit") | Some("install-toolchain") => {
|
||||||
let arg = env::args().nth(2);
|
let arg = env::args().nth(2);
|
||||||
|
|
@ -726,7 +754,7 @@ fn print_help() {
|
||||||
"Tasks:
|
"Tasks:
|
||||||
Hardware images:
|
Hardware images:
|
||||||
hw-image [soc.svd] builds an image for real hardware with baseline demo apps
|
hw-image [soc.svd] builds an image for real hardware with baseline demo apps
|
||||||
[loader.key] plus signing key options
|
-- [loader.key] plus signing key options
|
||||||
[kernel.key]
|
[kernel.key]
|
||||||
app-image [app1] [..] builds an image for real hardware of baseline kernel + specified apps
|
app-image [app1] [..] builds an image for real hardware of baseline kernel + specified apps
|
||||||
perf-image [app1] [..] builds an image for real hardware assuming a performance counter variant of the SOC.
|
perf-image [app1] [..] builds an image for real hardware assuming a performance counter variant of the SOC.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue