[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 04/23] grub-install can now recognize and install a LE grub b
From: |
Ram Pai |
Subject: |
[RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader |
Date: |
Wed, 26 Feb 2014 10:31:03 -0800 |
grub-install can now recognize and install a LE grub boot loader
Signed-off-by: Ram Pai <address@hidden>
---
include/grub/offsets.h | 5 +++++
include/grub/util/install.h | 1 +
util/grub-install-common.c | 1 +
util/grub-install.c | 15 +++++++++++++--
util/mkimage.c | 19 +++++++++++++++++++
5 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/include/grub/offsets.h b/include/grub/offsets.h
index 85e7401..b6acd02 100644
--- a/include/grub/offsets.h
+++ b/include/grub/offsets.h
@@ -63,6 +63,9 @@
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
+#define GRUB_KERNEL_POWERPC64LE_IEEE1275_LINK_ALIGN 4
+#define GRUB_KERNEL_POWERPC64LE_IEEE1275_LINK_ADDR 0x200000
+
#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000
#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32
@@ -111,6 +114,7 @@
#define GRUB_KERNEL_ARM_UBOOT_MOD_GAP 0x0
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
+#define GRUB_KERNEL_POWERPC64LE_IEEE1275_MOD_ALIGN 0x1000
#define GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN 3
#define GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN (1 <<
GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN)
@@ -126,6 +130,7 @@
for PowerMac to prevent "CLAIM failed" error. The real fix is to
rewrite grub-mkimage to generate valid ELF files. */
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000
+#define GRUB_KERNEL_POWERPC64LE_IEEE1275_MOD_GAP 0x8000
#ifdef GRUB_MACHINE
#define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c
diff --git a/include/grub/util/install.h b/include/grub/util/install.h
index aedcd29..3f32cd3 100644
--- a/include/grub/util/install.h
+++ b/include/grub/util/install.h
@@ -89,6 +89,7 @@ enum grub_install_plat
GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON,
GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275,
GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275,
+ GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275,
GRUB_INSTALL_PLATFORM_MIPSEL_ARC,
GRUB_INSTALL_PLATFORM_MIPS_ARC,
GRUB_INSTALL_PLATFORM_IA64_EFI,
diff --git a/util/grub-install-common.c b/util/grub-install-common.c
index c8bedcb..a1f18fc 100644
--- a/util/grub-install-common.c
+++ b/util/grub-install-common.c
@@ -661,6 +661,7 @@ static struct
[GRUB_INSTALL_PLATFORM_MIPS_ARC] = { "mips", "arc" },
[GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64", "ieee1275" },
[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc", "ieee1275" },
+ [GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275] = { "powerpc64le", "ieee1275"
},
[GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64", "efi" },
[GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm", "efi" },
[GRUB_INSTALL_PLATFORM_ARM64_EFI] = { "arm64", "efi" },
diff --git a/util/grub-install.c b/util/grub-install.c
index 2e6226a..994af24 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -311,6 +311,8 @@ get_default_platform (void)
{
#ifdef __powerpc__
return "powerpc-ieee1275";
+#elif __powerpc64le__
+ return "powerpc64le-ieee1275";
#elif defined (__sparc__) || defined (__sparc64__)
return "sparc64-ieee1275";
#elif defined (__MIPSEL__)
@@ -475,6 +477,7 @@ have_bootdev (enum grub_install_plat pl)
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
case GRUB_INSTALL_PLATFORM_MIPS_ARC:
return 1;
@@ -897,6 +900,7 @@ main (int argc, char *argv[])
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
case GRUB_INSTALL_PLATFORM_MIPS_ARC:
case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
@@ -926,6 +930,7 @@ main (int argc, char *argv[])
grub_util_error ("%s", _("install device isn't specified"));
break;
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
if (install_device)
is_prep = 1;
break;
@@ -1138,7 +1143,8 @@ main (int argc, char *argv[])
grub_install_mkdir_p (efidir);
}
- if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
+ if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275 ||
+ platform == GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275)
{
int is_guess = 0;
if (!macppcdir)
@@ -1340,7 +1346,8 @@ main (int argc, char *argv[])
if ((disk_module && grub_strcmp (disk_module, "biosdisk") != 0)
|| grub_drives[1]
|| (!install_drive
- && platform != GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
+ && platform != GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275
+ && platform != GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275)
|| (install_drive && !is_same_disk (grub_drives[0], install_drive))
|| !have_bootdev (platform))
{
@@ -1433,6 +1440,7 @@ main (int argc, char *argv[])
break;
case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
{
const char * ofpath = grub_util_devname_to_ofpath
(*curdev);
@@ -1539,6 +1547,7 @@ main (int argc, char *argv[])
case GRUB_INSTALL_PLATFORM_I386_MULTIBOOT:
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
case GRUB_INSTALL_PLATFORM_I386_XEN:
case GRUB_INSTALL_PLATFORM_X86_64_XEN:
core_name = "core.elf";
@@ -1598,6 +1607,7 @@ main (int argc, char *argv[])
case GRUB_INSTALL_PLATFORM_I386_IEEE1275:
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
{
char *dst = grub_util_path_concat (2, grubdir, "grub");
grub_install_copy_file (imgfile, dst, 1);
@@ -1700,6 +1710,7 @@ main (int argc, char *argv[])
}
case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
+ case GRUB_INSTALL_PLATFORM_POWERPC64LE_IEEE1275:
if (macppcdir)
{
char *core_services = grub_util_path_concat (4, macppcdir,
diff --git a/util/mkimage.c b/util/mkimage.c
index 26d9816..baf5fdc 100644
--- a/util/mkimage.c
+++ b/util/mkimage.c
@@ -371,6 +371,25 @@ static const struct grub_install_image_target_desc
image_targets[] =
.link_align = 4
},
{
+ .dirname = "powerpc64le-ieee1275",
+ .names = { "powerpc64le-ieee1275", NULL },
+ .voidp_sizeof = 8,
+ .bigendian = 0,
+ .id = IMAGE_PPC,
+ .flags = PLATFORM_FLAGS_NONE,
+ .total_module_size = TARGET_NO_FIELD,
+ .decompressor_compressed_size = TARGET_NO_FIELD,
+ .decompressor_uncompressed_size = TARGET_NO_FIELD,
+ .decompressor_uncompressed_addr = TARGET_NO_FIELD,
+ .section_align = 1,
+ .vaddr_offset = 0,
+ .link_addr = GRUB_KERNEL_POWERPC64LE_IEEE1275_LINK_ADDR,
+ .elf_target = EM_PPC64,
+ .mod_gap = GRUB_KERNEL_POWERPC64LE_IEEE1275_MOD_GAP,
+ .mod_align = GRUB_KERNEL_POWERPC64LE_IEEE1275_MOD_ALIGN,
+ .link_align = 4
+ },
+ {
.dirname = "sparc64-ieee1275",
.names = { "sparc64-ieee1275-raw", NULL },
.voidp_sizeof = 8,
--
1.8.5.3
- [RFC PATCH 00/23] grub 64bit little-endian on power, Ram Pai, 2014/02/26
- [RFC PATCH 01/23] Add a new architecture to the build process, Ram Pai, 2014/02/26
- [RFC PATCH 02/23] Build LE grub as O1, Ram Pai, 2014/02/26
- [RFC PATCH 03/23] ignore .TOC. symbol, Ram Pai, 2014/02/26
- [RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader,
Ram Pai <=
- [RFC PATCH 06/23] Add IEEE1275_ADDR helper, Ram Pai, 2014/02/26
- [RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image., Ram Pai, 2014/02/26
- [RFC PATCH 07/23] Fix some more warnings when casting., Ram Pai, 2014/02/26
- [RFC PATCH 08/23] Add powerpc64 types, Ram Pai, 2014/02/26
- [RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit, Ram Pai, 2014/02/26
- [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues, Ram Pai, 2014/02/26
- [RFC PATCH 10/23] GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader., Ram Pai, 2014/02/26
- [RFC PATCH 12/23] Add powerpc64 ieee1275 trampoline, Ram Pai, 2014/02/26
- [RFC PATCH 13/23] Add 64bit support to powerpc startup code, Ram Pai, 2014/02/26
- [RFC PATCH 14/23] Add grub_dl_find_section_addr, Ram Pai, 2014/02/26