X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fefibootmgr%2Fefibootmgr.c;fp=src%2Fefibootmgr%2Fefibootmgr.c;h=7aeb1868e0e9bc7e1e780b92a6b3ab0fbd68a895;hb=08b92cb68b9f2371c663367e9d529391960e6106;hp=5058f922baaad4c1dab4e5e1873ed62e12c6936e;hpb=d96a8f66c5fe2fac79073cc40e6f57f04c5bb4f1;p=debian%2Fefibootmgr diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c index 5058f92..7aeb186 100644 --- a/src/efibootmgr/efibootmgr.c +++ b/src/efibootmgr/efibootmgr.c @@ -96,6 +96,18 @@ fill_var(efi_variable_t *var, const char *name) | EFI_VARIABLE_RUNTIME_ACCESS; } +static void +free_vars(list_t *head) +{ + list_t *pos, *n; + var_entry_t *boot; + + list_for_each_safe(pos, n, head) { + boot = list_entry(pos, var_entry_t, list); + list_del(&(boot->list)); + free(boot); + } +} static void read_vars(struct dirent **namelist, @@ -750,6 +762,7 @@ usage() printf("\t-v | --verbose print additional information\n"); printf("\t-V | --version return version and exit\n"); printf("\t-w | --write-signature write unique sig to MBR if needed\n"); + printf("\t-@ | --append-binary-args file append extra args from file (use \"-\" for stdin)\n"); } static void @@ -809,17 +822,21 @@ parse_opts(int argc, char **argv) {"verbose", optional_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"write-signature", no_argument, 0, 'w'}, + {"append-binary-args", required_argument, 0, '@'}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, - "AaBb:cd:e:E:gH:i:l:L:n:No:Op:qt:TuU:v::Vw", + "AaBb:cd:e:E:gH:i:l:L:n:No:Op:qt:TuU:v::Vw@:", long_options, &option_index); if (c == -1) break; switch (c) { + case '@': + opts.extra_opts_file = optarg; + break; case 'a': opts.active = 1; break; @@ -1027,6 +1044,7 @@ main(int argc, char **argv) } } free_dirents(boot_names, num_boot_names); + free_vars(&boot_entry_list); return 0; }