Improve gettext support. Stylistic fixes and error handling fixes while

on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-08 19:26:01 +01:00
parent 215c90cb82
commit 9c4b5c13e6
184 changed files with 1175 additions and 959 deletions

View file

@ -910,7 +910,7 @@ grub_util_open_dm (const char *os_dev, struct dm_tree **tree,
*tree = dm_tree_create ();
if (! *tree)
{
grub_puts_ (N_("Failed to create tree"));
grub_puts_ (N_("Failed to create `device-mapper' tree"));
grub_dprintf ("hostdisk", "dm_tree_create failed\n");
return 0;
}
@ -1026,6 +1026,9 @@ grub_util_get_geom_abstraction (const char *dev)
error = geom_gettree (&mesh);
if (error != 0)
/* TRANSLATORS: geom is the name of (k)FreeBSD device framework.
Usually left untranslated.
*/
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
@ -1190,6 +1193,9 @@ grub_util_pull_device (const char *os_dev)
error = geom_gettree (&mesh);
if (error != 0)
/* TRANSLATORS: geom is the name of (k)FreeBSD device framework.
Usually left untranslated.
*/
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)
@ -1228,7 +1234,8 @@ grub_util_pull_device (const char *os_dev)
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 volume `%s': %s"),
lastsubdev, _(grub_errmsg));
}
grub_free (grdev);
@ -1272,7 +1279,8 @@ grub_util_pull_device (const char *os_dev)
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 volume `%s': %s"),
lastsubdev, _(grub_errmsg));
}
grub_free (grdev);
}
@ -1732,7 +1740,8 @@ devmapper_out:
if (fd == -1)
{
grub_error (GRUB_ERR_BAD_DEVICE,
"cannot open `%s' while attempting to get disk wedge info", os_dev);
N_("cannot open `%s': %s"), os_dev,
strerror (errno));
return xstrdup (os_dev);
}
/* We don't call configure_device_driver since this isn't a floppy device name. */
@ -1944,14 +1953,6 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
}
drive = find_system_device (os_dev, &st, 1, 1);
if (!drive)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"no mapping exists for `%s'", os_dev);
grub_util_info ("no mapping exists for `%s'", os_dev);
return 0;
}
sys_disk = convert_system_partition_to_system_disk (os_dev, &st);
if (grub_strcmp (os_dev, sys_disk) == 0)
{
@ -2046,13 +2047,6 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
os_dev);
drive = find_system_device (os_dev, &st, 0, 1);
if (!drive)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"no mapping exists for `%s'", os_dev);
return 0;
}
return make_device_name (drive, -1, -1);
}
else
@ -2192,6 +2186,9 @@ grub_util_get_grub_dev (const char *os_dev)
error = geom_gettree (&mesh);
if (error != 0)
/* TRANSLATORS: geom is the name of (k)FreeBSD device framework.
Usually left untranslated.
*/
grub_util_error (_("couldn't open geom"));
LIST_FOREACH (class, &mesh.lg_class, lg_class)

View file

