Improve gettext support. Stylistic fixes and error handling fixes while
on it.
This commit is contained in:
parent
215c90cb82
commit
9c4b5c13e6
184 changed files with 1175 additions and 959 deletions
|
@ -41,8 +41,8 @@ static const struct grub_arg_option options[] = {
|
|||
0, ARG_TYPE_STRING},
|
||||
{"load-only", 'n', 0,
|
||||
N_("Load only tables specified by comma-separated list."), 0, ARG_TYPE_STRING},
|
||||
{"v1", '1', 0, N_("Expose v1 tables."), 0, ARG_TYPE_NONE},
|
||||
{"v2", '2', 0, N_("Expose v2 and v3 tables."), 0, ARG_TYPE_NONE},
|
||||
{"v1", '1', 0, N_("Export version 1 tables to the OS."), 0, ARG_TYPE_NONE},
|
||||
{"v2", '2', 0, N_("Export version 2 and version 3 tables to the OS."), 0, ARG_TYPE_NONE},
|
||||
{"oemid", 'o', 0, N_("Set OEMID of RSDP, XSDT and RSDT."), 0, ARG_TYPE_STRING},
|
||||
{"oemtable", 't', 0,
|
||||
N_("Set OEMTABLE ID of RSDP, XSDT and RSDT."), 0, ARG_TYPE_STRING},
|
||||
|
@ -553,8 +553,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
free_tables ();
|
||||
grub_free (exclude);
|
||||
grub_free (load_only);
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't allocate table");
|
||||
return grub_errno;
|
||||
}
|
||||
grub_memcpy (table_dsdt, dsdt, dsdt->length);
|
||||
}
|
||||
|
@ -580,8 +579,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
free_tables ();
|
||||
grub_free (exclude);
|
||||
grub_free (load_only);
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't allocate table structure");
|
||||
return grub_errno;
|
||||
}
|
||||
table->size = curtable->length;
|
||||
table->addr = grub_malloc (table->size);
|
||||
|
@ -589,8 +587,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
if (! table->addr)
|
||||
{
|
||||
free_tables ();
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't allocate table");
|
||||
return grub_errno;
|
||||
}
|
||||
table->next = acpi_tables;
|
||||
acpi_tables = table;
|
||||
|
@ -633,7 +630,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
if (! file)
|
||||
{
|
||||
free_tables ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't open file %s", args[i]);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
size = grub_file_size (file);
|
||||
|
@ -641,7 +638,8 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
{
|
||||
grub_file_close (file);
|
||||
free_tables ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "file %s is too small", args[i]);
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
args[i]);
|
||||
}
|
||||
|
||||
buf = (char *) grub_malloc (size);
|
||||
|
@ -678,8 +676,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
if (! table)
|
||||
{
|
||||
free_tables ();
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't allocate table structure");
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
table->size = size;
|
||||
|
@ -771,7 +768,7 @@ GRUB_MOD_INIT(acpi)
|
|||
{
|
||||
cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 0,
|
||||
N_("[-1|-2] [--exclude=TABLE1,TABLE2|"
|
||||
"--load-only=table1,table2] FILE1"
|
||||
"--load-only=TABLE1,TABLE2] FILE1"
|
||||
" [FILE2] [...]"),
|
||||
N_("Load host ACPI tables and tables "
|
||||
"specified by arguments."),
|
||||
|
|
|
@ -82,7 +82,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (args[0]);
|
||||
|
|
|
@ -64,10 +64,7 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn),
|
|||
new_preboot = (struct grub_preboot *)
|
||||
grub_malloc (sizeof (struct grub_preboot));
|
||||
if (! new_preboot)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "hook not added");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
new_preboot->preboot_func = preboot_func;
|
||||
new_preboot->preboot_rest_func = preboot_rest_func;
|
||||
|
@ -146,7 +143,8 @@ grub_loader_boot (void)
|
|||
struct grub_preboot *cur;
|
||||
|
||||
if (! grub_loader_loaded)
|
||||
return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel");
|
||||
return grub_error (GRUB_ERR_NO_KERNEL,
|
||||
N_("you need to load the kernel first"));
|
||||
|
||||
if (grub_loader_noreturn)
|
||||
grub_machine_fini ();
|
||||
|
|
|
@ -31,14 +31,16 @@ grub_rescue_cmd_info (struct grub_command *cmd __attribute__ ((unused)),
|
|||
unsigned long hits, misses;
|
||||
|
||||
grub_disk_cache_get_performance (&hits, &misses);
|
||||
grub_printf_ (N_("Disk cache: hits = %lu, misses = %lu "), hits, misses);
|
||||
if (hits + misses)
|
||||
{
|
||||
unsigned long ratio = hits * 10000 / (hits + misses);
|
||||
grub_printf ("(%lu.%lu%%)\n", ratio / 100, ratio % 100);
|
||||
grub_printf_ (N_("Disk cache statistics: hits = %lu (%lu.%02lu%%),"
|
||||
" misses = %lu\n"), ratio / 100, ratio % 100,
|
||||
hits, misses);
|
||||
}
|
||||
else
|
||||
grub_puts_ (N_("(N/A)"));
|
||||
grub_printf ("%s\n", _("No disk cache statistics available\n"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
dos = 1;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
file = grub_file_open (args[0]);
|
||||
if (! file)
|
||||
|
|
|
@ -40,7 +40,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
|
|||
char *buf2 = 0;
|
||||
|
||||
if (argc != 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
grub_printf_ (N_("Compare file `%s' with `%s':\n"), args[0],
|
||||
args[1]);
|
||||
|
|
|
@ -32,7 +32,7 @@ grub_cmd_source (grub_command_t cmd, int argc, char **args)
|
|||
int new_env, extractor;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
extractor = (cmd->name[0] == 'e');
|
||||
new_env = (cmd->name[extractor ? sizeof ("extract_entries_") - 1 : 0] == 'c');
|
||||
|
|
|
@ -165,7 +165,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)),
|
|||
int size;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no ROM image specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
|
@ -206,7 +206,9 @@ static grub_command_t cmd_fakebios, cmd_loadbios;
|
|||
GRUB_MOD_INIT(loadbios)
|
||||
{
|
||||
cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios,
|
||||
0, N_("Fake BIOS."));
|
||||
0, N_("Create BIOS-like structures for"
|
||||
" backward compatibility with"
|
||||
" existing OS."));
|
||||
|
||||
cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios,
|
||||
N_("BIOS_DUMP [INT10_DUMP]"),
|
||||
|
|
|
@ -30,7 +30,8 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||
|
||||
static const struct grub_arg_option options[] = {
|
||||
{"hash", 'h', 0, N_("Specify hash to use."), N_("HASH"), ARG_TYPE_STRING},
|
||||
{"check", 'c', 0, N_("Check hash list file."), N_("FILE"), ARG_TYPE_STRING},
|
||||
{"check", 'c', 0, N_("Check hashes of files with hash list FILE."),
|
||||
N_("FILE"), ARG_TYPE_STRING},
|
||||
{"prefix", 'p', 0, N_("Base directory for hash list."), N_("DIR"),
|
||||
ARG_TYPE_STRING},
|
||||
{"keep-going", 'k', 0, N_("Don't stop after first error."), 0, 0},
|
||||
|
|
|
@ -47,7 +47,7 @@ static const struct grub_arg_option options[] = {
|
|||
{"sleep", 'Y', 0, N_("Set drive to sleep mode."), 0, ARG_TYPE_NONE},
|
||||
{"identify", 'i', 0, N_("Print drive identity and settings."),
|
||||
0, ARG_TYPE_NONE},
|
||||
{"dumpid", 'I', 0, N_("Dump contents of ATA IDENTIFY sector."),
|
||||
{"dumpid", 'I', 0, N_("Show raw contents of ATA IDENTIFY sector."),
|
||||
0, ARG_TYPE_NONE},
|
||||
{"smart", -1, 0, N_("Disable/enable SMART (0/1)."), 0, ARG_TYPE_INT},
|
||||
{"quiet", 'q', 0, N_("Do not print messages."), 0, ARG_TYPE_NONE},
|
||||
|
|
|
@ -44,7 +44,7 @@ grub_cmd_hexdump (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
int namelen;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
namelen = grub_strlen (args[0]);
|
||||
skip = (state[0].set) ? grub_strtoull (state[0].arg, 0, 0) : 0;
|
||||
|
@ -123,7 +123,7 @@ GRUB_MOD_INIT (hexdump)
|
|||
{
|
||||
cmd = grub_register_extcmd ("hexdump", grub_cmd_hexdump, 0,
|
||||
N_("[OPTIONS] FILE_OR_DEVICE"),
|
||||
N_("Dump the contents of a file or memory."),
|
||||
N_("Show raw contents of a file or memory."),
|
||||
options);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@ parse_args (int argc, char *argv[], int *byte, int *bit)
|
|||
char *rest;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Address required.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "address required");
|
||||
|
||||
*byte = grub_strtoul (argv[0], &rest, 0);
|
||||
if (*rest != ':')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Address required.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "address required");
|
||||
|
||||
*bit = grub_strtoul (rest + 1, 0, 0);
|
||||
|
||||
|
|
|
@ -107,8 +107,7 @@ drivemap_set (grub_uint8_t newdrive, grub_uint8_t redirto)
|
|||
{
|
||||
mapping = grub_malloc (sizeof (drivemap_node_t));
|
||||
if (! mapping)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"cannot allocate map entry, not enough memory");
|
||||
return grub_errno;
|
||||
mapping->newdrive = newdrive;
|
||||
mapping->redirto = redirto;
|
||||
mapping->next = map_head;
|
||||
|
@ -230,7 +229,7 @@ grub_cmd_drivemap (struct grub_extcmd_context *ctxt, int argc, char **args)
|
|||
grub_err_t err;
|
||||
|
||||
if (argc != 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
err = tryparse_diskstring (args[0], &mapfrom);
|
||||
if (err != GRUB_ERR_NONE)
|
||||
|
|
|
@ -74,7 +74,7 @@ grub_cmd_lsapm (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (!grub_apm_get_info (&info))
|
||||
return grub_error (GRUB_ERR_IO, "no APM found");
|
||||
|
||||
grub_printf_ (N_("Vesion %u.%u\n"
|
||||
grub_printf_ (N_("Version %u.%u\n"
|
||||
"32-bit CS = 0x%x, len = 0x%x, offset = 0x%x\n"
|
||||
"16-bit CS = 0x%x, len = 0x%x\n"
|
||||
"DS = 0x%x, len = 0x%x\n"),
|
||||
|
|
|
@ -192,13 +192,15 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
|
|||
file = grub_file_open (args[0]);
|
||||
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", args[0]);
|
||||
return grub_errno;
|
||||
|
||||
if (grub_file_read (file, &tempo, sizeof (tempo)) != sizeof (tempo))
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_FILE_READ_ERROR,
|
||||
"file doesn't even contains a full tempo record");
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
args[0]);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
tempo = grub_le_to_cpu32 (tempo);
|
||||
|
@ -227,7 +229,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (*end)
|
||||
/* Was not a number either, assume it was supposed to be a file name. */
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file `%s' not found", args[0]);
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), args[0]);
|
||||
|
||||
grub_dprintf ("play","tempo = %d\n", tempo);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static grub_command_t cmd;
|
|||
GRUB_MOD_INIT(ieee1275_suspend)
|
||||
{
|
||||
cmd = grub_register_command ("suspend", grub_cmd_suspend,
|
||||
0, N_("Return to Open Firmware prompt."));
|
||||
0, N_("Return to IEEE1275 prompt."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(ieee1275_suspend)
|
||||
|
|
|
@ -44,7 +44,7 @@ grub_cmd_read (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
grub_uint32_t value = 0;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
addr = grub_strtoul (argv[0], 0, 0);
|
||||
switch (ctxt->extcmd->cmd->name[sizeof ("in") - 1])
|
||||
|
@ -82,7 +82,7 @@ grub_cmd_write (grub_command_t cmd, int argc, char **argv)
|
|||
grub_uint32_t mask = 0xffffffff;
|
||||
|
||||
if (argc != 2 && argc != 3)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
addr = grub_strtoul (argv[0], 0, 0);
|
||||
value = grub_strtoul (argv[1], 0, 0);
|
||||
|
@ -120,25 +120,28 @@ GRUB_MOD_INIT(memrw)
|
|||
{
|
||||
cmd_read_byte =
|
||||
grub_register_extcmd ("inb", grub_cmd_read, 0,
|
||||
N_("PORT"), N_("Read byte from PORT."), options);
|
||||
N_("PORT"), N_("Read 8-bit value from PORT."),
|
||||
options);
|
||||
cmd_read_word =
|
||||
grub_register_extcmd ("inw", grub_cmd_read, 0,
|
||||
N_("PORT"), N_("Read word from PORT."), options);
|
||||
N_("PORT"), N_("Read 16-bit value from PORT."),
|
||||
options);
|
||||
cmd_read_dword =
|
||||
grub_register_extcmd ("inl", grub_cmd_read, 0,
|
||||
N_("PORT"), N_("Read dword from PORT."), options);
|
||||
N_("PORT"), N_("Read 32-bit value from PORT."),
|
||||
options);
|
||||
cmd_write_byte =
|
||||
grub_register_command ("outb", grub_cmd_write,
|
||||
N_("PORT VALUE [MASK]"),
|
||||
N_("Write byte VALUE to PORT."));
|
||||
N_("Write 8-bit VALUE to PORT."));
|
||||
cmd_write_word =
|
||||
grub_register_command ("outw", grub_cmd_write,
|
||||
N_("PORT VALUE [MASK]"),
|
||||
N_("Write word VALUE to PORT."));
|
||||
N_("Write 16-bit VALUE to PORT."));
|
||||
cmd_write_dword =
|
||||
grub_register_command ("outl", grub_cmd_write,
|
||||
N_("ADDR VALUE [MASK]"),
|
||||
N_("Write dword VALUE to PORT."));
|
||||
N_("Write 32-bit VALUE to PORT."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(memrw)
|
||||
|
|
|
@ -207,7 +207,7 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
|||
{
|
||||
const char *prefix = grub_env_get ("prefix");
|
||||
if (!prefix)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "No prefix set");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("variable `%s' isn't set"), "prefix");
|
||||
filename = grub_xasprintf ("%s/layouts/%s.gkb", prefix, argv[0]);
|
||||
if (!filename)
|
||||
return grub_errno;
|
||||
|
@ -222,7 +222,8 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
|||
if (grub_file_read (file, magic, sizeof (magic)) != sizeof (magic))
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "file is too short");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"),
|
||||
filename);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -236,7 +237,8 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
|||
if (grub_file_read (file, &version, sizeof (version)) != sizeof (version))
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "file is too short");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"),
|
||||
filename);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -253,7 +255,8 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
|||
if (grub_file_read (file, newmap, sizeof (*newmap)) != sizeof (*newmap))
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "file is too short");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("premature end of file %s"),
|
||||
filename);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ grub_cmd_legacy_source (struct grub_command *cmd,
|
|||
grub_err_t ret;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
extractor = (cmd->name[0] == 'e');
|
||||
new_env = (cmd->name[extractor ? (sizeof ("extract_legacy_entries_") - 1)
|
||||
|
@ -299,7 +299,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
if (argc < 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename required");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
cutargs = grub_malloc (sizeof (cutargs[0]) * (argc - 1));
|
||||
cutargc = argc - 1;
|
||||
|
@ -481,7 +481,7 @@ grub_cmd_legacy_initrd (struct grub_command *mycmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"no kernel with module support is loaded in legacy way");
|
||||
"you need to load the kernel first");
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
@ -517,7 +517,7 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused
|
|||
}
|
||||
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"no kernel with module support is loaded in legacy way");
|
||||
"you need to load the kernel first");
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
@ -696,7 +696,7 @@ grub_cmd_legacy_password (struct grub_command *mycmd __attribute__ ((unused)),
|
|||
struct legacy_md5_password *pw = NULL;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "arguments expected");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
if (args[0][0] != '-' || args[0][1] != '-')
|
||||
return grub_normal_set_password ("legacy", args[0]);
|
||||
|
||||
|
@ -722,7 +722,7 @@ grub_cmd_legacy_check_password (struct grub_command *mycmd __attribute__ ((unuse
|
|||
char entered[GRUB_AUTH_MAX_PASSLEN];
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "arguments expected");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
grub_puts_ (N_("Enter password: "));
|
||||
if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN))
|
||||
return GRUB_ACCESS_DENIED;
|
||||
|
|
|
@ -65,7 +65,7 @@ open_envblk_file (char *filename)
|
|||
}
|
||||
else
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, "prefix is not found");
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +93,6 @@ read_envblk_file (grub_file_t file)
|
|||
ret = grub_file_read (file, buf + offset, size);
|
||||
if (ret <= 0)
|
||||
{
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "cannot read");
|
||||
grub_free (buf);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,13 +26,13 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||
|
||||
static const char *names[] =
|
||||
{
|
||||
[GRUB_MEMORY_AVAILABLE] = N_("available"),
|
||||
[GRUB_MEMORY_RESERVED] = N_("reserved"),
|
||||
[GRUB_MEMORY_ACPI] = N_("ACPI reclamaible"),
|
||||
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage"),
|
||||
[GRUB_MEMORY_BADRAM] = N_("BadRAM"),
|
||||
[GRUB_MEMORY_CODE] = N_("firmware code"),
|
||||
[GRUB_MEMORY_HOLE] = N_("hole")
|
||||
[GRUB_MEMORY_AVAILABLE] = N_("available RAM"),
|
||||
[GRUB_MEMORY_RESERVED] = N_("reserved RAM"),
|
||||
[GRUB_MEMORY_ACPI] = N_("ACPI reclaimable RAM"),
|
||||
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"),
|
||||
[GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"),
|
||||
[GRUB_MEMORY_CODE] = N_("RAM holding firmware code"),
|
||||
[GRUB_MEMORY_HOLE] = N_("Address range not associated with RAM")
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
|
|
|
@ -44,7 +44,7 @@ grub_cmd_read (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
char buf[sizeof ("XXXXXXXX")];
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid number of arguments");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
addr = grub_strtoul (argv[0], 0, 0);
|
||||
switch (ctxt->extcmd->cmd->name[sizeof ("read_") - 1])
|
||||
|
@ -81,7 +81,7 @@ grub_cmd_write (grub_command_t cmd, int argc, char **argv)
|
|||
grub_uint32_t mask = 0xffffffff;
|
||||
|
||||
if (argc != 2 && argc != 3)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid number of arguments");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
addr = grub_strtoul (argv[0], 0, 0);
|
||||
value = grub_strtoul (argv[1], 0, 0);
|
||||
|
@ -122,22 +122,28 @@ GRUB_MOD_INIT(memrw)
|
|||
{
|
||||
cmd_read_byte =
|
||||
grub_register_extcmd ("read_byte", grub_cmd_read, 0,
|
||||
N_("ADDR"), N_("Read byte from ADDR."), options);
|
||||
N_("ADDR"), N_("Read 8-bit value from ADDR."),
|
||||
options);
|
||||
cmd_read_word =
|
||||
grub_register_extcmd ("read_word", grub_cmd_read, 0,
|
||||
N_("ADDR"), N_("Read word from ADDR."), options);
|
||||
N_("ADDR"), N_("Read 16-bit value from ADDR."),
|
||||
options);
|
||||
cmd_read_dword =
|
||||
grub_register_extcmd ("read_dword", grub_cmd_read, 0,
|
||||
N_("ADDR"), N_("Read dword from ADDR."), options);
|
||||
N_("ADDR"), N_("Read 32-bit value from ADDR."),
|
||||
options);
|
||||
cmd_write_byte =
|
||||
grub_register_command ("write_byte", grub_cmd_write,
|
||||
N_("ADDR VALUE [MASK]"), N_("Write byte VALUE to ADDR."));
|
||||
N_("ADDR VALUE [MASK]"),
|
||||
N_("Write 8-bit VALUE to ADDR."));
|
||||
cmd_write_word =
|
||||
grub_register_command ("write_word", grub_cmd_write,
|
||||
N_("ADDR VALUE [MASK]"), N_("Write word VALUE to ADDR."));
|
||||
N_("ADDR VALUE [MASK]"),
|
||||
N_("Write 16-bit VALUE to ADDR."));
|
||||
cmd_write_dword =
|
||||
grub_register_command ("write_dword", grub_cmd_write,
|
||||
N_("ADDR VALUE [MASK]"), N_("Write dword VALUE to ADDR."));
|
||||
N_("ADDR VALUE [MASK]"),
|
||||
N_("Write 32-bit VALUE to ADDR."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(memrw)
|
||||
|
|
|
@ -30,11 +30,12 @@ static const struct grub_arg_option options[] =
|
|||
{"class", 1, GRUB_ARG_OPTION_REPEATABLE,
|
||||
N_("Menu entry type."), N_("STRING"), ARG_TYPE_STRING},
|
||||
{"users", 2, 0,
|
||||
N_("Users allowed to boot this entry."), N_("USERNAME"), ARG_TYPE_STRING},
|
||||
N_("List of users allowed to boot this entry."), N_("USERNAME[,USERNAME]"),
|
||||
ARG_TYPE_STRING},
|
||||
{"hotkey", 3, 0,
|
||||
N_("Keyboard key to quickly boot this entry."), N_("KEYBOARD_KEY"), ARG_TYPE_STRING},
|
||||
{"source", 4, 0,
|
||||
N_("Menu entry definition as a string."), N_("STRING"), ARG_TYPE_STRING},
|
||||
N_("Use STRING as menu entry body."), N_("STRING"), ARG_TYPE_STRING},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)),
|
|||
grub_ssize_t size;
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
|
@ -187,7 +187,7 @@ GRUB_MOD_INIT(minicmd)
|
|||
0, N_("Show this message."));
|
||||
cmd_dump =
|
||||
grub_register_command ("dump", grub_mini_cmd_dump,
|
||||
N_("ADDR [SIZE]"), N_("Dump memory."));
|
||||
N_("ADDR [SIZE]"), N_("Show memory contents."));
|
||||
cmd_rmmod =
|
||||
grub_register_command ("rmmod", grub_mini_cmd_rmmod,
|
||||
N_("MODULE"), N_("Remove a module."));
|
||||
|
|
|
@ -49,14 +49,15 @@ grub_cmd_lsspd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
grub_printf_ (N_("SMB base = 0x%x\n"), smbbase);
|
||||
grub_printf_ (N_("System management bus controller I/O space is at 0x%x\n"),
|
||||
smbbase);
|
||||
|
||||
for (i = GRUB_SMB_RAM_START_ADDR;
|
||||
i < GRUB_SMB_RAM_START_ADDR + GRUB_SMB_RAM_NUM_MAX; i++)
|
||||
{
|
||||
struct grub_smbus_spd spd;
|
||||
grub_memset (&spd, 0, sizeof (spd));
|
||||
grub_printf_ (N_("Device %d\n"), i);
|
||||
grub_printf_ (N_("RAM slot number %d\n"), i);
|
||||
err = grub_cs5536_read_spd (smbbase, i, &spd);
|
||||
if (err)
|
||||
{
|
||||
|
|
|
@ -72,7 +72,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
int argc, char **args)
|
||||
{
|
||||
if (argc != 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments expected");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
return grub_normal_set_password (args[0], args[1]);
|
||||
}
|
||||
|
||||
|
|
|
@ -90,11 +90,11 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
struct pbkdf2_password *pass;
|
||||
|
||||
if (argc != 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two arguments expected.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
if (grub_memcmp (args[1], "grub.pbkdf2.sha512.",
|
||||
sizeof ("grub.pbkdf2.sha512.") - 1) != 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Incorrect PBKDF2 password.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password");
|
||||
|
||||
ptr = args[1] + sizeof ("grub.pbkdf2.sha512.") - 1;
|
||||
|
||||
|
@ -106,7 +106,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (*ptr != '.')
|
||||
{
|
||||
grub_free (pass);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Incorrect PBKDF2 password.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password");
|
||||
}
|
||||
ptr++;
|
||||
|
||||
|
@ -114,7 +114,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (!ptr2 || ((ptr2 - ptr) & 1) || grub_strlen (ptr2 + 1) & 1)
|
||||
{
|
||||
grub_free (pass);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Incorrect PBKDF2 password.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "incorrect PBKDF2 password");
|
||||
}
|
||||
|
||||
pass->saltlen = (ptr2 - ptr) >> 1;
|
||||
|
@ -137,7 +137,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_free (pass->salt);
|
||||
grub_free (pass);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Incorrect PBKDF2 password.");
|
||||
"incorrect PBKDF2 password");
|
||||
}
|
||||
|
||||
*ptro = (hex1 << 4) | hex2;
|
||||
|
@ -166,7 +166,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_free (pass->salt);
|
||||
grub_free (pass);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Incorrect PBKDF2 password.");
|
||||
"incorrect PBKDF2 password");
|
||||
}
|
||||
|
||||
*ptro = (hex1 << 4) | hex2;
|
||||
|
|
|
@ -68,7 +68,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
else
|
||||
dev = grub_device_open (args[0]);
|
||||
if (! dev)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "couldn't open device");
|
||||
return grub_errno;
|
||||
|
||||
if (state[1].set)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
}
|
||||
fs = grub_fs_probe (dev);
|
||||
if (! fs)
|
||||
return grub_error (GRUB_ERR_UNKNOWN_FS, "unrecognised fs");
|
||||
return grub_errno;
|
||||
if (state[3].set)
|
||||
{
|
||||
if (state[0].set)
|
||||
|
|
|
@ -32,7 +32,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
|||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{ "set", 's', GRUB_ARG_OPTION_REPEATABLE,
|
||||
N_("Variable names to update with matches."),
|
||||
N_("Store matched component NUMBER in VARNAME."),
|
||||
N_("[NUMBER:]VARNAME"), ARG_TYPE_STRING },
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
@ -42,7 +42,6 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
|||
regmatch_t *matches)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
char *p;
|
||||
char *q;
|
||||
grub_err_t err;
|
||||
|
@ -51,6 +50,7 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
|||
auto void setvar (char *v, regmatch_t *m);
|
||||
void setvar (char *v, regmatch_t *m)
|
||||
{
|
||||
char ch;
|
||||
ch = str[m->rm_eo];
|
||||
str[m->rm_eo] = '\0';
|
||||
err = grub_env_set (v, str + m->rm_so);
|
||||
|
@ -59,7 +59,8 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
|||
|
||||
for (i = 0; varnames && varnames[i]; i++)
|
||||
{
|
||||
if (! (p = grub_strchr (varnames[i], ':')))
|
||||
p = grub_strchr (varnames[i], ':');
|
||||
if (! p)
|
||||
{
|
||||
/* varname w/o index defaults to 1 */
|
||||
if (nmatches < 2 || matches[1].rm_so == -1)
|
||||
|
@ -97,7 +98,7 @@ grub_cmd_regexp (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
regmatch_t *matches = 0;
|
||||
|
||||
if (argc != 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "2 arguments expected");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
ret = regcomp (®ex, args[0], REG_EXTENDED);
|
||||
if (ret)
|
||||
|
|
|
@ -277,7 +277,7 @@ grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc,
|
|||
char **args)
|
||||
{
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
FUNC_NAME (args[0], argc == 1 ? 0 : args[1], 0, (args + 2),
|
||||
argc > 2 ? argc - 2 : 0);
|
||||
|
|
|
@ -158,7 +158,7 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
break;
|
||||
|
||||
if (argc == j)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
if (state[SEARCH_SET].set)
|
||||
var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root";
|
||||
|
|
|
@ -179,7 +179,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr != ':')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Colon expected.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':');
|
||||
ptr++;
|
||||
pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff)
|
||||
<< 16;
|
||||
|
@ -210,7 +210,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr != ':')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Colon expected.");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':');
|
||||
ptr++;
|
||||
optr = ptr;
|
||||
device = grub_strtoul (ptr, (char **) &ptr, 16);
|
||||
|
@ -238,11 +238,8 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
|
||||
write_mask = 0;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Command expected.");
|
||||
|
||||
if (argc > 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Only one command is supported.");
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
ptr = argv[0];
|
||||
|
||||
|
@ -257,7 +254,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
regsize = 0;
|
||||
regaddr = grub_strtoul (ptr, (char **) &ptr, 16);
|
||||
if (grub_errno)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown register");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown register");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -298,7 +295,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
|
||||
if (!regsize)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Unknown register size.");
|
||||
"unknown register size");
|
||||
|
||||
write_mask = 0;
|
||||
if (*ptr == '=')
|
||||
|
@ -321,7 +318,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
|||
|
||||
if (write_mask && varname)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Option -v isn't valid for writes.");
|
||||
"option -v isn't valid for writes");
|
||||
|
||||
grub_pci_iterate (grub_setpci_iter);
|
||||
return GRUB_ERR_NONE;
|
||||
|
|
|
@ -67,7 +67,7 @@ grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
int n;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing operand");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
n = grub_strtoul (args[0], 0, 10);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
|
|
|
@ -46,9 +46,13 @@ GRUB_MOD_INIT(true)
|
|||
{
|
||||
cmd_true =
|
||||
grub_register_command ("true", grub_cmd_true,
|
||||
/* TRANSLATORS: it's imperative, not
|
||||
infinitive. */
|
||||
0, N_("Do nothing, successfully."));
|
||||
cmd_false =
|
||||
grub_register_command ("false", grub_cmd_false,
|
||||
/* TRANSLATORS: it's imperative, not
|
||||
infinitive. */
|
||||
0, N_("Do nothing, unsuccessfully."));
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
if (adapter->init ())
|
||||
{
|
||||
grub_puts_ (N_(" Failed"));
|
||||
grub_puts_ (N_(" Failed to initialize video adapter"));
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue