Dash:
[t2.git] / package / boot / arcload / 14_command_line_config.patch
blobfba1697f9b401807a3aacdd1058f9485ca9977ea
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 14_command_line_config.dpatch by <jblache@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Add the ability to pass a label name on the command line,
6 ## DP: overriding the label name set in the environment.
8 @DPATCH@
9 diff -urNad arcload-0.5~/loader/main.c arcload-0.5/loader/main.c
10 --- arcload-0.5~/loader/main.c 2007-11-26 14:21:58.000000000 +0000
11 +++ arcload-0.5/loader/main.c 2007-11-26 14:23:58.000000000 +0000
12 @@ -651,8 +651,15 @@
13 else
14 strcpy(text_label, "no_system");
16 - if(argc>1 && !strcmp(argv[1],"list"))
17 - text_label[0] = 0;
18 + /* NOTE: The PROM piles up some of the env vars in argv */
19 + if (argc > 1) {
20 + if (!strcmp(argv[1], "list")) {
21 + text_label[0] = 0;
22 + } else if (!strchr(argv[1], '=')) {
23 + /* Not an env var, for now, let's just say it's a label name */
24 + strcpy(text_label, argv[1]);
25 + }
26 + }
28 if(*text_label)
29 printf("Loading configuration for '%s'...\n\r", text_label);