@ -128,7 +128,7 @@ create_envblk_file (const char *name)
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': %s"), namenew,
grub_util_error (_("cannot write to `%s': %s"), namenew,
strerror (errno));
fsync (fileno (fp));
@ -160,13 +160,13 @@ open_envblk_file (const char *name)
}
if (fseek (fp, 0, SEEK_END) < 0)
grub_util_error (_("cannot seek the file `%s': %s"), name,
grub_util_error (_("cannot seek `%s': %s"), name,
strerror (errno));
size = (size_t) ftell (fp);
if (fseek (fp, 0, SEEK_SET) < 0)
grub_util_error (_("cannot seek the file `%s': %s"), name,
grub_util_error (_("cannot seek `%s': %s"), name,
strerror (errno));
buf = malloc (size);
@ -174,7 +174,7 @@ open_envblk_file (const char *name)
grub_util_error (_("out of memory"));
if (fread (buf, 1, size, fp) != size)
grub_util_error (_("cannot read the file `%s': %s"), name,
grub_util_error (_("cannot read `%s': %s"), name,
strerror (errno));
fclose (fp);
@ -215,7 +215,7 @@ write_envblk (const char *name, grub_envblk_t envblk)
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': %s"), name,
grub_util_error (_("cannot write to `%s': %s"), name,
strerror (errno));
fsync (fileno (fp));

View file

@ -173,7 +173,7 @@ cmd_cp (char *src, char *dest)
if ((int) fwrite (buf, 1, len, ff) != len)
{
grub_util_error (_("cannot write to the file `%s': %s"),
grub_util_error (_("cannot write to `%s': %s"),
dest, strerror (errno));
return 1;
}
@ -251,7 +251,7 @@ cmd_cmp (char *src, char *dest)
}
if ((skip) && (fseeko (ff, skip, SEEK_SET)))
grub_util_error (_("cannot seek the file `%s': %s"), dest,
grub_util_error (_("cannot seek `%s': %s"), dest,
strerror (errno));
read_file (src, cmp_hook);
@ -332,7 +332,7 @@ fstest (int n, char **args)
argv[1] = host_file;
if (execute_command ("loopback", 2, argv))
grub_util_error (_("\`loopback' command fails: %s"), grub_errmsg);
grub_util_error (_("`loopback' command fails: %s"), grub_errmsg);
grub_free (loop_name);
grub_free (host_file);
@ -343,7 +343,7 @@ fstest (int n, char **args)
if (mount_crypt)
{
if (execute_command ("cryptomount", 1, argv))
grub_util_error (_("\`cryptomount' command fails: %s"), grub_errmsg);
grub_util_error (_("`cryptomount' command fails: %s"), grub_errmsg);
}
}
@ -435,7 +435,7 @@ static struct argp_option options[] = {
{N_("cp FILE LOCAL"), 0, 0, OPTION_DOC, N_("Copy FILE to local file LOCAL."), 1},
{N_("cat FILE"), 0, 0 , OPTION_DOC, N_("Copy FILE to standard output."), 1},
{N_("cmp FILE LOCAL"), 0, 0, OPTION_DOC, N_("Compare FILE with local file LOCAL."), 1},
{N_("hex FILE"), 0, 0 , OPTION_DOC, N_("Hex dump FILE."), 1},
{N_("hex FILE"), 0, 0 , OPTION_DOC, N_("Show contents of FILE in hex."), 1},
{N_("crc FILE"), 0, 0 , OPTION_DOC, N_("Get crc32 checksum of FILE."), 1},
{N_("blocklist FILE"), 0, 0, OPTION_DOC, N_("Display blocklist of FILE."), 1},
{N_("xnu_uuid DEVICE"), 0, 0, OPTION_DOC, N_("Compute XNU UUID of the device."), 1},
@ -443,10 +443,12 @@ static struct argp_option options[] = {
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"skip", 's', "N", 0, N_("Skip N bytes from output file."), 2},
{"length", 'n', "N", 0, N_("Handle N bytes in output file."), 2},
{"diskcount", 'c', "N", 0, N_("N input files."), 2},
{"diskcount", 'c', "N", 0, N_("Specify the number of input files."), 2},
{"debug", 'd', "S", 0, N_("Set debug environment variable."), 2},
{"crypto", 'C', NULL, OPTION_ARG_OPTIONAL, N_("Mount crypto devices."), 2},
{"zfs-key", 'K', N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"zfs-key", 'K',
/* TRANSLATORS: "prompt" is a keyword. */
N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"verbose", 'v', NULL, OPTION_ARG_OPTIONAL, N_("print verbose messages."), 2},
{"uncompress", 'u', NULL, OPTION_ARG_OPTIONAL, N_("Uncompress data."), 2},
{0, 0, 0, 0, 0, 0}
@ -489,13 +491,17 @@ argp_parser (int key, char *arg, struct argp_state *state)
f = fopen (arg, "rb");
if (!f)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot open `%s': %s"), arg, strerror (errno));
printf ("\n");
return 0;
}
real_size = fread (buf, 1, 1024, f);
if (real_size < 0)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot read `%s': %s"), arg, strerror (errno));
printf ("\n");
fclose (f);
return 0;
}
@ -528,6 +534,9 @@ argp_parser (int key, char *arg, struct argp_state *state)
}
if (args_count != 0)
{
/* TRANSLATORS: disk count is optional but if it's there it must
be before disk list. So please don't imply disk count as mandatory.
*/
fprintf (stderr, "%s", _("Disk count must precede disks list.\n"));
argp_usage (state);
}

View file

@ -49,7 +49,6 @@ grubdir="`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`"
modules=
install_device=
no_floppy=
force_lba=
recheck=no
debug=no
@ -101,7 +100,6 @@ usage () {
printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
printf " --grub-mkrelpath=%-7s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkrelpath")"
printf " --grub-probe=%-11s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-probe")"
printf " --no-floppy %s\n" "$(gettext "do not probe any floppy drive")"
printf " --allow-floppy %s\n" "$(gettext "Make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes.")"
printf " --recheck %s\n" "$(gettext "delete device map if it already exists")"
printf " --force %s\n" "$(gettext "install even if problems are detected")"
@ -207,7 +205,7 @@ do
grub_probe="`echo "$option" | sed 's/--grub-probe=//'`" ;;
--no-floppy)
no_floppy="--no-floppy" ;;
;;
--recheck)
recheck=yes ;;
--removable)
@ -535,6 +533,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then
elif [ "$disk_module" = ata ]; then
gettext_printf "UUID needed with ata mod, but the filesystem containing %s does not support UUIDs.\n" "${grubdir}" 1>&2
else
# TRANSLATORS: cross-disk refers to /boot being on one disk
# but MBR on another.
gettext_printf "UUID needed with cross-disk installs, but the filesystem containing %s does not support UUIDs.\n" "${grubdir}" 1>&2
fi
@ -633,7 +633,7 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla
dev="`echo $grub_device | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`"
partno="`echo $grub_device | sed -e 's/.*[^0-9]\([0-9]\+\)$/\1/'`"
ofpath="`$ofpathname $dev`" || {
gettext_printf "Couldn't find Open Firmware device tree path for %s.\nYou will have to set \`boot-device' variable manually.\n" "$dev" 1>&2
gettext_printf "Couldn't find IEEE1275 device tree path for %s.\nYou will have to set \`boot-device' variable manually.\n" "$dev" 1>&2
exit 1
}
@ -668,7 +668,7 @@ elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${pla
"$nvsetenv" boot-device "$boot_device" || {
# TRANSLATORS: The %s will be replaced by an external program name.
gettext_printf "\`%s' failed.\n" "$nvsetenv" 1>&2
gettext "You will have to set \`boot-device' variable manually. At the Open Firmware prompt, type:" 1>&2
gettext "You will have to set \`boot-device' variable manually. At the IEEE1275 prompt, type:" 1>&2
echo 1>&2
echo " setenv boot-device $boot_device" 1>&2
exit 1

View file

@ -184,7 +184,7 @@ for x in ${GRUB_TERMINAL_OUTPUT}; do
fi
if [ -z "${GRUB_FONT_PATH}" ] ; then
if [ "x$termoutdefault" != "x1" ]; then
gettext "No font for gfxterm found." >&2; echo >&2 ; exit 1
gettext "No font for video terminal found." >&2; echo >&2 ; exit 1
fi
GRUB_TERMINAL_OUTPUT=
fi

View file

@ -31,7 +31,7 @@ if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/`echo grub-mkrelpath | sed "${transform}"`"
fi
if $(which gettext >/dev/null 2>/dev/null) ; then
if which gettext >/dev/null 2>/dev/null; then
:
else
gettext () {

View file

@ -591,7 +591,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
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 font feature parameters: %x\n"),
grub_be_to_cpu16 (feature->params));
switch (feattag)
{
@ -621,7 +621,8 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
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 font feature 0x%x (%s)\n"),
feattag, str);
}
}
}
@ -692,8 +693,8 @@ print_glyphs (struct grub_font_info *font_info)
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);
@ -760,7 +761,7 @@ write_font_ascii_bitmap (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error (_("cannot write to the file `%s': %s"), output_file,
grub_util_error (_("cannot write to `%s': %s"), output_file,
strerror (errno));
int correct_size;
@ -797,7 +798,7 @@ write_font_width_spec (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error (_("cannot write to the file `%s': %s"), output_file,
grub_util_error (_("cannot write to `%s': %s"), output_file,
strerror (errno));
for (glyph = font_info->glyphs_sorted;
@ -821,7 +822,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
file = fopen (output_file, "wb");
if (! file)
grub_util_error (_("cannot write to the file `%s': %s"), output_file,
grub_util_error (_("cannot write to `%s': %s"), output_file,
strerror (errno));
offset = 0;
@ -961,7 +962,7 @@ static struct argp_option options[] = {
{"index", 'i', N_("NUM"), 0, N_("set face index"), 0},
{"range", 'r', N_("FROM-TO[,FROM-TO]"), 0, N_("set font range"), 0},
{"name", 'n', N_("NAME"), 0, N_("set font family name"), 0},
{"size", 's', N_("STR"), 0, N_("set font size"), 0},
{"size", 's', N_("SIZE"), 0, N_("set font size"), 0},
{"desc", 'd', N_("NUM"), 0, N_("set font descent"), 0},
{"asce", 'c', N_("NUM"), 0, N_("set font ascent"), 0},
{"bold", 'b', 0, 0, N_("convert to bold font"), 0},
@ -1128,7 +1129,7 @@ main (int argc, char *argv[])
if (arguments.file_format == ASCII_BITMAPS
&& arguments.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 (it always uses ASCII)."));
return 1;
}
else if (arguments.file_format == ASCII_BITMAPS)

View file

@ -1633,10 +1633,11 @@ generate_image (const char *dir, char *prefix, FILE *out, const char *outname,
static struct argp_option options[] = {
{"directory", 'd', N_("DIR"), 0, N_("use images and modules under DIR [default=%s/<platform>]"), 0},
{"prefix", 'p', N_("DIR"), 0, N_("set grub_prefix directory [default=%s]"), 0},
{"prefix", 'p', N_("DIR"), 0, N_("set prefix directory [default=%s]"), 0},
{"memdisk", 'm', N_("FILE"), 0, N_("embed FILE as a memdisk image"), 0},
{"config", 'c', N_("FILE"), 0, N_("embed FILE as boot config"), 0},
{"note", 'n', 0, 0, N_("add NOTE segment for CHRP Open Firmware"), 0},
{"config", 'c', N_("FILE"), 0, N_("embed FILE as an early config"), 0},
/* TRANSLATORS: NOTE is a name of segment. */
{"note", 'n', 0, 0, N_("add NOTE segment for CHRP IEEE1275"), 0},
{"output", 'o', N_("FILE"), 0, N_("output a generated image to FILE [default=stdout]"), 0},
{"format", 'O', N_("FORMAT"), 0, 0, 0},
{"compression", 'C', "(xz|none|auto)", 0, N_("choose the compression to use"), 0},

View file

@ -389,7 +389,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
*target, offset);
break;
default:
grub_util_error ("unknown relocation type 0x%x",
grub_util_error (_("relocation 0x%x is not implemented yet"),
ELF_R_TYPE (info));
break;
}
@ -432,7 +432,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
}
default:
grub_util_error ("unknown relocation type %d",
grub_util_error (_("relocation 0x%x is not implemented yet"),
ELF_R_TYPE (info));
break;
}
@ -505,7 +505,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
break;
default:
grub_util_error ("unknown relocation type 0x%x",
grub_util_error (_("relocation 0x%x is not implemented yet"),
ELF_R_TYPE (info));
break;
}
@ -730,7 +730,7 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out,
#endif
break;
default:
grub_util_error ("unknown relocation type 0x%x",
grub_util_error (_("relocation 0x%x is not implemented yet"),
ELF_R_TYPE (info));
break;
}

View file

@ -289,7 +289,7 @@ lookup (char *code, int shift)
if (strcmp (code, console_grub_equivalences_common[i].layout) == 0)
return console_grub_equivalences_common[i].grub;
fprintf (stderr, _("Unknown key %s\n"), code);
fprintf (stderr, _("Unknown keyboard scan identifier %s\n"), code);
return '\0';
}
@ -385,7 +385,7 @@ write_keymaps (FILE *in, FILE *out)
if (keycode_usb == 0
|| keycode_usb >= GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE)
{
fprintf (stderr, _("Unknown keycode 0x%02x\n"), keycode_linux);
fprintf (stderr, _("Unknown keyboard scan code 0x%02x\n"), keycode_linux);
continue;
}
if (keycode_usb < GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE)
@ -403,7 +403,7 @@ write_keymaps (FILE *in, FILE *out)
if (ok == 0)
{
fprintf (stderr, "%s", _("ERROR: no keycodes found. Check the input.\n"));
fprintf (stderr, "%s", _("ERROR: no valid keyboard layout found. Check the input.\n"));
exit (1);
}

View file

@ -114,7 +114,7 @@ main (int argc, char *argv[])
.buflen = 64,
.saltlen = 64
};
char *bufhex, *salthex;
char *bufhex, *salthex, *result;
gcry_err_code_t gcry_err;
grub_uint8_t *buf, *salt;
ssize_t nr;
@ -243,8 +243,14 @@ main (int argc, char *argv[])
hexify (bufhex, buf, arguments.buflen);
hexify (salthex, salt, arguments.saltlen);
printf (_("Your PBKDF2 is grub.pbkdf2.sha512.%d.%s.%s\n"),
arguments.count, salthex, bufhex);
result = xmalloc (sizeof ("grub.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S")
+ arguments.buflen * 2 + arguments.saltlen * 2);
snprintf (result, sizeof ("grub.pbkdf2.sha512.XXXXXXXXXXXXXXXXXXX.S.S")
+ arguments.buflen * 2 + arguments.saltlen * 2,
"grub.pbkdf2.sha512.%d.%s.%s",
arguments.count, salthex, bufhex);
printf (_("PBKDF2 hash of your password is %s\n"), result);
memset (buf, 0, arguments.buflen);
memset (bufhex, 0, 2 * arguments.buflen);
free (buf);

View file

@ -73,7 +73,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
static struct argp argp = {
options, argp_parser, N_("PATH"),
N_("Make a system path relative to its root."),
N_("Transform a sytem filename into GRUB one."),
NULL, NULL, NULL
};

View file

@ -52,7 +52,7 @@ xorriso=xorriso
# Print the usage.
usage () {
gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
gettext "Make GRUB rescue image."; echo
gettext "Make GRUB CDROM, disk, pendrive and floppy bootable image."; echo
echo
printf " -h, --help %s\n" "$(gettext "print this message and exit")"
printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
@ -62,7 +62,7 @@ usage () {
printf " --xorriso=%-14s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as xorriso [optional]")"
printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
echo
gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by: %s\n" "xorriso -as mkisofs -help" "$self"
gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by the output of \`%s'\n" "xorriso -as mkisofs -help" "$self"
echo
gettext "Option -- switches to native xorriso command mode."; echo
echo

View file

@ -47,6 +47,8 @@ source=
usage () {
formats="i386-coreboot i386-multiboot i386-pc i386-pc-pxe i386-efi i386-ieee1275 i386-qemu x86_64-efi mipsel-yeeloong-flash mipsel-fuloong2f-flash mipsel-loongson-elf powerpc-ieee1275 sparc64-ieee1275-raw sparc64-ieee1275-aout ia64-efi mips-arc mipsel-qemu_mips-elf mips-qemu_mips-flash mipsel-qemu_mips-flash mips-qemu_mips-elf"
gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
gettext "Generate a standalone image (containing all modules) in the selected format"
echo
gettext "Make GRUB rescue image."; echo
echo
printf " -h, --help %s\n" "$(gettext "print this message and exit")"
@ -62,8 +64,6 @@ usage () {
printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
echo
gettext_printf "%s generates a standalone image (containing all modules) in the selected format" "$self"
echo
gettext "Report bugs to <bug-grub@gnu.org>."; echo
}

View file

@ -407,7 +407,9 @@ static struct argp_option options[] = {
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"debug", 'd', "S", 0, N_("Set debug environment variable."), 2},
{"crypto", 'C', NULL, OPTION_ARG_OPTIONAL, N_("Mount crypto devices."), 2},
{"zfs-key", 'K', N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"zfs-key", 'K',
/* TRANSLATORS: "prompt" is a keyword. */
N_("FILE|prompt"), 0, N_("Load zfs crypto key."), 2},
{"verbose", 'v', NULL, OPTION_ARG_OPTIONAL, N_("print verbose messages."), 2},
{0, 0, 0, 0, 0, 0}
};
@ -449,13 +451,18 @@ argp_parser (int key, char *arg, struct argp_state *state)
f = fopen (arg, "rb");
if (!f)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot open `%s': %s"), arg, strerror (errno));
printf ("\n");
return 0;
}
real_size = fread (buf, 1, 1024, f);
if (real_size < 0)
{
printf (_("Error loading file %s: %s\n"), arg, strerror (errno));
printf (_("%s: error:"), program_name);
printf (_("cannot read `%s': %s"), arg,
strerror (errno));
printf ("\n");
fclose (f);
return 0;
}

View file

@ -425,7 +425,8 @@ probe (const char *path, char **device_names, char delim)
{
char *label;
if (! fs->label)
grub_util_error (_("%s does not support labels"), fs->name);
grub_util_error (_("filesystem `%s' does not support labels"),
fs->name);
if (fs->label (dev, &label) != GRUB_ERR_NONE)
grub_util_error ("%s", _(grub_errmsg));
@ -688,12 +689,11 @@ static struct argp_option options[] = {
{"device-map", 'm', N_("FILE"), 0,
N_("use FILE as the device map [default=%s]"), 0},
{"target", 't', "(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|cryptodisk_uuid|msdos_parttype)", 0,
N_("print filesystem module, GRUB drive, system device, partition map module, abstraction module or CRYPTO UUID [default=fs]"), 0},
N_("print filesystem module, GRUB drive, system device, partition map module, abstraction module or cryptographic container UUID [default=fs]"), 0},
{"verbose", 'v', 0, 0, N_("print verbose messages."), 0},
{ 0, 0, 0, 0, 0, 0 }
};
static char *
help_filter (int key, const char *text, void *input __attribute__ ((unused)))
{

View file

@ -431,14 +431,14 @@ setup (const char *dir,
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 embedding"),
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 embedding"),
fs->name);
goto unable_to_embed;
}
@ -542,16 +542,17 @@ setup (const char *dir,
unable_to_embed:
#ifdef GRUB_MACHINE_PCBIOS
if (dest_dev->disk->id != root_dev->disk->id
|| dest_dev->disk->dev->id != root_dev->disk->dev->id)
grub_util_error (_("embedding is not possible, but this is required for "
"cross-disk, RAID and LVM install"));
#else
if (dest_dev->disk->dev->id != root_dev->disk->dev->id)
grub_util_error (_("embedding is not possible, but this is required for "
"RAID and LVM install"));
#ifdef GRUB_MACHINE_PCBIOS
if (dest_dev->disk->id != root_dev->disk->id
|| dest_dev->disk->dev->id != root_dev->disk->dev->id)
/* TRANSLATORS: cross-disk refers to /boot being on one disk
but MBR on another. */
grub_util_error (_("embedding is not possible, but this is required for "
"cross-disk install"));
#endif
grub_util_warn (_("Embedding is not possible. GRUB can only be installed in this "
@ -740,11 +741,9 @@ static struct argp_option options[] = {
{"directory", 'd', N_("DIR"), 0,
N_("Use GRUB files in the directory DIR [default=%s]"), 0},
{"device-map", 'm', N_("FILE"), 0,
N_("Use FILE as the device map [default=%s]"), 0},
{"root-device", 'r', N_("DEVICE"), 0,
N_("Use DEV as the root device [default=guessed]"), 0},
N_("use FILE as the device map [default=%s]"), 0},
{"force", 'f', 0, 0,
N_("Install even if problems are detected"), 0},
N_("install even if problems are detected"), 0},
{"skip-fs-probe",'s',0, 0,
N_("Do not probe for filesystems in DEVICE"), 0},
{"verbose", 'v', 0, 0, N_("print verbose messages."), 0},

View file

@ -63,18 +63,18 @@ for drv in $drives ; do
# Check for Vista bootmgr.
if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then
OS="$(gettext_quoted "Windows Vista bootmgr")"
OS="$(gettext_quoted "Windows Vista/7 (loader)")"
# Check for NTLDR.
elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then
OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="$(gettext_quoted "Windows NT/2000/XP loader")"
OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="$(gettext_quoted "Windows NT/2000/XP (loader)")"
needmap=t
else
continue
fi
# Get boot /dev/ice.
# Get boot device.
dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue
gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&2

View file

@ -114,7 +114,7 @@ grub_util_read_image (const char *path)
strerror (errno));
if (fread (img, 1, size, fp) != size)
grub_util_error (_("cannot read the file `%s': %s"), path,
grub_util_error (_("cannot read `%s': %s"), path,
strerror (errno));
fclose (fp);
@ -138,7 +138,7 @@ grub_util_load_image (const char *path, char *buf)
strerror (errno));
if (fread (buf, 1, size, fp) != size)
grub_util_error (_("cannot read the file `%s': %s"), path,
grub_util_error (_("cannot read `%s': %s"), path,
strerror (errno));
fclose (fp);
@ -150,10 +150,10 @@ grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out,
{
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
if (fseeko (out, offset, SEEK_SET) == -1)
grub_util_error (_("cannot seek the file `%s': %s"),
grub_util_error (_("cannot seek `%s': %s"),
name, strerror (errno));
if (fwrite (img, 1, size, out) != size)
grub_util_error (_("cannot write to the file `%s': %s"),
grub_util_error (_("cannot write to `%s': %s"),
name, strerror (errno));
}
@ -163,12 +163,14 @@ grub_util_write_image (const char *img, size_t size, FILE *out,
{
grub_util_info ("writing 0x%x bytes", size);
if (fwrite (img, 1, size, out) != size)
if (!name)
grub_util_error (_("cannot write to the stdout: %s"),
strerror (errno));
else
grub_util_error (_("cannot write to the file `%s': %s"),
name, strerror (errno));
{
if (!name)
grub_util_error (_("cannot write to the stdout: %s"),
strerror (errno));
else
grub_util_error (_("cannot write to `%s': %s"),
name, strerror (errno));
}
}
char *

View file

@ -20,33 +20,37 @@ set -e
# Initialize some variables.
transform="@program_transform_name@"
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
libdir="@libdir@"
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
platform=@platform@
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
datarootdir="@datarootdir@"
datadir="@datadir@"
self=`basename $0`
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
# Usage: usage
# Print the usage.
usage () {
gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
gettext "Make GRUB rescue image."; echo
gettext "Make GRUB CDROM, disk, pendrive and floppy bootable image."; echo
echo
printf " -h, --help %s\n" "$(gettext "print this message and exit")"
printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
echo
gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by: %s\n" "genisoimage -help" "$self"
gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by the output of \`%s'\n" "genisoimage -help" "$self"
echo
gettext "Report bugs to <bug-grub@gnu.org>."; echo
}