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"),
os_dev, errstr);
grub_util_info (_("cannot stat `%s': %s"), os_dev, errstr);
== 0);
dri = make_device_name (drive);
-
+
if (!disk && !rdisk)
return dri;
grub_util_biosdisk_is_present (const char *os_dev)
{
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);
return ret;
}
if (fwrite (buf, 1, size32, out) != size32)
{
if (out_filename)
- grub_util_error ("cannot write to `%s': %s",
+ grub_util_error ("cannot write to `%s': %s",
out_filename, strerror (errno));
else
grub_util_error ("cannot write to the stdout: %s", strerror (errno));
static void
cmd_cp (char *src, const char *dest)
{
- struct cp_hook_ctx ctx =
+ struct cp_hook_ctx ctx =
{
.dest = dest
};
crc_hook (grub_off_t ofs, char *buf, int len, void *crc_ctx)
{
(void) ofs;
-
+
GRUB_MD_CRC32->write(crc_ctx, buf, len);
return 0;
}
grub_device_close (dev);
}
}
-
+
for (i = 0; i < num_disks; i++)
{
char *argv[2];
{N_("crc FILE"), 0, 0 , OPTION_DOC, N_("Get crc32 checksum of FILE."), 1},
{N_("blocklist FILE"), 0, 0, OPTION_DOC, N_("Display blocklist of FILE."), 1},
{N_("xnu_uuid DEVICE"), 0, 0, OPTION_DOC, N_("Compute XNU UUID of the device."), 1},
-
+
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 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},
}
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)
{
const char *p;
case 'K':
if (strcmp (arg, "prompt") == 0)
{
- char buf[1024];
+ char buf[1024];
grub_puts_ (N_("Enter ZFS password: "));
if (grub_password_get (buf, 1023))
{
struct argp argp = {
options, argp_parser, N_("IMAGE_PATH COMMANDS"),
- N_("Debug tool for filesystem driver."),
+ N_("Debug tool for filesystem driver."),
NULL, NULL, NULL
};
#include FT_SYNTHESIS_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_ERROR_END_LIST };
-#include FT_ERRORS_H
+#include FT_ERRORS_H
#define GRUB_FONT_DEFAULT_SIZE 16
#include FT_SYNTHESIS_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_ERROR_END_LIST };
-#include FT_ERRORS_H
+#include FT_ERRORS_H
#define GRUB_FONT_DEFAULT_SIZE 16
fprintf (stderr, "grub-gen-widthspec: error: can't set %dx%d font size", size, size);
return 1;
}
-
+
for (char_code = FT_Get_First_Char (ft_face, &glyph_index);
glyph_index;
char_code = FT_Get_Next_Char (ft_face, char_code, &glyph_index))
return xasprintf(text, "unicode");
case GRUB_INSTALL_OPTIONS_DIRECTORY:
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:
return xasprintf(text, grub_util_get_localedir ());
case GRUB_INSTALL_OPTIONS_THEMES_DIRECTORY:
const char *dst,
int is_needed)
{
- grub_util_fd_t in, out;
+ grub_util_fd_t in, out;
ssize_t r;
grub_util_info ("copying `%s' -> `%s'", src, dst);
if (!grub_install_copy_buffer)
grub_install_copy_buffer = xmalloc (GRUB_INSTALL_COPY_BUFFER_SIZE);
-
+
while (1)
{
r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE);
const char *mkimage_target, int note)
{
const struct grub_install_image_target_desc *tgt;
- const char *const compnames[] =
+ const char *const compnames[] =
{
[GRUB_COMPRESSION_AUTO] = "auto",
[GRUB_COMPRESSION_NONE] = "none",
[GRUB_INSTALL_PLATFORM_ARM_COREBOOT] = { "arm", "coreboot" },
[GRUB_INSTALL_PLATFORM_RISCV32_EFI] = { "riscv32", "efi" },
[GRUB_INSTALL_PLATFORM_RISCV64_EFI] = { "riscv64", "efi" },
- };
+ };
char *
grub_install_get_platforms_string (void)
}
ptr[-2] = 0;
free (arr);
-
+
return platforms_string;
}
fn = grub_util_path_concat (2, src, "modinfo.sh");
f = grub_util_fd_open (fn, GRUB_UTIL_FD_O_RDONLY);
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);
r = grub_util_fd_read (f, buf, sizeof (buf) - 1);
if (r < 0)
OPTION_ROOT_DIRECTORY,
OPTION_TARGET,
OPTION_SETUP,
- OPTION_MKRELPATH,
- OPTION_MKDEVICEMAP,
- OPTION_PROBE,
- OPTION_EDITENV,
- OPTION_ALLOW_FLOPPY,
- OPTION_RECHECK,
+ OPTION_MKRELPATH,
+ OPTION_MKDEVICEMAP,
+ OPTION_PROBE,
+ OPTION_EDITENV,
+ OPTION_ALLOW_FLOPPY,
+ OPTION_RECHECK,
OPTION_FORCE,
OPTION_FORCE_FILE_ID,
- OPTION_NO_NVRAM,
- OPTION_REMOVABLE,
- OPTION_BOOTLOADER_ID,
+ OPTION_NO_NVRAM,
+ OPTION_REMOVABLE,
+ OPTION_BOOTLOADER_ID,
OPTION_EFI_DIRECTORY,
OPTION_FONT,
OPTION_DEBUG,
static int fs_probe = 1;
-static error_t
+static error_t
argp_parser (int key, char *arg, struct argp_state *state)
{
if (grub_install_parse (key, arg))
N_("Install GRUB on your drive.")"\v"
N_("INSTALL_DEVICE must be system device filename.\n"
"%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
};
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);
err = grub_disk_write (dev->disk, 0, 0,
const char * t;
t = get_default_platform ();
if (!t)
- grub_util_error ("%s",
+ grub_util_error ("%s",
_("Unable to determine your platform."
" Use --target.")
);
- target = xstrdup (t);
+ target = xstrdup (t);
}
grub_install_source_directory
= grub_util_path_concat (2, grub_util_get_pkglibdir (), target);
for (curdev = efidir_device_names; *curdev; curdev++)
grub_util_pull_device (*curdev);
-
+
efidir_grub_devname = grub_util_get_grub_dev (efidir_device_names[0]);
if (!efidir_grub_devname)
grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
for (curdev = macppcdir_device_names; *curdev; curdev++)
grub_util_pull_device (*curdev);
-
+
macppcdir_grub_devname = grub_util_get_grub_dev (macppcdir_device_names[0]);
if (!macppcdir_grub_devname)
grub_util_error (_("cannot find a GRUB drive for %s. Check your device.map"),
macppcdir_device_names[0]);
-
+
macppcdir_grub_dev = grub_device_open (macppcdir_grub_devname);
if (! macppcdir_grub_dev)
grub_util_error ("%s", grub_errmsg);
{
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,
"boot.img");
char *boot_img = grub_util_path_concat (2, platdir,
platdir,
device_map,
install_device);
-
+
/* Now perform the installation. */
if (install_bootsector)
{
}
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,
"boot.img");
char *boot_img = grub_util_path_concat (2, platdir,
platdir,
device_map,
install_drive);
-
+
/* Now perform the installation. */
if (install_bootsector)
{
{
out = grub_util_fopen (argv[2], "w");
if (!out)
- {
+ {
if (in != stdin)
fclose (in);
fprintf (stderr, _("cannot open `%s': %s"),
#include FT_SYNTHESIS_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_ERROR_END_LIST };
-#include FT_ERRORS_H
+#include FT_ERRORS_H
#ifndef GRUB_BUILD
#include "progname.h"
char_code | GRUB_FONT_CODE_RIGHT_JOINED, nocut);
break;
}
-
+
}
for (cur = subst_leftjoin; cur; cur = cur->next)
char_code | GRUB_FONT_CODE_LEFT_JOINED, nocut);
break;
}
-
+
}
for (cur = subst_medijoin; cur; cur = cur->next)
if (cur->from == glyph_idx)
| GRUB_FONT_CODE_RIGHT_JOINED, nocut);
break;
}
-
+
}
}
{
grub_uint16_t type;
grub_uint16_t count;
- struct
+ struct
{
grub_uint16_t start;
grub_uint16_t end;
if (lookup_index >= grub_be_to_cpu16 (lookups->count))
{
/* 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". "*/
printf (_("Out of range lookup: %d\n"), lookup_index);
continue;
}
lookup = (struct gsub_lookup *)
- ((grub_uint8_t *) lookups
+ ((grub_uint8_t *) lookups
+ grub_be_to_cpu16 (lookups->offsets[lookup_index]));
if (grub_be_to_cpu16 (lookup->type) != GSUB_SINGLE_SUBSTITUTION)
{
printf (_("Unsupported substitution type: %d\n"),
grub_be_to_cpu16 (lookup->type));
continue;
- }
+ }
if (grub_be_to_cpu16 (lookup->flag) & ~GSUB_RTL_CHAR)
{
grub_util_info ("unsupported substitution flag: 0x%x",
break;
case FEATURE_MEDI:
target = &subst_medijoin;
- break;
+ break;
}
for (k = 0; k < grub_be_to_cpu16 (lookup->subtablecount); k++)
{
}
if (gsub)
{
- struct gsub_features *features
+ struct gsub_features *features
= (struct gsub_features *) (((grub_uint8_t *) gsub)
+ grub_be_to_cpu16 (gsub->features_off));
struct gsub_lookup_list *lookups
This option is used to chose among them, the first face being '0'.
Rarely used. */
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. */
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
like "Bold". */
N_("set font family name"), 0},
grub_util_error ("%s", _("FT_Init_FreeType fails"));
{
- size_t i;
+ size_t i;
for (i = 0; i < arguments.nfiles; i++)
{
FT_Face ft_face;
phdr->p_align = grub_host_to_target32 (layout->align > image_target->link_align ?
layout->align : image_target->link_align);
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);
else
ehdr->e_flags = 0;
if (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);
grub_util_info ("adding CHRP NOTE segment");
static int
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)
return 0;
return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC))
layout->bss_start = layout->kernel_size;
layout->end = layout->kernel_size;
-
+
/* .bss */
for (i = 0, s = smd->sections;
i < smd->num_sections;
{"dead_grave", '`'},
{"dead_tilde", '~'},
{"dead_diaeresis", '"'},
-
+
/* Following ones don't provide any useful symbols for shell. */
{"dead_cedilla", 0},
{"dead_ogonek", 0},
};
static grub_uint8_t linux_to_usb_map[128] = {
- /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE,
- /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2,
- /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4,
- /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6,
- /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8,
- /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0,
- /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL,
- /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB,
- /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W,
- /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R,
- /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y,
- /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I,
- /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P,
- /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET,
- /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL,
- /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S,
- /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F,
- /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H,
- /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K,
- /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON,
- /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE,
- /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH,
- /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X,
- /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V,
- /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N,
- /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA,
- /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH,
- /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL,
- /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE,
- /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1,
- /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3,
- /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5,
- /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7,
- /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9,
- /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK,
- /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7,
- /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9,
- /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4,
- /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6,
- /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1,
- /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3,
- /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT,
- /* 0x54 */ 0, 0,
- /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11,
+ /* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE,
+ /* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2,
+ /* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4,
+ /* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6,
+ /* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8,
+ /* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0,
+ /* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL,
+ /* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB,
+ /* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W,
+ /* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R,
+ /* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y,
+ /* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I,
+ /* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P,
+ /* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET,
+ /* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL,
+ /* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S,
+ /* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F,
+ /* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H,
+ /* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K,
+ /* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON,
+ /* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE,
+ /* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH,
+ /* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X,
+ /* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V,
+ /* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N,
+ /* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA,
+ /* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH,
+ /* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL,
+ /* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE,
+ /* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1,
+ /* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3,
+ /* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5,
+ /* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7,
+ /* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9,
+ /* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK,
+ /* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7,
+ /* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9,
+ /* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4,
+ /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6,
+ /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1,
+ /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3,
+ /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT,
+ /* 0x54 */ 0, 0,
+ /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11,
/* 0x58 */ GRUB_KEYBOARD_KEY_F12, GRUB_KEYBOARD_KEY_JP_RO,
/* 0x5a */ 0, 0,
/* 0x5c */ 0, 0,
/* 0x66 */ GRUB_KEYBOARD_KEY_HOME, GRUB_KEYBOARD_KEY_UP,
/* 0x68 */ GRUB_KEYBOARD_KEY_PPAGE, GRUB_KEYBOARD_KEY_LEFT,
/* 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,
/* 0x70 */ 0, 0,
/* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
/* 0x78 */ 0, GRUB_KEYBOARD_KEY_KPCOMMA,
/* 0x7a */ 0, 0,
/* 0x7c */ GRUB_KEYBOARD_KEY_JP_YEN,
-};
+};
static void
add_special_keys (struct grub_keyboard_layout *layout)
unsigned i;
version = grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION);
-
+
for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++)
layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]);
{0, 0, 0, 0, 0, 0}
};
-static error_t
+static error_t
argp_parser (int key, char *arg, struct argp_state *state)
{
if (grub_install_parse (key, arg))
struct argp argp = {
options, argp_parser, NULL,
"\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
};
buf = xmalloc (arguments.buflen);
salt = xmalloc (arguments.saltlen);
-
+
printf ("%s", _("Enter password: "));
if (!grub_password_get (pass1, GRUB_AUTH_MAX_PASSLEN))
{
ptr = result;
memcpy (ptr, "grub.pbkdf2.sha512.", sizeof ("grub.pbkdf2.sha512.") - 1);
ptr += sizeof ("grub.pbkdf2.sha512.") - 1;
-
+
grub_snprintf (ptr, sizeof ("XXXXXXXXXXXXXXXXXXX"), "%d", arguments.count);
ptr += strlen (ptr);
*ptr++ = '.';
SYS_AREA_ARCS
} system_area = SYS_AREA_AUTO;
-static error_t
+static error_t
argp_parser (int key, char *arg, struct argp_state *state)
{
if (grub_install_parse (key, arg))
xorriso_push ("-as");
xorriso_push ("mkisofs");
xorriso_push ("-graft-points");
-
+
iso9660_dir = grub_util_make_temporary_dir ();
grub_util_info ("temporary iso9660 dir is `%s'", iso9660_dir);
boot_grub = grub_util_path_concat (3, iso9660_dir, "boot", "grub");
strerror (errno));
fclose (bi);
fwrite (buf, 1, 512, sa);
-
+
grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
"/boot/grub", sa, sysarea_img,
0, load_cfg,
fflush (sa);
grub_util_fd_sync (fileno (sa));
fclose (sa);
-
+
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."));
struct argp argp = {
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
};
compute_checksum (&hd);
fwrite (&hd, 1, sizeof (hd), memdisk);
-
+
while (1)
{
r = grub_util_fd_read (in, grub_install_copy_buffer, GRUB_INSTALL_COPY_BUFFER_SIZE);
{
struct fuse_getattr_ctx ctx;
char *pathname, *path2;
-
+
if (path[0] == '/' && path[1] == 0)
{
st->st_dev = 0;
ctx.file_exists = 0;
pathname = xstrdup (path);
-
+
/* Remove trailing '/'. */
while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')
pathname[grub_strlen (pathname) - 1] = 0;
}
static int
-fuse_opendir (const char *path, struct fuse_file_info *fi)
+fuse_opendir (const char *path, struct fuse_file_info *fi)
{
return 0;
}
static grub_file_t files[65536];
static int first_fd = 1;
-static int
+static int
fuse_open (const char *path, struct fuse_file_info *fi __attribute__ ((unused)))
{
grub_file_t file;
files[first_fd++] = file;
grub_errno = GRUB_ERR_NONE;
return 0;
-}
+}
-static int
+static int
fuse_read (const char *path, char *buf, size_t sz, off_t off,
struct fuse_file_info *fi)
{
return -EINVAL;
file->offset = off;
-
+
size = grub_file_read (file, buf, sz);
if (size < 0)
return translate_error ();
grub_errno = GRUB_ERR_NONE;
return size;
}
-}
+}
-static int
+static int
fuse_release (const char *path, struct fuse_file_info *fi)
{
grub_file_close (files[fi->fh]);
return 0;
}
-static int
+static int
fuse_readdir (const char *path, void *buf,
fuse_fill_dir_t fill, off_t off, struct fuse_file_info *fi)
{
char *pathname;
pathname = xstrdup (path);
-
+
/* Remove trailing '/'. */
while (pathname [0] && pathname[1]
&& pathname[grub_strlen (pathname) - 1] == '/')
return grub_errno;
}
-static struct argp_option options[] = {
+static struct argp_option options[] = {
{"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2},
{"debug", 'd', N_("STRING"), 0, N_("Set debug environment variable."), 2},
{"crypto", 'C', NULL, 0, N_("Mount crypto devices."), 2},
}
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)
{
switch (key)
case 'K':
if (strcmp (arg, "prompt") == 0)
{
- char buf[1024];
+ char buf[1024];
grub_printf ("%s", _("Enter ZFS password: "));
if (grub_password_get (buf, 1023))
{
struct argp argp = {
options, argp_parser, N_("IMAGE1 [IMAGE2 ...] MOUNTPOINT"),
- N_("Debug tool for filesystem driver."),
+ N_("Debug tool for filesystem driver."),
NULL, NULL, NULL
};
fuse_argc++;
argp_parse (&argp, argc, argv, 0, 0, 0);
-
+
if (num_disks < 2)
grub_util_error ("%s", _("need an image and mountpoint"));
fuse_args = xrealloc (fuse_args, (fuse_argc + 2) * sizeof (fuse_args[0]));
dev = grub_device_open (drives_names[0]);
if (! dev)
grub_util_error ("%s", grub_errmsg);
-
+
fs = grub_fs_probe (dev);
if (! fs)
grub_util_error ("%s", grub_errmsg);
else
printf ("\n");
}
-
+
else if ((print == PRINT_COMPATIBILITY_HINT || print == PRINT_BIOS_HINT
|| print == PRINT_IEEE1275_HINT || print == PRINT_BAREMETAL_HINT
|| print == PRINT_EFI_HINT || print == PRINT_ARC_HINT)
{
input = 0;
get_config_line (&input, 0, &ctx);
- if (! input)
+ if (! input)
break;
found_input = 1;
{
grub_util_error (_("cannot open `%s': %s"), arguments.input,
strerror (errno));
- }
+ }
inpfull = xasprintf ("(host)/%s", t);
free (t);
{
grub_util_error (_("cannot open `%s': %s"), arguments.root,
strerror (errno));
- }
+ }
rootfull = xasprintf ("(host)/%s", t);
free (t);
{
grub_util_error (_("cannot open `%s': %s"), arguments.root,
strerror (errno));
- }
+ }
cwdfull = xasprintf ("(host)/%s", t);
free (t);
if (!f)
grub_util_error (_("cannot open `%s': %s"), arguments.output,
strerror (errno));
- fwrite (res, 1, strlen (res), f);
+ fwrite (res, 1, strlen (res), f);
fclose (f);
}
else
.names = { "i386-pc", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_I386_PC,
+ .id = IMAGE_I386_PC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
.names = { "i386-pc-pxe", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_I386_PC_PXE,
+ .id = IMAGE_I386_PC_PXE,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
.names = { "i386-pc-eltorito", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_I386_PC_ELTORITO,
+ .id = IMAGE_I386_PC_ELTORITO,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE,
.names = { "i386-ieee1275", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_I386_IEEE1275,
+ .id = IMAGE_I386_IEEE1275,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.names = { "i386-qemu", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_QEMU,
+ .id = IMAGE_QEMU,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.dirname = "x86_64-efi",
.names = { "x86_64-efi", NULL },
.voidp_sizeof = 8,
- .bigendian = 0,
- .id = IMAGE_EFI,
+ .bigendian = 0,
+ .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.names = { "i386-xen", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_XEN,
+ .id = IMAGE_XEN,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.names = { "x86_64-xen", NULL },
.voidp_sizeof = 8,
.bigendian = 0,
- .id = IMAGE_XEN,
+ .id = IMAGE_XEN,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.names = { "mipsel-yeeloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_YEELOONG_FLASH,
+ .id = IMAGE_YEELOONG_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "mipsel-fuloong2f-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_FULOONG2F_FLASH,
+ .id = IMAGE_FULOONG2F_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
"mipsel-fuloong-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_LOONGSON_ELF,
+ .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "powerpc-ieee1275", NULL },
.voidp_sizeof = 4,
.bigendian = 1,
- .id = IMAGE_PPC,
+ .id = IMAGE_PPC,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.dirname = "sparc64-ieee1275",
.names = { "sparc64-ieee1275-raw", NULL },
.voidp_sizeof = 8,
- .bigendian = 1,
+ .bigendian = 1,
.id = IMAGE_SPARC64_RAW,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE,
.dirname = "sparc64-ieee1275",
.names = { "sparc64-ieee1275-cdcore", NULL },
.voidp_sizeof = 8,
- .bigendian = 1,
+ .bigendian = 1,
.id = IMAGE_SPARC64_CDCORE,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE,
.dirname = "ia64-efi",
.names = {"ia64-efi", NULL},
.voidp_sizeof = 8,
- .bigendian = 0,
- .id = IMAGE_EFI,
+ .bigendian = 0,
+ .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
.names = {"mips-arc", NULL},
.voidp_sizeof = 4,
.bigendian = 1,
- .id = IMAGE_MIPS_ARC,
+ .id = IMAGE_MIPS_ARC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = {"mipsel-arc", NULL},
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_MIPS_ARC,
+ .id = IMAGE_MIPS_ARC,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "mipsel-qemu_mips-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_LOONGSON_ELF,
+ .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "mips-qemu_mips-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 1,
- .id = IMAGE_QEMU_MIPS_FLASH,
+ .id = IMAGE_QEMU_MIPS_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "mipsel-qemu_mips-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_QEMU_MIPS_FLASH,
+ .id = IMAGE_QEMU_MIPS_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "mips-qemu_mips-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 1,
- .id = IMAGE_LOONGSON_ELF,
+ .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
.total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE,
.names = { "arm-uboot", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_UBOOT,
+ .id = IMAGE_UBOOT,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE,
.decompressor_compressed_size = TARGET_NO_FIELD,
.dirname = "arm-efi",
.names = { "arm-efi", NULL },
.voidp_sizeof = 4,
- .bigendian = 0,
- .id = IMAGE_EFI,
+ .bigendian = 0,
+ .id = IMAGE_EFI,
.flags = PLATFORM_FLAGS_NONE,
.total_module_size = TARGET_NO_FIELD,
.decompressor_compressed_size = TARGET_NO_FIELD,
grub_util_info ("the core size is 0x%" GRUB_HOST_PRIxLONG_LONG,
(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)
*((grub_uint32_t *) (core_img + image_target->total_module_size))
= grub_host_to_target32 (total_module_size);
default:
grub_util_error (_("unknown compression %d"), comp);
}
-
+
decompress_path = grub_util_get_path (dir, name);
decompress_size = grub_util_get_image_size (decompress_path);
decompress_img = grub_util_read_image (decompress_path);
char *pxeboot_path, *pxeboot_img;
size_t pxeboot_size;
grub_uint32_t *ptr;
-
+
pxeboot_path = grub_util_get_path (dir, "pxeboot.img");
pxeboot_size = grub_util_get_image_size (pxeboot_path);
pxeboot_img = grub_util_read_image (pxeboot_path);
-
+
grub_util_write_image (pxeboot_img, pxeboot_size, out,
outname);
free (pxeboot_img);
{
char *eltorito_path, *eltorito_img;
size_t eltorito_size;
-
+
eltorito_path = grub_util_get_path (dir, "cdboot.img");
eltorito_size = grub_util_get_image_size (eltorito_path);
eltorito_img = grub_util_read_image (eltorito_path);
-
+
grub_util_write_image (eltorito_img, eltorito_size, out,
outname);
free (eltorito_img);
size_t boot_size;
/* fwstart.img is the only part which can't be tested by using *-elf
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,
0xe9, 0x98, 0x18, 0xc9, 0xf3, 0xca, 0x45, 0xa5,
0x5e, 0x5f, 0x23, 0x7d, 0x7a, 0xe8, 0x51, 0xf7,
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,
0x1f, 0xc9, 0x3a, 0x6d, 0x05, 0x5c, 0x43, 0x5c,
0x29, 0x4a, 0x7e, 0x08, 0x2a, 0x31, 0x8f, 0x5d,
};
const grub_uint8_t *fwstart_good_hash;
grub_uint8_t fwstart_hash[512 / 8];
-
+
if (image_target->id == IMAGE_FULOONG2F_FLASH)
{
fwstart_good_hash = fuloong2f_fwstart_good_hash;
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
- memset (rom_img, 0, rom_size);
+ memset (rom_img, 0, rom_size);
memcpy (rom_img, boot_img, boot_size);
rom_size = 512 * 1024;
rom_img = xmalloc (rom_size);
- memset (rom_img, 0, rom_size);
+ memset (rom_img, 0, rom_size);
memcpy (rom_img, core_img, core_size);
head->entry = 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);
- 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->size = grub_host_to_target32 (program_size);
section->file_offset = grub_host_to_target32 (sizeof (*head) + sizeof (*section));
else
fprintf (f, "%s", dname);
free (dname);
-}
+}
{
grub_util_error (_("cannot open `%s': %s"), label_font,
strerror (errno));
- }
+ }
fontfull = xasprintf ("(host)/%s", t);
free (t);
{
grub_util_error (_("cannot open `%s': %s"), label_font,
grub_errmsg);
- }
+ }
width = grub_font_get_string_width (font, text) + 10;
height = grub_font_get_height (font);
root = drive;
continue;
}
- grub_device_close (try_dev);
+ grub_device_close (try_dev);
free (drive);
}
if (!root_dev)
tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE);
if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img))
grub_util_error ("%s", grub_errmsg);
-
+
boot_drive_check = (grub_uint8_t *) (boot_img
+ GRUB_BOOT_MACHINE_DRIVE_CHECK);
/* Copy the possible DOS BPB. */
N_("Your embedding area is unusually small. "
"core.img won't fit in it."));
}
-
+
if (err)
{
grub_util_warn ("%s", grub_errmsg);
while (bl.block->len)
{
grub_memset (bl.block, 0, sizeof (*bl.block));
-
+
bl.block--;
if ((char *) bl.block <= core_img)
- sizeof (*bl.block));
#if GRUB_SETUP_BIOS
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_DISK_SECTOR_SIZE
+ GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH));
ptr += cur;
len -= cur;
bl.block--;
-
+
if ((char *) bl.block <= core_img)
grub_util_error ("%s", _("no terminator in the core image"));
}