+2010-01-16 Carles Pina i Estany <carles@pina.cat>
+
+ * util/misc.c (grub_util_warn): Gettextizze, print full stop after
+ the message.
+ (grub_util_info): Likewise.
+ (grub_util_error): Likewise.
+ * util/elf/grub-mkimage.c: Fix capitalisation, quotes, full stops
+ and/or new lines in `grub_util_warna', `grub_util_info',
+ `grub_util_error' calls.
+ * util/getroot.c: Likewise.
+ * util/grub-editenv.c: Likewise.
+ * util/grub-emu.c: Likewise.
+ * util/grub-fstest.c: Likewise.
+ * util/grub-mkdevicemap.c: Likewise.
+ * util/grub-mkfont.c: Likewise.
+ * util/grub-mkpasswd-pbkdf2.c: Likewise.
+ * util/grub-mkrelpath.c: Likewise.
+ * util/grub-pe2elf.c: Likewise.
+ * util/grub-probe.c: Likewise.
+ * util/hostdisk.c: Likewise.
+ * util/i386/efi/grub-mkimage.c: Likewise.
+ * util/i386/pc/grub-mkimage.c: Likewise.
+ * util/i386/pc/grub-setup.c: Likewise.
+ * util/ieee1275/ofpath.c: Likewise.
+ * util/mkisofs/eltorito.c: Likewise.
+ * util/mkisofs/rock.c: Likewise.
+ * util/mkisofs/write.c: Likewise.
+ * util/raid.c: Likewise.
+ * util/sparc64/ieee1275/grub-mkimage.c: Likewise.
+ * util/sparc64/ieee1275/grub-setup.c: Likewise.
+
2010-01-15 Vladimir Serbinenko <phcoder@gmail.com>
Enable multiboot on non-pc.
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 ("\
Usage: %s -o FILE [OPTION]... [MODULES]\n\
saved_cwd = xgetcwd ();
if (chdir (dir) < 0)
- grub_util_error ("Cannot change directory to `%s'", dir);
+ grub_util_error ("cannot change directory to `%s'", dir);
abs_dir = xgetcwd ();
strip_extra_slashes (abs_dir);
prev_dir = xstrdup (abs_dir);
if (stat (".", &prev_st) < 0)
- grub_util_error ("Cannot stat `%s'", dir);
+ grub_util_error ("cannot stat `%s'", dir);
if (! S_ISDIR (prev_st.st_mode))
grub_util_error ("`%s' is not a directory", dir);
while (1)
{
if (chdir ("..") < 0)
- grub_util_error ("Cannot change directory to the parent");
+ grub_util_error ("cannot change directory to the parent");
if (stat (".", &st) < 0)
- grub_util_error ("Cannot stat current directory");
+ grub_util_error ("cannot stat current directory");
if (! S_ISDIR (st.st_mode))
- grub_util_error ("Current directory is not a directory???");
+ grub_util_error ("current directory is not a directory???");
if (prev_st.st_dev != st.st_dev || prev_st.st_ino == st.st_ino)
break;
strip_extra_slashes (prefix);
if (chdir (saved_cwd) < 0)
- grub_util_error ("Cannot change directory to `%s'", dir);
+ grub_util_error ("cannot change directory to `%s'", dir);
#ifdef __CYGWIN__
if (st.st_dev != (DEV_CYGDRIVE_MAJOR << 16))
if (res)
{
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);
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);
struct stat st;
if (stat (dir, &st) < 0)
- grub_util_error ("Cannot stat `%s'", dir);
+ grub_util_error ("cannot stat `%s'", dir);
#ifdef __CYGWIN__
/* Cygwin specific function. */
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);
break;
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);
usage (int status)
{
if (status)
- fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n");
+ fprintf (stderr, "Try `grub-editenv --help' for more information.\n");
else
printf ("\
Usage: grub-editenv [OPTIONS] [FILENAME] COMMAND\n\
{
if (status)
fprintf (stderr,
- "Try ``grub-emu --help'' for more information.\n");
+ "Try `grub-emu --help' for more information.\n");
else
printf (
"Usage: grub-emu [OPTION]...\n"
{
char *device_name = grub_guess_root_device (dir);
if (! device_name)
- grub_util_error ("cannot find a device for %s.\n", dir);
+ grub_util_error ("cannot find a device for %s", dir);
root_dev = grub_util_get_grub_dev (device_name);
if (! root_dev)
{
grub_util_info ("guessing the root device failed, because of `%s'",
grub_errmsg);
- grub_util_error ("Cannot guess the root device. Specify the option ``--root-device''.");
+ grub_util_error ("cannot guess the root device. Specify the option `--root-device'");
}
}
cmd = grub_command_find (name);
if (! cmd)
- grub_util_error ("Can\'t find command %s", name);
+ grub_util_error ("can\'t find command %s", name);
return (cmd->func) (cmd, n, args);
}
dev = grub_device_open (0);
if ((! dev) || (! dev->disk))
- grub_util_error ("Can\'t open device.");
+ grub_util_error ("can\'t open device");
- grub_util_info ("total sectors : %lld.",
+ grub_util_info ("total sectors : %lld",
(unsigned long long) dev->disk->total_sectors);
if (! leng)
len = (leng > BUF_SIZE) ? BUF_SIZE : leng;
if (grub_disk_read (dev->disk, 0, skip, len, buf))
- grub_util_error ("Disk read fails at offset %lld, length %d.",
+ grub_util_error ("disk read fails at offset %lld, length %d",
skip, len);
if (hook (skip, buf, len))
file = grub_file_open (pathname);
if (!file)
{
- grub_util_error ("cannot open file %s.", pathname);
+ grub_util_error ("cannot open file %s", pathname);
return;
}
- grub_util_info ("file size : %lld.", (unsigned long long) file->size);
+ grub_util_info ("file size : %lld", (unsigned long long) file->size);
if (skip > file->size)
{
- grub_util_error ("invalid skip value %lld.", (unsigned long long) skip);
+ grub_util_error ("invalid skip value %lld", (unsigned long long) skip);
return;
}
sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len);
if (sz < 0)
{
- grub_util_error ("read error at offset %llu.", ofs);
+ grub_util_error ("read error at offset %llu", ofs);
break;
}
if ((int) fwrite (buf, 1, len, ff) != len)
{
- grub_util_error ("write error.");
+ grub_util_error ("write error");
return 1;
}
ff = fopen (dest, "wb");
if (ff == NULL)
{
- grub_util_error ("open error.");
+ grub_util_error ("open error");
return;
}
read_file (src, cp_hook);
{
if ((int) fread (buf_1, 1, len, ff) != len)
{
- grub_util_error ("read error at offset %llu.", ofs);
+ grub_util_error ("read error at offset %llu", ofs);
return 1;
}
for (i = 0; i < len; i++, ofs++)
if (buf_1[i] != buf[i])
{
- grub_util_error ("compare fail at offset %llu.", ofs);
+ grub_util_error ("compare fail at offset %llu", ofs);
return 1;
}
}
ff = fopen (dest, "rb");
if (ff == NULL)
{
- grub_util_error ("open error.");
+ grub_util_error ("open error");
return;
}
if ((skip) && (fseeko (ff, skip, SEEK_SET)))
- grub_util_error ("seek error.");
+ grub_util_error ("seek error");
read_file (src, cmp_hook);
fclose (ff);
for (i = 0; i < num_disks; i++)
{
if (grub_strlen (images[i]) + 7 > sizeof (host_file))
- grub_util_error ("Pathname %s too long.", images[i]);
+ grub_util_error ("pathname %s too long", images[i]);
grub_sprintf (loop_name, "loop%d", i);
grub_sprintf (host_file, "(host)%s", images[i]);
if (execute_command ("loopback", 3, argv))
- grub_util_error ("loopback command fails.");
+ grub_util_error ("loopback command fails");
}
grub_lvm_fini ();
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 ("\
Usage: %s [OPTION]... IMAGE_PATH COMMANDS\n\
{
if (status)
fprintf (stderr,
- "Try ``%s --help'' for more information.\n", program_name);
+ "Try `%s --help' for more information.\n", program_name);
else
printf ("\
Usage: %s [OPTION]...\n\
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 ("\
Usage: %s [OPTIONS] FONT_FILES\n\
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 (! 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");
if (FT_New_Face (ft_lib, argv[optind], font_index, &ft_face))
{
- grub_util_info ("Can't open file %s, index %d\n", argv[optind],
+ grub_util_info ("can't open file %s, index %d", argv[optind],
font_index);
continue;
}
usage (int status)
{
if (status)
- fprintf (stderr, "Try ``grub-scrypt --help'' for more information.\n");
+ fprintf (stderr, "Try `grub-scrypt --help' for more information.\n");
else
printf ("\
Usage: grub-scrypt [OPTIONS]\n\
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");
}
/* Disable echoing. Based on glibc. */
/* Restore the original setting. */
if (tty_changed)
(void) tcsetattr (fileno (in), TCSAFLUSH, &s);
- grub_util_error ("Failure to read password");
+ grub_util_error ("failure to read password");
}
if (nr >= 1 && pass1[nr-1] == '\n')
pass1[nr-1] = 0;
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("Failure to read password");
+ grub_util_error ("failure to read password");
}
if (nr >= 1 && pass2[nr-1] == '\n')
pass2[nr-1] = 0;
free (bufhex);
free (salthex);
free (salt);
- grub_util_error ("Passwords don't match");
+ grub_util_error ("passwords don't match");
}
memset (pass2, 0, strlen (pass2));
free (pass2);
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 (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");
}
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);
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 ("\
Usage: %s [OPTIONS] PATH\n\
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 ("\
Usage: %s [OPTIONS] input [output]\n\
char name[5 + strlen (pe_shdr->name)];
if (num_sections >= MAX_SECTIONS)
- grub_util_error ("Too many sections");
+ grub_util_error ("too many sections");
sprintf (name, ".rel%s", pe_shdr->name);
if ((pe_rel->symtab_index >= pe_chdr->num_symbols) ||
(symtab_map[pe_rel->symtab_index] == -1))
- grub_util_error ("Invalid symbol");
+ grub_util_error ("invalid symbol");
if (pe_rel->type == GRUB_PE32_REL_I386_DIR32)
type = R_386_32;
else if (pe_rel->type == GRUB_PE32_REL_I386_REL32)
type = R_386_PC32;
else
- grub_util_error ("Unknown pe relocation type %d\n", pe_rel->type);
+ grub_util_error ("unknown pe relocation type %d\n", pe_rel->type);
ofs = pe_rel->offset - pe_sec->virtual_address;
addr = (grub_uint32_t *)(image + pe_sec->raw_data_offset + ofs);
code = image[pe_sec->raw_data_offset + ofs - 1];
if (((code != 0xe8) && (code != 0xe9)) || (*addr))
- grub_util_error ("Invalid relocation (%x %x)", code, *addr);
+ grub_util_error ("invalid relocation (%x %x)", code, *addr);
modified = 1;
if (symtab[symtab_map[pe_rel->symtab_index]].st_shndx)
{
if (symtab[symtab_map[pe_rel->symtab_index]].st_shndx
!= shdr[i].sh_info)
- grub_util_error ("Cross section call is not allowed");
+ grub_util_error ("cross section call is not allowed");
*addr = (symtab[symtab_map[pe_rel->symtab_index]].st_value
- ofs - 4);
pe_chdr = (struct grub_pe32_coff_header *) image;
if (grub_le_to_cpu16 (pe_chdr->machine) != GRUB_PE32_MACHINE_I386)
- grub_util_error ("Invalid coff image");
+ grub_util_error ("invalid coff image");
strtab = xmalloc (STRTAB_BLOCK);
strtab_max = STRTAB_BLOCK;
{
if (disk->partition == NULL)
{
- grub_util_info ("No partition map found for %s", disk->name);
+ grub_util_info ("no partition map found for %s", disk->name);
return;
}
{
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (! grub_util_check_char_device (device_name))
- grub_util_error ("%s is not a character device.\n", 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.\n", device_name);
+ grub_util_error ("%s is not a block device", device_name);
#endif
}
else
device_name = grub_guess_root_device (path);
if (! device_name)
- grub_util_error ("cannot find a device for %s (is /dev mounted?).\n", 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.\n", device_name);
+ grub_util_error ("cannot find a GRUB drive for %s. Check your device.map", device_name);
if (print == PRINT_DRIVE)
{
{
if (status)
fprintf (stderr,
- "Try ``%s --help'' for more information.\n", program_name);
+ "Try `%s --help' for more information.\n", program_name);
else
printf ("\
Usage: %s [OPTION]... [PATH|DEVICE]\n\
fp = fopen (dev_map, "r");
if (! fp)
{
- grub_util_info (_("Cannot open `%s'"), dev_map);
+ grub_util_info (_("cannot open `%s'"), dev_map);
return;
}
symbolic links. */
map[drive].device = xmalloc (PATH_MAX);
if (! realpath (p, map[drive].device))
- grub_util_error ("Cannot get the real path of `%s'", p);
+ grub_util_error ("cannot get the real path of `%s'", p);
#else
map[drive].device = xstrdup (p);
#endif
if ((ELF_R_TYPE (info) == R_X86_64_32) ||
(ELF_R_TYPE (info) == R_X86_64_32S))
{
- grub_util_error ("Can\'t add fixup entry for R_X86_64_32(S)");
+ grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)");
}
else if (ELF_R_TYPE (info) == R_X86_64_64)
{
usage (int status)
{
if (status)
- fprintf (stderr, "Try ``grub-mkimage --help'' for more information.\n");
+ fprintf (stderr, "Try `grub-mkimage --help' for more information.\n");
else
printf ("\
Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\
#ifdef GRUB_MACHINE_PCBIOS
if (GRUB_KERNEL_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER)
- grub_util_error (_("Core image is too big (%p > %p)\n"),
+ grub_util_error (_("core image is too big (%p > %p)"),
GRUB_KERNEL_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER);
#endif
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 (_("\
Usage: grub-mkimage [OPTION]... [MODULES]\n\
sector, offset, length);
if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("The first sector of the core file is not sector-aligned"));
+ grub_util_error (_("the first sector of the core file is not sector-aligned"));
first_sector = sector;
}
sector, offset, length, (unsigned) current_segment);
if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("Non-sector-aligned data is found in the core file"));
+ grub_util_error (_("non-sector-aligned data is found in the core file"));
if (block != first_block
&& (grub_le_to_cpu64 (prev->start)
block--;
if (block->len)
- grub_util_error (_("The sectors of the core file are too fragmented"));
+ grub_util_error (_("the sectors of the core file are too fragmented"));
}
last_length = length;
boot_path = grub_util_get_path (dir, boot_file);
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("The size of `%s' is not %u"),
+ grub_util_error (_("the size of `%s' is not %u"),
boot_path, GRUB_DISK_SECTOR_SIZE);
boot_img = grub_util_read_image (boot_path);
free (boot_path);
core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
>> GRUB_DISK_SECTOR_BITS);
if (core_size < GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("The size of `%s' is too small"), core_path);
+ grub_util_error (_("the size of `%s' is too small"), core_path);
else if (core_size > 0xFFFF * GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("The size of `%s' is too large"), core_path);
+ grub_util_error (_("the size of `%s' is too large"), core_path);
core_img = grub_util_read_image (core_path);
grub_fs_t fs;
fs = grub_fs_probe (dest_dev);
if (! fs)
- grub_util_error (_("Unable to identify a filesystem in %s; safety check can't be performed"),
+ grub_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"),
dest_dev->disk->name);
if (! fs->reserved_first_sector)
bsd_part = -1;
}
else
- grub_util_error (_("No DOS-style partitions found"));
+ grub_util_error (_("no DOS-style partitions found"));
}
else
dos_part = bsd_part = -1;
unable_to_embed:
if (must_embed)
- grub_util_error (_("Embedding is not possible, but this is required when "
- "the root device is on a RAID array or LVM volume."));
+ grub_util_error (_("embedding is not possible, but this is required when "
+ "the root device is on a RAID array or LVM volume"));
grub_util_warn (_("Embedding is not possible. GRUB can only be installed in this "
"setup by using blocklists. However, blocklists are UNRELIABLE and "
"its use is discouraged."));
if (! force)
- grub_util_error (_("If you really want blocklists, use --force."));
+ grub_util_error (_("if you really want blocklists, use --force"));
/* Make sure that GRUB reads the identical image as the OS. */
tmp_img = xmalloc (core_size);
}
if (i == MAX_TRIES)
- grub_util_error (_("Cannot read `%s' correctly"), core_path_dev);
+ grub_util_error (_("cannot read `%s' correctly"), core_path_dev);
/* Clean out the blocklists. */
block = first_block;
block--;
if ((char *) block <= core_img)
- grub_util_error (_("No terminator in the core image"));
+ grub_util_error (_("no terminator in the core image"));
}
/* Now read the core image to determine where the sectors are. */
file->read_hook = save_first_sector;
if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE)
!= GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("Failed to read the first sector of the core image"));
+ grub_util_error (_("failed to read the first sector of the core image"));
block = first_block;
file->read_hook = save_blocklists;
if (grub_file_read (file, tmp_img, core_size - GRUB_DISK_SECTOR_SIZE)
!= (grub_ssize_t) core_size - GRUB_DISK_SECTOR_SIZE)
- grub_util_error (_("Failed to read the rest sectors of the core image"));
+ grub_util_error (_("failed to read the rest sectors of the core image"));
grub_file_close (file);
grub_util_info ("opening the core image `%s'", core_path);
fp = fopen (core_path, "r+b");
if (! fp)
- grub_util_error (_("Cannot open `%s'"), core_path);
+ grub_util_error (_("cannot open `%s'"), core_path);
grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE * 2, fp);
fclose (fp);
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 (_("\
Usage: grub-setup [OPTION]... DEVICE\n\
\n\
Set up images to boot from DEVICE.\n\
-DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n\
+DEVICE must be a GRUB device (e.g. `(hd0,1)').\n\
\n\
-b, --boot-image=FILE use FILE as the boot image [default=%s]\n\
-c, --core-image=FILE use FILE as the core image [default=%s]\n\
char *tmp = get_device_name (root_dev);
if (! tmp)
- grub_util_error (_("Invalid root device `%s'"), root_dev);
+ grub_util_error (_("invalid root device `%s'"), root_dev);
tmp = xstrdup (tmp);
free (root_dev);
{
grub_util_info ("guessing the root device failed, because of `%s'",
grub_errmsg);
- grub_util_error (_("Cannot guess the root device. Specify the option ``--root-device''."));
+ grub_util_error (_("cannot guess the root device. Specify the option `--root-device'"));
}
}
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 (devname);
devnode = strip_trailing_digits (devname);
{
va_list ap;
- fprintf (stderr, "%s: warn: ", program_name);
+ fprintf (stderr, _("%s: warn:"), program_name);
+ fprintf (stderr, " ");
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
- fputc ('\n', stderr);
+ fprintf (stderr, ".\n");
fflush (stderr);
}
{
va_list ap;
- fprintf (stderr, "%s: info: ", program_name);
+ fprintf (stderr, _("%s: info:"), program_name);
+ fprintf (stderr, " ");
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
- fputc ('\n', stderr);
+ fprintf (".\n", stderr);
fflush (stderr);
}
}
{
va_list ap;
- fprintf (stderr, "%s: error: ", program_name);
+ fprintf (stderr, _("%s: error:"), program_name);
+ fprintf (stderr, " ");
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
- fputc ('\n', stderr);
+ fprintf (stderr, ".\n");
exit (1);
}
struct eltorito_boot_info bi_table;
bootimage = fopen (de->whole_name, "r+b");
if (bootimage == NULL)
- error (1, errno, _("Error opening boot image file '%s' for update"),
+ error (1, errno, _("Error opening boot image file `%s' for update"),
de->whole_name);
/* Compute checksum of boot image, sans 64 bytes */
total_len = 0;
while ((len = fread (csum_buffer, 1, SECTOR_SIZE, bootimage)) > 0)
{
if (total_len & 3)
- error (1, 0, _("Odd alignment at non-end-of-file in boot image '%s'"),
+ error (1, 0, _("Odd alignment at non-end-of-file in boot image `%s'"),
de->whole_name);
if (total_len < 64)
memset (csum_buffer, 0, 64 - total_len);
}
if (total_len != de->size)
- error (1, 0, _("Boot image file '%s' changed unexpectedly"),
+ error (1, 0, _("Boot image file `%s' changed unexpectedly"),
de->whole_name);
/* End of file, set position to byte 8 */
fseeko (bootimage, (off_t) 8, SEEK_SET);
* the symbolic link won't fit into one SL System Use Field
* print an error message and continue with splited one
*/
- fprintf (stderr, _("symbolic link ``%s'' too long for one SL System Use Field, splitting"), cpnt);
+ fprintf (stderr, _("symbolic link `%s' too long for one SL System Use Field, splitting"), cpnt);
}
if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry();
}
sprintf(nbuf, "%s_%02d", outfile, idx++);
file = freopen(nbuf, "wb", file);
if (file == NULL)
- error (1, errno, _("Cannot open '%s'"), nbuf);
+ error (1, errno, _("Cannot open `%s'"), nbuf);
}
while(count)
else if (major == SCSI_DISK0_MAJOR)
sprintf (name, "/dev/sd%c", 'a' + minor / 16);
else
- grub_util_error ("Unknown device number: %d, %d", major, minor);
+ grub_util_error ("unknown device number: %d, %d", major, minor);
return name;
}
fd = open (devname, O_RDONLY);
if (fd == -1)
- grub_util_error ("Can't open %s: %s", devname, strerror (errno));
+ grub_util_error ("can't open %s: %s", devname, strerror (errno));
free (devname);
grub_util_error ("ioctl RAID_VERSION error: %s", strerror (errno));
if (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);
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 ("\
Usage: %s [OPTION]... [MODULES]\n\
grub_util_info ("first sector is <%llu,%u,%u>", sector, offset, length);
if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("The first sector of the core file "
+ grub_util_error ("the first sector of the core file "
"is not sector-aligned");
first_sector = sector;
grub_util_info ("saving <%llu,%u,%u>", sector, offset, length);
if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("Non-sector-aligned data is found in the core file");
+ grub_util_error ("non-sector-aligned data is found in the core file");
if (block != first_block
&& (grub_be_to_cpu64 (prev->start)
block--;
if (block->len)
- grub_util_error ("The sectors of the core file are too fragmented");
+ grub_util_error ("the sectors of the core file are too fragmented");
}
last_length = length;
boot_path = grub_util_get_path (dir, boot_file);
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("The size of `%s' is not %d",
+ grub_util_error ("the size of `%s' is not %d",
boot_path, GRUB_DISK_SECTOR_SIZE);
boot_img = grub_util_read_image (boot_path);
free (boot_path);
core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
>> GRUB_DISK_SECTOR_BITS);
if (core_size < GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("The size of `%s' is too small", core_path);
+ grub_util_error ("the size of `%s' is too small", core_path);
core_img = grub_util_read_image (core_path);
free (core_path);
+ GRUB_DISK_SECTOR_SIZE
- sizeof (*block));
- grub_util_info ("root is '%s', dest is '%s', and dest_ofpath is '%s'",
+ grub_util_info ("root is `%s', dest is `%s', and dest_ofpath is `%s'",
root, dest, dest_ofpath);
/* Open the root device and the destination device. */
}
if (i == MAX_TRIES)
- grub_util_error ("Cannot read `%s' correctly", core_path);
+ grub_util_error ("cannot read `%s' correctly", core_path);
/* Clean out the blocklists. */
block = first_block;
block--;
if ((char *) block <= core_img)
- grub_util_error ("No terminator in the core image");
+ grub_util_error ("no terminator in the core image");
}
/* Now read the core image to determine where the sectors are. */
file->read_hook = save_first_sector;
if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE)
!= GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("Failed to read the first sector of the core image");
+ grub_util_error ("failed to read the first sector of the core image");
block = first_block;
file->read_hook = save_blocklists;
if (grub_file_read (file, tmp_img, core_size - GRUB_DISK_SECTOR_SIZE)
!= (grub_ssize_t) core_size - GRUB_DISK_SECTOR_SIZE)
- grub_util_error ("Failed to read the rest sectors of the core image");
+ grub_util_error ("failed to read the rest sectors of the core image");
grub_file_close (file);
grub_util_info ("opening the core image `%s'", core_path);
fp = fopen (core_path, "r+b");
if (! fp)
- grub_util_error ("Cannot open `%s'", core_path);
+ grub_util_error ("cannot open `%s'", core_path);
grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE, fp);
fclose (fp);
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 ("\
Usage: %s [OPTION]... DEVICE\n\
\n\
Set up images to boot from DEVICE.\n\
-DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n\
+DEVICE must be a GRUB device (e.g. `(hd0,1)').\n\
\n\
-b, --boot-image=FILE use FILE as the boot image [default=%s]\n\
-c, --core-image=FILE use FILE as the core image [default=%s]\n\
fprintf (stderr, "Invalid device `%s'.\n", argv[optind]);
usage (1);
}
- grub_util_info ("transformed OS device '%s' into GRUB device '%s'",
+ grub_util_info ("transformed OS device `%s' into GRUB device `%s'",
argv[optind], gp->dest_dev);
}
else
{
/* For simplicity. */
gp->dest_dev = xstrdup (gp->dest_dev);
- grub_util_info ("Using '%s' as GRUB device", gp->dest_dev);
+ grub_util_info ("Using `%s' as GRUB device", gp->dest_dev);
}
}
char *tmp = get_device_name (gp->root_dev);
if (! tmp)
- grub_util_error ("Invalid root device `%s'", gp->root_dev);
+ grub_util_error ("invalid root device `%s'", gp->root_dev);
tmp = xstrdup (tmp);
free (gp->root_dev);
{
grub_util_info ("guessing the root device failed, because of `%s'",
grub_errmsg);
- grub_util_error ("Cannot guess the root device. "
- "Specify the option ``--root-device''.");
+ grub_util_error ("cannot guess the root device. "
+ "Specify the option `--root-device'");
}
- grub_util_info ("Guessed root device '%s' and root_dev '%s' from "
- "dir '%s'", root_device, gp->root_dev, dir);
+ grub_util_info ("guessed root device `%s' and root_dev `%s' from "
+ "dir `%s'", root_device, gp->root_dev, dir);
}
}