* grub-core/commands/hashsum.c: Likewise.
* grub-core/commands/i386/cmostest.c: Likewise.
* grub-core/commands/i386/pc/drivemap.c: Likewise.
* grub-core/commands/i386/pc/lsapm.c: Likewise.
* grub-core/commands/i386/pc/sendkey.c: Likewise.
* grub-core/commands/lsmmap.c: Likewise.
* grub-core/commands/menuentry.c: Likewise.
* grub-core/commands/mips/loongson/lsspd.c: Likewise.
* grub-core/commands/setpci.c: Likewise.
* grub-core/loader/i386/bsd.c: Likewise.
* grub-core/loader/i386/linux.c: Likewise.
* util/getroot.c: Likewise.
* util/grub-editenv.c: Likewise.
* util/grub-fstest.c: Likewise.
* util/grub-mkfont.c: Likewise.
* util/grub-mkimage.c: Likewise.
* util/grub-mkpasswd-pbkdf2.c: Likewise.
* util/grub-pe2elf.c: Likewise.
* util/grub-probe.c: Likewise.
* util/grub-setup.c: Likewise.
* util/ieee1275/ofpath.c: Likewise.
* util/misc.c: Likewise.
* util/raid.c: Likewise.
+2011-11-11 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/commands/efi/fixvideo.c: Gettextize.
+ * grub-core/commands/hashsum.c: Likewise.
+ * grub-core/commands/i386/cmostest.c: Likewise.
+ * grub-core/commands/i386/pc/drivemap.c: Likewise.
+ * grub-core/commands/i386/pc/lsapm.c: Likewise.
+ * grub-core/commands/i386/pc/sendkey.c: Likewise.
+ * grub-core/commands/lsmmap.c: Likewise.
+ * grub-core/commands/menuentry.c: Likewise.
+ * grub-core/commands/mips/loongson/lsspd.c: Likewise.
+ * grub-core/commands/setpci.c: Likewise.
+ * grub-core/loader/i386/bsd.c: Likewise.
+ * grub-core/loader/i386/linux.c: Likewise.
+ * util/getroot.c: Likewise.
+ * util/grub-editenv.c: Likewise.
+ * util/grub-fstest.c: Likewise.
+ * util/grub-mkfont.c: Likewise.
+ * util/grub-mkimage.c: Likewise.
+ * util/grub-mkpasswd-pbkdf2.c: Likewise.
+ * util/grub-pe2elf.c: Likewise.
+ * util/grub-probe.c: Likewise.
+ * util/grub-setup.c: Likewise.
+ * util/ieee1275/ofpath.c: Likewise.
+ * util/misc.c: Likewise.
+ * util/raid.c: Likewise.
+
2011-11-11 Robert Millan <rmh@gnu.org>
* util/getroot.c (grub_util_get_geom_abstraction): Remove
{
grub_target_addr_t base;
- grub_printf ("Found graphic card: %s\n", p->name);
+ grub_dprintf ("fixvideo", "Found graphic card: %s\n", p->name);
addr += 8 + p->mmio_bar * 4;
base = grub_pci_read (addr);
if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) ||
(base & GRUB_PCI_ADDR_MEM_PREFETCH))
- grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar);
+ grub_dprintf ("fixvideo", "Invalid MMIO bar %d\n", p->mmio_bar);
else
{
base &= GRUB_PCI_ADDR_MEM_MASK;
base += p->mmio_reg;
if (*((volatile grub_uint32_t *) base) != p->mmio_old)
- grub_printf ("Old value don't match\n");
+ grub_dprintf ("fixvideo", "Old value doesn't match\n");
else
{
*((volatile grub_uint32_t *) base) = 0;
if (*((volatile grub_uint32_t *) base))
- grub_printf ("Set MMIO fails\n");
+ grub_dprintf ("fixvideo", "Setting MMIO fails\n");
}
}
p++;
}
- grub_printf ("Unknown graphic card: %x\n", pciid);
+ grub_dprintf ("fixvideo", "Unknown graphic card: %x\n", pciid);
}
return 0;
grub_file_close (file);
if (err)
{
- grub_printf ("%s: READ ERROR\n", p);
+ grub_printf_ (N_("%s: READ ERROR\n"), p);
if (!keep)
{
grub_file_close (hashlist);
}
if (grub_crypto_memcmp (expected, actual, hash->mdlen) != 0)
{
- grub_printf ("%s: HASH MISMATCH\n", p);
+ grub_printf_ (N_("%s: HASH MISMATCH\n"), p);
if (!keep)
{
grub_file_close (hashlist);
mismatch++;
continue;
}
- grub_printf ("%s: OK\n", p);
+ grub_printf_ (N_("%s: OK\n"), p);
}
if (mismatch || unread)
return grub_error (GRUB_ERR_TEST_FAILURE,
GRUB_MOD_INIT(hashsum)
{
cmd = grub_register_extcmd ("hashsum", grub_cmd_hashsum, 0,
- "hashsum -h HASH [-c FILE [-p PREFIX]] "
- "[FILE1 [FILE2 ...]]",
+ N_("-h HASH [-c FILE [-p PREFIX]] "
+ "[FILE1 [FILE2 ...]]"),
N_("Compute or check hash checksum."),
options);
cmd_md5 = grub_register_extcmd ("md5sum", grub_cmd_hashsum, 0,
#include <grub/command.h>
#include <grub/misc.h>
#include <grub/cmos.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
GRUB_MOD_INIT(cmostest)
{
cmd = grub_register_command ("cmostest", grub_cmd_cmostest,
- "cmostest BYTE:BIT",
- "Test bit at BYTE:BIT in CMOS.");
+ N_("BYTE:BIT"),
+ N_("Test bit at BYTE:BIT in CMOS."));
cmd_clean = grub_register_command ("cmosclean", grub_cmd_cmosclean,
- "cmosclean BYTE:BIT",
- "Clean bit at BYTE:BIT in CMOS.");
+ N_("BYTE:BIT"),
+ N_("Clean bit at BYTE:BIT in CMOS."));
}
GRUB_MOD_FINI(cmostest)
/* Show: list mappings. */
if (! map_head)
{
- grub_printf ("No drives have been remapped\n");
+ grub_puts_ (N_("No drives have been remapped"));
return GRUB_ERR_NONE;
}
- grub_printf ("OS disk #num ------> GRUB/BIOS device\n");
+ grub_puts_ (N_("OS disk #num ------> GRUB/BIOS device"));
drivemap_node_t *curnode = map_head;
while (curnode)
{
if (!grub_apm_get_info (&info))
return grub_error (GRUB_ERR_IO, "no APM found");
- grub_printf ("Vesion %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",
- info.version >> 8, info.version & 0xff,
- info.cseg, info.cseg_len, info.offset,
- info.cseg_16, info.cseg_16_len,
- info.dseg, info.dseg_len);
+ grub_printf_ (N_("Vesion %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"),
+ info.version >> 8, info.version & 0xff,
+ info.cseg, info.cseg_len, info.offset,
+ info.cseg_16, info.cseg_16_len,
+ info.dseg, info.dseg_len);
grub_xputs (info.flags & GRUB_APM_FLAGS_16BITPROTECTED_SUPPORTED
- ? "16-bit protected interface supported\n"
- : "16-bit protected interface unsupported\n");
+ ? _("16-bit protected interface supported\n")
+ : _("16-bit protected interface unsupported\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_32BITPROTECTED_SUPPORTED
- ? "32-bit protected interface supported\n"
- : "32-bit protected interface unsupported\n");
+ ? _("32-bit protected interface supported\n")
+ : _("32-bit protected interface unsupported\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_CPUIDLE_SLOWS_DOWN
- ? "CPU Idle slows down processor\n"
- : "CPU Idle doesn't slow down processor\n");
+ ? _("CPU Idle slows down processor\n")
+ : _("CPU Idle doesn't slow down processor\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_DISABLED
- ? "APM disabled\n" : "APM enabled\n");
+ ? _("APM disabled\n") : _("APM enabled\n"));
grub_xputs (info.flags & GRUB_APM_FLAGS_DISENGAGED
- ? "APM disengaged\n" : "APM engaged\n");
+ ? _("APM disengaged\n") : _("APM engaged\n"));
return GRUB_ERR_NONE;
}
#include <grub/extcmd.h>
#include <grub/cpu/io.h>
#include <grub/loader.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv2+");
static int noled = 0;
static const struct grub_arg_option options[] =
{
- {"num", 'n', 0, "set numlock mode", "[on|off]", ARG_TYPE_STRING},
- {"caps", 'c', 0, "set capslock mode", "[on|off]", ARG_TYPE_STRING},
- {"scroll", 's', 0, "set scrolllock mode", "[on|off]", ARG_TYPE_STRING},
- {"insert", 0, 0, "set insert mode", "[on|off]", ARG_TYPE_STRING},
- {"pause", 0, 0, "set pause mode", "[on|off]", ARG_TYPE_STRING},
- {"left-shift", 0, 0, "press left shift", "[on|off]", ARG_TYPE_STRING},
- {"right-shift", 0, 0, "press right shift", "[on|off]", ARG_TYPE_STRING},
- {"sysrq", 0, 0, "press SysRq", "[on|off]", ARG_TYPE_STRING},
- {"numkey", 0, 0, "press NumLock key", "[on|off]", ARG_TYPE_STRING},
- {"capskey", 0, 0, "press CapsLock key", "[on|off]", ARG_TYPE_STRING},
- {"scrollkey", 0, 0, "press ScrollLock key", "[on|off]", ARG_TYPE_STRING},
- {"insertkey", 0, 0, "press Insert key", "[on|off]", ARG_TYPE_STRING},
- {"left-alt", 0, 0, "press left alt", "[on|off]", ARG_TYPE_STRING},
- {"right-alt", 0, 0, "press right alt", "[on|off]", ARG_TYPE_STRING},
- {"left-ctrl", 0, 0, "press left ctrl", "[on|off]", ARG_TYPE_STRING},
- {"right-ctrl", 0, 0, "press right ctrl", "[on|off]", ARG_TYPE_STRING},
- {"no-led", 0, 0, "don't update LED state", 0, 0},
+ {"num", 'n', 0, N_("set numlock mode"), "[on|off]", ARG_TYPE_STRING},
+ {"caps", 'c', 0, N_("set capslock mode"), "[on|off]", ARG_TYPE_STRING},
+ {"scroll", 's', 0, N_("set scrolllock mode"), "[on|off]", ARG_TYPE_STRING},
+ {"insert", 0, 0, N_("set insert mode"), "[on|off]", ARG_TYPE_STRING},
+ {"pause", 0, 0, N_("set pause mode"), "[on|off]", ARG_TYPE_STRING},
+ {"left-shift", 0, 0, N_("press left shift"), "[on|off]", ARG_TYPE_STRING},
+ {"right-shift", 0, 0, N_("press right shift"), "[on|off]", ARG_TYPE_STRING},
+ {"sysrq", 0, 0, N_("press SysRq"), "[on|off]", ARG_TYPE_STRING},
+ {"numkey", 0, 0, N_("press NumLock key"), "[on|off]", ARG_TYPE_STRING},
+ {"capskey", 0, 0, N_("press CapsLock key"), "[on|off]", ARG_TYPE_STRING},
+ {"scrollkey", 0, 0, N_("press ScrollLock key"), "[on|off]", ARG_TYPE_STRING},
+ {"insertkey", 0, 0, N_("press Insert key"), "[on|off]", ARG_TYPE_STRING},
+ {"left-alt", 0, 0, N_("press left alt"), "[on|off]", ARG_TYPE_STRING},
+ {"right-alt", 0, 0, N_("press right alt"), "[on|off]", ARG_TYPE_STRING},
+ {"left-ctrl", 0, 0, N_("press left ctrl"), "[on|off]", ARG_TYPE_STRING},
+ {"right-ctrl", 0, 0, N_("press right ctrl"), "[on|off]", ARG_TYPE_STRING},
+ {"no-led", 0, 0, N_("don't update LED state"), 0, 0},
{0, 0, 0, 0, 0, 0}
};
static int simple_flag_offsets[]
GRUB_MOD_INIT (sendkey)
{
cmd = grub_register_extcmd ("sendkey", grub_cmd_sendkey, 0,
- "sendkey [KEYSTROKE1] [KEYSTROKE2] ...",
- "Emulate a keystroke", options);
+ N_("[KEYSTROKE1] [KEYSTROKE2] ..."),
+ N_("Emulate a keystroke"), options);
preboot_hook
= grub_loader_register_preboot_hook (grub_sendkey_preboot,
static const char *names[] =
{
- [GRUB_MEMORY_AVAILABLE] = "available",
- [GRUB_MEMORY_RESERVED] = "reserved",
- [GRUB_MEMORY_ACPI] = "ACPI reclamaible",
- [GRUB_MEMORY_NVS] = "NVS",
- [GRUB_MEMORY_BADRAM] = "BadRAM",
- [GRUB_MEMORY_CODE] = "firmware code",
- [GRUB_MEMORY_HOLE] = "hole"
+ [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")
};
static grub_err_t
grub_memory_type_t type)
{
if (type < ARRAY_SIZE (names) && names[type])
- grub_printf ("base_addr = 0x%llx, length = 0x%llx, %s\n",
- (long long) addr, (long long) size, names[type]);
+ grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"),
+ (long long) addr, (long long) size, _(names[type]));
else
- grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n",
- (long long) addr, (long long) size, type);
+ grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"),
+ (long long) addr, (long long) size, type);
return 0;
}
#ifndef GRUB_MACHINE_EMU
static const struct grub_arg_option options[] =
{
{"class", 1, GRUB_ARG_OPTION_REPEATABLE,
- N_("Menu entry type."), "STRING", ARG_TYPE_STRING},
+ N_("Menu entry type."), N_("STRING"), ARG_TYPE_STRING},
{"users", 2, 0,
- N_("Users allowed to boot this entry."), "USERNAME", ARG_TYPE_STRING},
+ N_("Users allowed to boot this entry."), N_("USERNAME"), ARG_TYPE_STRING},
{"hotkey", 3, 0,
- N_("Keyboard key for this entry."), "KEY", ARG_TYPE_STRING},
+ N_("Keyboard key for this entry."), N_("KEY"), ARG_TYPE_STRING},
{"source", 4, 0,
- N_("Menu entry definition as a string."), "STRING", ARG_TYPE_STRING},
+ N_("Menu entry definition as a string."), N_("STRING"), ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/cs5536.h>
+#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
if (!grub_cs5536_find (&dev))
{
- grub_printf ("No CS5536 found\n");
+ grub_puts_ (N_("No CS5536 found"));
return GRUB_ERR_NONE;
}
- grub_printf ("CS5536 at %d:%d.%d\n", grub_pci_get_bus (dev),
- grub_pci_get_device (dev), grub_pci_get_function (dev));
+ grub_printf_ (N_("CS5536 at %d:%d.%d\n"), grub_pci_get_bus (dev),
+ grub_pci_get_device (dev), grub_pci_get_function (dev));
err = grub_cs5536_init_smbus (dev, 0x7fff, &smbbase);
if (err)
return err;
- grub_printf ("SMB base = 0x%x\n", smbbase);
+ grub_printf_ (N_("SMB base = 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 ("Device %d\n", i);
+ grub_printf_ (N_("Device %d\n"), i);
err = grub_cs5536_read_spd (smbbase, i, &spd);
if (err)
{
grub_print_error ();
continue;
}
- grub_printf ("Written SPD bytes: %d B.\n", spd.written_size);
- grub_printf ("Total flash size: %d B.\n", 1 << spd.log_total_flash_size);
+ grub_printf_ (N_("Written SPD bytes: %d B.\n"), spd.written_size);
+ grub_printf_ (N_("Total flash size: %d B.\n"),
+ 1 << spd.log_total_flash_size);
if (spd.memory_type == GRUB_SMBUS_SPD_MEMORY_TYPE_DDR2)
{
char str[sizeof (spd.ddr2.part_number) + 1];
- grub_printf ("Memory type: DDR2.\n");
+ grub_puts_ (N_("Memory type: DDR2."));
grub_memcpy (str, spd.ddr2.part_number,
sizeof (spd.ddr2.part_number));
str[sizeof (spd.ddr2.part_number)] = 0;
- grub_printf ("Part no: %s.\n", str);
+ grub_printf_ (N_("Part no: %s.\n"), str);
}
else
- grub_printf ("Memory type: Unknown.\n");
+ grub_puts_ (N_("Memory type: Unknown."));
}
return GRUB_ERR_NONE;
GRUB_MOD_INIT(lsspd)
{
cmd = grub_register_command ("lsspd", grub_cmd_lsspd, 0,
- "Print Memory information.");
+ N_("Print Memory information."));
}
GRUB_MOD_FINI(lsspd)
static const struct grub_arg_option options[] =
{
- {0, 'd', 0, "Select device by vendor and device IDs.",
- "[vendor]:[device]", ARG_TYPE_STRING},
- {0, 's', 0, "Select device by its position on the bus.",
- "[bus]:[slot][.func]", ARG_TYPE_STRING},
- {0, 'v', 0, "Save read value into variable VARNAME.",
- "VARNAME", ARG_TYPE_STRING},
+ {0, 'd', 0, N_("Select device by vendor and device IDs."),
+ N_("[vendor]:[device]"), ARG_TYPE_STRING},
+ {0, 's', 0, N_("Select device by its position on the bus."),
+ N_("[bus]:[slot][.func]"), ARG_TYPE_STRING},
+ {0, 'v', 0, N_("Save read value into variable VARNAME."),
+ N_("VARNAME"), ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
if (!write_mask)
{
- grub_printf ("Register %x of %d:%d.%d is %x\n", regaddr,
+ grub_printf (N_("Register %x of %d:%d.%d is %x\n"), regaddr,
grub_pci_get_bus (dev),
grub_pci_get_device (dev),
grub_pci_get_function (dev),
{
struct bsd_tag *tag;
- grub_printf (" %-18s %-18s%14s%14s\n", "name", "type", "addr", "size");
+ grub_printf (" %-18s %-18s%14s%14s\n", _("name"), _("type"), _("addr"),
+ _("size"));
for (tag = tags; tag; tag = tag->next)
{
{
struct netbsd_module *mod;
- grub_printf (" %-18s%14s%14s%14s\n", "name", "type", "addr", "size");
+ grub_printf (" %-18s%14s%14s%14s\n", _("name"), _("type"), _("addr"),
+ _("size"));
for (mod = netbsd_mods; mod; mod = mod->next)
grub_printf (" %-18s 0x%08x 0x%08x 0x%08x", mod->mod.name,
if (err)
{
grub_print_error ();
- grub_printf ("Booting however\n");
+ grub_puts_ (N_("Booting in blind mode"));
grub_errno = GRUB_ERR_NONE;
}
cmd_openbsd_ramdisk = grub_register_command ("kopenbsd_ramdisk",
grub_cmd_openbsd_ramdisk, 0,
- "Load kOpenBSD ramdisk. ");
+ N_("Load kOpenBSD ramdisk."));
my_mod = mod;
}
if (err)
{
grub_print_error ();
- grub_printf ("Booting however\n");
+ grub_puts_ (N_("Booting in blind mode"));
grub_errno = GRUB_ERR_NONE;
}
vid_mode = GRUB_LINUX_VID_MODE_EXTENDED;
else if (grub_strcmp (val, "ask") == 0)
{
- grub_printf ("Legacy `ask' parameter no longer supported.\n");
+ grub_puts_ (N_("Legacy `ask' parameter no longer supported."));
/* We usually would never do this in a loader, but "vga=ask" means user
requested interaction, so it can't hurt to request keyboard input. */
case 0:
case GRUB_LINUX_VID_MODE_NORMAL:
grub_env_set ("gfxpayload", "text");
- grub_printf ("%s is deprecated. "
- "Use set gfxpayload=text before "
- "linux command instead.\n",
+ grub_printf_ (N_("%s is deprecated. "
+ "Use set gfxpayload=text before "
+ "linux command instead.\n"),
argv[i]);
break;
case GRUB_LINUX_VID_MODE_EXTENDED:
/* FIXME: support 80x50 text. */
grub_env_set ("gfxpayload", "text");
- grub_printf ("%s is deprecated. "
- "Use set gfxpayload=text before "
- "linux command instead.\n",
+ grub_printf_ (N_("%s is deprecated. "
+ "Use set gfxpayload=text before "
+ "linux command instead.\n"),
argv[i]);
break;
default:
vid_mode > GRUB_VESA_MODE_TABLE_END)
{
grub_env_set ("gfxpayload", "text");
- grub_printf ("%s is deprecated. Mode %d isn't recognized. "
- "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] before "
- "linux command instead.\n",
+ grub_printf_ (N_("%s is deprecated. Mode %d isn't recognized. "
+ "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] "
+ "before linux command instead.\n"),
argv[i], vid_mode);
break;
}
if (! buf)
goto fail;
- grub_printf ("%s is deprecated. "
- "Use set gfxpayload=%s before "
- "linux command instead.\n",
+ grub_printf_ (N_("%s is deprecated. "
+ "Use set gfxpayload=%s before "
+ "linux command instead.\n"),
argv[i], buf);
err = grub_env_set ("gfxpayload", buf);
grub_free (buf);
#include <grub/util/misc.h>
#include <grub/util/lvm.h>
#include <grub/cryptodisk.h>
+#include <grub/i18n.h>
#ifdef HAVE_DEVICE_MAPPER
# include <libdevmapper.h>
continue;
if (chdir (saved_cwd) < 0)
- grub_util_error ("cannot restore the original directory");
+ grub_util_error (_("cannot restore the original directory"));
free (saved_cwd);
closedir (dp);
}
if (chdir (saved_cwd) < 0)
- grub_util_error ("cannot restore the original directory");
+ grub_util_error (_("cannot restore the original directory"));
free (saved_cwd);
closedir (dp);
&data, &data_len);
if (num_ints < 1)
- grub_util_error ("Storage info for `%s' does not include type", dir);
+ grub_util_error (_("Storage info for `%s' does not include type"), dir);
if (ints[0] != STORAGE_DEVICE)
- grub_util_error ("Filesystem of `%s' is not stored on local disk", dir);
+ grub_util_error (_("Filesystem of `%s' is not stored on local disk"), dir);
if (num_ints < 5)
- grub_util_error ("Storage info for `%s' does not include name", dir);
+ grub_util_error (_("Storage info for `%s' does not include name"), dir);
name_len = ints[4];
if (name_len < data_len)
- grub_util_error ("Bogus name length for storage info for `%s'", dir);
+ grub_util_error (_("Bogus name length for storage info for `%s'"), dir);
if (data[name_len - 1] != '\0')
- grub_util_error ("Storage name for `%s' not NUL-terminated", dir);
+ grub_util_error (_("Storage name for `%s' not NUL-terminated"), dir);
os_dev = xmalloc (strlen ("/dev/") + data_len);
memcpy (os_dev, "/dev/", strlen ("/dev/"));
}
if (stat (dir, &st) < 0)
- grub_util_error ("cannot stat `%s'", dir);
+ grub_util_error (_("cannot stat `%s'"), dir);
dev = st.st_dev;
*tree = dm_tree_create ();
if (! *tree)
{
- grub_printf ("Failed to create tree\n");
+ grub_puts_ (N_("Failed to create tree"));
grub_dprintf ("hostdisk", "dm_tree_create failed\n");
return 0;
}
error = geom_gettree (&mesh);
if (error != 0)
- grub_util_error ("couldn't open geom");
+ grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
if (pipe (mdadm_pipe) < 0)
{
- grub_util_warn ("Unable to create pipe for mdadm: %s", strerror (errno));
+ grub_util_warn (_("Unable to create pipe for mdadm: %s"),
+ strerror (errno));
return NULL;
}
mdadm_pid = fork ();
if (mdadm_pid < 0)
- grub_util_warn ("Unable to fork mdadm: %s", strerror (errno));
+ grub_util_warn (_("Unable to fork mdadm: %s"), strerror (errno));
else if (mdadm_pid == 0)
{
/* Child. */
mdadm = fdopen (mdadm_pipe[0], "r");
if (! mdadm)
{
- grub_util_warn ("Unable to open stream from mdadm: %s",
+ grub_util_warn (_("Unable to open stream from mdadm: %s"),
strerror (errno));
goto out;
}
error = geom_gettree (&mesh);
if (error != 0)
- grub_util_error ("couldn't open geom");
+ grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer)
break;
if (!consumer)
- grub_util_error ("couldn't find geli consumer");
+ grub_util_error (_("couldn't find geli consumer"));
fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name);
grub_util_info ("consumer %s", consumer->lg_provider->lg_name);
lastsubdev = consumer->lg_provider->lg_name;
grub_err_t err;
err = grub_cryptodisk_cheat_mount (grdev, os_dev);
if (err)
- grub_util_error ("Can't mount crypto: %s", grub_errmsg);
+ grub_util_error (_("Can't mount crypto: %s"), _(grub_errmsg));
}
grub_free (grdev);
grub_err_t err;
err = grub_cryptodisk_cheat_mount (grdev, os_dev);
if (err)
- grub_util_error ("Can't mount crypto: %s", grub_errmsg);
+ grub_util_error (_("Can't mount crypto: %s"), _(grub_errmsg));
}
grub_free (grdev);
}
error = geom_gettree (&mesh);
if (error != 0)
- grub_util_error ("couldn't open geom");
+ grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
{
LIST_FOREACH (consumer, &geom->lg_consumer, lg_consumer)
break;
if (!consumer)
- grub_util_error ("couldn't find geli consumer");
+ grub_util_error (_("couldn't find geli consumer"));
fname = xasprintf ("/dev/%s", consumer->lg_provider->lg_name);
uuid = grub_util_get_geli_uuid (fname);
if (!uuid)
- grub_util_error ("couldn't retrieve geli UUID");
+ grub_util_error (_("couldn't retrieve geli UUID"));
grub_dev = xasprintf ("cryptouuid/%s", uuid);
free (fname);
free (uuid);
free (p);
}
else
- grub_util_error ("unknown kind of RAID device `%s'", os_dev);
+ grub_util_error (_("unknown kind of RAID device `%s'"), os_dev);
{
char *mdadm_name = get_mdadm_uuid (os_dev);
struct stat st;
if (stat (blk_dev, &st) < 0)
- grub_util_error ("cannot stat `%s'", blk_dev);
+ grub_util_error (_("cannot stat `%s'"), blk_dev);
if (S_ISBLK (st.st_mode))
return (blk_dev);
struct stat st;
if (stat (blk_dev, &st) < 0)
- grub_util_error ("cannot stat `%s'", blk_dev);
+ grub_util_error (_("cannot stat `%s'"), blk_dev);
if (S_ISCHR (st.st_mode))
return (blk_dev);
{
char winpath[PATH_MAX];
if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
- grub_util_error ("cygwin_conv_path() failed");
+ grub_util_error (_("cygwin_conv_path() failed"));
int len = strlen (winpath);
int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
/* canonicalize. */
p = canonicalize_file_name (path);
if (p == NULL)
- grub_util_error ("failed to get canonical path of %s", path);
+ grub_util_error (_("failed to get canonical path of %s"), path);
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
/* For ZFS sub-pool filesystems, could be extended to others (btrfs?). */
free (p);
if (stat (buf, &st) < 0)
- grub_util_error ("cannot stat %s: %s", buf, strerror (errno));
+ grub_util_error (_("cannot stat %s: %s"), buf, strerror (errno));
buf2 = xstrdup (buf);
num = st.st_dev;
p = strrchr (buf, '/');
if (p == NULL)
/* This should never happen. */
- grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)");
+ grub_util_error (_("FIXME: no / in buf. (make_system_path_relative_to_its_root)"));
if (p != buf)
*p = 0;
else
*++p = 0;
if (stat (buf, &st) < 0)
- grub_util_error ("cannot stat %s: %s", buf, strerror (errno));
+ grub_util_error (_("cannot stat %s: %s"), buf, strerror (errno));
/* buf is another filesystem; we found it. */
if (st.st_dev != num)
buf = malloc (DEFAULT_ENVBLK_SIZE);
if (! buf)
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
namenew = xasprintf ("%s.new", name);
fp = fopen (namenew, "wb");
if (! fp)
- grub_util_error ("cannot open the file %s", namenew);
+ grub_util_error (_("cannot open the file %s"), namenew);
memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1);
memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#',
DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1);
if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE)
- grub_util_error ("cannot write to the file %s", namenew);
+ grub_util_error (_("cannot write to the file %s"), namenew);
fsync (fileno (fp));
free (buf);
fclose (fp);
if (rename (namenew, name) < 0)
- grub_util_error ("cannot rename the file %s to %s", namenew, name);
+ grub_util_error (_("cannot rename the file %s to %s"), namenew, name);
free (namenew);
}
create_envblk_file (name);
fp = fopen (name, "rb");
if (! fp)
- grub_util_error ("cannot open the file %s", name);
+ grub_util_error (_("cannot open the file %s"), name);
}
if (fseek (fp, 0, SEEK_END) < 0)
- grub_util_error ("cannot seek the file %s", name);
+ grub_util_error (_("cannot seek the file %s"), name);
size = (size_t) ftell (fp);
if (fseek (fp, 0, SEEK_SET) < 0)
- grub_util_error ("cannot seek the file %s", name);
+ grub_util_error (_("cannot seek the file %s"), name);
buf = malloc (size);
if (! buf)
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
if (fread (buf, 1, size, fp) != size)
- grub_util_error ("cannot read the file %s", name);
+ grub_util_error (_("cannot read the file %s"), name);
fclose (fp);
envblk = grub_envblk_open (buf, size);
if (! envblk)
- grub_util_error ("invalid environment block");
+ grub_util_error (_("invalid environment block"));
return envblk;
}
fp = fopen (name, "wb");
if (! fp)
- grub_util_error ("cannot open the file %s", name);
+ grub_util_error (_("cannot open the file %s"), name);
if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp)
!= grub_envblk_size (envblk))
- grub_util_error ("cannot write to the file %s", name);
+ grub_util_error (_("cannot write to the file %s"), name);
fsync (fileno (fp));
fclose (fp);
p = strchr (argv[0], '=');
if (! p)
- grub_util_error ("invalid parameter %s", argv[0]);
+ grub_util_error (_("invalid parameter %s"), argv[0]);
*(p++) = 0;
if (! grub_envblk_set (envblk, argv[0], p))
- grub_util_error ("environment block too small");
+ grub_util_error (_("environment block too small"));
argc--;
argv++;
if (!fs)
grub_util_error (grub_errmsg);
if (!fs->uuid)
- grub_util_error ("couldn't retrieve UUID");
+ grub_util_error (_("couldn't retrieve UUID"));
if (fs->uuid (dev, &uuid))
grub_util_error (grub_errmsg);
if (!uuid)
- grub_util_error ("couldn't retrieve UUID");
+ grub_util_error (_("couldn't retrieve UUID"));
argv[1] = uuid;
execute_command ("xnu_uuid", 2, argv);
grub_free (uuid);
if (strcmp (arg, "prompt") == 0)
{
char buf[1024];
- grub_printf ("Enter ZFS password: ");
+ grub_puts_ (N_("Enter ZFS password: "));
if (grub_password_get (buf, 1023))
{
grub_zfs_add_key ((grub_uint8_t *) buf, grub_strlen (buf), 1);
f = fopen (arg, "rb");
if (!f)
{
- printf ("Error loading file %s: %s\n", arg, strerror (errno));
+ printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
return 0;
}
real_size = fread (buf, 1, 1024, f);
if (real_size < 0)
{
- printf ("Error loading file %s: %s\n", arg, strerror (errno));
+ printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
fclose (f);
return 0;
}
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS] FONT_FILES\n\
\nOptions:\n\
-o, --output=FILE_NAME set output file name\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
err = FT_Load_Glyph (face, glyph_idx, flag);
if (err)
{
- printf ("Freetype Error %d loading glyph 0x%x for U+0x%x%s",
+ printf (_("Freetype Error %d loading glyph 0x%x for U+0x%x%s"),
err, glyph_idx, char_code & GRUB_FONT_CODE_CHAR_MASK,
char_code & GRUB_FONT_CODE_RIGHT_JOINED
- ? ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? " (medial)":
- " (leftmost)")
- : ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? " (rightmost)":
+ ? ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (medial)"):
+ _(" (leftmost)"))
+ : ((char_code & GRUB_FONT_CODE_LEFT_JOINED) ? _(" (rightmost)"):
""));
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
if (substtype == GSUB_SUBSTITUTION_DELTA)
add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target);
else if (i >= grub_be_to_cpu16 (sub->count))
- printf ("Out of range substitution (%d, %d)\n", i,
+ printf (_("Out of range substitution (%d, %d)\n"), i,
grub_be_to_cpu16 (sub->count));
else
add_subst (glyph, grub_be_to_cpu16 (sub->repl[i++]), target);
struct gsub_lookup *lookup;
if (lookup_index >= grub_be_to_cpu16 (lookups->count))
{
- printf ("Out of range lookup: %d\n", lookup_index);
+ printf (_("Out of range lookup: %d\n"), lookup_index);
continue;
}
lookup = (struct gsub_lookup *)
+ grub_be_to_cpu16 (lookups->offsets[lookup_index]));
if (grub_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION)
{
- printf ("Unsupported substitution type: %d\n",
+ printf (_("Unsupported substitution type: %d\n"),
grub_be_to_cpu16 (lookup->type));
continue;
}
if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR)
{
- printf ("Unsupported substitution flag: 0x%x\n",
+ printf (_("Unsupported substitution flag: 0x%x\n"),
grub_be_to_cpu16 (lookup->flag));
}
switch (feattag)
if (substtype != GSUB_SUBSTITUTION_MAP
&& substtype != GSUB_SUBSTITUTION_DELTA)
{
- printf ("Unsupported substitution specification: %d\n",
+ printf (_("Unsupported substitution specification: %d\n"),
substtype);
continue;
}
subst (m);
}
else
- printf ("Unsupported coverage specification: %d\n", covertype);
+ printf (_("Unsupported coverage specification: %d\n"), covertype);
}
}
}
grub_uint32_t feattag
= grub_be_to_cpu32 (features->features[i].feature_tag);
if (feature->params)
- printf ("WARNING: unsupported feature parameters: %x\n",
+ printf (_("WARNING: unsupported feature parameters: %x\n"),
grub_be_to_cpu16 (feature->params));
switch (feattag)
{
for (j = 0; j < 4; j++)
if (!grub_isgraph (str[j]))
str[j] = '?';
- printf ("Unknown gsub feature 0x%x (%s)\n", feattag, str);
+ printf (_("Unknown gsub feature 0x%x (%s)\n"), feattag, str);
}
}
}
int x, y, xmax, xmin, ymax, ymin;
grub_uint8_t *bitmap, mask;
- printf ("\nGlyph #%d, U+%04x\n", num, glyph->char_code);
- printf ("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n",
+ printf (_("\nGlyph #%d, U+%04x\n"), num, glyph->char_code);
+ printf (_("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n"),
glyph->width, glyph->height, glyph->x_ofs, glyph->y_ofs,
glyph->device_width);
file = fopen (output_file, "wb");
if (! file)
- grub_util_error ("Can\'t write to file %s.", output_file);
+ grub_util_error (_("Can\'t write to file %s."), output_file);
int correct_size;
for (glyph = font_info->glyphs_sorted, num = 0; num < font_info->num_glyphs;
file = fopen (output_file, "wb");
if (! file)
- grub_util_error ("Can\'t write to file %s.", output_file);
+ grub_util_error (_("Can\'t write to file %s."), output_file);
for (glyph = font_info->glyphs_sorted;
glyph < font_info->glyphs_sorted + font_info->num_glyphs; glyph++)
file = fopen (output_file, "wb");
if (! file)
- grub_util_error ("can\'t write to file %s.", output_file);
+ grub_util_error (_("Can\'t write to file %s."), output_file);
offset = 0;
a = strtoul (p, &p, 0);
if (*p != '-')
- grub_util_error ("invalid font range");
+ grub_util_error (_("invalid font range"));
b = strtoul (p + 1, &p, 0);
if ((font_info.num_range & (GRUB_FONT_RANGE_BLOCK - 1)) == 0)
font_info.ranges = xrealloc (font_info.ranges,
if (*p)
{
if (*p != ',')
- grub_util_error ("invalid font range");
+ grub_util_error (_("invalid font range"));
else
p++;
}
if (file_format == ASCII_BITMAPS && font_info.num_range > 0)
{
- grub_util_error ("Option --ascii-bitmaps doesn't accept ranges (use ASCII).");
+ grub_util_error (_("Option --ascii-bitmaps doesn't accept ranges (use ASCII)."));
return 1;
}
}
if (! output_file)
- grub_util_error ("no output file is specified");
+ grub_util_error (_("no output file is specified"));
if (FT_Init_FreeType (&ft_lib))
- grub_util_error ("FT_Init_FreeType fails");
+ grub_util_error (_("FT_Init_FreeType fails"));
for (; optind < argc; optind++)
{
err = FT_New_Face (ft_lib, argv[optind], font_index, &ft_face);
if (err)
{
- grub_printf ("can't open file %s, index %d: error %d", argv[optind],
- font_index, err);
+ grub_printf (_("can't open file %s, index %d: error %d"),
+ argv[optind], font_index, err);
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
printf (": %s\n", ft_errmsgs[err]);
else
font_info.size = size;
if (FT_Set_Pixel_Sizes (ft_face, size, size))
- grub_util_error ("can't set %dx%d font size", size, size);
+ grub_util_error (_("can't set %dx%d font size"), size, size);
add_font (&font_info, ft_face, file_format != PF2);
FT_Done_Face (ft_face);
}
if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS
&& (comp != COMPRESSION_NONE))
- grub_util_error ("unknown compression %d\n", comp);
+ grub_util_error (_("unknown compression %d\n"), comp);
*core_img = xmalloc (kernel_size);
memcpy (*core_img, kernel_img, kernel_size);
name = "none_decompress.img";
break;
default:
- grub_util_error ("unknown compression %d\n", comp);
+ grub_util_error (_("unknown compression %d\n"), comp);
}
decompress_path = grub_util_get_path (dir, name);
boot_path = grub_util_get_path (dir, "diskboot.img");
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("diskboot.img is not one sector size");
+ grub_util_error (_("diskboot.img is not one sector size"));
boot_img = grub_util_read_image (boot_path);
GRUB_MD_SHA512->final (context);
if (grub_memcmp (GRUB_MD_SHA512->read (context), fwstart_good_hash,
GRUB_MD_SHA512->mdlen) != 0)
- grub_util_warn ("fwstart.img doesn't match the known good version. "
- "Proceed at your own risk");
+ grub_util_warn (_("fwstart.img doesn't match the known good version. "
+ "proceed at your own risk"));
if (core_size + boot_size > 512 * 1024)
- grub_util_error ("firmware image is too big");
+ grub_util_error (_("firmware image is too big"));
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
size_t rom_size;
if (core_size > 512 * 1024)
- grub_util_error ("firmware image is too big");
+ grub_util_error (_("firmware image is too big"));
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
image_target = &image_targets[i];
if (!image_target)
{
- printf ("unknown target format %s\n", optarg);
+ printf (_("unknown target format %s\n"), optarg);
usage (1);
}
break;
#ifdef HAVE_LIBLZMA
comp = COMPRESSION_XZ;
#else
- grub_util_error ("grub-mkimage is compiled without XZ support",
+ grub_util_error (_("grub-mkimage is compiled without XZ support"),
optarg);
#endif
}
else if (grub_strcmp (optarg, "none") == 0)
comp = COMPRESSION_NONE;
else
- grub_util_error ("Unknown compression format %s", optarg);
+ grub_util_error (_("Unknown compression format %s"), optarg);
break;
case 'h':
if (!image_target)
{
- printf ("Target format not specified (use the -O option).\n");
+ printf (_("Target format not specified (use the -O option).\n"));
usage (1);
}
usage (int status)
{
if (status)
- fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTIONS]\n\
\nOptions:\n\
-c number, --iteration-count=number Number of PBKDF2 iterations\n\
-l number, --buflen=number Length of generated hash\n\
-s number, --salt=number Length of salt\n\
\n\
-Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
+Report bugs to <%s>.\n"), program_name, PACKAGE_BUGREPORT);
exit (status);
}
bufhex = malloc (buflen * 2 + 1);
if (!bufhex)
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
buf = malloc (buflen);
if (!buf)
{
free (bufhex);
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
}
salt = malloc (saltlen);
{
free (bufhex);
free (buf);
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
}
salthex = malloc (saltlen * 2 + 1);
if (!salthex)
free (salt);
free (bufhex);
free (buf);
- grub_util_error ("out of memory");
+ grub_util_error (_("out of memory"));
}
- printf ("Enter password: ");
+ printf ("%s", _("Enter password: "));
if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN))
{
free (buf);
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("failure to read password");
+ grub_util_error (_("failure to read password"));
}
- printf ("\nReenter password: ");
+ printf ("\n%s", _("Reenter password: "));
if (!grub_password_get (pass2, GRUB_AUTH_MAX_PASSLEN))
{
free (buf);
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("failure to read password");
+ grub_util_error (_("failure to read password"));
}
if (strcmp (pass1, pass2) != 0)
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("passwords don't match");
+ grub_util_error (_("passwords don't match"));
}
memset (pass2, 0, sizeof (pass2));
#if ! defined (__linux__) && ! defined (__FreeBSD__)
- printf ("WARNING: your random generator isn't known to be secure\n");
+ printf ("%s", _("WARNING: your random generator isn't known to be secure\n"));
#endif
{
free (salthex);
free (salt);
fclose (f);
- grub_util_error ("couldn't retrieve random data for salt");
+ grub_util_error (_("couldn't retrieve random data for salt"));
}
rd = fread (salt, 1, saltlen, f);
if (rd != saltlen)
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("couldn't retrieve random data for salt");
+ grub_util_error (_("couldn't retrieve random data for salt"));
}
fclose (f);
}
memset (salthex, 0, 2 * saltlen);
free (salt);
free (salthex);
- grub_util_error ("cryptographic error number %d", gcry_err);
+ grub_util_error (_("cryptographic error number %d"), gcry_err);
}
hexify (bufhex, buf, buflen);
hexify (salthex, salt, saltlen);
- printf ("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n",
+ printf (_("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n"),
count, salthex, bufhex);
memset (buf, 0, buflen);
memset (bufhex, 0, 2 * buflen);
#include "progname.h"
+/* Please don't internationalise this file. It's pointless. */
+
static struct option options[] = {
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
{
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__sun__)
if (! grub_util_check_char_device (device_name))
- grub_util_error ("%s is not a character device", device_name);
+ grub_util_error (_("%s is not a character device"), device_name);
#else
if (! grub_util_check_block_device (device_name))
- grub_util_error ("%s is not a block device", device_name);
+ grub_util_error (_("%s is not a block device"), device_name);
#endif
}
else
}
if (! device_name)
- grub_util_error ("cannot find a device for %s (is /dev mounted?)", path);
+ grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), path);
if (print == PRINT_DEVICE)
{
drive_name = grub_util_get_grub_dev (device_name);
if (! drive_name)
- grub_util_error ("cannot find a GRUB drive for %s. Check your device.map", device_name);
+ grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
+ device_name);
if (print == PRINT_DRIVE)
{
grub_util_info ("opening %s", drive_name);
dev = grub_device_open (drive_name);
if (! dev)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
if (print == PRINT_ABSTRACTION)
{
fs = grub_fs_probe (dev);
if (! fs)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
if (print == PRINT_FS)
{
{
char *uuid;
if (! fs->uuid)
- grub_util_error ("%s does not support UUIDs", fs->name);
+ grub_util_error (_("%s does not support UUIDs"), fs->name);
if (fs->uuid (dev, &uuid) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
{
char *label;
if (! fs->label)
- grub_util_error ("%s does not support labels", fs->name);
+ grub_util_error (_("%s does not support labels"), fs->name);
if (fs->label (dev, &label) != GRUB_ERR_NONE)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
printf ("%s\n", label);
}
{
if (status)
fprintf (stderr,
- "Try `%s --help' for more information.\n", program_name);
+ _("Try `%s --help' for more information.\n"), program_name);
else
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... [PATH|DEVICE]\n\
\n\
Probe device information for a given path (or device, if the -d option is given).\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
-", program_name,
+"), program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
/* Obtain ARGUMENT. */
if (optind >= argc)
{
- fprintf (stderr, "No path or device is specified.\n");
+ fprintf (stderr, _("No path or device is specified.\n"));
usage (1);
}
if (optind + 1 != argc)
{
- fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
+ fprintf (stderr, _("Unknown extra argument `%s'.\n"), argv[optind + 1]);
usage (1);
}
if (root_dev->disk->partition->parent)
{
if (root_dev->disk->partition->parent->parent)
- grub_util_error ("Installing on doubly nested partitions is "
- "not supported");
+ grub_util_error (_("Installing on doubly nested partitions "
+ "is not supported"));
dos_part = root_dev->disk->partition->parent->number;
bsd_part = root_dev->disk->partition->number;
}
grub_util_info ("Opening root");
root_dev = grub_device_open (root);
if (! root_dev)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
grub_util_info ("Opening dest");
dest_dev = grub_device_open (dest);
if (! dest_dev)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
grub_util_info ("setting the root device to `%s'", root);
if (grub_env_set ("root", root) != GRUB_ERR_NONE)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
#ifdef GRUB_MACHINE_PCBIOS
/* Read the original sector from the disk. */
tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE);
if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img))
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
#endif
#ifdef GRUB_MACHINE_PCBIOS
if (dest_partmap && !dest_partmap->embed)
{
- grub_util_warn ("Partition style '%s' doesn't support embeding",
+ grub_util_warn (_("Partition style '%s' doesn't support embeding"),
dest_partmap->name);
goto unable_to_embed;
}
if (fs && !fs->embed)
{
- grub_util_warn ("File system '%s' doesn't support embeding",
+ grub_util_warn (_("File system '%s' doesn't support embeding"),
fs->name);
goto unable_to_embed;
}
if (!err && nsec < core_sectors)
{
err = grub_error (GRUB_ERR_OUT_OF_RANGE,
- "Your embedding area is unusually small. "
- "core.img won't fit in it.");
+ N_("Your embedding area is unusually small. "
+ "core.img won't fit in it."));
}
if (err)
{
- grub_util_warn ("%s", grub_errmsg);
+ grub_util_warn ("%s", _(grub_errmsg));
grub_errno = GRUB_ERR_NONE;
goto unable_to_embed;
}
block--;
if ((char *) block <= core_img)
- grub_util_error ("No terminator in the core image");
+ grub_util_error (_("No terminator in the core image"));
}
save_first_sector (sectors[0] + grub_partition_get_start (container),
grub_file_filter_disable_compression ();
file = grub_file_open (core_path_dev);
if (! file)
- grub_util_error ("%s", grub_errmsg);
+ grub_util_error ("%s", _(grub_errmsg));
file->read_hook = save_first_sector;
if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE)
/* Write the boot image onto the disk. */
if (grub_disk_write (dest_dev->disk, BOOT_SECTOR,
0, GRUB_DISK_SECTOR_SIZE, boot_img))
- grub_util_error ("%s", grub_errmsg);
-
+ grub_util_error ("%s", _(grub_errmsg));
grub_util_biosdisk_flush (root_dev->disk);
grub_util_biosdisk_flush (dest_dev->disk);
#include <grub/types.h>
#include <grub/util/misc.h>
#include <grub/util/ofpath.h>
+#include <grub/i18n.h>
#endif
#include <limits.h>
exit (1);
}
+#define _(x) x
#endif
static void
{
kill_trailing_dir(sysfs_path);
if (!strcmp(sysfs_path, "/sys"))
- grub_util_error("'obppath' not found in parent dirs of %s",
+ grub_util_error(_("'obppath' not found in parent dirs of %s"),
sysfs_path_orig);
continue;
}
snprintf(sysfs_path, sysfs_path_len, "/sys/block/%s", devicenode);
if (!realpath (sysfs_path, rpath))
- grub_util_error ("cannot get the real path of `%s'", sysfs_path);
+ grub_util_error (_("cannot get the real path of `%s'"), sysfs_path);
strcat(rpath, "/device");
if (!realpath (rpath, sysfs_path))
- grub_util_error ("cannot get the real path of `%s'", rpath);
+ grub_util_error (_("cannot get the real path of `%s'"), rpath);
free (rpath);
}
snprintf(buf, PATH_MAX, "%s/vendor", path);
fd = open(buf, O_RDONLY);
if (fd < 0)
- grub_util_error ("cannot open 'vendor' node of `%s'", path);
+ grub_util_error (_("cannot open 'vendor' node of `%s'"), path);
memset(buf, 0, PATH_MAX);
err = read(fd, buf, PATH_MAX);
if (err < 0)
- grub_util_error ("cannot read 'vendor' node of `%s'", path);
+ grub_util_error (_("cannot read 'vendor' node of `%s'"), path);
close(fd);
fd = open(path, O_RDONLY);
if (fd < 0)
- grub_util_error("cannot open SAS PHY ID `%s'\n", path);
+ grub_util_error(_("cannot open SAS PHY ID `%s'\n"), path);
memset (phy, 0, sizeof (phy));
read (fd, phy, sizeof (phy));
name_buf = xmalloc (PATH_MAX);
name_buf = realpath (devname, name_buf);
if (! name_buf)
- grub_util_error ("cannot get the real path of `%s'", devname);
+ grub_util_error (_("cannot get the real path of `%s'"), devname);
device = get_basename (name_buf);
devnode = strip_trailing_digits (name_buf);
New models have no floppy at all. */
strcpy (ofpath, "floppy");
else
- grub_util_error ("unknown device type %s\n", device);
+ grub_util_error (_("unknown device type %s\n"), device);
free (devnode);
free (devicenode);
if (argc != 2)
{
- printf("Usage: grub-ofpathname DEVICE\n");
+ printf(_("Usage: %s DEVICE\n"), argv[0]);
return 1;
}
struct stat st;
if (fflush (fp) == EOF)
- grub_util_error ("fflush failed");
+ grub_util_error (_("fflush failed"));
if (fstat (fileno (fp), &st) == -1)
- grub_util_error ("fstat failed");
+ grub_util_error (_("fstat failed"));
return st.st_size;
}
grub_util_info ("getting the size of %s", path);
if (stat (path, &st) == -1)
- grub_util_error ("cannot stat %s", path);
+ grub_util_error (_("cannot stat %s"), path);
return st.st_size;
}
grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp)
{
if (fseeko (fp, offset, SEEK_SET) == -1)
- grub_util_error ("seek failed");
+ grub_util_error (_("seek failed"));
if (fread (img, 1, size, fp) != size)
- grub_util_error ("read failed");
+ grub_util_error (_("read failed"));
}
char *
fp = fopen (path, "rb");
if (! fp)
- grub_util_error ("cannot open %s", path);
+ grub_util_error (_("cannot open %s"), path);
grub_util_read_at (img, size, 0, fp);
fp = fopen (path, "rb");
if (! fp)
- grub_util_error ("cannot open %s", path);
+ grub_util_error (_("cannot open %s"), path);
if (fread (buf, 1, size, fp) != size)
- grub_util_error ("cannot read %s", path);
+ grub_util_error (_("cannot read %s"), path);
fclose (fp);
}
{
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
if (fseeko (out, offset, SEEK_SET) == -1)
- grub_util_error ("seek failed");
+ grub_util_error (_("seek failed"));
if (fwrite (img, 1, size, out) != size)
- grub_util_error ("write failed");
+ grub_util_error (_("write failed"));
}
void
{
grub_util_info ("writing 0x%x bytes", size);
if (fwrite (img, 1, size, out) != size)
- grub_util_error ("write failed");
+ grub_util_error (_("write failed"));
}
char *
#include <linux/major.h>
#include <linux/raid/md_p.h>
#include <linux/raid/md_u.h>
+#include <grub/i18n.h>
char **
grub_util_raid_getmembers (const char *name, int bootable)
fd = open (name, O_RDONLY);
if (fd == -1)
- grub_util_error ("can't open %s: %s", name, strerror (errno));
+ grub_util_error (_("can't open %s: %s"), name, strerror (errno));
ret = ioctl (fd, RAID_VERSION, &version);
if (ret != 0)
- grub_util_error ("ioctl RAID_VERSION error: %s", strerror (errno));
+ grub_util_error (_("ioctl RAID_VERSION error: %s"), strerror (errno));
if ((version.major != 0 || version.minor != 90)
&& (version.major != 1 || version.minor != 0)
&& (version.major != 1 || version.minor != 1)
&& (version.major != 1 || version.minor != 2))
- grub_util_error ("unsupported RAID version: %d.%d",
+ grub_util_error (_("unsupported RAID version: %d.%d"),
version.major, version.minor);
if (bootable && (version.major != 0 || version.minor != 90))
- grub_util_error ("unsupported RAID version: %d.%d",
+ grub_util_error (_("unsupported RAID version: %d.%d"),
version.major, version.minor);
ret = ioctl (fd, GET_ARRAY_INFO, &info);
if (ret != 0)
- grub_util_error ("ioctl GET_ARRAY_INFO error: %s", strerror (errno));
+ grub_util_error (_("ioctl GET_ARRAY_INFO error: %s"), strerror (errno));
devicelist = xmalloc ((info.nr_disks + 1) * sizeof (char *));
disk.number = i;
ret = ioctl (fd, GET_DISK_INFO, &disk);
if (ret != 0)
- grub_util_error ("ioctl GET_DISK_INFO error: %s", strerror (errno));
+ grub_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (errno));
if (disk.state & (1 << MD_DISK_ACTIVE))
{