util: Remove trailing whitespaces

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Elyes Haouas authored and Daniel Kiper committed 2022-03-14 16:01:07 +01:00
1 parent 1f48917d8d
commit d07084e50c
23 files changed
+192 -192

No files matched your search

+3 -3
View File
@@ -156,7 +156,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part)
if (stat (os_dev, &st) < 0) if (stat (os_dev, &st) < 0)
{ {
const char *errstr = strerror (errno); const char *errstr = strerror (errno);
grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot stat `%s': %s"), grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot stat `%s': %s"),
os_dev, errstr); os_dev, errstr);
grub_util_info (_("cannot stat `%s': %s"), os_dev, errstr); grub_util_info (_("cannot stat `%s': %s"), os_dev, errstr);
@@ -293,7 +293,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
== 0); == 0);
dri = make_device_name (drive); dri = make_device_name (drive);
if (!disk && !rdisk) if (!disk && !rdisk)
return dri; return dri;
@@ -451,7 +451,7 @@ int
grub_util_biosdisk_is_present (const char *os_dev) grub_util_biosdisk_is_present (const char *os_dev)
{ {
int ret = (find_system_device (os_dev) != NULL); int ret = (find_system_device (os_dev) != NULL);
grub_util_info ((ret ? "%s is present" : "%s is not present"), grub_util_info ((ret ? "%s is present" : "%s is not present"),
os_dev); os_dev);
return ret; return ret;
} }
+1 -1
View File
@@ -92,7 +92,7 @@ write_fat (FILE *in32, FILE *in64, FILE *out, const char *out_filename,
if (fwrite (buf, 1, size32, out) != size32) if (fwrite (buf, 1, size32, out) != size32)
{ {
if (out_filename) if (out_filename)
grub_util_error ("cannot write to `%s': %s", grub_util_error ("cannot write to `%s': %s",
out_filename, strerror (errno)); out_filename, strerror (errno));
else else
grub_util_error ("cannot write to the stdout: %s", strerror (errno)); grub_util_error ("cannot write to the stdout: %s", strerror (errno));
+7 -7
View File
@@ -199,7 +199,7 @@ cp_hook (grub_off_t ofs, char *buf, int len, void *_ctx)
static void static void
cmd_cp (char *src, const char *dest) cmd_cp (char *src, const char *dest)
{ {
struct cp_hook_ctx ctx = struct cp_hook_ctx ctx =
{ {
.dest = dest .dest = dest
}; };
@@ -355,7 +355,7 @@ static int
crc_hook (grub_off_t ofs, char *buf, int len, void *crc_ctx) crc_hook (grub_off_t ofs, char *buf, int len, void *crc_ctx)
{ {
(void) ofs; (void) ofs;
GRUB_MD_CRC32->write(crc_ctx, buf, len); GRUB_MD_CRC32->write(crc_ctx, buf, len);
return 0; return 0;
} }
@@ -489,7 +489,7 @@ fstest (int n)
grub_device_close (dev); grub_device_close (dev);
} }
} }
for (i = 0; i < num_disks; i++) for (i = 0; i < num_disks; i++)
{ {
char *argv[2]; char *argv[2];
@@ -518,7 +518,7 @@ static struct argp_option options[] = {
{N_("crc FILE"), 0, 0 , OPTION_DOC, N_("Get crc32 checksum of FILE."), 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_("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}, {N_("xnu_uuid DEVICE"), 0, 0, OPTION_DOC, N_("Compute XNU UUID of the device."), 1},
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2}, {"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"skip", 's', N_("NUM"), 0, N_("Skip N bytes from output file."), 2}, {"skip", 's', N_("NUM"), 0, N_("Skip N bytes from output file."), 2},
{"length", 'n', N_("NUM"), 0, N_("Handle N bytes in output file."), 2}, {"length", 'n', N_("NUM"), 0, N_("Handle N bytes in output file."), 2},
@@ -541,7 +541,7 @@ print_version (FILE *stream, struct argp_state *state)
} }
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
static error_t static error_t
argp_parser (int key, char *arg, struct argp_state *state) argp_parser (int key, char *arg, struct argp_state *state)
{ {
const char *p; const char *p;
@@ -555,7 +555,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
case 'K': case 'K':
if (strcmp (arg, "prompt") == 0) if (strcmp (arg, "prompt") == 0)
{ {
char buf[1024]; char buf[1024];
grub_puts_ (N_("Enter ZFS password: ")); grub_puts_ (N_("Enter ZFS password: "));
if (grub_password_get (buf, 1023)) if (grub_password_get (buf, 1023))
{ {
@@ -728,7 +728,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
struct argp argp = { struct argp argp = {
options, argp_parser, N_("IMAGE_PATH COMMANDS"), options, argp_parser, N_("IMAGE_PATH COMMANDS"),
N_("Debug tool for filesystem driver."), N_("Debug tool for filesystem driver."),
NULL, NULL, NULL NULL, NULL, NULL
}; };
+2 -2
View File
@@ -29,10 +29,10 @@
#include FT_SYNTHESIS_H #include FT_SYNTHESIS_H
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERROR_START_LIST const char *ft_errmsgs[] = { #define FT_ERROR_START_LIST const char *ft_errmsgs[] = {
#define FT_ERRORDEF(e, v, s) [e] = s, #define FT_ERRORDEF(e, v, s) [e] = s,
#define FT_ERROR_END_LIST }; #define FT_ERROR_END_LIST };
#include FT_ERRORS_H #include FT_ERRORS_H
#define GRUB_FONT_DEFAULT_SIZE 16 #define GRUB_FONT_DEFAULT_SIZE 16
+3 -3
View File
@@ -29,10 +29,10 @@
#include FT_SYNTHESIS_H #include FT_SYNTHESIS_H
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERROR_START_LIST const char *ft_errmsgs[] = { #define FT_ERROR_START_LIST const char *ft_errmsgs[] = {
#define FT_ERRORDEF(e, v, s) [e] = s, #define FT_ERRORDEF(e, v, s) [e] = s,
#define FT_ERROR_END_LIST }; #define FT_ERROR_END_LIST };
#include FT_ERRORS_H #include FT_ERRORS_H
#define GRUB_FONT_DEFAULT_SIZE 16 #define GRUB_FONT_DEFAULT_SIZE 16
@@ -119,7 +119,7 @@ main (int argc, char *argv[])
fprintf (stderr, "grub-gen-widthspec: error: can't set %dx%d font size", size, size); fprintf (stderr, "grub-gen-widthspec: error: can't set %dx%d font size", size, size);
return 1; return 1;
} }
for (char_code = FT_Get_First_Char (ft_face, &glyph_index); for (char_code = FT_Get_First_Char (ft_face, &glyph_index);
glyph_index; glyph_index;
char_code = FT_Get_Next_Char (ft_face, char_code, &glyph_index)) char_code = FT_Get_Next_Char (ft_face, char_code, &glyph_index))
+7 -7
View File
@@ -59,7 +59,7 @@ grub_install_help_filter (int key, const char *text,
return xasprintf(text, "unicode"); return xasprintf(text, "unicode");
case GRUB_INSTALL_OPTIONS_DIRECTORY: case GRUB_INSTALL_OPTIONS_DIRECTORY:
case GRUB_INSTALL_OPTIONS_DIRECTORY2: case GRUB_INSTALL_OPTIONS_DIRECTORY2:
return xasprintf(text, grub_util_get_pkglibdir ()); return xasprintf(text, grub_util_get_pkglibdir ());
case GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY: case GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY:
return xasprintf(text, grub_util_get_localedir ()); return xasprintf(text, grub_util_get_localedir ());
case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY: case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY:
@@ -80,7 +80,7 @@ grub_install_copy_file (const char *src,
const char *dst, const char *dst,
int is_needed) int is_needed)
{ {
grub_util_fd_t in, out; grub_util_fd_t in, out;
ssize_t r; ssize_t r;
grub_util_info ("copying `%s' -> `%s'", src, dst); grub_util_info ("copying `%s' -> `%s'", src, dst);
@@ -106,7 +106,7 @@ grub_install_copy_file (const char *src,
if (!grub_install_copy_buffer) if (!grub_install_copy_buffer)
grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE); grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE);
while (1) while (1)
{ {
r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE); r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE);
@@ -599,7 +599,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix,
const char *mkimage_target, int note) const char *mkimage_target, int note)
{ {
const struct grub_install_image_target_desc *tgt; const struct grub_install_image_target_desc *tgt;
const char *const compnames[] = const char *const compnames[] =
{ {
[GRUB_COMPRESSION_AUTO] = "auto", [GRUB_COMPRESSION_AUTO] = "auto",
[GRUB_COMPRESSION_NONE] = "none", [GRUB_COMPRESSION_NONE] = "none",
@@ -905,7 +905,7 @@ static struct
[GRUB_INSTALL_PLATFORM_ARM_COREBOOT] = { "arm", "coreboot" }, [GRUB_INSTALL_PLATFORM_ARM_COREBOOT] = { "arm", "coreboot" },
[GRUB_INSTALL_PLATFORM_RISCV32_EFI] = { "riscv32", "efi" }, [GRUB_INSTALL_PLATFORM_RISCV32_EFI] = { "riscv32", "efi" },
[GRUB_INSTALL_PLATFORM_RISCV64_EFI] = { "riscv64", "efi" }, [GRUB_INSTALL_PLATFORM_RISCV64_EFI] = { "riscv64", "efi" },
}; };
char * char *
grub_install_get_platforms_string (void) grub_install_get_platforms_string (void)
@@ -933,7 +933,7 @@ grub_install_get_platforms_string (void)
} }
ptr[-2] = 0; ptr[-2] = 0;
free (arr); free (arr);
return platforms_string; return platforms_string;
} }
@@ -1104,7 +1104,7 @@ grub_install_get_target (const char *src)
fn = grub_util_path_concat (2, src, "modinfo.sh"); fn = grub_util_path_concat (2, src, "modinfo.sh");
f = grub_util_fd_open (fn, GRUB_UTIL_FD_O_RDONLY); f = grub_util_fd_open (fn, GRUB_UTIL_FD_O_RDONLY);
if (!GRUB_UTIL_FD_IS_VALID (f)) if (!GRUB_UTIL_FD_IS_VALID (f))
grub_util_error (_("%s doesn't exist. Please specify --target or --directory"), grub_util_error (_("%s doesn't exist. Please specify --target or --directory"),
fn); fn);
r = grub_util_fd_read (f, buf, sizeof (buf) - 1); r = grub_util_fd_read (f, buf, sizeof (buf) - 1);
if (r < 0) if (r < 0)
+21 -21
View File
@@ -86,17 +86,17 @@ enum
OPTION_ROOT_DIRECTORY, OPTION_ROOT_DIRECTORY,
OPTION_TARGET, OPTION_TARGET,
OPTION_SETUP, OPTION_SETUP,
OPTION_MKRELPATH, OPTION_MKRELPATH,
OPTION_MKDEVICEMAP, OPTION_MKDEVICEMAP,
OPTION_PROBE, OPTION_PROBE,
OPTION_EDITENV, OPTION_EDITENV,
OPTION_ALLOW_FLOPPY, OPTION_ALLOW_FLOPPY,
OPTION_RECHECK, OPTION_RECHECK,
OPTION_FORCE, OPTION_FORCE,
OPTION_FORCE_FILE_ID, OPTION_FORCE_FILE_ID,
OPTION_NO_NVRAM, OPTION_NO_NVRAM,
OPTION_REMOVABLE, OPTION_REMOVABLE,
OPTION_BOOTLOADER_ID, OPTION_BOOTLOADER_ID,
OPTION_EFI_DIRECTORY, OPTION_EFI_DIRECTORY,
OPTION_FONT, OPTION_FONT,
OPTION_DEBUG, OPTION_DEBUG,
@@ -114,7 +114,7 @@ enum
static int fs_probe = 1; static int fs_probe = 1;
static error_t static error_t
argp_parser (int key, char *arg, struct argp_state *state) argp_parser (int key, char *arg, struct argp_state *state)
{ {
if (grub_install_parse (key, arg)) if (grub_install_parse (key, arg))
@@ -370,7 +370,7 @@ struct argp argp = {
N_("Install GRUB on your drive.")"\v" N_("Install GRUB on your drive.")"\v"
N_("INSTALL_DEVICE must be system device filename.\n" N_("INSTALL_DEVICE must be system device filename.\n"
"%s copies GRUB images into %s. On some platforms, it" "%s copies GRUB images into %s. On some platforms, it"
" may also install GRUB into the boot sector."), " may also install GRUB into the boot sector."),
NULL, help_filter, NULL NULL, help_filter, NULL
}; };
@@ -696,7 +696,7 @@ write_to_disk (grub_device_t dev, const char *fn)
core_size = grub_util_get_image_size (fn); core_size = grub_util_get_image_size (fn);
core_img = grub_util_read_image (fn); core_img = grub_util_read_image (fn);
grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name); grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name);
err = grub_disk_write (dev->disk, 0, 0, err = grub_disk_write (dev->disk, 0, 0,
@@ -882,11 +882,11 @@ main (int argc, char *argv[])
const char * t; const char * t;
t = get_default_platform (); t = get_default_platform ();
if (!t) if (!t)
grub_util_error ("%s", grub_util_error ("%s",
_("Unable to determine your platform." _("Unable to determine your platform."
" Use --target.") " Use --target.")
); );
target = xstrdup (t); target = xstrdup (t);
} }
grub_install_source_directory grub_install_source_directory
= grub_util_path_concat (2, grub_util_get_pkglibdir (), target); = grub_util_path_concat (2, grub_util_get_pkglibdir (), target);
@@ -1071,7 +1071,7 @@ main (int argc, char *argv[])
for (curdev = efidir_device_names; *curdev; curdev++) for (curdev = efidir_device_names; *curdev; curdev++)
grub_util_pull_device (*curdev); grub_util_pull_device (*curdev);
efidir_grub_devname = grub_util_get_grub_dev (efidir_device_names[0]); efidir_grub_devname = grub_util_get_grub_dev (efidir_device_names[0]);
if (!efidir_grub_devname) if (!efidir_grub_devname)
grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
@@ -1219,12 +1219,12 @@ main (int argc, char *argv[])
for (curdev = macppcdir_device_names; *curdev; curdev++) for (curdev = macppcdir_device_names; *curdev; curdev++)
grub_util_pull_device (*curdev); grub_util_pull_device (*curdev);
macppcdir_grub_devname = grub_util_get_grub_dev (macppcdir_device_names[0]); macppcdir_grub_devname = grub_util_get_grub_dev (macppcdir_device_names[0]);
if (!macppcdir_grub_devname) if (!macppcdir_grub_devname)
grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"), grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
macppcdir_device_names[0]); macppcdir_device_names[0]);
macppcdir_grub_dev = grub_device_open (macppcdir_grub_devname); macppcdir_grub_dev = grub_device_open (macppcdir_grub_devname);
if (! macppcdir_grub_dev) if (! macppcdir_grub_dev)
grub_util_error ("%s", grub_errmsg); grub_util_error ("%s", grub_errmsg);
@@ -1697,7 +1697,7 @@ main (int argc, char *argv[])
{ {
case GRUB_INSTALL_PLATFORM_I386_PC: case GRUB_INSTALL_PLATFORM_I386_PC:
{ {
char *boot_img_src = grub_util_path_concat (2, char *boot_img_src = grub_util_path_concat (2,
grub_install_source_directory, grub_install_source_directory,
"boot.img"); "boot.img");
char *boot_img = grub_util_path_concat (2, platdir, char *boot_img = grub_util_path_concat (2, platdir,
@@ -1716,7 +1716,7 @@ main (int argc, char *argv[])
platdir, platdir,
device_map, device_map,
install_device); install_device);
/* Now perform the installation. */ /* Now perform the installation. */
if (install_bootsector) if (install_bootsector)
{ {
@@ -1731,7 +1731,7 @@ main (int argc, char *argv[])
} }
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
{ {
char *boot_img_src = grub_util_path_concat (2, char *boot_img_src = grub_util_path_concat (2,
grub_install_source_directory, grub_install_source_directory,
"boot.img"); "boot.img");
char *boot_img = grub_util_path_concat (2, platdir, char *boot_img = grub_util_path_concat (2, platdir,
@@ -1747,7 +1747,7 @@ main (int argc, char *argv[])
platdir, platdir,
device_map, device_map,
install_drive); install_drive);
/* Now perform the installation. */ /* Now perform the installation. */
if (install_bootsector) if (install_bootsector)
{ {
+1 -1
View File
@@ -62,7 +62,7 @@ main (int argc, char **argv)
{ {
out = grub_util_fopen (argv[2], "w"); out = grub_util_fopen (argv[2], "w");
if (!out) if (!out)
{ {
if (in != stdin) if (in != stdin)
fclose (in); fclose (in);
fprintf (stderr, _("cannot open `%s': %s"), fprintf (stderr, _("cannot open `%s': %s"),
+14 -14
View File
@@ -50,10 +50,10 @@
#include FT_SYNTHESIS_H #include FT_SYNTHESIS_H
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERROR_START_LIST const char *ft_errmsgs[] = { #define FT_ERROR_START_LIST const char *ft_errmsgs[] = {
#define FT_ERRORDEF(e, v, s) [e] = s, #define FT_ERRORDEF(e, v, s) [e] = s,
#define FT_ERROR_END_LIST }; #define FT_ERROR_END_LIST };
#include FT_ERRORS_H #include FT_ERRORS_H
#ifndef GRUB_BUILD #ifndef GRUB_BUILD
#include "progname.h" #include "progname.h"
@@ -312,7 +312,7 @@ add_char (struct grub_font_info *font_info, FT_Face face,
char_code | GRUB_FONT_CODE_RIGHT_JOINED, nocut); char_code | GRUB_FONT_CODE_RIGHT_JOINED, nocut);
break; break;
} }
} }
for (cur = subst_leftjoin; cur; cur = cur->next) for (cur = subst_leftjoin; cur; cur = cur->next)
@@ -338,7 +338,7 @@ add_char (struct grub_font_info *font_info, FT_Face face,
char_code | GRUB_FONT_CODE_LEFT_JOINED, nocut); char_code | GRUB_FONT_CODE_LEFT_JOINED, nocut);
break; break;
} }
} }
for (cur = subst_medijoin; cur; cur = cur->next) for (cur = subst_medijoin; cur; cur = cur->next)
if (cur->from == glyph_idx) if (cur->from == glyph_idx)
@@ -365,7 +365,7 @@ add_char (struct grub_font_info *font_info, FT_Face face,
| GRUB_FONT_CODE_RIGHT_JOINED, nocut); | GRUB_FONT_CODE_RIGHT_JOINED, nocut);
break; break;
} }
} }
} }
@@ -440,7 +440,7 @@ struct gsub_coverage_ranges
{ {
grub_uint16_t type; grub_uint16_t type;
grub_uint16_t count; grub_uint16_t count;
struct struct
{ {
grub_uint16_t start; grub_uint16_t start;
grub_uint16_t end; grub_uint16_t end;
@@ -501,20 +501,20 @@ process_cursive (struct gsub_feature *feature,
if (lookup_index >= grub_be_to_cpu16 (lookups->count)) if (lookup_index >= grub_be_to_cpu16 (lookups->count))
{ {
/* TRANSLATORS: "lookup" is taken directly from font specifications /* TRANSLATORS: "lookup" is taken directly from font specifications
which are formulated as "Under condition X replace LOOKUP with which are formulated as "Under condition X replace LOOKUP with
SUBSTITUITION". "*/ SUBSTITUITION". "*/
printf (_("Out of range lookup: %d\n"), lookup_index); printf (_("Out of range lookup: %d\n"), lookup_index);
continue; continue;
} }
lookup = (struct gsub_lookup *) lookup = (struct gsub_lookup *)
((grub_uint8_t *) lookups ((grub_uint8_t *) lookups
+ grub_be_to_cpu16 (lookups->offsets[lookup_index])); + grub_be_to_cpu16 (lookups->offsets[lookup_index]));
if (grub_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION) 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)); grub_be_to_cpu16 (lookup->type));
continue; continue;
} }
if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR) if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR)
{ {
grub_util_info ("unsupported substitution flag: 0x%x", grub_util_info ("unsupported substitution flag: 0x%x",
@@ -536,7 +536,7 @@ process_cursive (struct gsub_feature *feature,
break; break;
case FEATURE_MEDI: case FEATURE_MEDI:
target = &subst_medijoin; target = &subst_medijoin;
break; break;
} }
for (k = 0; k < grub_be_to_cpu16 (lookup->subtablecount); k++) for (k = 0; k < grub_be_to_cpu16 (lookup->subtablecount); k++)
{ {
@@ -602,7 +602,7 @@ add_font (struct grub_font_info *font_info, FT_Face face, int nocut)
} }
if (gsub) if (gsub)
{ {
struct gsub_features *features struct gsub_features *features
= (struct gsub_features *) (((grub_uint8_t *) gsub) = (struct gsub_features *) (((grub_uint8_t *) gsub)
+ grub_be_to_cpu16 (gsub->features_off)); + grub_be_to_cpu16 (gsub->features_off));
struct gsub_lookup_list *lookups struct gsub_lookup_list *lookups
@@ -941,10 +941,10 @@ static struct argp_option options[] = {
This option is used to chose among them, the first face being '0'. This option is used to chose among them, the first face being '0'.
Rarely used. */ Rarely used. */
N_("select face index"), 0}, N_("select face index"), 0},
{"range", 'r', N_("FROM-TO[,FROM-TO]"), 0, {"range", 'r', N_("FROM-TO[,FROM-TO]"), 0,
/* TRANSLATORS: It refers to the range of characters in font. */ /* TRANSLATORS: It refers to the range of characters in font. */
N_("set font range"), 0}, N_("set font range"), 0},
{"name", 'n', N_("NAME"), 0, {"name", 'n', N_("NAME"), 0,
/* TRANSLATORS: "family name" for font is just a generic name without suffix /* TRANSLATORS: "family name" for font is just a generic name without suffix
like "Bold". */ like "Bold". */
N_("set font family name"), 0}, N_("set font family name"), 0},
@@ -1186,7 +1186,7 @@ main (int argc, char *argv[])
grub_util_error ("%s", _("FT_Init_FreeType fails")); grub_util_error ("%s", _("FT_Init_FreeType fails"));
{ {
size_t i; size_t i;
for (i = 0; i < arguments.nfiles; i++) for (i = 0; i < arguments.nfiles; i++)
{ {
FT_Face ft_face; FT_Face ft_face;
+4 -4
View File
@@ -284,7 +284,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc
phdr->p_align = grub_host_to_target32 (layout->align > image_target->link_align ? phdr->p_align = grub_host_to_target32 (layout->align > image_target->link_align ?
layout->align : image_target->link_align); layout->align : image_target->link_align);
if (image_target->id == IMAGE_LOONGSON_ELF) if (image_target->id == IMAGE_LOONGSON_ELF)
ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER
| EF_MIPS_PIC | EF_MIPS_CPIC); | EF_MIPS_PIC | EF_MIPS_CPIC);
else else
ehdr->e_flags = 0; ehdr->e_flags = 0;
@@ -457,7 +457,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc
if (note) if (note)
{ {
int note_size = sizeof (struct grub_ieee1275_note); int note_size = sizeof (struct grub_ieee1275_note);
struct grub_ieee1275_note *note_ptr = (struct grub_ieee1275_note *) struct grub_ieee1275_note *note_ptr = (struct grub_ieee1275_note *)
(elf_img + program_size + header_size); (elf_img + program_size + header_size);
grub_util_info ("adding CHRP NOTE segment"); grub_util_info ("adding CHRP NOTE segment");
@@ -2041,7 +2041,7 @@ SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_de
static int static int
SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target)
{ {
if (!is_relocatable (image_target) if (!is_relocatable (image_target)
&& grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS)
return 0; return 0;
return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC))
@@ -2227,7 +2227,7 @@ SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path,
layout->bss_start = layout->kernel_size; layout->bss_start = layout->kernel_size;
layout->end = layout->kernel_size; layout->end = layout->kernel_size;
/* .bss */ /* .bss */
for (i = 0, s = smd->sections; for (i = 0, s = smd->sections;
i < smd->num_sections; i < smd->num_sections;
+48 -48
View File
@@ -175,7 +175,7 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = {
{"dead_grave", '`'}, {"dead_grave", '`'},
{"dead_tilde", '~'}, {"dead_tilde", '~'},
{"dead_diaeresis", '"'}, {"dead_diaeresis", '"'},
/* Following ones don't provide any useful symbols for shell. */ /* Following ones don't provide any useful symbols for shell. */
{"dead_cedilla", 0}, {"dead_cedilla", 0},
{"dead_ogonek", 0}, {"dead_ogonek", 0},
@@ -213,50 +213,50 @@ static struct console_grub_equivalence console_grub_equivalences_common[] = {
}; };
static grub_uint8_t linux_to_usb_map[128] = { static grub_uint8_t linux_to_usb_map[128] = {
/* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE, /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE,
/* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2, /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2,
/* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4, /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4,
/* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6, /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6,
/* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8, /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8,
/* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0, /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0,
/* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL, /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL,
/* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB, /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB,
/* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W, /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W,
/* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R, /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R,
/* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y, /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y,
/* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I, /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I,
/* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P, /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P,
/* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET, /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET,
/* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL, /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL,
/* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S, /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S,
/* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F, /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F,
/* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H, /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H,
/* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K, /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K,
/* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON, /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON,
/* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE, /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE,
/* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH, /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH,
/* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X, /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X,
/* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V, /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V,
/* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N, /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N,
/* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA, /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA,
/* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH, /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH,
/* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL, /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL,
/* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE, /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE,
/* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1, /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1,
/* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3, /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3,
/* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5, /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5,
/* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7, /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7,
/* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9, /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9,
/* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK, /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK,
/* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7, /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7,
/* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9, /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9,
/* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4, /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4,
/* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6,
/* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1,
/* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3,
/* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT,
/* 0x54 */ 0, 0, /* 0x54 */ 0, 0,
/* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11,
/* 0x58 */ GRUB_KEYBOARD_KEY_F12, GRUB_KEYBOARD_KEY_JP_RO, /* 0x58 */ GRUB_KEYBOARD_KEY_F12, GRUB_KEYBOARD_KEY_JP_RO,
/* 0x5a */ 0, 0, /* 0x5a */ 0, 0,
/* 0x5c */ 0, 0, /* 0x5c */ 0, 0,
@@ -267,7 +267,7 @@ static grub_uint8_t linux_to_usb_map[128] = {
/* 0x66 */ GRUB_KEYBOARD_KEY_HOME, GRUB_KEYBOARD_KEY_UP, /* 0x66 */ GRUB_KEYBOARD_KEY_HOME, GRUB_KEYBOARD_KEY_UP,
/* 0x68 */ GRUB_KEYBOARD_KEY_PPAGE, GRUB_KEYBOARD_KEY_LEFT, /* 0x68 */ GRUB_KEYBOARD_KEY_PPAGE, GRUB_KEYBOARD_KEY_LEFT,
/* 0x6a */ GRUB_KEYBOARD_KEY_RIGHT, GRUB_KEYBOARD_KEY_END, /* 0x6a */ GRUB_KEYBOARD_KEY_RIGHT, GRUB_KEYBOARD_KEY_END,
/* 0x6c */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_NPAGE, /* 0x6c */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_NPAGE,
/* 0x6e */ GRUB_KEYBOARD_KEY_INSERT, GRUB_KEYBOARD_KEY_DELETE, /* 0x6e */ GRUB_KEYBOARD_KEY_INSERT, GRUB_KEYBOARD_KEY_DELETE,
/* 0x70 */ 0, 0, /* 0x70 */ 0, 0,
/* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO, /* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
@@ -276,7 +276,7 @@ static grub_uint8_t linux_to_usb_map[128] = {
/* 0x78 */ 0, GRUB_KEYBOARD_KEY_KPCOMMA, /* 0x78 */ 0, GRUB_KEYBOARD_KEY_KPCOMMA,
/* 0x7a */ 0, 0, /* 0x7a */ 0, 0,
/* 0x7c */ GRUB_KEYBOARD_KEY_JP_YEN, /* 0x7c */ GRUB_KEYBOARD_KEY_JP_YEN,
}; };
static void static void
add_special_keys (struct grub_keyboard_layout *layout) add_special_keys (struct grub_keyboard_layout *layout)
@@ -330,7 +330,7 @@ write_file (FILE *out, const char *fname, struct grub_keyboard_layout *layout)
unsigned i; unsigned i;
version = grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION); version = grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION);
for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++) for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++)
layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]); layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]);
+2 -2
View File
@@ -52,7 +52,7 @@ static struct argp_option options[] = {
{0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0}
}; };
static error_t static error_t
argp_parser (int key, char *arg, struct argp_state *state) argp_parser (int key, char *arg, struct argp_state *state)
{ {
if (grub_install_parse (key, arg)) if (grub_install_parse (key, arg))
@@ -86,7 +86,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
struct argp argp = { struct argp argp = {
options, argp_parser, NULL, options, argp_parser, NULL,
"\v"N_("Prepares GRUB network boot images at net_directory/subdir " "\v"N_("Prepares GRUB network boot images at net_directory/subdir "
"assuming net_directory being TFTP root."), "assuming net_directory being TFTP root."),
NULL, grub_install_help_filter, NULL NULL, grub_install_help_filter, NULL
}; };
+2 -2
View File
@@ -135,7 +135,7 @@ main (int argc, char *argv[])
buf = xmalloc (arguments.buflen); buf = xmalloc (arguments.buflen);
salt = xmalloc (arguments.saltlen); salt = xmalloc (arguments.saltlen);
printf ("%s", _("Enter password: ")); printf ("%s", _("Enter password: "));
if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN)) if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN))
{ {
@@ -189,7 +189,7 @@ main (int argc, char *argv[])
ptr = result; ptr = result;
memcpy (ptr, "grub.pbkdf2.sha512.", sizeof ("grub.pbkdf2.sha512.") - 1); memcpy (ptr, "grub.pbkdf2.sha512.", sizeof ("grub.pbkdf2.sha512.") - 1);
ptr += sizeof ("grub.pbkdf2.sha512.") - 1; ptr += sizeof ("grub.pbkdf2.sha512.") - 1;
grub_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXX"), "%d", arguments.count); grub_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXX"), "%d", arguments.count);
ptr += strlen (ptr); ptr += strlen (ptr);
*ptr++ = '.'; *ptr++ = '.';
+4 -4
View File
@@ -150,7 +150,7 @@ enum {
SYS_AREA_ARCS SYS_AREA_ARCS
} system_area = SYS_AREA_AUTO; } system_area = SYS_AREA_AUTO;
static error_t static error_t
argp_parser (int key, char *arg, struct argp_state *state) argp_parser (int key, char *arg, struct argp_state *state)
{ {
if (grub_install_parse (key, arg)) if (grub_install_parse (key, arg))
@@ -495,7 +495,7 @@ main (int argc, char *argv[])
xorriso_push ("-as"); xorriso_push ("-as");
xorriso_push ("mkisofs"); xorriso_push ("mkisofs");
xorriso_push ("-graft-points"); xorriso_push ("-graft-points");
iso9660_dir = grub_util_make_temporary_dir (); iso9660_dir = grub_util_make_temporary_dir ();
grub_util_info ("temporary iso9660 dir is `%s'", iso9660_dir); grub_util_info ("temporary iso9660 dir is `%s'", iso9660_dir);
boot_grub = grub_util_path_concat (3, iso9660_dir, "boot", "grub"); boot_grub = grub_util_path_concat (3, iso9660_dir, "boot", "grub");
@@ -639,7 +639,7 @@ main (int argc, char *argv[])
strerror (errno)); strerror (errno));
fclose (bi); fclose (bi);
fwrite (buf, 1, 512, sa); fwrite (buf, 1, 512, sa);
grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC], grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
"/boot/grub", sa, sysarea_img, "/boot/grub", sa, sysarea_img,
0, load_cfg, 0, load_cfg,
@@ -648,7 +648,7 @@ main (int argc, char *argv[])
fflush (sa); fflush (sa);
grub_util_fd_sync (fileno (sa)); grub_util_fd_sync (fileno (sa));
fclose (sa); fclose (sa);
if (sz > 32768) if (sz > 32768)
{ {
grub_util_warn ("%s", _("Your xorriso doesn't support `--grub2-boot-info'. Your core image is too big. Boot as disk is disabled. Please use xorriso 1.2.9 or later.")); grub_util_warn ("%s", _("Your xorriso doesn't support `--grub2-boot-info'. Your core image is too big. Boot as disk is disabled. Please use xorriso 1.2.9 or later."));
+2 -2
View File
@@ -112,7 +112,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
struct argp argp = { struct argp argp = {
options, argp_parser, N_("[OPTION] SOURCE..."), options, argp_parser, N_("[OPTION] SOURCE..."),
N_("Generate a standalone image (containing all modules) in the selected format")"\v"N_("Graft point syntax (E.g. /boot/grub/grub.cfg=./grub.cfg) is accepted"), N_("Generate a standalone image (containing all modules) in the selected format")"\v"N_("Graft point syntax (E.g. /boot/grub/grub.cfg=./grub.cfg) is accepted"),
NULL, help_filter, NULL NULL, help_filter, NULL
}; };
@@ -273,7 +273,7 @@ add_tar_file (const char *from,
compute_checksum (&hd); compute_checksum (&hd);
fwrite (&hd, 1, sizeof (hd), memdisk); fwrite (&hd, 1, sizeof (hd), memdisk);
while (1) while (1)
{ {
r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE); r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE);
+16 -16
View File
@@ -151,7 +151,7 @@ fuse_getattr (const char *path, struct stat *st)
{ {
struct fuse_getattr_ctx ctx; struct fuse_getattr_ctx ctx;
char *pathname, *path2; char *pathname, *path2;
if (path[0] == '/' && path[1] == 0) if (path[0] == '/' && path[1] == 0)
{ {
st->st_dev = 0; st->st_dev = 0;
@@ -170,7 +170,7 @@ fuse_getattr (const char *path, struct stat *st)
ctx.file_exists = 0; ctx.file_exists = 0;
pathname = xstrdup (path); pathname = xstrdup (path);
/* Remove trailing '/'. */ /* Remove trailing '/'. */
while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')
pathname[grub_strlen (pathname) - 1] = 0; pathname[grub_strlen (pathname) - 1] = 0;
@@ -231,7 +231,7 @@ fuse_getattr (const char *path, struct stat *st)
} }
static int static int
fuse_opendir (const char *path, struct fuse_file_info *fi) fuse_opendir (const char *path, struct fuse_file_info *fi)
{ {
return 0; return 0;
} }
@@ -240,7 +240,7 @@ fuse_opendir (const char *path, struct fuse_file_info *fi)
static grub_file_t files[65536]; static grub_file_t files[65536];
static int first_fd = 1; static int first_fd = 1;
static int static int
fuse_open (const char *path, struct fuse_file_info *fi __attribute__ ((unused))) fuse_open (const char *path, struct fuse_file_info *fi __attribute__ ((unused)))
{ {
grub_file_t file; grub_file_t file;
@@ -252,9 +252,9 @@ fuse_open (const char *path, struct fuse_file_info *fi __attribute__ ((unused)))
files[first_fd++] = file; files[first_fd++] = file;
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
return 0; return 0;
} }
static int static int
fuse_read (const char *path, char *buf, size_t sz, off_t off, fuse_read (const char *path, char *buf, size_t sz, off_t off,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
@@ -265,7 +265,7 @@ fuse_read (const char *path, char *buf, size_t sz, off_t off,
return -EINVAL; return -EINVAL;
file->offset = off; file->offset = off;
size = grub_file_read (file, buf, sz); size = grub_file_read (file, buf, sz);
if (size < 0) if (size < 0)
return translate_error (); return translate_error ();
@@ -274,9 +274,9 @@ fuse_read (const char *path, char *buf, size_t sz, off_t off,
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
return size; return size;
} }
} }
static int static int
fuse_release (const char *path, struct fuse_file_info *fi) fuse_release (const char *path, struct fuse_file_info *fi)
{ {
grub_file_close (files[fi->fh]); grub_file_close (files[fi->fh]);
@@ -334,7 +334,7 @@ fuse_readdir_call_fill (const char *filename,
return 0; return 0;
} }
static int static int
fuse_readdir (const char *path, void *buf, fuse_readdir (const char *path, void *buf,
fuse_fill_dir_t fill, off_t off, struct fuse_file_info *fi) fuse_fill_dir_t fill, off_t off, struct fuse_file_info *fi)
{ {
@@ -346,7 +346,7 @@ fuse_readdir (const char *path, void *buf,
char *pathname; char *pathname;
pathname = xstrdup (path); pathname = xstrdup (path);
/* Remove trailing '/'. */ /* Remove trailing '/'. */
while (pathname [0] && pathname[1] while (pathname [0] && pathname[1]
&& pathname[grub_strlen (pathname) - 1] == '/') && pathname[grub_strlen (pathname) - 1] == '/')
@@ -448,7 +448,7 @@ fuse_init (void)
return grub_errno; return grub_errno;
} }
static struct argp_option options[] = { static struct argp_option options[] = {
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2}, {"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"debug", 'd', N_("STRING"), 0, N_("Set debug environment variable."), 2}, {"debug", 'd', N_("STRING"), 0, N_("Set debug environment variable."), 2},
{"crypto", 'C', NULL, 0, N_("Mount crypto devices."), 2}, {"crypto", 'C', NULL, 0, N_("Mount crypto devices."), 2},
@@ -467,7 +467,7 @@ print_version (FILE *stream, struct argp_state *state)
} }
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
static error_t static error_t
argp_parser (int key, char *arg, struct argp_state *state) argp_parser (int key, char *arg, struct argp_state *state)
{ {
switch (key) switch (key)
@@ -479,7 +479,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
case 'K': case 'K':
if (strcmp (arg, "prompt") == 0) if (strcmp (arg, "prompt") == 0)
{ {
char buf[1024]; char buf[1024];
grub_printf ("%s", _("Enter ZFS password: ")); grub_printf ("%s", _("Enter ZFS password: "));
if (grub_password_get (buf, 1023)) if (grub_password_get (buf, 1023))
{ {
@@ -550,7 +550,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
struct argp argp = { struct argp argp = {
options, argp_parser, N_("IMAGE1 [IMAGE2 ...] MOUNTPOINT"), options, argp_parser, N_("IMAGE1 [IMAGE2 ...] MOUNTPOINT"),
N_("Debug tool for filesystem driver."), N_("Debug tool for filesystem driver."),
NULL, NULL, NULL NULL, NULL, NULL
}; };
@@ -570,7 +570,7 @@ main (int argc, char *argv[])
fuse_argc++; fuse_argc++;
argp_parse (&argp, argc, argv, 0, 0, 0); argp_parse (&argp, argc, argv, 0, 0, 0);
if (num_disks < 2) if (num_disks < 2)
grub_util_error ("%s", _("need an image and mountpoint")); grub_util_error ("%s", _("need an image and mountpoint"));
fuse_args = xrealloc (fuse_args, (fuse_argc + 2) * sizeof (fuse_args[0])); fuse_args = xrealloc (fuse_args, (fuse_argc + 2) * sizeof (fuse_args[0]));
+2 -2
View File
@@ -433,7 +433,7 @@ probe (const char *path, char **device_names, char delim)
dev = grub_device_open (drives_names[0]); dev = grub_device_open (drives_names[0]);
if (! dev) if (! dev)
grub_util_error ("%s", grub_errmsg); grub_util_error ("%s", grub_errmsg);
fs = grub_fs_probe (dev); fs = grub_fs_probe (dev);
if (! fs) if (! fs)
grub_util_error ("%s", grub_errmsg); grub_util_error ("%s", grub_errmsg);
@@ -543,7 +543,7 @@ probe (const char *path, char **device_names, char delim)
else else
printf ("\n"); printf ("\n");
} }
else if ((print == PRINT_COMPATIBILITY_HINT || print == PRINT_BIOS_HINT else if ((print == PRINT_COMPATIBILITY_HINT || print == PRINT_BIOS_HINT
|| print == PRINT_IEEE1275_HINT || print == PRINT_BAREMETAL_HINT || print == PRINT_IEEE1275_HINT || print == PRINT_BAREMETAL_HINT
|| print == PRINT_EFI_HINT || print == PRINT_ARC_HINT) || print == PRINT_EFI_HINT || print == PRINT_ARC_HINT)
+1 -1
View File
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
{ {
input = 0; input = 0;
get_config_line (&input, 0, &ctx); get_config_line (&input, 0, &ctx);
if (! input) if (! input)
break; break;
found_input = 1; found_input = 1;
+4 -4
View File
@@ -180,7 +180,7 @@ main (int argc, char *argv[])
{ {
grub_util_error (_("cannot open `%s': %s"), arguments.input, grub_util_error (_("cannot open `%s': %s"), arguments.input,
strerror (errno)); strerror (errno));
} }
inpfull = xasprintf ("(host)/%s", t); inpfull = xasprintf ("(host)/%s", t);
free (t); free (t);
@@ -190,7 +190,7 @@ main (int argc, char *argv[])
{ {
grub_util_error (_("cannot open `%s': %s"), arguments.root, grub_util_error (_("cannot open `%s': %s"), arguments.root,
strerror (errno)); strerror (errno));
} }
rootfull = xasprintf ("(host)/%s", t); rootfull = xasprintf ("(host)/%s", t);
free (t); free (t);
@@ -211,7 +211,7 @@ main (int argc, char *argv[])
{ {
grub_util_error (_("cannot open `%s': %s"), arguments.root, grub_util_error (_("cannot open `%s': %s"), arguments.root,
strerror (errno)); strerror (errno));
} }
cwdfull = xasprintf ("(host)/%s", t); cwdfull = xasprintf ("(host)/%s", t);
free (t); free (t);
@@ -227,7 +227,7 @@ main (int argc, char *argv[])
if (!f) if (!f)
grub_util_error (_("cannot open `%s': %s"), arguments.output, grub_util_error (_("cannot open `%s': %s"), arguments.output,
strerror (errno)); strerror (errno));
fwrite (res, 1, strlen (res), f); fwrite (res, 1, strlen (res), f);
fclose (f); fclose (f);
} }
else else
+39 -39
View File
@@ -121,7 +121,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-pc", NULL }, .names = { "i386-pc", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_I386_PC, .id = IMAGE_I386_PC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
@@ -155,7 +155,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-pc-pxe", NULL }, .names = { "i386-pc-pxe", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_I386_PC_PXE, .id = IMAGE_I386_PC_PXE,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
@@ -171,7 +171,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-pc-eltorito", NULL }, .names = { "i386-pc-eltorito", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_I386_PC_ELTORITO, .id = IMAGE_I386_PC_ELTORITO,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
@@ -203,7 +203,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-ieee1275", NULL }, .names = { "i386-ieee1275", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_I386_IEEE1275, .id = IMAGE_I386_IEEE1275,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -222,7 +222,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-qemu", NULL }, .names = { "i386-qemu", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_QEMU, .id = IMAGE_QEMU,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -236,8 +236,8 @@ static const struct grub_install_image_target_desc image_targets[] =
.dirname = "x86_64-efi", .dirname = "x86_64-efi",
.names = { "x86_64-efi", NULL }, .names = { "x86_64-efi", NULL },
.voidp_sizeof = 8, .voidp_sizeof = 8,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_EFI, .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -253,7 +253,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "i386-xen", NULL }, .names = { "i386-xen", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_XEN, .id = IMAGE_XEN,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -272,7 +272,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "x86_64-xen", NULL }, .names = { "x86_64-xen", NULL },
.voidp_sizeof = 8, .voidp_sizeof = 8,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_XEN, .id = IMAGE_XEN,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -291,7 +291,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mipsel-yeeloong-flash", NULL }, .names = { "mipsel-yeeloong-flash", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_YEELOONG_FLASH, .id = IMAGE_YEELOONG_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -309,7 +309,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mipsel-fuloong2f-flash", NULL }, .names = { "mipsel-fuloong2f-flash", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_FULOONG2F_FLASH, .id = IMAGE_FULOONG2F_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -329,7 +329,7 @@ static const struct grub_install_image_target_desc image_targets[] =
"mipsel-fuloong-elf", NULL }, "mipsel-fuloong-elf", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_LOONGSON_ELF, .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -347,7 +347,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "powerpc-ieee1275", NULL }, .names = { "powerpc-ieee1275", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_PPC, .id = IMAGE_PPC,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -365,7 +365,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.dirname = "sparc64-ieee1275", .dirname = "sparc64-ieee1275",
.names = { "sparc64-ieee1275-raw", NULL }, .names = { "sparc64-ieee1275-raw", NULL },
.voidp_sizeof = 8, .voidp_sizeof = 8,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_SPARC64_RAW, .id = IMAGE_SPARC64_RAW,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE,
@@ -381,7 +381,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.dirname = "sparc64-ieee1275", .dirname = "sparc64-ieee1275",
.names = { "sparc64-ieee1275-cdcore", NULL }, .names = { "sparc64-ieee1275-cdcore", NULL },
.voidp_sizeof = 8, .voidp_sizeof = 8,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_SPARC64_CDCORE, .id = IMAGE_SPARC64_CDCORE,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE,
@@ -413,8 +413,8 @@ static const struct grub_install_image_target_desc image_targets[] =
.dirname = "ia64-efi", .dirname = "ia64-efi",
.names = {"ia64-efi", NULL}, .names = {"ia64-efi", NULL},
.voidp_sizeof = 8, .voidp_sizeof = 8,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_EFI, .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -430,7 +430,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = {"mips-arc", NULL}, .names = {"mips-arc", NULL},
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_MIPS_ARC, .id = IMAGE_MIPS_ARC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -448,7 +448,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = {"mipsel-arc", NULL}, .names = {"mipsel-arc", NULL},
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_MIPS_ARC, .id = IMAGE_MIPS_ARC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -466,7 +466,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mipsel-qemu_mips-elf", NULL }, .names = { "mipsel-qemu_mips-elf", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_LOONGSON_ELF, .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -484,7 +484,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mips-qemu_mips-flash", NULL }, .names = { "mips-qemu_mips-flash", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_QEMU_MIPS_FLASH, .id = IMAGE_QEMU_MIPS_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -502,7 +502,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mipsel-qemu_mips-flash", NULL }, .names = { "mipsel-qemu_mips-flash", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_QEMU_MIPS_FLASH, .id = IMAGE_QEMU_MIPS_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -520,7 +520,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "mips-qemu_mips-elf", NULL }, .names = { "mips-qemu_mips-elf", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 1, .bigendian = 1,
.id = IMAGE_LOONGSON_ELF, .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS, .flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE, .decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
@@ -538,7 +538,7 @@ static const struct grub_install_image_target_desc image_targets[] =
.names = { "arm-uboot", NULL }, .names = { "arm-uboot", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_UBOOT, .id = IMAGE_UBOOT,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE, .total_module_size = GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -594,8 +594,8 @@ static const struct grub_install_image_target_desc image_targets[] =
.dirname = "arm-efi", .dirname = "arm-efi",
.names = { "arm-efi", NULL }, .names = { "arm-efi", NULL },
.voidp_sizeof = 4, .voidp_sizeof = 4,
.bigendian = 0, .bigendian = 0,
.id = IMAGE_EFI, .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE, .flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD, .total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_compressed_size = TARGET_NO_FIELD,
@@ -1114,7 +1114,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
grub_util_info ("the core size is 0x%" GRUB_HOST_PRIxLONG_LONG, grub_util_info ("the core size is 0x%" GRUB_HOST_PRIxLONG_LONG,
(unsigned long long) core_size); (unsigned long long) core_size);
if (!(image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) if (!(image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS)
&& image_target->total_module_size != TARGET_NO_FIELD) && image_target->total_module_size != TARGET_NO_FIELD)
*((grub_uint32_t *) (core_img + image_target->total_module_size)) *((grub_uint32_t *) (core_img + image_target->total_module_size))
= grub_host_to_target32 (total_module_size); = grub_host_to_target32 (total_module_size);
@@ -1140,7 +1140,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
default: default:
grub_util_error (_("unknown compression %d"), comp); grub_util_error (_("unknown compression %d"), comp);
} }
decompress_path = grub_util_get_path (dir, name); decompress_path = grub_util_get_path (dir, name);
decompress_size = grub_util_get_image_size (decompress_path); decompress_size = grub_util_get_image_size (decompress_path);
decompress_img = grub_util_read_image (decompress_path); decompress_img = grub_util_read_image (decompress_path);
@@ -1240,11 +1240,11 @@ grub_install_generate_image (const char *dir, const char *prefix,
char *pxeboot_path, *pxeboot_img; char *pxeboot_path, *pxeboot_img;
size_t pxeboot_size; size_t pxeboot_size;
grub_uint32_t *ptr; grub_uint32_t *ptr;
pxeboot_path = grub_util_get_path (dir, "pxeboot.img"); pxeboot_path = grub_util_get_path (dir, "pxeboot.img");
pxeboot_size = grub_util_get_image_size (pxeboot_path); pxeboot_size = grub_util_get_image_size (pxeboot_path);
pxeboot_img = grub_util_read_image (pxeboot_path); pxeboot_img = grub_util_read_image (pxeboot_path);
grub_util_write_image (pxeboot_img, pxeboot_size, out, grub_util_write_image (pxeboot_img, pxeboot_size, out,
outname); outname);
free (pxeboot_img); free (pxeboot_img);
@@ -1267,11 +1267,11 @@ grub_install_generate_image (const char *dir, const char *prefix,
{ {
char *eltorito_path, *eltorito_img; char *eltorito_path, *eltorito_img;
size_t eltorito_size; size_t eltorito_size;
eltorito_path = grub_util_get_path (dir, "cdboot.img"); eltorito_path = grub_util_get_path (dir, "cdboot.img");
eltorito_size = grub_util_get_image_size (eltorito_path); eltorito_size = grub_util_get_image_size (eltorito_path);
eltorito_img = grub_util_read_image (eltorito_path); eltorito_img = grub_util_read_image (eltorito_path);
grub_util_write_image (eltorito_img, eltorito_size, out, grub_util_write_image (eltorito_img, eltorito_size, out,
outname); outname);
free (eltorito_img); free (eltorito_img);
@@ -1554,7 +1554,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
size_t boot_size; size_t boot_size;
/* fwstart.img is the only part which can't be tested by using *-elf /* fwstart.img is the only part which can't be tested by using *-elf
target. Check it against the checksum. */ target. Check it against the checksum. */
const grub_uint8_t yeeloong_fwstart_good_hash[512 / 8] = const grub_uint8_t yeeloong_fwstart_good_hash[512 / 8] =
{ {
0x5f, 0x67, 0x46, 0x57, 0x31, 0x30, 0xc5, 0x0a, 0x5f, 0x67, 0x46, 0x57, 0x31, 0x30, 0xc5, 0x0a,
0xe9, 0x98, 0x18, 0xc9, 0xf3, 0xca, 0x45, 0xa5, 0xe9, 0x98, 0x18, 0xc9, 0xf3, 0xca, 0x45, 0xa5,
@@ -1565,8 +1565,8 @@ grub_install_generate_image (const char *dir, const char *prefix,
0x5e, 0x5f, 0x23, 0x7d, 0x7a, 0xe8, 0x51, 0xf7, 0x5e, 0x5f, 0x23, 0x7d, 0x7a, 0xe8, 0x51, 0xf7,
0x1a, 0xaf, 0x2f, 0x54, 0x11, 0x2e, 0x5c, 0x25 0x1a, 0xaf, 0x2f, 0x54, 0x11, 0x2e, 0x5c, 0x25
}; };
const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] =
{ {
0x76, 0x9b, 0xad, 0x6e, 0xa2, 0x39, 0x47, 0x62, 0x76, 0x9b, 0xad, 0x6e, 0xa2, 0x39, 0x47, 0x62,
0x1f, 0xc9, 0x3a, 0x6d, 0x05, 0x5c, 0x43, 0x5c, 0x1f, 0xc9, 0x3a, 0x6d, 0x05, 0x5c, 0x43, 0x5c,
0x29, 0x4a, 0x7e, 0x08, 0x2a, 0x31, 0x8f, 0x5d, 0x29, 0x4a, 0x7e, 0x08, 0x2a, 0x31, 0x8f, 0x5d,
@@ -1578,7 +1578,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
}; };
const grub_uint8_t *fwstart_good_hash; const grub_uint8_t *fwstart_good_hash;
grub_uint8_t fwstart_hash[512 / 8]; grub_uint8_t fwstart_hash[512 / 8];
if (image_target->id == IMAGE_FULOONG2F_FLASH) if (image_target->id == IMAGE_FULOONG2F_FLASH)
{ {
fwstart_good_hash = fuloong2f_fwstart_good_hash; fwstart_good_hash = fuloong2f_fwstart_good_hash;
@@ -1607,7 +1607,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
rom_size = 512 * 1024; rom_size = 512 * 1024;
rom_img = xmalloc (rom_size); rom_img = xmalloc (rom_size);
memset (rom_img, 0, rom_size); memset (rom_img, 0, rom_size);
memcpy (rom_img, boot_img, boot_size); memcpy (rom_img, boot_img, boot_size);
@@ -1633,7 +1633,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
rom_size = 512 * 1024; rom_size = 512 * 1024;
rom_img = xmalloc (rom_size); rom_img = xmalloc (rom_size);
memset (rom_img, 0, rom_size); memset (rom_img, 0, rom_size);
memcpy (rom_img, core_img, core_size); memcpy (rom_img, core_img, core_size);
@@ -1739,7 +1739,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
head->entry = grub_host_to_target32 (target_addr); head->entry = grub_host_to_target32 (target_addr);
head->text_start = grub_host_to_target32 (target_addr); head->text_start = grub_host_to_target32 (target_addr);
head->data_start = grub_host_to_target32 (target_addr + program_size); head->data_start = grub_host_to_target32 (target_addr + program_size);
grub_memcpy (section->name, ".text", sizeof (".text") - 1); grub_memcpy (section->name, ".text", sizeof (".text") - 1);
section->vaddr = grub_host_to_target32 (target_addr); section->vaddr = grub_host_to_target32 (target_addr);
section->size = grub_host_to_target32 (program_size); section->size = grub_host_to_target32 (program_size);
section->file_offset = grub_host_to_target32 (sizeof (*head) + sizeof (*section)); section->file_offset = grub_host_to_target32 (sizeof (*head) + sizeof (*section));
+1 -1
View File
@@ -169,4 +169,4 @@ grub_util_fprint_full_disk_name (FILE *f,
else else
fprintf (f, "%s", dname); fprintf (f, "%s", dname);
free (dname); free (dname);
} }
+2 -2
View File
@@ -162,7 +162,7 @@ grub_util_render_label (const char *label_font,
{ {
grub_util_error (_("cannot open `%s': %s"), label_font, grub_util_error (_("cannot open `%s': %s"), label_font,
strerror (errno)); strerror (errno));
} }
fontfull = xasprintf ("(host)/%s", t); fontfull = xasprintf ("(host)/%s", t);
free (t); free (t);
@@ -173,7 +173,7 @@ grub_util_render_label (const char *label_font,
{ {
grub_util_error (_("cannot open `%s': %s"), label_font, grub_util_error (_("cannot open `%s': %s"), label_font,
grub_errmsg); grub_errmsg);
} }
width = grub_font_get_string_width (font, text) + 10; width = grub_font_get_string_width (font, text) + 10;
height = grub_font_get_height (font); height = grub_font_get_height (font);
+6 -6
View File
@@ -350,7 +350,7 @@ SETUP (const char *dir,
root = drive; root = drive;
continue; continue;
} }
grub_device_close (try_dev); grub_device_close (try_dev);
free (drive); free (drive);
} }
if (!root_dev) if (!root_dev)
@@ -379,7 +379,7 @@ SETUP (const char *dir,
tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE); tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE);
if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img)) 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);
boot_drive_check = (grub_uint8_t *) (boot_img boot_drive_check = (grub_uint8_t *) (boot_img
+ GRUB_BOOT_MACHINE_DRIVE_CHECK); + GRUB_BOOT_MACHINE_DRIVE_CHECK);
/* Copy the possible DOS BPB. */ /* Copy the possible DOS BPB. */
@@ -541,7 +541,7 @@ SETUP (const char *dir,
N_("Your embedding area is unusually small. " N_("Your embedding area is unusually small. "
"core.img won't fit in it.")); "core.img won't fit in it."));
} }
if (err) if (err)
{ {
grub_util_warn ("%s", grub_errmsg); grub_util_warn ("%s", grub_errmsg);
@@ -556,7 +556,7 @@ SETUP (const char *dir,
while (bl.block->len) while (bl.block->len)
{ {
grub_memset (bl.block, 0, sizeof (*bl.block)); grub_memset (bl.block, 0, sizeof (*bl.block));
bl.block--; bl.block--;
if ((char *) bl.block <= core_img) if ((char *) bl.block <= core_img)
@@ -617,7 +617,7 @@ SETUP (const char *dir,
- sizeof (*bl.block)); - sizeof (*bl.block));
#if GRUB_SETUP_BIOS #if GRUB_SETUP_BIOS
grub_size_t no_rs_length; grub_size_t no_rs_length;
no_rs_length = grub_target_to_host16 no_rs_length = grub_target_to_host16
(grub_get_unaligned16 (core_img (grub_get_unaligned16 (core_img
+ GRUB_DISK_SECTOR_SIZE + GRUB_DISK_SECTOR_SIZE
+ GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH)); + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH));
@@ -842,7 +842,7 @@ unable_to_embed:
ptr += cur; ptr += cur;
len -= cur; len -= cur;
bl.block--; bl.block--;
if ((char *) bl.block <= core_img) if ((char *) bl.block <= core_img)
grub_util_error ("%s", _("no terminator in the core image")); grub_util_error ("%s", _("no terminator in the core image"));
} }