Merge branch 'master' into leiflindholm/arm64
This commit is contained in:
commit
96fa2d9d02
33 changed files with 519 additions and 96 deletions
|
@ -271,6 +271,7 @@ handle_install_list (struct install_list *il, const char *val,
|
|||
}
|
||||
il->n_alloc = il->n_entries + 1;
|
||||
il->entries = xmalloc (il->n_alloc * sizeof (il->entries[0]));
|
||||
ptr = val;
|
||||
for (ce = il->entries; ; ce++)
|
||||
{
|
||||
const char *bptr;
|
||||
|
@ -284,7 +285,6 @@ handle_install_list (struct install_list *il, const char *val,
|
|||
*ce = xmalloc (ptr - bptr + 1);
|
||||
memcpy (*ce, bptr, ptr - bptr);
|
||||
(*ce)[ptr - bptr] = '\0';
|
||||
ce++;
|
||||
}
|
||||
*ce = NULL;
|
||||
}
|
||||
|
@ -329,7 +329,8 @@ grub_install_parse (int key, char *arg)
|
|||
handle_install_list (&install_fonts, arg, 0);
|
||||
return 1;
|
||||
case GRUB_INSTALL_OPTIONS_INSTALL_COMPRESS:
|
||||
if (strcmp (arg, "no") == 0)
|
||||
if (strcmp (arg, "no") == 0
|
||||
|| strcmp (arg, "none") == 0)
|
||||
{
|
||||
compress_func = NULL;
|
||||
return 1;
|
||||
|
@ -585,28 +586,27 @@ copy_locales (const char *dstd)
|
|||
|
||||
static struct
|
||||
{
|
||||
enum grub_install_plat val;
|
||||
const char *cpu;
|
||||
const char *platform;
|
||||
} platforms[] =
|
||||
} platforms[GRUB_INSTALL_PLATFORM_MAX] =
|
||||
{
|
||||
{ GRUB_INSTALL_PLATFORM_I386_PC, "i386", "pc" },
|
||||
{ GRUB_INSTALL_PLATFORM_I386_EFI, "i386", "efi" },
|
||||
{ GRUB_INSTALL_PLATFORM_I386_QEMU, "i386", "qemu" },
|
||||
{ GRUB_INSTALL_PLATFORM_I386_COREBOOT, "i386", "coreboot" },
|
||||
{ GRUB_INSTALL_PLATFORM_I386_MULTIBOOT, "i386", "multiboot" },
|
||||
{ GRUB_INSTALL_PLATFORM_I386_IEEE1275, "i386", "ieee1275" },
|
||||
{ GRUB_INSTALL_PLATFORM_X86_64_EFI, "x86_64", "efi" },
|
||||
{ GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel", "loongson" },
|
||||
{ GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "mipsel", "qemu_mips" },
|
||||
{ GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "mips", "qemu_mips" },
|
||||
{ GRUB_INSTALL_PLATFORM_MIPSEL_ARC, "mipsel", "arc" },
|
||||
{ GRUB_INSTALL_PLATFORM_MIPS_ARC, "mips", "arc" },
|
||||
{ GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275, "sparc64", "ieee1275" },
|
||||
{ GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275, "powerpc", "ieee1275" },
|
||||
{ GRUB_INSTALL_PLATFORM_IA64_EFI, "ia64", "efi" },
|
||||
{ GRUB_INSTALL_PLATFORM_ARM_EFI, "arm", "efi" },
|
||||
{ GRUB_INSTALL_PLATFORM_ARM_UBOOT, "arm", "uboot" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_PC] = { "i386", "pc" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_EFI] = { "i386", "efi" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_QEMU] = { "i386", "qemu" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_COREBOOT] = { "i386", "coreboot" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_MULTIBOOT] = { "i386", "multiboot" },
|
||||
[GRUB_INSTALL_PLATFORM_I386_IEEE1275] = { "i386", "ieee1275" },
|
||||
[GRUB_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64", "efi" },
|
||||
[GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON] = { "mipsel", "loongson" },
|
||||
[GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS] = { "mipsel", "qemu_mips" },
|
||||
[GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS] = { "mips", "qemu_mips" },
|
||||
[GRUB_INSTALL_PLATFORM_MIPSEL_ARC] = { "mipsel", "arc" },
|
||||
[GRUB_INSTALL_PLATFORM_MIPS_ARC] = { "mips", "arc" },
|
||||
[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64", "ieee1275" },
|
||||
[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc", "ieee1275" },
|
||||
[GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64", "efi" },
|
||||
[GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm", "efi" },
|
||||
[GRUB_INSTALL_PLATFORM_ARM_UBOOT] = { "arm", "uboot" },
|
||||
};
|
||||
|
||||
char *
|
||||
|
@ -662,10 +662,17 @@ grub_install_copy_files (const char *src,
|
|||
install_modules.entries);
|
||||
for (p = path_list; p; p = p->next)
|
||||
{
|
||||
char *srcf = grub_util_path_concat_ext (2, src, p->name, ".mo");
|
||||
char *dstf = grub_util_path_concat_ext (2, dst, p->name, ".mo");
|
||||
const char *srcf = p->name;
|
||||
const char *dir;
|
||||
char *dstf;
|
||||
|
||||
dir = grub_strrchr (srcf, '/');
|
||||
if (dir)
|
||||
dir++;
|
||||
else
|
||||
dir = srcf;
|
||||
dstf = grub_util_path_concat (2, dst_platform, dir);
|
||||
grub_install_compress_file (srcf, dstf, 1);
|
||||
free (srcf);
|
||||
free (dstf);
|
||||
}
|
||||
}
|
||||
|
@ -825,7 +832,7 @@ grub_install_get_target (const char *src)
|
|||
&& strcmp (platforms[i].platform, pl) == 0)
|
||||
{
|
||||
free (fn);
|
||||
return platforms[i].val;
|
||||
return i;
|
||||
}
|
||||
grub_util_error (_("Unknown platform `%s-%s'"), c, pl);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ static char * bootloader_id;
|
|||
static int have_load_cfg = 0;
|
||||
static FILE * load_cfg_f = NULL;
|
||||
static char *load_cfg;
|
||||
static int install_bootsector = 1;
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -91,7 +92,8 @@ enum
|
|||
OPTION_DEBUG,
|
||||
OPTION_DEBUG_IMAGE,
|
||||
OPTION_NO_FLOPPY,
|
||||
OPTION_DISK_MODULE
|
||||
OPTION_DISK_MODULE,
|
||||
OPTION_NO_BOOTSECTOR
|
||||
};
|
||||
|
||||
static int fs_probe = 1;
|
||||
|
@ -110,9 +112,13 @@ argp_parser (int key, char *arg, struct argp_state *state)
|
|||
fs_probe = 0;
|
||||
return 0;
|
||||
|
||||
case OPTION_SETUP:
|
||||
if (!grub_strstr (arg, "setup"))
|
||||
install_bootsector = 0;
|
||||
return 0;
|
||||
|
||||
/* Accept and ignore for compatibility. */
|
||||
case OPTION_FONT:
|
||||
case OPTION_SETUP:
|
||||
case OPTION_MKRELPATH:
|
||||
case OPTION_PROBE:
|
||||
case OPTION_EDITENV:
|
||||
|
@ -170,6 +176,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
|
|||
allow_floppy = 1;
|
||||
return 0;
|
||||
|
||||
case OPTION_NO_BOOTSECTOR:
|
||||
install_bootsector = 0;
|
||||
return 0;
|
||||
|
||||
case OPTION_DEBUG:
|
||||
verbosity++;
|
||||
return 0;
|
||||
|
@ -224,6 +234,10 @@ static struct argp_option options[] = {
|
|||
{"no-nvram", OPTION_NO_NVRAM, 0, 0,
|
||||
N_("don't update the `boot-device' NVRAM variable. "
|
||||
"This option is only available on IEEE1275 targets."), 2},
|
||||
{"skip-fs-probe",'s',0, 0,
|
||||
N_("do not probe for filesystems in DEVICE"), 0},
|
||||
{"no-bootsector", OPTION_NO_BOOTSECTOR, 0, 0,
|
||||
N_("do not install bootsector"), 0},
|
||||
|
||||
{"debug", OPTION_DEBUG, 0, OPTION_HIDDEN, 0, 2},
|
||||
{"no-floppy", OPTION_NO_FLOPPY, 0, OPTION_HIDDEN, 0, 2},
|
||||
|
@ -235,9 +249,6 @@ static struct argp_option options[] = {
|
|||
N_("the ID of bootloader. This option is only available on EFI."), 2},
|
||||
{"efi-directory", OPTION_EFI_DIRECTORY, N_("DIR"), 0,
|
||||
N_("use DIR as the EFI System Partition root."), 2},
|
||||
{"skip-fs-probe",'s',0, 0,
|
||||
N_("do not probe for filesystems in DEVICE"), 0},
|
||||
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -1403,7 +1414,8 @@ main (int argc, char *argv[])
|
|||
"boot.img");
|
||||
grub_install_copy_file (boot_img_src, boot_img, 1);
|
||||
|
||||
grub_util_info ("grub_bios_setup %s %s %s %s --directory='%s' --device-map='%s' '%s'",
|
||||
grub_util_info ("%sgrub_bios_setup %s %s %s %s --directory='%s' --device-map='%s' '%s'",
|
||||
install_bootsector ? "" : "NOT RUNNING: ",
|
||||
allow_floppy ? "--allow-floppy " : "",
|
||||
verbosity ? "--verbose " : "",
|
||||
force ? "--force " : "",
|
||||
|
@ -1413,9 +1425,10 @@ main (int argc, char *argv[])
|
|||
install_device);
|
||||
|
||||
/* Now perform the installation. */
|
||||
grub_util_bios_setup (platdir, "boot.img", "core.img",
|
||||
install_drive, force,
|
||||
fs_probe, allow_floppy);
|
||||
if (install_bootsector)
|
||||
grub_util_bios_setup (platdir, "boot.img", "core.img",
|
||||
install_drive, force,
|
||||
fs_probe, allow_floppy);
|
||||
break;
|
||||
}
|
||||
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
|
||||
|
@ -1427,7 +1440,8 @@ main (int argc, char *argv[])
|
|||
"boot.img");
|
||||
grub_install_copy_file (boot_img_src, boot_img, 1);
|
||||
|
||||
grub_util_info ("grub_sparc_setup %s %s %s %s --directory='%s' --device-map='%s' '%s'",
|
||||
grub_util_info ("%sgrub_sparc_setup %s %s %s %s --directory='%s' --device-map='%s' '%s'",
|
||||
install_bootsector ? "" : "NOT RUNNING: ",
|
||||
allow_floppy ? "--allow-floppy " : "",
|
||||
verbosity ? "--verbose " : "",
|
||||
force ? "--force " : "",
|
||||
|
@ -1437,9 +1451,10 @@ main (int argc, char *argv[])
|
|||
install_drive);
|
||||
|
||||
/* Now perform the installation. */
|
||||
grub_util_sparc_setup (platdir, "boot.img", "core.img",
|
||||
install_device, force,
|
||||
fs_probe, allow_floppy);
|
||||
if (install_bootsector)
|
||||
grub_util_sparc_setup (platdir, "boot.img", "core.img",
|
||||
install_device, force,
|
||||
fs_probe, allow_floppy);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -290,12 +290,24 @@ make_image_fwdisk_abs (enum grub_install_plat plat,
|
|||
const char *mkimage_target,
|
||||
const char *output)
|
||||
{
|
||||
char *load_cfg;
|
||||
FILE *load_cfg_f;
|
||||
|
||||
if (!source_dirs[plat])
|
||||
return;
|
||||
|
||||
grub_util_info (N_("enabling %s support ..."),
|
||||
mkimage_target);
|
||||
|
||||
load_cfg = grub_util_make_temporary_file ();
|
||||
|
||||
load_cfg_f = grub_util_fopen (load_cfg, "wb");
|
||||
write_part (load_cfg_f, source_dirs[plat]);
|
||||
fclose (load_cfg_f);
|
||||
|
||||
grub_install_push_module ("iso9660");
|
||||
grub_install_make_image_wrap (source_dirs[plat], "()/boot/grub", output,
|
||||
0, 0, mkimage_target, 0,
|
||||
0, load_cfg, mkimage_target, 0,
|
||||
GRUB_COMPRESSION_AUTO);
|
||||
grub_install_pop_module ();
|
||||
}
|
||||
|
@ -376,8 +388,7 @@ main (int argc, char *argv[])
|
|||
xorriso_push ("-graft-points");
|
||||
|
||||
iso9660_dir = grub_util_make_temporary_dir ();
|
||||
grub_util_info ("temporaray 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");
|
||||
grub_install_mkdir_p (boot_grub);
|
||||
romdir = grub_util_path_concat (2, boot_grub, "roms");
|
||||
|
@ -583,7 +594,7 @@ main (int argc, char *argv[])
|
|||
free (label);
|
||||
label_text = grub_util_path_concat (2, core_services, ".disk_label.contentDetails");
|
||||
f = grub_util_fopen (label_text, "wb");
|
||||
fprintf (f, "%s", label_string);
|
||||
fprintf (f, "%s\n", label_string);
|
||||
fclose (f);
|
||||
free (label_string);
|
||||
free (label_text);
|
||||
|
@ -679,7 +690,7 @@ main (int argc, char *argv[])
|
|||
char *grub_chrp = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275],
|
||||
"grub.chrp");
|
||||
char *bisrc = grub_util_path_concat (2, source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275],
|
||||
"grub.chrp");
|
||||
"bootinfo.txt");
|
||||
char *bootx = grub_util_path_concat (2, core_services, "BootX");
|
||||
char *ppc_chrp = grub_util_path_concat (3, iso9660_dir, "ppc", "chrp");
|
||||
char *bitgt = grub_util_path_concat (3, iso9660_dir, "ppc", "bootinfo.txt");
|
||||
|
@ -757,7 +768,7 @@ main (int argc, char *argv[])
|
|||
make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-loongson-elf", "loongson.elf", GRUB_COMPRESSION_XZ);
|
||||
|
||||
make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-yeeloong-flash", "mipsel-yeeloong.bin", GRUB_COMPRESSION_XZ);
|
||||
make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-fulong2f-flash", "mipsel-fuloong2f.bin", GRUB_COMPRESSION_XZ);
|
||||
make_image (GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON, "mipsel-fuloong2f-flash", "mipsel-fuloong2f.bin", GRUB_COMPRESSION_XZ);
|
||||
|
||||
make_image (GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS, "mips-qemu_mips-elf", "roms/mips-qemu_mips.elf", GRUB_COMPRESSION_AUTO);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue