#! /bin/sh /usr/share/dpatch/dpatch-run ## 14_command_line_config.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Add the ability to pass a label name on the command line, ## DP: overriding the label name set in the environment. @DPATCH@ diff -urNad arcload-0.5~/loader/main.c arcload-0.5/loader/main.c --- arcload-0.5~/loader/main.c 2007-11-26 14:21:58.000000000 +0000 +++ arcload-0.5/loader/main.c 2007-11-26 14:23:58.000000000 +0000 @@ -651,8 +651,15 @@ else strcpy(text_label, "no_system"); - if(argc>1 && !strcmp(argv[1],"list")) - text_label[0] = 0; + /* NOTE: The PROM piles up some of the env vars in argv */ + if (argc > 1) { + if (!strcmp(argv[1], "list")) { + text_label[0] = 0; + } else if (!strchr(argv[1], '=')) { + /* Not an env var, for now, let's just say it's a label name */ + strcpy(text_label, argv[1]); + } + } if(*text_label) printf("Loading configuration for '%s'...\n\r", text_label);