Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show First 20 Lines • Show All 691 Lines • ▼ Show 20 Lines | parse_args(int argc, CHAR16 *argv[]) | ||||
* | * | ||||
* Loop through the args, and for each one that contains an '=' that is | * Loop through the args, and for each one that contains an '=' that is | ||||
* not the first character, add it to the environment. This allows | * not the first character, add it to the environment. This allows | ||||
* loader and kernel env vars to be passed on the command line. Convert | * loader and kernel env vars to be passed on the command line. Convert | ||||
* args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this | * args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this | ||||
* method is flawed for non-ASCII characters). | * method is flawed for non-ASCII characters). | ||||
*/ | */ | ||||
howto = 0; | howto = 0; | ||||
for (i = 1; i < argc; i++) { | for (i = 0; i < argc; i++) { | ||||
cpy16to8(argv[i], var, sizeof(var)); | cpy16to8(argv[i], var, sizeof(var)); | ||||
howto |= boot_parse_arg(var); | howto |= boot_parse_arg(var); | ||||
} | } | ||||
return (howto); | return (howto); | ||||
} | } | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | #endif | ||||
* changes to take effect, regardless of where they come from. | * changes to take effect, regardless of where they come from. | ||||
*/ | */ | ||||
setenv("console", "efi", 1); | setenv("console", "efi", 1); | ||||
uhowto = parse_uefi_con_out(); | uhowto = parse_uefi_con_out(); | ||||
#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) | #if defined(__aarch64__) || defined(__arm__) || defined(__riscv) | ||||
if ((uhowto & RB_SERIAL) != 0) | if ((uhowto & RB_SERIAL) != 0) | ||||
setenv("console", "comconsole", 1); | setenv("console", "comconsole", 1); | ||||
#endif | #endif | ||||
howto = parse_args(argc, argv); | |||||
if ((howto & RB_MUTE) != 0) | |||||
setenv("console", "nullconsole", 1); | |||||
cons_probe(); | cons_probe(); | ||||
/* Init the time source */ | /* Init the time source */ | ||||
efi_time_init(); | efi_time_init(); | ||||
/* | /* | ||||
* Initialise the block cache. Set the upper limit. | * Initialise the block cache. Set the upper limit. | ||||
*/ | */ | ||||
Show All 13 Lines | for (i = 0; devsw[i] != NULL; i++) | ||||
if (devsw[i]->dv_init != NULL) | if (devsw[i]->dv_init != NULL) | ||||
(devsw[i]->dv_init)(); | (devsw[i]->dv_init)(); | ||||
/* | /* | ||||
* Detect console settings two different ways: one via the command | * Detect console settings two different ways: one via the command | ||||
* args (eg -h) or via the UEFI ConOut variable. | * args (eg -h) or via the UEFI ConOut variable. | ||||
*/ | */ | ||||
has_kbd = has_keyboard(); | has_kbd = has_keyboard(); | ||||
howto = parse_args(argc, argv); | |||||
if (!has_kbd && (howto & RB_PROBE)) | if (!has_kbd && (howto & RB_PROBE)) | ||||
howto |= RB_SERIAL | RB_MULTIPLE; | howto |= RB_SERIAL | RB_MULTIPLE; | ||||
howto &= ~RB_PROBE; | howto &= ~RB_PROBE; | ||||
/* | /* | ||||
* Read additional environment variables from the boot device's | * Read additional environment variables from the boot device's | ||||
* "LoaderEnv" file. Any boot loader environment variable may be set | * "LoaderEnv" file. Any boot loader environment variable may be set | ||||
* there, which are subtly different than loader.conf variables. Only | * there, which are subtly different than loader.conf variables. Only | ||||
▲ Show 20 Lines • Show All 663 Lines • Show Last 20 Lines |