From a9399f2e1e5819fdd9bd2a4d35d32420dd6cc679 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 19 Dec 2015 11:32:26 +0300 Subject: [PATCH 001/207] windows: correct LBA in generated EFI HDD media paths GRUB keeps partition offset and size in units of 512B sectors. Media paths are defined in terms of LBA which are presumed to match HDD sector size. This is probably cosmetic (EFI requires that partition is searched by GUID) and still incorrect if GPT was created using different logical block size. But current code is obviously wrong and new has better chances to be correct. --- grub-core/osdep/windows/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c index d217efe17..912269191 100644 --- a/grub-core/osdep/windows/platform.c +++ b/grub-core/osdep/windows/platform.c @@ -370,9 +370,9 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, } hddp->partition_start = grub_partition_get_start (efidir_grub_dev->disk->partition) - << (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); hddp->partition_size = grub_disk_get_size (efidir_grub_dev->disk) - << (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); pathptr = hddp + 1; filep = pathptr; From 3bca85b4184f74995a7cc2791e432173fde26d34 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 26 Dec 2015 21:45:22 +0300 Subject: [PATCH 002/207] devmapper: check for valid device abstraction in get_grub_dev This was lost when code was refactored. Patch restores previous behavior. It is still not clear whether this is the right one. Due to the way we detect DM abstraction, partitions on DM are skipped, we fall through to generic detection which ends up in assuming parent device is BIOS disk. It is useful to install GRUB on VM disk from the host. But it also means that GRUB will mistakenly allow install on real system as well. For now let's fix regression; future behavior needs to be discussed. Closes: 45163 --- grub-core/osdep/devmapper/getroot.c | 33 +++++++++++++++++------------ grub-core/osdep/linux/getroot.c | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index 64419f678..05eda500a 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -223,11 +223,14 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) uuid = get_dm_uuid (os_dev); if (!uuid) return NULL; - - if (strncmp (uuid, "LVM-", sizeof ("LVM-") - 1) == 0) + + switch (grub_util_get_dev_abstraction (os_dev)) { + case GRUB_DEV_ABSTRACTION_LVM: + { unsigned i; int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32, 38, 42, 46, 50, 54, 58}; + grub_dev = xmalloc (grub_strlen (uuid) + 40); optr = grub_stpcpy (grub_dev, "lvmid/"); for (i = 0; i < ARRAY_SIZE (dashes) - 1; i++) @@ -245,19 +248,23 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) return grub_dev; } - if (strncmp (uuid, "CRYPT-LUKS1-", sizeof ("CRYPT-LUKS1-") - 1) == 0) - { - char *dash; - dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); - if (dash) - *dash = 0; - grub_dev = grub_xasprintf ("cryptouuid/%s", - uuid + sizeof ("CRYPT-LUKS1-") - 1); + case GRUB_DEV_ABSTRACTION_LUKS: + { + char *dash; + + dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); + if (dash) + *dash = 0; + grub_dev = grub_xasprintf ("cryptouuid/%s", + uuid + sizeof ("CRYPT-LUKS1-") - 1); + grub_free (uuid); + return grub_dev; + } + + default: grub_free (uuid); - return grub_dev; + return NULL; } - grub_free (uuid); - return NULL; } char * diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 3978c7114..10480b646 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -1075,7 +1075,7 @@ grub_util_get_grub_dev_os (const char *os_dev) switch (grub_util_get_dev_abstraction (os_dev)) { /* Fallback for non-devmapper build. In devmapper-builds LVM is handled - in rub_util_get_devmapper_grub_dev and this point isn't reached. + in grub_util_get_devmapper_grub_dev and this point isn't reached. */ case GRUB_DEV_ABSTRACTION_LVM: { From ca7bb46d5c3b8c3db6577f1f7d5cdc8d0e104264 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 29 Dec 2015 17:42:25 +0100 Subject: [PATCH 003/207] exfat: Fix stream extension flag parsing. --- grub-core/fs/fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index aa2145cf2..635c2c425 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -681,7 +681,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, ctxt->dir.file_size = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size); ctxt->dir.have_stream = 1; - ctxt->dir.is_contiguous = !!(dir.type_specific.stream_extension.flags + ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags & grub_cpu_to_le16_compile_time (FLAG_CONTIGUOUS)); break; case 0xc1: From 4111882828597cbf68ae6f9429b68d0210dc2d41 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 29 Dec 2015 17:43:05 +0100 Subject: [PATCH 004/207] grub-mount: Fix oath parsing. Brackets detection was copied from somewhere else and makes no sense in case of grub-mount and prevents user from accessing and files with ) in them. --- util/grub-mount.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/util/grub-mount.c b/util/grub-mount.c index 0d0fea5f2..aca5f82e3 100644 --- a/util/grub-mount.c +++ b/util/grub-mount.c @@ -151,7 +151,6 @@ fuse_getattr (const char *path, struct stat *st) { struct fuse_getattr_ctx ctx; char *pathname, *path2; - const char *pathname_t; if (path[0] == '/' && path[1] == 0) { @@ -170,12 +169,7 @@ fuse_getattr (const char *path, struct stat *st) ctx.file_exists = 0; - pathname_t = grub_strchr (path, ')'); - if (! pathname_t) - pathname_t = path; - else - pathname_t++; - pathname = xstrdup (pathname_t); + pathname = xstrdup (path); /* Remove trailing '/'. */ while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') From dbab354157fed01841317ae0927cbccc622c3c03 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 29 Dec 2015 17:48:34 +0100 Subject: [PATCH 005/207] grub-mkrescue: Delete temporary file Reported by: Thomas Schmitt --- util/grub-mkrescue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c index 451182647..da0dc021a 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -310,6 +310,7 @@ make_image_fwdisk_abs (enum grub_install_plat plat, grub_install_make_image_wrap (source_dirs[plat], "()/boot/grub", output, 0, load_cfg, mkimage_target, 0); grub_install_pop_module (); + grub_util_unlink (load_cfg); } static int @@ -647,6 +648,7 @@ main (int argc, char *argv[]) } grub_install_pop_module (); grub_install_pop_module (); + grub_util_unlink (load_cfg); } /** build multiboot core.img */ From 93ecc3f1f8372e43101301866eea87aa9257a9e0 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 30 Dec 2015 06:20:51 +0300 Subject: [PATCH 006/207] menu: fix line count calculation for long lines It gave one extra screen line if length was exactly equal to screen width. Reported by Michael Chang. Also-By: Michael Chang --- grub-core/normal/menu_entry.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c index 62c7e1627..2b732250d 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -126,9 +126,13 @@ ensure_space (struct line *linep, int extra) static int get_logical_num_lines (struct line *linep, struct per_term_screen *term_screen) { - return (grub_getstringwidth (linep->buf, linep->buf + linep->len, - term_screen->term) - / (unsigned) term_screen->geo.entry_width) + 1; + grub_size_t width = grub_getstringwidth (linep->buf, linep->buf + linep->len, + term_screen->term); + + /* Empty line still consumes space on screen */ + return width ? (width + (unsigned) term_screen->geo.entry_width - 1) / + (unsigned) term_screen->geo.entry_width + : 1; } static void From 79cfad6fbeafcfa9b8a664643024e897123927c7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 30 Dec 2015 18:19:44 +0100 Subject: [PATCH 007/207] backtrace: Remove assembly assumption that grub_backtrace_pointer is under 4G --- grub-core/lib/i386/backtrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c index 7a7796a12..d76a46a23 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -56,11 +56,11 @@ void grub_backtrace (void) { #ifdef __x86_64__ - asm volatile ("movq %rbp, %rdi\n" - "call " EXT_C("grub_backtrace_pointer")); + asm volatile ("movq %%rbp, %%rdi\n" + "call %%rax": :"a"(grub_backtrace_pointer)); #else - asm volatile ("movl %ebp, %eax\n" - "call " EXT_C("grub_backtrace_pointer")); + asm volatile ("movl %%ebp, %%eax\n" + "call %%ecx": :"c"(grub_backtrace_pointer)); #endif } From 2333a83baa3caf7efb0c6b94f0d9f9914682cf87 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Wed, 30 Dec 2015 22:30:16 +0300 Subject: [PATCH 008/207] 30_os-prober: derive --class from os-prober generated label Currently only Windows gets distinguished icons, everything else is displayed using the same generic one. Add additional --class based on os-prober returned label, which usually is expected to match primary distribution name. Also use it for Windows as well - chainloader prober may actually return different strings (Windows, MS-DOS, Windows9xME). --- util/grub.d/30_os-prober.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 5fc4f0c83..5604ce2b6 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -135,6 +135,9 @@ for OS in ${OSPROBED} ; do LONGNAME="${LABEL}" fi + # os-prober returns text string followed by optional counter + CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')" + gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 case ${BOOT} in @@ -142,7 +145,7 @@ for OS in ${OSPROBED} ; do onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { EOF save_default_entry | grub_add_tab prepare_grub_to_access_device ${DEVICE} | grub_add_tab @@ -174,7 +177,7 @@ EOF DEVICE=${DEVICE%@*} onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' { EOF save_default_entry | sed -e "s/^/\t/" prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" @@ -230,7 +233,7 @@ EOF if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then cat << EOF -menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { +menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { EOF save_default_entry | grub_add_tab printf '%s\n' "${prepare_boot_cache}" From 5919626c907a2d141bfeffa4ec04d71e521fbbaa Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 13:07:16 +0100 Subject: [PATCH 009/207] sparc64: Fix assembly to let compiler to fill in memory references. This fixes the use of not fully relocatable (they assume that variables are under 4G limit in virtual memory) references. --- grub-core/loader/sparc64/ieee1275/linux.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c index 346d9538e..d44d7a113 100644 --- a/grub-core/loader/sparc64/ieee1275/linux.c +++ b/grub-core/loader/sparc64/ieee1275/linux.c @@ -140,17 +140,17 @@ grub_linux_boot (void) grub_dprintf ("loader", "Jumping to Linux...\n"); /* Boot the kernel. */ - asm volatile ("sethi %hi(grub_ieee1275_entry_fn), %o1\n" - "ldx [%o1 + %lo(grub_ieee1275_entry_fn)], %o4\n" - "sethi %hi(grub_ieee1275_original_stack), %o1\n" - "ldx [%o1 + %lo(grub_ieee1275_original_stack)], %o6\n" - "sethi %hi(linux_addr), %o1\n" - "ldx [%o1 + %lo(linux_addr)], %o5\n" - "mov %g0, %o0\n" - "mov %g0, %o2\n" - "mov %g0, %o3\n" - "jmp %o5\n" - "mov %g0, %o1\n"); + asm volatile ("ldx %0, %%o4\n" + "ldx %1, %%o6\n" + "ldx %2, %%o5\n" + "mov %%g0, %%o0\n" + "mov %%g0, %%o2\n" + "mov %%g0, %%o3\n" + "jmp %%o5\n" + "mov %%g0, %%o1\n": : + "m"(grub_ieee1275_entry_fn), + "m"(grub_ieee1275_original_stack), + "m"(linux_addr)); return GRUB_ERR_NONE; } From a7cf8b1e235fbbc8a460510615c7ff85f21c2d05 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 13:09:15 +0100 Subject: [PATCH 010/207] Verify modules on build-time rather than failing in runtime. --- grub-core/Makefile.am | 6 +- grub-core/genmod.sh.in | 5 +- include/grub/module_verifier.h | 19 ++ util/grub-module-verifier.c | 122 +++++++++++++ util/grub-module-verifier32.c | 2 + util/grub-module-verifier64.c | 2 + util/grub-module-verifierXX.c | 315 +++++++++++++++++++++++++++++++++ 7 files changed, 468 insertions(+), 3 deletions(-) create mode 100644 include/grub/module_verifier.h create mode 100644 util/grub-module-verifier.c create mode 100644 util/grub-module-verifier32.c create mode 100644 util/grub-module-verifier64.c create mode 100644 util/grub-module-verifierXX.c diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index c671aed4b..508e86bcd 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -39,6 +39,10 @@ gentrigtables$(BUILD_EXEEXT): gentrigtables.c $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM) CLEANFILES += gentrigtables$(BUILD_EXEEXT) +build-grub-module-verifier$(BUILD_EXEEXT): $(top_srcdir)/util/grub-module-verifier.c $(top_srcdir)/util/grub-module-verifier32.c $(top_srcdir)/util/grub-module-verifier64.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-module-verifier\" $^ +CLEANFILES += build-grub-module-verifier$(BUILD_EXEEXT) + # trigtables.c trigtables.c: gentrigtables$(BUILD_EXEEXT) gentrigtables.c $(top_srcdir)/configure.ac ./gentrigtables$(BUILD_EXEEXT) > $@ @@ -390,7 +394,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst platform_DATA += moddep.lst CLEANFILES += config.log syminfo.lst moddep.lst -$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) +$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ platform_DATA += $(MOD_FILES) platform_DATA += modinfo.sh diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 789732b10..7dcafd9d3 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -15,12 +15,12 @@ set -e # # Example: # -# genmod.sh moddep.lst normal.module normal.mod +# genmod.sh moddep.lst normal.module build-grub-module-verifier normal.mod # moddep=$1 infile=$2 -outfile=$3 +outfile=$4 tmpfile=${outfile}.tmp modname=`echo $infile | sed -e 's@\.module.*$@@'` @@ -93,4 +93,5 @@ else -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 rm -f $name.bin fi +./build-grub-module-verifier $tmpfile @target_cpu@ mv $tmpfile $outfile diff --git a/include/grub/module_verifier.h b/include/grub/module_verifier.h new file mode 100644 index 000000000..9e3a2ba72 --- /dev/null +++ b/include/grub/module_verifier.h @@ -0,0 +1,19 @@ +#include +#include + +#include + +#define GRUB_MODULE_VERIFY_SUPPORTS_REL 1 +#define GRUB_MODULE_VERIFY_SUPPORTS_RELA 2 + +struct grub_module_verifier_arch { + const char *name; + int voidp_sizeof; + int bigendian; + int machine; + int flags; + const int *supported_relocations; +}; + +void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); +void grub_module_verify32(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c new file mode 100644 index 000000000..d2d698403 --- /dev/null +++ b/util/grub-module-verifier.c @@ -0,0 +1,122 @@ +#include +#include + +#include +#include +#include +#include + +struct grub_module_verifier_arch archs[] = { + { "i386", 4, 0, EM_386, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ + R_386_32, + R_386_PC32, + -1 + } }, + { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_X86_64_64, + R_X86_64_PC64, + /* R_X86_64_32, R_X86_64_32S, R_X86_64_PC32 are supported but shouldn't be used because of their limited range. */ + -1 + } }, + { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + GRUB_ELF_R_PPC_ADDR16_LO, + GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ + GRUB_ELF_R_PPC_ADDR16_HA, + GRUB_ELF_R_PPC_ADDR32, + GRUB_ELF_R_PPC_REL32, + -1 + } }, + { "sparc64", 8, 1, EM_SPARCV9, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_SPARC_WDISP30, /* It has limited range but GRUB adds trampolines when necessarry. */ + R_SPARC_HH22, + R_SPARC_HM10, + R_SPARC_LM22, + R_SPARC_LO10, + R_SPARC_64, + R_SPARC_OLO10, + /* R_SPARC_32, R_SPARC_HI22 are supported but shouldn't be used because of their limited range. */ + -1 + } }, + { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_IA64_PCREL21B, /* We should verify that it's pointing either + to a function or to a section in the same module. */ + R_IA64_SEGREL64LSB, + R_IA64_FPTR64LSB, + R_IA64_DIR64LSB, + R_IA64_PCREL64LSB, + R_IA64_GPREL22, /* We should verify that it's pointing to a section in the same module. */ + R_IA64_LTOFF22X, + R_IA64_LTOFF22, + R_IA64_LTOFF_FPTR22, + R_IA64_LDXMOV, + -1 + } }, + { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_MIPS_HI16, + R_MIPS_LO16, + R_MIPS_32, + R_MIPS_GPREL32, + R_MIPS_26, + R_MIPS_GOT16, + R_MIPS_CALL16, + R_MIPS_JALR, + -1 + } }, + { "mips", 4, 1, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_MIPS_HI16, + R_MIPS_LO16, + R_MIPS_32, + R_MIPS_GPREL32, + R_MIPS_26, + R_MIPS_GOT16, + R_MIPS_CALL16, + R_MIPS_JALR, + -1 + } }, + { "arm", 4, 0, EM_ARM, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ + /* Some relocations are range-limited but trampolines are added when necessarry. */ + R_ARM_ABS32, + R_ARM_CALL, + R_ARM_JUMP24, + R_ARM_THM_CALL, + R_ARM_THM_JUMP24, + R_ARM_V4BX, + R_ARM_THM_MOVW_ABS_NC, + R_ARM_THM_MOVT_ABS, + R_ARM_THM_JUMP19, + -1 + } }, + { "arm64", 8, 0, EM_AARCH64, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_AARCH64_ABS64, + R_AARCH64_CALL26, + R_AARCH64_JUMP26, + -1 + } }, +}; + + +int +main (int argc, char **argv) +{ + size_t module_size; + unsigned arch; + char *module_img; + if (argc != 3) { + fprintf (stderr, "usage: %s FILE ARCH\n", argv[0]); + return 1; + } + + for (arch = 0; arch < ARRAY_SIZE(archs); arch++) + if (strcmp(archs[arch].name, argv[2]) == 0) + break; + if (arch == ARRAY_SIZE(archs)) + grub_util_error("unknown arch: %s", argv[2]); + + module_size = grub_util_get_image_size (argv[1]); + module_img = grub_util_read_image (argv[1]); + if (archs[arch].voidp_sizeof == 8) + grub_module_verify64(module_img, module_size, &archs[arch]); + else + grub_module_verify32(module_img, module_size, &archs[arch]); + return 0; +} diff --git a/util/grub-module-verifier32.c b/util/grub-module-verifier32.c new file mode 100644 index 000000000..257229f8f --- /dev/null +++ b/util/grub-module-verifier32.c @@ -0,0 +1,2 @@ +#define MODULEVERIFIER_ELF32 1 +#include "grub-module-verifierXX.c" diff --git a/util/grub-module-verifier64.c b/util/grub-module-verifier64.c new file mode 100644 index 000000000..4db6b4bed --- /dev/null +++ b/util/grub-module-verifier64.c @@ -0,0 +1,2 @@ +#define MODULEVERIFIER_ELF64 1 +#include "grub-module-verifierXX.c" diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c new file mode 100644 index 000000000..904be27d3 --- /dev/null +++ b/util/grub-module-verifierXX.c @@ -0,0 +1,315 @@ +#include + +#include +#include +#include + +#if defined(MODULEVERIFIER_ELF32) +# define SUFFIX(x) x ## 32 +# define ELFCLASSXX ELFCLASS32 +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Phdr Elf32_Phdr +# define Elf_Nhdr Elf32_Nhdr +# define Elf_Addr Elf32_Addr +# define Elf_Sym Elf32_Sym +# define Elf_Off Elf32_Off +# define Elf_Shdr Elf32_Shdr +# define Elf_Rela Elf32_Rela +# define Elf_Rel Elf32_Rel +# define Elf_Word Elf32_Word +# define Elf_Half Elf32_Half +# define Elf_Section Elf32_Section +# define ELF_R_SYM(val) ELF32_R_SYM(val) +# define ELF_R_TYPE(val) ELF32_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) +#elif defined(MODULEVERIFIER_ELF64) +# define SUFFIX(x) x ## 64 +# define ELFCLASSXX ELFCLASS64 +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Phdr Elf64_Phdr +# define Elf_Nhdr Elf64_Nhdr +# define Elf_Addr Elf64_Addr +# define Elf_Sym Elf64_Sym +# define Elf_Off Elf64_Off +# define Elf_Shdr Elf64_Shdr +# define Elf_Rela Elf64_Rela +# define Elf_Rel Elf64_Rel +# define Elf_Word Elf64_Word +# define Elf_Half Elf64_Half +# define Elf_Section Elf64_Section +# define ELF_R_SYM(val) ELF64_R_SYM(val) +# define ELF_R_TYPE(val) ELF64_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) +#else +#error "I'm confused" +#endif + +#define grub_target_to_host32(x) (grub_target_to_host32_real (arch, (x))) +#define grub_host_to_target32(x) (grub_host_to_target32_real (arch, (x))) +#define grub_target_to_host64(x) (grub_target_to_host64_real (arch, (x))) +#define grub_host_to_target64(x) (grub_host_to_target64_real (arch, (x))) +#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (arch, (x))) +#define grub_target_to_host16(x) (grub_target_to_host16_real (arch, (x))) +#define grub_host_to_target16(x) (grub_host_to_target16_real (arch, (x))) +#define grub_target_to_host(val) grub_target_to_host_real(arch, (val)) + +static inline grub_uint32_t +grub_target_to_host32_real (const struct grub_module_verifier_arch *arch, + grub_uint32_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu32 (in); + else + return grub_le_to_cpu32 (in); +} + +static inline grub_uint64_t +grub_target_to_host64_real (const struct grub_module_verifier_arch *arch, + grub_uint64_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu64 (in); + else + return grub_le_to_cpu64 (in); +} + +static inline grub_uint64_t +grub_host_to_target64_real (const struct grub_module_verifier_arch *arch, + grub_uint64_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be64 (in); + else + return grub_cpu_to_le64 (in); +} + +static inline grub_uint32_t +grub_host_to_target32_real (const struct grub_module_verifier_arch *arch, + grub_uint32_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be32 (in); + else + return grub_cpu_to_le32 (in); +} + +static inline grub_uint16_t +grub_target_to_host16_real (const struct grub_module_verifier_arch *arch, + grub_uint16_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu16 (in); + else + return grub_le_to_cpu16 (in); +} + +static inline grub_uint16_t +grub_host_to_target16_real (const struct grub_module_verifier_arch *arch, + grub_uint16_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be16 (in); + else + return grub_cpu_to_le16 (in); +} + +static inline grub_uint64_t +grub_host_to_target_addr_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +{ + if (arch->voidp_sizeof == 8) + return grub_host_to_target64_real (arch, in); + else + return grub_host_to_target32_real (arch, in); +} + +static inline grub_uint64_t +grub_target_to_host_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +{ + if (arch->voidp_sizeof == 8) + return grub_target_to_host64_real (arch, in); + else + return grub_target_to_host32_real (arch, in); +} + + +static Elf_Shdr * +find_section (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, const char *name) +{ + Elf_Shdr *s; + const char *str; + unsigned i; + + s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host16 (e->e_shstrndx) * grub_target_to_host16 (e->e_shentsize)); + str = (char *) e + grub_target_to_host (s->sh_offset); + + for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (strcmp (str + grub_target_to_host32 (s->sh_name), name) == 0) + return s; + return NULL; +} + +static void +check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Shdr *s = find_section (arch, e, ".module_license"); + if (s && (strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3") == 0 + || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3+") == 0 + || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv2+") == 0)) + return; + grub_util_error ("incompatible license"); +} + +static void +check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + unsigned i; + Elf_Shdr *s, *sections; + Elf_Sym *sym; + const char *str; + Elf_Word size, entsize; + + sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + for (i = 0, s = sections; + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (grub_target_to_host32 (s->sh_type) == SHT_SYMTAB) + break; + + if (i == grub_target_to_host16 (e->e_shnum)) + grub_util_error ("no symbol table"); + + sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); + size = grub_target_to_host (s->sh_size); + entsize = grub_target_to_host (s->sh_entsize); + + s = (Elf_Shdr *) ((char *) sections + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host32 (s->sh_link)); + str = (char *) e + grub_target_to_host (s->sh_offset); + + for (i = 0; + i < size / entsize; + i++, sym = (Elf_Sym *) ((char *) sym + entsize)) + { + unsigned char type = ELF_ST_TYPE (sym->st_info); + + switch (type) + { + case STT_NOTYPE: + case STT_OBJECT: + case STT_FUNC: + case STT_SECTION: + case STT_FILE: + break; + + default: + return grub_util_error ("unknown symbol type `%d'", (int) type); + } + } +} + +/* Relocate symbols. */ +static void +section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, + Elf_Shdr *s, size_t target_seg_size) +{ + Elf_Rel *rel, *max; + + for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), + max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); + rel < max; + rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) + { + Elf_Word *addr; + Elf_Sym *sym; + unsigned i; + + if (target_seg_size < grub_target_to_host (rel->r_offset)) + grub_util_error ("reloc offset is out of the segment"); + + grub_uint32_t type = ELF_R_TYPE (grub_target_to_host (rel->r_info)); + + if (arch->machine == EM_SPARCV9) + type &= 0xff; + + for (i = 0; arch->supported_relocations[i] != -1; i++) + if (type == arch->supported_relocations[i]) + break; + if (arch->supported_relocations[i] == -1) + grub_util_error ("unsupported relocation 0x%x", type); + } +} + +static void +check_relocations (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Shdr *s; + unsigned i; + + for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (grub_target_to_host32 (s->sh_type) == SHT_REL || grub_target_to_host32 (s->sh_type) == SHT_RELA) + { + Elf_Shdr *ts; + + if (grub_target_to_host32 (s->sh_type) == SHT_REL && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_REL)) + grub_util_error ("unsupported SHT_REL"); + if (grub_target_to_host32 (s->sh_type) == SHT_RELA && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_RELA)) + grub_util_error ("unsupported SHT_RELA"); + + /* Find the target segment. */ + if (grub_target_to_host32 (s->sh_info) >= grub_target_to_host16 (e->e_shnum)) + grub_util_error ("orphaned reloc section"); + ts = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host32 (s->sh_info) * grub_target_to_host16 (e->e_shentsize)); + + section_check_relocations (arch, e, s, grub_target_to_host (ts->sh_size)); + } +} + +void +SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_module_verifier_arch *arch) +{ + Elf_Ehdr *e = module_img; + + /* Check the header size. */ + if (size < sizeof (Elf_Ehdr)) + grub_util_error ("ELF header smaller than expected"); + + /* Check the magic numbers. */ + if (e->e_ident[EI_MAG0] != ELFMAG0 + || e->e_ident[EI_MAG1] != ELFMAG1 + || e->e_ident[EI_MAG2] != ELFMAG2 + || e->e_ident[EI_MAG3] != ELFMAG3 + || e->e_ident[EI_VERSION] != EV_CURRENT + || grub_target_to_host32 (e->e_version) != EV_CURRENT) + grub_util_error ("invalid arch-independent ELF magic"); + + if (e->e_ident[EI_CLASS] != ELFCLASSXX + || e->e_ident[EI_DATA] != (arch->bigendian ? ELFDATA2MSB : ELFDATA2LSB) + || grub_target_to_host16 (e->e_machine) != arch->machine) + grub_util_error ("invalid arch-dependent ELF magic"); + + if (grub_target_to_host16 (e->e_type) != ET_REL) + { + grub_util_error ("this ELF file is not of the right type"); + } + + /* Make sure that every section is within the core. */ + if (size < grub_target_to_host (e->e_shoff) + + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) + { + grub_util_error ("ELF sections outside core"); + } + + check_license (arch, e); + + Elf_Shdr *s; + + s = find_section (arch, e, ".modname"); + if (!s) + grub_util_error ("no module name found"); + + check_symbols(arch, e); + check_relocations(arch, e); +} From 60ae5821428433945b62a79f6a1f71f14f8dfb19 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 14:54:48 +0100 Subject: [PATCH 011/207] backtrace: Fix register call syntax --- grub-core/lib/i386/backtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c index d76a46a23..c3e03c727 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -57,10 +57,10 @@ grub_backtrace (void) { #ifdef __x86_64__ asm volatile ("movq %%rbp, %%rdi\n" - "call %%rax": :"a"(grub_backtrace_pointer)); + "callq *%%rax": :"a"(grub_backtrace_pointer)); #else asm volatile ("movl %%ebp, %%eax\n" - "call %%ecx": :"c"(grub_backtrace_pointer)); + "calll *%%ecx": :"c"(grub_backtrace_pointer)); #endif } From 76588d1319cccde6c3e68279db2a4dcdf2ce7562 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 14:54:56 +0100 Subject: [PATCH 012/207] xen/relocator: Use local symbol to ensure that code is relocation-free. --- grub-core/lib/x86_64/xen/relocator.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/x86_64/xen/relocator.S b/grub-core/lib/x86_64/xen/relocator.S index 78c123350..92e9e72a9 100644 --- a/grub-core/lib/x86_64/xen/relocator.S +++ b/grub-core/lib/x86_64/xen/relocator.S @@ -89,7 +89,7 @@ VARIABLE(grub_relocator_xen_mfn_list) loop 1b - leaq EXT_C(grub_relocator_xen_mmu_op) (%rip), %rdi + leaq LOCAL(mmu_op) (%rip), %rdi movq $3, %rsi movq $0, %rdx movq $0x7FF0, %r10 @@ -104,6 +104,7 @@ VARIABLE(grub_relocator_xen_remap_continue) jmp *%rax +LOCAL(mmu_op): VARIABLE(grub_relocator_xen_mmu_op) .space 256 From e1b2b9bf1d1cb3b411b5ae45046e4002091f6f5f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 15:29:28 +0100 Subject: [PATCH 013/207] module-verifier: Check range-limited relative relocations. Check that they point to the same module, so will end up in the same chunk of memory. --- include/grub/module_verifier.h | 1 + util/grub-module-verifier.c | 19 ++++++++--- util/grub-module-verifierXX.c | 62 ++++++++++++++++++++++++++++------ 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/include/grub/module_verifier.h b/include/grub/module_verifier.h index 9e3a2ba72..6cddff30f 100644 --- a/include/grub/module_verifier.h +++ b/include/grub/module_verifier.h @@ -13,6 +13,7 @@ struct grub_module_verifier_arch { int machine; int flags; const int *supported_relocations; + const int *short_relocations; }; void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c index d2d698403..c027f0a0f 100644 --- a/util/grub-module-verifier.c +++ b/util/grub-module-verifier.c @@ -15,9 +15,13 @@ struct grub_module_verifier_arch archs[] = { { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_X86_64_64, R_X86_64_PC64, - /* R_X86_64_32, R_X86_64_32S, R_X86_64_PC32 are supported but shouldn't be used because of their limited range. */ + /* R_X86_64_32, R_X86_64_32S are supported but shouldn't be used because of their limited range. */ -1 - } }, + }, (int[]){ + R_X86_64_PC32, + -1 + } + }, { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ GRUB_ELF_R_PPC_ADDR16_LO, GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ @@ -39,17 +43,24 @@ struct grub_module_verifier_arch archs[] = { } }, { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_IA64_PCREL21B, /* We should verify that it's pointing either - to a function or to a section in the same module. */ + to a function or to a section in the same module. + Checking that external symbol is a function is + non-trivial and I have never seen this relocation used + for anything else, so assume that it always points to a + function. + */ R_IA64_SEGREL64LSB, R_IA64_FPTR64LSB, R_IA64_DIR64LSB, R_IA64_PCREL64LSB, - R_IA64_GPREL22, /* We should verify that it's pointing to a section in the same module. */ R_IA64_LTOFF22X, R_IA64_LTOFF22, R_IA64_LTOFF_FPTR22, R_IA64_LDXMOV, -1 + }, (int[]){ + R_IA64_GPREL22, + -1 } }, { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ R_MIPS_HI16, diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c index 904be27d3..25988ebc2 100644 --- a/util/grub-module-verifierXX.c +++ b/util/grub-module-verifierXX.c @@ -161,14 +161,12 @@ check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) grub_util_error ("incompatible license"); } -static void -check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +static Elf_Sym * +get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word *size, Elf_Word *entsize) { unsigned i; Elf_Shdr *s, *sections; Elf_Sym *sym; - const char *str; - Elf_Word size, entsize; sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); for (i = 0, s = sections; @@ -181,11 +179,19 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) grub_util_error ("no symbol table"); sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); - size = grub_target_to_host (s->sh_size); - entsize = grub_target_to_host (s->sh_entsize); + *size = grub_target_to_host (s->sh_size); + *entsize = grub_target_to_host (s->sh_entsize); + return sym; +} - s = (Elf_Shdr *) ((char *) sections + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host32 (s->sh_link)); - str = (char *) e + grub_target_to_host (s->sh_offset); +static void +check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Sym *sym; + Elf_Word size, entsize; + unsigned i; + + sym = get_symtab (arch, e, &size, &entsize); for (i = 0; i < size / entsize; @@ -208,19 +214,41 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) } } -/* Relocate symbols. */ +static int +is_symbol_local(Elf_Sym *sym) +{ + switch (ELF_ST_TYPE (sym->st_info)) + { + case STT_NOTYPE: + case STT_OBJECT: + if (sym->st_name != 0 && sym->st_shndx == 0) + return 0; + return 1; + + case STT_FUNC: + case STT_SECTION: + return 1; + + default: + return 0; + } +} + static void section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, Elf_Shdr *s, size_t target_seg_size) { Elf_Rel *rel, *max; + Elf_Sym *symtab; + Elf_Word symtabsize, symtabentsize; + + symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); rel < max; rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) { - Elf_Word *addr; Elf_Sym *sym; unsigned i; @@ -235,8 +263,20 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e for (i = 0; arch->supported_relocations[i] != -1; i++) if (type == arch->supported_relocations[i]) break; - if (arch->supported_relocations[i] == -1) + if (arch->supported_relocations[i] != -1) + continue; + if (!arch->short_relocations) grub_util_error ("unsupported relocation 0x%x", type); + for (i = 0; arch->short_relocations[i] != -1; i++) + if (type == arch->short_relocations[i]) + break; + if (arch->short_relocations[i] == -1) + grub_util_error ("unsupported relocation 0x%x", type); + sym = (Elf_Sym *) ((char *) symtab + symtabentsize * ELF_R_SYM (grub_target_to_host (rel->r_info))); + + if (is_symbol_local (sym)) + continue; + grub_util_error ("relocation 0x%x is not module-local", type); } } From 68e158dffde328d5b961518fe23504cc534744ce Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 18:13:59 +0100 Subject: [PATCH 014/207] Strip .ARM.exidx This section is generated by clang and is useful only for debugging. It contains exotic relocations, so strip them to avoid them interferring with module loading. --- conf/Makefile.common | 2 +- gentpl.py | 2 +- grub-core/genmod.sh.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 5083d5f1e..11296b550 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) -STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags +STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags -R .ARM.exidx CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d diff --git a/gentpl.py b/gentpl.py index 76971d3ce..0782e447d 100644 --- a/gentpl.py +++ b/gentpl.py @@ -759,7 +759,7 @@ def image(defn, platform): if test x$(TARGET_APPLE_LINKER) = x1; then \ $(MACHO2IMG) $< $@; \ else \ - $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ + $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .ARM.exidx $< $@; \ fi """) diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 7dcafd9d3..005cb1985 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -58,7 +58,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then -K grub_mod_init -K grub_mod_fini \ -K _grub_mod_init -K _grub_mod_fini \ -R .note.gnu.gold-version -R .note.GNU-stack \ - -R .note -R .comment $tmpfile || exit 1 + -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 fi if ! test -z "${TARGET_OBJ2ELF}"; then "${TARGET_OBJ2ELF}" $tmpfile || exit 1 From f1b352538556711dc3f9e8b9bf5bf2e4abea8e25 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 18:15:49 +0100 Subject: [PATCH 015/207] Add -mno-stack-arg-probe on mingw. This argument disables generation of calls to __chkstk_ms. Those calls are useless on GRUB as function is dummy. Yet they increase module size and use limited-range relocations which may not work under some memory layouts. We currently don't use such layouts on concerned platforms but lt's correct this. --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 3300545e0..f662e200e 100644 --- a/configure.ac +++ b/configure.ac @@ -910,6 +910,18 @@ if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xy TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" fi +AC_CACHE_CHECK([whether -mno-stack-arg-probe works], [grub_cv_cc_mno_stack_arg_probe], [ + CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_mno_stack_arg_probe=yes], + [grub_cv_cc_mno_stack_arg_probe=no]) +]) + +if test "x$grub_cv_cc_mno_stack_arg_probe" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" +fi + + # By default, GCC 4.6 generates .eh_frame sections containing unwind # information in some cases where it previously did not. GRUB doesn't need # these and they just use up vital space. Restore the old compiler From 5ae590b32d2fa535050399193d21a2305bd008a7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 18:19:15 +0100 Subject: [PATCH 016/207] configure: Fix grub_cv_cc_fno_unwind_tables check. Check tries -fno-dwarf2-cfi-asm but adds -fno-asynchronous-unwind-tables to TARGET_CFLAGS. Fix this. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f662e200e..ada6068d9 100644 --- a/configure.ac +++ b/configure.ac @@ -927,7 +927,7 @@ fi # these and they just use up vital space. Restore the old compiler # behaviour. AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [ - CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" + CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_fno_asynchronous_unwind_tables=yes], [grub_cv_cc_fno_asynchronous_unwind_tables=no]) From 3b21499506b633494cccb1cdb3fc757594ef0ef0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 18:20:11 +0100 Subject: [PATCH 017/207] Disable build-time module check on emu. On emu some checks can be laxer like check for relocation range. Additionally module loading in emu is rarely used. So skip this check rather than making it laxer for all platforms. In ideal we may want to have slightly different check for emu but for now this is good enough. --- grub-core/genmod.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 005cb1985..f74edd551 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -93,5 +93,7 @@ else -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 rm -f $name.bin fi -./build-grub-module-verifier $tmpfile @target_cpu@ +if test x@platform@ != xemu; then + ./build-grub-module-verifier $tmpfile @target_cpu@ +fi mv $tmpfile $outfile From dcc499aaf034a5ee2f1ae11c7ec6f990ab9aea3c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 18:30:39 +0100 Subject: [PATCH 018/207] module-verifier: allow limited-range relocations on sparc64. clang as incomplete mcmodel=large support. As we don't currently need full mcmodel=large support for sparc64, relax those checks. --- util/grub-module-verifier.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c index c027f0a0f..e217dcddc 100644 --- a/util/grub-module-verifier.c +++ b/util/grub-module-verifier.c @@ -38,7 +38,12 @@ struct grub_module_verifier_arch archs[] = { R_SPARC_LO10, R_SPARC_64, R_SPARC_OLO10, - /* R_SPARC_32, R_SPARC_HI22 are supported but shouldn't be used because of their limited range. */ + /* Following 2 relocations have limited range but unfortunately + clang generates them, as it doesn't implement mcmodel=large properly. + At least our heap and core are under 4G, so it's not a problem + usually. */ + R_SPARC_HI22, + R_SPARC_32, -1 } }, { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ From 40051fedc33f2ec10924d66ae1371940dce2ca8a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 19:20:03 +0100 Subject: [PATCH 019/207] configure: Add -fno-unwind-tables if supported. Unwind tables are useless for us bt consume space if present. Ensure that they are not. --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index ada6068d9..2e656dbea 100644 --- a/configure.ac +++ b/configure.ac @@ -937,6 +937,17 @@ if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" fi +AC_CACHE_CHECK([whether -fno-unwind-tables works], [grub_cv_cc_fno_unwind_tables], [ + CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_fno_unwind_tables=yes], + [grub_cv_cc_fno_unwind_tables=no]) +]) + +if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" +fi + AC_ARG_ENABLE([efiemu], [AS_HELP_STRING([--enable-efiemu], [build and install the efiemu runtimes (default=guessed)])]) From c67025fad5104fe48daa24115a16373413cddbf4 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 31 Dec 2015 21:35:11 +0300 Subject: [PATCH 020/207] Add grub-module-verifier files to EXTRA_DIST --- conf/Makefile.extra-dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 9dd64fdca..b16bd9253 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -50,8 +50,13 @@ EXTRA_DIST += util/import_gcrypth.sed EXTRA_DIST += util/bin2h.c EXTRA_DIST += util/grub-gen-asciih.c EXTRA_DIST += util/grub-gen-widthspec.c +EXTRA_DIST += util/grub-module-verifier.c +EXTRA_DIST += util/grub-module-verifier32.c +EXTRA_DIST += util/grub-module-verifier64.c +EXTRA_DIST += util/grub-module-verifierXX.c EXTRA_DIST += util/grub-pe2elf.c + EXTRA_DIST += m4/gnulib-cache.m4 EXTRA_DIST += m4/glibc2.m4 EXTRA_DIST += m4/gnulib-tool.m4 From af23303cbd551c8b1d70701530916f221a0b47e4 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Thu, 31 Dec 2015 22:23:12 +0300 Subject: [PATCH 021/207] add dejavu built fonts to cleanfiles --- Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.am b/Makefile.am index 994ebbd39..b8423b08d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -91,14 +91,19 @@ if COND_STARFIELD starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont ./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_10.pf2 dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont ./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_12.pf2 dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont ./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_14.pf2 dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont ./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_bold_14.pf2 dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont ./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_16.pf2 else starfield_DATA = endif From 4d6e9c8a92ce1b1b88980e31f9dd1e8ab78f3888 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Thu, 31 Dec 2015 23:00:25 +0300 Subject: [PATCH 022/207] remove temporary .bin files (kernel and modules) --- gentpl.py | 2 ++ grub-core/genmod.sh.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gentpl.py b/gentpl.py index 0782e447d..f08bcc404 100644 --- a/gentpl.py +++ b/gentpl.py @@ -729,9 +729,11 @@ def kernel(defn, platform): """if test x$(TARGET_APPLE_LINKER) = x1; then \ $(TARGET_STRIP) -S -x $(""" + cname(defn) + """) -o $@.bin $<; \ $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \ + rm -f $@.bin; \ elif test ! -z '$(TARGET_OBJ2ELF)'; then \ """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@.bin $< && \ $(TARGET_OBJ2ELF) $@.bin $@ || (rm -f $@; rm -f $@.bin; exit 1); \ + rm -f $@.bin; \ else """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@ $<; \ fi""")) diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index f74edd551..ca2e59d5c 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -91,7 +91,7 @@ else -nr:_grub_mod_init:grub_mod_init \ -nr:_grub_mod_fini:grub_mod_fini \ -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 - rm -f $name.bin + rm -f $tmpfile.bin fi if test x@platform@ != xemu; then ./build-grub-module-verifier $tmpfile @target_cpu@ From 80fdaf1d012fa0403f7b75568df926735f070c3c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 31 Dec 2015 22:34:26 +0100 Subject: [PATCH 023/207] configure.ac: Reorder efiemu check to after link format check. efiemu is supposed to be disabled when compiling through exe format. Unfortunately format was determined only after efiemu check. Reorder to fix the problem --- configure.ac | 127 +++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/configure.ac b/configure.ac index 2e656dbea..26d2f33c7 100644 --- a/configure.ac +++ b/configure.ac @@ -948,66 +948,6 @@ if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" fi -AC_ARG_ENABLE([efiemu], - [AS_HELP_STRING([--enable-efiemu], - [build and install the efiemu runtimes (default=guessed)])]) -if test x"$enable_efiemu" = xno ; then - efiemu_excuse="explicitly disabled" -fi -if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then - efiemu_excuse="not available on cygwin" -fi -if test x"$target_cpu" != xi386 ; then - efiemu_excuse="only available on i386" -fi -if test x"$platform" = xefi ; then - efiemu_excuse="not available on efi" -fi -if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ - CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_efiemu=yes], - [grub_cv_cc_efiemu=no]) - ]) - if test x$grub_cv_cc_efiemu = xno; then - efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" - fi -fi -if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ - grub_cv_target_cc_efiemu64_link_format=unknown - for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do - CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" - LDFLAGS="-m64 -Wl,$format -nostdlib -static" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - asm (".globl start; start:"); - asm (".globl _start; _start:"); - asm (".globl __start; __start:"); - void __main (void); - void __main (void) {} - ]], [[]])], [flag=1], [flag=0]) - if test x"$flag" = x1; then - grub_cv_target_cc_efiemu64_link_format="$format" - break - fi - done]) - if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then - efiemu_excuse="no suitable link format for efiemu64 found" - else - EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" - fi -fi -if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then - AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) -fi -if test x"$efiemu_excuse" = x ; then -enable_efiemu=yes -else -enable_efiemu=no -fi -AC_SUBST([enable_efiemu]) -AC_SUBST([EFIEMU64_LINK_FORMAT]) CFLAGS="$TARGET_CFLAGS" @@ -1101,6 +1041,73 @@ else TARGET_IMG_CFLAGS= fi +CFLAGS="$TARGET_CFLAGS" + +AC_ARG_ENABLE([efiemu], + [AS_HELP_STRING([--enable-efiemu], + [build and install the efiemu runtimes (default=guessed)])]) +if test x"$enable_efiemu" = xno ; then + efiemu_excuse="explicitly disabled" +fi + +if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then + efiemu_excuse="not available on cygwin" +fi +if test x"$target_cpu" != xi386 ; then + efiemu_excuse="only available on i386" +fi +if test x"$platform" = xefi ; then + efiemu_excuse="not available on efi" +fi + +if test x"$efiemu_excuse" = x ; then + AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ + CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_efiemu=yes], + [grub_cv_cc_efiemu=no]) + ]) + if test x$grub_cv_cc_efiemu = xno; then + efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" + fi +fi +if test x"$efiemu_excuse" = x ; then + AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ + grub_cv_target_cc_efiemu64_link_format=unknown + for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do + CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" + LDFLAGS="-m64 -Wl,$format -nostdlib -static" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + asm (".globl start; start:"); + asm (".globl _start; _start:"); + asm (".globl __start; __start:"); + void __main (void); + void __main (void) {} + ]], [[]])], [flag=1], [flag=0]) + if test x"$flag" = x1; then + grub_cv_target_cc_efiemu64_link_format="$format" + break + fi + done]) + if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then + efiemu_excuse="no suitable link format for efiemu64 found" + else + EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" + fi +fi +if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then + AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) +fi +if test x"$efiemu_excuse" = x ; then +enable_efiemu=yes +else +enable_efiemu=no +fi +AC_SUBST([enable_efiemu]) +AC_SUBST([EFIEMU64_LINK_FORMAT]) + +CFLAGS="$TARGET_CFLAGS" + AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) From ba83ed1538b8765227bcdfbfe6fa013816f85be7 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 1 Jan 2016 11:13:54 +0300 Subject: [PATCH 024/207] Add missing BUILD_EXEEXT --- Makefile.am | 40 ++++++++++++++++++++-------------------- grub-core/Makefile.am | 2 +- grub-core/genmod.sh.in | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile.am b/Makefile.am index b8423b08d..3872b220c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,20 +89,20 @@ CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) if COND_STARFIELD starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) -dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE) +dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 10 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_10.pf2 -dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE) +dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 12 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_12.pf2 -dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE) +dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 14 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_14.pf2 -dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE) +dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -b -s 14 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_bold_14.pf2 -dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE) +dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 16 -o $@ $(DJVU_FONT_SOURCE) CLEANFILES += dejavu_16.pf2 else starfield_DATA = @@ -111,28 +111,28 @@ endif EXTRA_DIST += $(starfield_theme_files) EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf -unicode.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) +unicode.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) CLEANFILES += unicode.pf2 # Arrows and lines are needed to draw the menu, so always include them UNICODE_ARROWS=0x2190-0x2193 UNICODE_LINES=0x2501-0x251B -ascii.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +ascii.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += ascii.pf2 -euro.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +euro.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += euro.pf2 -ascii.h: $(FONT_SOURCE) build-grub-gen-asciih - ./build-grub-gen-asciih $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +ascii.h: $(FONT_SOURCE) build-grub-gen-asciih$(BUILD_EXEEXT) + ./build-grub-gen-asciih$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += ascii.h -widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec - ./build-grub-gen-widthspec $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec$(BUILD_EXEEXT) + ./build-grub-gen-widthspec$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += widthspec.h # Install config.h into platformdir diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 508e86bcd..90502cb1e 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -394,7 +394,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst platform_DATA += moddep.lst CLEANFILES += config.log syminfo.lst moddep.lst -$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier +$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier$(BUILD_EXEEXT) TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ platform_DATA += $(MOD_FILES) platform_DATA += modinfo.sh diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index ca2e59d5c..045817b15 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -94,6 +94,6 @@ else rm -f $tmpfile.bin fi if test x@platform@ != xemu; then - ./build-grub-module-verifier $tmpfile @target_cpu@ + ./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ fi mv $tmpfile $outfile From 19554a6034edfc333143fd7dc4842429a64bbd2d Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 2 Jan 2016 19:02:19 +0300 Subject: [PATCH 025/207] acpihalt: fix GRUB_DSDT_TEST compilation --- grub-core/commands/acpihalt.c | 2 ++ include/grub/acpi.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/grub-core/commands/acpihalt.c b/grub-core/commands/acpihalt.c index da68b5b52..412a9c9ac 100644 --- a/grub-core/commands/acpihalt.c +++ b/grub-core/commands/acpihalt.c @@ -26,6 +26,8 @@ #define grub_dprintf(cond, args...) printf ( args ) #define grub_printf printf +#define grub_util_fopen fopen +#define grub_memcmp memcmp typedef uint64_t grub_uint64_t; typedef uint32_t grub_uint32_t; typedef uint16_t grub_uint16_t; diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 8a8110241..10bfbd2cd 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -22,6 +22,8 @@ #ifndef GRUB_DSDT_TEST #include #include +#else +#define GRUB_PACKED __attribute__ ((packed)) #endif #define GRUB_RSDP_SIGNATURE "RSD PTR " From aa7bb4607bb799b2790ea008bcfd8d6ca0a6d752 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 2 Jan 2016 21:33:18 +0300 Subject: [PATCH 026/207] acpihalt: add GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD (0x8a) Fixes ACPI halt on ASUSTeK P8B75-V, Bios: American Megatrends v: 0414 date: 04/24/2012 Reported-By: Goh Lip --- grub-core/commands/acpihalt.c | 1 + include/grub/acpi.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/commands/acpihalt.c b/grub-core/commands/acpihalt.c index 412a9c9ac..9cc7f18e3 100644 --- a/grub-core/commands/acpihalt.c +++ b/grub-core/commands/acpihalt.c @@ -248,6 +248,7 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, if (!add) return -1; break; + case GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD: case GRUB_ACPI_OPCODE_CREATE_WORD_FIELD: case GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD: { diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 10bfbd2cd..a4224e046 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -221,9 +221,10 @@ enum GRUB_ACPI_OPCODE_CONCATRES = 0x84, GRUB_ACPI_OPCODE_MOD = 0x85, GRUB_ACPI_OPCODE_INDEX = 0x88, - GRUB_ACPI_OPCODE_TOSTRING = 0x9c, + GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD = 0x8a, GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b, GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c, + GRUB_ACPI_OPCODE_TOSTRING = 0x9c, GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff }; enum From 300be005a88930e1b9273c7eec7c239b6cf7beae Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 5 Jan 2016 11:54:39 +0100 Subject: [PATCH 027/207] Update checksums --- grub-core/tests/checksums.h | 594 ++++++++---------------------------- 1 file changed, 129 insertions(+), 465 deletions(-) diff --git a/grub-core/tests/checksums.h b/grub-core/tests/checksums.h index c9807a0dc..b42d63d25 100644 --- a/grub-core/tests/checksums.h +++ b/grub-core/tests/checksums.h @@ -1,465 +1,129 @@ - { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7dbff368, 0x7dbff368, 0x5a5bdc8d, 0x5a5bdc8d, 0x79753177, 0x79753177, 0xd01ede5b, 0xd01ede5b, 0x13708a73, 0x13708a73, 0x90186de3, 0x90186de3, 0xe63d02a2, 0xe63d02a2, 0x2c9dc262, 0x2c9dc262, 0x3eebd7b, 0x3eebd7b, 0xe8f3a5d8, 0xe8f3a5d8, 0xd38ecfe3, 0xd38ecfe3, 0x51878485, 0x51878485, 0xcbdb6d67, 0xcbdb6d67, 0xca25582, 0xca25582, 0x5bea0484, 0x5bea0484, 0x9ec5f71d, 0x9ec5f71d, 0x3f0bd7bc, 0x3f0bd7bc, 0xdbb0a5d2, 0xdbb0a5d2, 0xea710e2f, 0xea710e2f, 0xd14933fe, 0xd14933fe, 0x4906b783, 0xffd1d04b, 0xa159bdf9, 0xa159bdf9, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf1546749, 0xf1546749, 0x95d30576, 0x95d30576, 0x77f13935, 0x77f13935, 0xcc296836, 0xcc296836, 0x9af42bc7, 0x9af42bc7, 0x84c23709, 0x84c23709, 0x26b5a3c5, 0x26b5a3c5, 0x52d943fb, 0x52d943fb, 0x38beda82, 0x38beda82, 0xc12306b1, 0xc12306b1, 0xed251115, 0xed251115, 0xe0099a2f, 0xe0099a2f, 0xee929157, 0xee929157, 0xd96a1169, 0xd96a1169, 0x42fac799, 0x42fac799, 0x635af416, 0x635af416, 0x8e90342f, 0x8e90342f, 0xed467cbf, 0xed467cbf, 0x999fc60b, 0x999fc60b, 0xb45d2b1f, 0xb45d2b1f, 0x7e23ccef, 0x8e988beb, 0x8783fdf8, 0x8783fdf8, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x50b82239, 0x50b82239, 0x82c36c12, 0x82c36c12, 0x6311208d, 0x6311208d, 0x816bd4b3, 0x816bd4b3, 0xc9281fd0, 0xc9281fd0, 0x75767bac, 0x75767bac, 0x52edeac, 0x52edeac, 0xfdb551f7, 0xfdb551f7, 0xba21cd3, 0xba21cd3, 0xf2b3468a, 0xf2b3468a, 0xd5560323, 0xd5560323, 0x12c650f6, 0x12c650f6, 0x3d6c5861, 0x3d6c5861, 0x50062423, 0x50062423, 0x2ce22983, 0x2ce22983, 0x4996bc4d, 0x4996bc4d, 0x50450525, 0x50450525, 0xe1c94312, 0xe1c94312, 0x21224aac, 0x21224aac, 0x94cbe214, 0x94cbe214, 0x4578c664, 0x38a9dbd2, 0xa9eb4c48, 0xa9eb4c48, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbb687653, 0xbb687653, 0xa81427a7, 0xa81427a7, 0x71d7f3b, 0x71d7f3b, 0x25fea6ca, 0x25fea6ca, 0x17c19d74, 0x17c19d74, 0x4779bf48, 0x4779bf48, 0xe424e759, 0xe424e759, 0xb57fb5ae, 0xb57fb5ae, 0xd877002b, 0xd877002b, 0xdd8d7442, 0xdd8d7442, 0xe2536fde, 0xe2536fde, 0x1ebba341, 0x1ebba341, 0xef042176, 0xef042176, 0x6137f228, 0x6137f228, 0xf04a8558, 0xf04a8558, 0xff72172d, 0xff72172d, 0x5f26278f, 0x5f26278f, 0x3ed777c, 0x3ed777c, 0xb1d686e, 0xb1d686e, 0x5cead249, 0x5cead249, 0x271487f6, 0x9b7201b9, 0x6c2f147d, 0x6c2f147d, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x378dc141, 0x378dc141, 0xc7564497, 0xc7564497, 0xd20e9dba, 0xd20e9dba, 0xf84e8efb, 0xf84e8efb, 0x620d984, 0x620d984, 0x509042b4, 0x509042b4, 0x2bf32e11, 0x2bf32e11, 0x7c6fe3a0, 0x7c6fe3a0, 0x18106e6f, 0x18106e6f, 0xba983948, 0xba983948, 0xd85321cc, 0xd85321cc, 0xc22777cd, 0xc22777cd, 0x85b737c8, 0x85b737c8, 0x55590c10, 0x55590c10, 0x371ba701, 0x371ba701, 0x2da6264, 0x2da6264, 0x77c1ff46, 0x77c1ff46, 0xf2485577, 0xf2485577, 0x93e9eeeb, 0x93e9eeeb, 0x1460059, 0x1460059, 0xfbbbaa1, 0xa03c490a, 0x234dcb08, 0x234dcb08, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd803b53b, 0xd803b53b, 0x70b7ae8b, 0x70b7ae8b, 0xa20d9a15, 0xa20d9a15, 0x6113d33b, 0x6113d33b, 0xfd38d301, 0xfd38d301, 0x8b04db4, 0x8b04db4, 0xdae859df, 0xdae859df, 0x80cf138b, 0x80cf138b, 0xdfa6ef9, 0xdfa6ef9, 0x856adaf0, 0x856adaf0, 0x7023cc2d, 0x7023cc2d, 0xad7e7d54, 0xad7e7d54, 0xde8eff49, 0xde8eff49, 0x34355cc3, 0x34355cc3, 0x25adccda, 0x25adccda, 0x6d6c350d, 0x6d6c350d, 0x1c49b499, 0x1c49b499, 0x8188f1b4, 0x8188f1b4, 0x5556dc0c, 0x5556dc0c, 0xbd9ef1f5, 0xbd9ef1f5, 0x5176575b, 0x19da9ee1, 0x6e2f07c, 0x6e2f07c, }, 45 }, - { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xed7d2809, 0xed7d2809, 0x52c14224, 0x52c14224, 0xec52d912, 0xec52d912, 0x63276ae2, 0x63276ae2, 0xeeb4bfa4, 0xeeb4bfa4, 0xdf0f1ff0, 0xdf0f1ff0, 0xe2021708, 0xe2021708, 0x67c17085, 0x67c17085, 0x646e4d78, 0x646e4d78, 0x3b15f4b6, 0x3b15f4b6, 0xf4945ac5, 0xf4945ac5, 0x6cf60c00, 0x6cf60c00, 0x126648cd, 0x126648cd, 0xe7b8e348, 0xe7b8e348, 0x1626e35f, 0x1626e35f, 0x8022976c, 0x8022976c, 0xbc7e6d22, 0xbc7e6d22, 0xa2d50ad6, 0xa2d50ad6, 0x5072fea, 0x5072fea, 0x8481a563, 0x8481a563, 0x60a95143, 0x12fda168, 0xc8fe0549, 0xc8fe0549, }, 45 }, - { "cmdline_cat", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x7dbff368, 0x7dbff368, 0x5a5bdc8d, 0x5a5bdc8d, 0x79753177, 0x79753177, 0xd01ede5b, 0xd01ede5b, 0x13708a73, 0x13708a73, 0x90186de3, 0x90186de3, 0xe63d02a2, 0xe63d02a2, 0x2c9dc262, 0x2c9dc262, 0x3eebd7b, 0x3eebd7b, 0xe8f3a5d8, 0xe8f3a5d8, 0xd38ecfe3, 0xd38ecfe3, 0x51878485, 0x51878485, 0xcbdb6d67, 0xcbdb6d67, 0xca25582, 0xca25582, 0x5bea0484, 0x5bea0484, 0x9ec5f71d, 0x9ec5f71d, 0x3f0bd7bc, 0x3f0bd7bc, 0xdbb0a5d2, 0xdbb0a5d2, 0xea710e2f, 0xea710e2f, 0xd14933fe, 0xd14933fe, 0x4906b783, 0xffd1d04b, 0xa159bdf9, 0xa159bdf9, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xf1546749, 0xf1546749, 0x95d30576, 0x95d30576, 0x77f13935, 0x77f13935, 0xcc296836, 0xcc296836, 0x9af42bc7, 0x9af42bc7, 0x84c23709, 0x84c23709, 0x26b5a3c5, 0x26b5a3c5, 0x52d943fb, 0x52d943fb, 0x38beda82, 0x38beda82, 0xc12306b1, 0xc12306b1, 0xed251115, 0xed251115, 0xe0099a2f, 0xe0099a2f, 0xee929157, 0xee929157, 0xd96a1169, 0xd96a1169, 0x42fac799, 0x42fac799, 0x635af416, 0x635af416, 0x8e90342f, 0x8e90342f, 0xed467cbf, 0xed467cbf, 0x999fc60b, 0x999fc60b, 0xb45d2b1f, 0xb45d2b1f, 0x7e23ccef, 0x8e988beb, 0x8783fdf8, 0x8783fdf8, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x50b82239, 0x50b82239, 0x82c36c12, 0x82c36c12, 0x6311208d, 0x6311208d, 0x816bd4b3, 0x816bd4b3, 0xc9281fd0, 0xc9281fd0, 0x75767bac, 0x75767bac, 0x52edeac, 0x52edeac, 0xfdb551f7, 0xfdb551f7, 0xba21cd3, 0xba21cd3, 0xf2b3468a, 0xf2b3468a, 0xd5560323, 0xd5560323, 0x12c650f6, 0x12c650f6, 0x3d6c5861, 0x3d6c5861, 0x50062423, 0x50062423, 0x2ce22983, 0x2ce22983, 0x4996bc4d, 0x4996bc4d, 0x50450525, 0x50450525, 0xe1c94312, 0xe1c94312, 0x21224aac, 0x21224aac, 0x94cbe214, 0x94cbe214, 0x4578c664, 0x38a9dbd2, 0xa9eb4c48, 0xa9eb4c48, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x93fbd3a3, 0x93fbd3a3, 0x1617bee0, 0x1617bee0, 0x4bfbae7f, 0x4bfbae7f, 0xa3558248, 0xa3558248, 0xaf468a11, 0xaf468a11, 0x68ac5986, 0x68ac5986, 0xd8065600, 0xd8065600, 0xef6c6222, 0xef6c6222, 0x1a04371, 0x1a04371, 0xc92981b6, 0xc92981b6, 0x53f9bfc8, 0x53f9bfc8, 0xfef01300, 0xfef01300, 0xce753805, 0xce753805, 0x858f6540, 0x858f6540, 0x6429dae4, 0x6429dae4, 0x19222aa5, 0x19222aa5, 0x3f9a0303, 0x3f9a0303, 0x978a47da, 0x978a47da, 0x6bf7f199, 0x6bf7f199, 0x97dab6d, 0x97dab6d, 0xeb643dbd, 0x9fe6a006, 0x2b7a0b5b, 0x2b7a0b5b, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xe8381636, 0xe8381636, 0x977b32f5, 0x977b32f5, 0x54bb62c1, 0x54bb62c1, 0xe26211f2, 0xe26211f2, 0xb0d0aca3, 0xb0d0aca3, 0x8d1f7491, 0x8d1f7491, 0x261a3820, 0x261a3820, 0x571c16d3, 0x571c16d3, 0xdc5fb880, 0xdc5fb880, 0xc8b086fe, 0xc8b086fe, 0x55b07770, 0x55b07770, 0x1d5e160, 0x1d5e160, 0x5e5dddc8, 0x5e5dddc8, 0xceeaa332, 0xceeaa332, 0x81c9d3f3, 0x81c9d3f3, 0xa6bbab67, 0xa6bbab67, 0x9366a264, 0x9366a264, 0x4bcbc84c, 0x4bcbc84c, 0x8aacda73, 0x8aacda73, 0x356159d0, 0x356159d0, 0x74872545, 0x5a28a86f, 0x3a1f5494, 0x3a1f5494, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xccbd401, 0xccbd401, 0x35859629, 0x35859629, 0x269f013b, 0x269f013b, 0xe8c8196, 0xe8c8196, 0x95e2849c, 0x95e2849c, 0xb2019543, 0xb2019543, 0xf739b6c9, 0xf739b6c9, 0xd8227519, 0xd8227519, 0x6b1ae8cf, 0x6b1ae8cf, 0x84fbe9b2, 0x84fbe9b2, 0xed69a305, 0xed69a305, 0x15f4f0cf, 0x15f4f0cf, 0x57ce0973, 0x57ce0973, 0x3f5b0b97, 0x3f5b0b97, 0xc3e87bef, 0xc3e87bef, 0x3ac7584b, 0x3ac7584b, 0xdb95f2c7, 0xdb95f2c7, 0xc1942d4c, 0xc1942d4c, 0x17e9634e, 0x17e9634e, 0xd8dd41a3, 0xd8dd41a3, 0x927a8a2f, 0x339d3240, 0x398e6a2a, 0x398e6a2a, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa06498a0, 0xa06498a0, 0xd1336ad7, 0xd1336ad7, 0x68c888e0, 0x68c888e0, 0xf01fb74, 0xf01fb74, 0x6b743235, 0x6b743235, 0xe7b71a49, 0xe7b71a49, 0x798da4d7, 0x798da4d7, 0x5398f44b, 0x5398f44b, 0x4794ee5e, 0x4794ee5e, 0x61c2cb0d, 0x61c2cb0d, 0xad3fcef3, 0xad3fcef3, 0xd9b6f291, 0xd9b6f291, 0xbaf0962d, 0xbaf0962d, 0x11848b9e, 0x11848b9e, 0xb8f3d2bf, 0xb8f3d2bf, 0x3f9978, 0x3f9978, 0xafd76c24, 0xafd76c24, 0xee0b9b9e, 0xee0b9b9e, 0x1f80451e, 0x1f80451e, 0x817e030a, 0x817e030a, 0x64ee9a5d, 0x1d187aed, 0xb2c05a4a, 0xb2c05a4a, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x95c83b7d, 0x95c83b7d, 0xb8cac2b5, 0xb8cac2b5, 0xf0ef977f, 0xf0ef977f, 0xc4640770, 0xc4640770, 0x8ea8595e, 0x8ea8595e, 0xc7d26302, 0xc7d26302, 0x6f756fbc, 0x6f756fbc, 0x68bc6258, 0x68bc6258, 0xe77cff10, 0xe77cff10, 0x835ae8e5, 0x835ae8e5, 0x622cfc05, 0x622cfc05, 0xe192499f, 0xe192499f, 0x3b976218, 0x3b976218, 0xe2dcd75, 0xe2dcd75, 0xed05eae8, 0xed05eae8, 0xc0b8ee9a, 0xc0b8ee9a, 0x255ec66a, 0x255ec66a, 0x3391d9b6, 0x3391d9b6, 0x779834b3, 0x779834b3, 0xdf77a37f, 0xdf77a37f, 0xd3cc8a1d, 0xfec30b6e, 0x884fa360, 0x884fa360, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x698515fa, 0x698515fa, 0xc313ebe6, 0xc313ebe6, 0x32b9228f, 0x32b9228f, 0xa58d78e8, 0xa58d78e8, 0xf41d5153, 0xf41d5153, 0xdfa3af16, 0xdfa3af16, 0xd4a68422, 0xd4a68422, 0xa7ea67e0, 0xa7ea67e0, 0xaee4c8f6, 0xaee4c8f6, 0x78ddd8aa, 0x78ddd8aa, 0xe662b827, 0xe662b827, 0x190ab892, 0x190ab892, 0x7c1e04ab, 0x7c1e04ab, 0xae4e2ed2, 0xae4e2ed2, 0x9ac52f8d, 0x9ac52f8d, 0x7e7b6776, 0x7e7b6776, 0x21c37700, 0x21c37700, 0x4fc11e7c, 0x4fc11e7c, 0x612a17d, 0x612a17d, 0x1f549440, 0x1f549440, 0xd6ce5af0, 0x2751d45f, 0x41e24797, 0x41e24797, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x7a06e04b, 0x7a06e04b, 0x122f59ab, 0x122f59ab, 0x993a50b9, 0x993a50b9, 0x5545f8f, 0x5545f8f, 0xcdd2b587, 0xcdd2b587, 0x18bec138, 0x18bec138, 0xa9b4345d, 0xa9b4345d, 0x92c6eb1c, 0x92c6eb1c, 0x2aa44d63, 0x2aa44d63, 0xc9e7b549, 0xc9e7b549, 0x24732d85, 0x24732d85, 0xeedce06, 0xeedce06, 0x69a732a1, 0x69a732a1, 0xc53906e5, 0xc53906e5, 0x306e0f4b, 0x306e0f4b, 0x895e6f09, 0x895e6f09, 0x27f1c24e, 0x27f1c24e, 0x76a2b606, 0x76a2b606, 0x9fdd1ff3, 0x9fdd1ff3, 0x408d0a19, 0x408d0a19, 0xc9b3f877, 0xce19a637, 0x8cfd7321, 0x8cfd7321, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9fa21cbe, 0x9fa21cbe, 0xa9ad84e6, 0xa9ad84e6, 0x4f4ccbc, 0x4f4ccbc, 0x6a4f5fda, 0x6a4f5fda, 0x4d4ccb50, 0x4d4ccb50, 0xb854236c, 0xb854236c, 0x990a5b4a, 0x990a5b4a, 0xa9dba8c8, 0xa9dba8c8, 0xe12b4ca1, 0xe12b4ca1, 0x4200ebc0, 0x4200ebc0, 0x86a931cf, 0x86a931cf, 0xda3a178, 0xda3a178, 0x2739917d, 0x2739917d, 0x48005e41, 0x48005e41, 0x550a94ac, 0x550a94ac, 0x73f363b6, 0x73f363b6, 0x4811082a, 0x4811082a, 0xdc025f10, 0xdc025f10, 0x4f18937e, 0x4f18937e, 0xa3749fd8, 0xa3749fd8, 0x93ce5c0b, 0xdddd4de6, 0x97f43654, 0x97f43654, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x7d9b5dd7, 0x7d9b5dd7, 0x42e1176a, 0x42e1176a, 0x7e2da576, 0x7e2da576, 0xd5a8afa, 0xd5a8afa, 0x3eb2146b, 0x3eb2146b, 0x60d9b3, 0x60d9b3, 0xb893f5ca, 0xb893f5ca, 0xd431b2bf, 0xd431b2bf, 0x8ea1b6a6, 0x8ea1b6a6, 0x4d730ad0, 0x4d730ad0, 0x28d1888b, 0x28d1888b, 0x6d8c3672, 0x6d8c3672, 0x65dec2dd, 0x65dec2dd, 0x9d7c6d99, 0x9d7c6d99, 0xdfcd1eba, 0xdfcd1eba, 0xed4fb650, 0xed4fb650, 0xd9f1574c, 0xd9f1574c, 0x2b05a17e, 0x2b05a17e, 0x64e652f5, 0x64e652f5, 0x5f83fdb1, 0x5f83fdb1, 0x7918b180, 0xf54e3c4a, 0xe26cf2de, 0xe26cf2de, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x93fbd3a3, 0x93fbd3a3, 0x1617bee0, 0x1617bee0, 0x4bfbae7f, 0x4bfbae7f, 0xa3558248, 0xa3558248, 0xaf468a11, 0xaf468a11, 0x68ac5986, 0x68ac5986, 0xd8065600, 0xd8065600, 0xef6c6222, 0xef6c6222, 0x1a04371, 0x1a04371, 0xc92981b6, 0xc92981b6, 0x53f9bfc8, 0x53f9bfc8, 0xfef01300, 0xfef01300, 0xce753805, 0xce753805, 0x858f6540, 0x858f6540, 0x6429dae4, 0x6429dae4, 0x19222aa5, 0x19222aa5, 0x3f9a0303, 0x3f9a0303, 0x978a47da, 0x978a47da, 0x6bf7f199, 0x6bf7f199, 0x97dab6d, 0x97dab6d, 0xeb643dbd, 0x9fe6a006, 0x2b7a0b5b, 0x2b7a0b5b, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xe8381636, 0xe8381636, 0x977b32f5, 0x977b32f5, 0x54bb62c1, 0x54bb62c1, 0xe26211f2, 0xe26211f2, 0xb0d0aca3, 0xb0d0aca3, 0x8d1f7491, 0x8d1f7491, 0x261a3820, 0x261a3820, 0x571c16d3, 0x571c16d3, 0xdc5fb880, 0xdc5fb880, 0xc8b086fe, 0xc8b086fe, 0x55b07770, 0x55b07770, 0x1d5e160, 0x1d5e160, 0x5e5dddc8, 0x5e5dddc8, 0xceeaa332, 0xceeaa332, 0x81c9d3f3, 0x81c9d3f3, 0xa6bbab67, 0xa6bbab67, 0x9366a264, 0x9366a264, 0x4bcbc84c, 0x4bcbc84c, 0x8aacda73, 0x8aacda73, 0x356159d0, 0x356159d0, 0x74872545, 0x5a28a86f, 0x3a1f5494, 0x3a1f5494, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xccbd401, 0xccbd401, 0x35859629, 0x35859629, 0x269f013b, 0x269f013b, 0xe8c8196, 0xe8c8196, 0x95e2849c, 0x95e2849c, 0xb2019543, 0xb2019543, 0xf739b6c9, 0xf739b6c9, 0xd8227519, 0xd8227519, 0x6b1ae8cf, 0x6b1ae8cf, 0x84fbe9b2, 0x84fbe9b2, 0xed69a305, 0xed69a305, 0x15f4f0cf, 0x15f4f0cf, 0x57ce0973, 0x57ce0973, 0x3f5b0b97, 0x3f5b0b97, 0xc3e87bef, 0xc3e87bef, 0x3ac7584b, 0x3ac7584b, 0xdb95f2c7, 0xdb95f2c7, 0xc1942d4c, 0xc1942d4c, 0x17e9634e, 0x17e9634e, 0xd8dd41a3, 0xd8dd41a3, 0x927a8a2f, 0x339d3240, 0x398e6a2a, 0x398e6a2a, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa06498a0, 0xa06498a0, 0xd1336ad7, 0xd1336ad7, 0x68c888e0, 0x68c888e0, 0xf01fb74, 0xf01fb74, 0x6b743235, 0x6b743235, 0xe7b71a49, 0xe7b71a49, 0x798da4d7, 0x798da4d7, 0x5398f44b, 0x5398f44b, 0x4794ee5e, 0x4794ee5e, 0x61c2cb0d, 0x61c2cb0d, 0xad3fcef3, 0xad3fcef3, 0xd9b6f291, 0xd9b6f291, 0xbaf0962d, 0xbaf0962d, 0x11848b9e, 0x11848b9e, 0xb8f3d2bf, 0xb8f3d2bf, 0x3f9978, 0x3f9978, 0xafd76c24, 0xafd76c24, 0xee0b9b9e, 0xee0b9b9e, 0x1f80451e, 0x1f80451e, 0x817e030a, 0x817e030a, 0x64ee9a5d, 0x1d187aed, 0xb2c05a4a, 0xb2c05a4a, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x95c83b7d, 0x95c83b7d, 0xb8cac2b5, 0xb8cac2b5, 0xf0ef977f, 0xf0ef977f, 0xc4640770, 0xc4640770, 0x8ea8595e, 0x8ea8595e, 0xc7d26302, 0xc7d26302, 0x6f756fbc, 0x6f756fbc, 0x68bc6258, 0x68bc6258, 0xe77cff10, 0xe77cff10, 0x835ae8e5, 0x835ae8e5, 0x622cfc05, 0x622cfc05, 0xe192499f, 0xe192499f, 0x3b976218, 0x3b976218, 0xe2dcd75, 0xe2dcd75, 0xed05eae8, 0xed05eae8, 0xc0b8ee9a, 0xc0b8ee9a, 0x255ec66a, 0x255ec66a, 0x3391d9b6, 0x3391d9b6, 0x779834b3, 0x779834b3, 0xdf77a37f, 0xdf77a37f, 0xd3cc8a1d, 0xfec30b6e, 0x884fa360, 0x884fa360, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x698515fa, 0x698515fa, 0xc313ebe6, 0xc313ebe6, 0x32b9228f, 0x32b9228f, 0xa58d78e8, 0xa58d78e8, 0xf41d5153, 0xf41d5153, 0xdfa3af16, 0xdfa3af16, 0xd4a68422, 0xd4a68422, 0xa7ea67e0, 0xa7ea67e0, 0xaee4c8f6, 0xaee4c8f6, 0x78ddd8aa, 0x78ddd8aa, 0xe662b827, 0xe662b827, 0x190ab892, 0x190ab892, 0x7c1e04ab, 0x7c1e04ab, 0xae4e2ed2, 0xae4e2ed2, 0x9ac52f8d, 0x9ac52f8d, 0x7e7b6776, 0x7e7b6776, 0x21c37700, 0x21c37700, 0x4fc11e7c, 0x4fc11e7c, 0x612a17d, 0x612a17d, 0x1f549440, 0x1f549440, 0xd6ce5af0, 0x2751d45f, 0x41e24797, 0x41e24797, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x7a06e04b, 0x7a06e04b, 0x122f59ab, 0x122f59ab, 0x993a50b9, 0x993a50b9, 0x5545f8f, 0x5545f8f, 0xcdd2b587, 0xcdd2b587, 0x18bec138, 0x18bec138, 0xa9b4345d, 0xa9b4345d, 0x92c6eb1c, 0x92c6eb1c, 0x2aa44d63, 0x2aa44d63, 0xc9e7b549, 0xc9e7b549, 0x24732d85, 0x24732d85, 0xeedce06, 0xeedce06, 0x69a732a1, 0x69a732a1, 0xc53906e5, 0xc53906e5, 0x306e0f4b, 0x306e0f4b, 0x895e6f09, 0x895e6f09, 0x27f1c24e, 0x27f1c24e, 0x76a2b606, 0x76a2b606, 0x9fdd1ff3, 0x9fdd1ff3, 0x408d0a19, 0x408d0a19, 0xc9b3f877, 0xce19a637, 0x8cfd7321, 0x8cfd7321, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9fa21cbe, 0x9fa21cbe, 0xa9ad84e6, 0xa9ad84e6, 0x4f4ccbc, 0x4f4ccbc, 0x6a4f5fda, 0x6a4f5fda, 0x4d4ccb50, 0x4d4ccb50, 0xb854236c, 0xb854236c, 0x990a5b4a, 0x990a5b4a, 0xa9dba8c8, 0xa9dba8c8, 0xe12b4ca1, 0xe12b4ca1, 0x4200ebc0, 0x4200ebc0, 0x86a931cf, 0x86a931cf, 0xda3a178, 0xda3a178, 0x2739917d, 0x2739917d, 0x48005e41, 0x48005e41, 0x550a94ac, 0x550a94ac, 0x73f363b6, 0x73f363b6, 0x4811082a, 0x4811082a, 0xdc025f10, 0xdc025f10, 0x4f18937e, 0x4f18937e, 0xa3749fd8, 0xa3749fd8, 0x93ce5c0b, 0xdddd4de6, 0x97f43654, 0x97f43654, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x7d9b5dd7, 0x7d9b5dd7, 0x42e1176a, 0x42e1176a, 0x7e2da576, 0x7e2da576, 0xd5a8afa, 0xd5a8afa, 0x3eb2146b, 0x3eb2146b, 0x60d9b3, 0x60d9b3, 0xb893f5ca, 0xb893f5ca, 0xd431b2bf, 0xd431b2bf, 0x8ea1b6a6, 0x8ea1b6a6, 0x4d730ad0, 0x4d730ad0, 0x28d1888b, 0x28d1888b, 0x6d8c3672, 0x6d8c3672, 0x65dec2dd, 0x65dec2dd, 0x9d7c6d99, 0x9d7c6d99, 0xdfcd1eba, 0xdfcd1eba, 0xed4fb650, 0xed4fb650, 0xd9f1574c, 0xd9f1574c, 0x2b05a17e, 0x2b05a17e, 0x64e652f5, 0x64e652f5, 0x5f83fdb1, 0x5f83fdb1, 0x7918b180, 0xf54e3c4a, 0xe26cf2de, 0xe26cf2de, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xbb687653, 0xbb687653, 0xa81427a7, 0xa81427a7, 0x71d7f3b, 0x71d7f3b, 0x25fea6ca, 0x25fea6ca, 0x17c19d74, 0x17c19d74, 0x4779bf48, 0x4779bf48, 0xe424e759, 0xe424e759, 0xb57fb5ae, 0xb57fb5ae, 0xd877002b, 0xd877002b, 0xdd8d7442, 0xdd8d7442, 0xe2536fde, 0xe2536fde, 0x1ebba341, 0x1ebba341, 0xef042176, 0xef042176, 0x6137f228, 0x6137f228, 0xf04a8558, 0xf04a8558, 0xff72172d, 0xff72172d, 0x5f26278f, 0x5f26278f, 0x3ed777c, 0x3ed777c, 0xb1d686e, 0xb1d686e, 0x5cead249, 0x5cead249, 0x271487f6, 0x9b7201b9, 0x6c2f147d, 0x6c2f147d, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x378dc141, 0x378dc141, 0xc7564497, 0xc7564497, 0xd20e9dba, 0xd20e9dba, 0xf84e8efb, 0xf84e8efb, 0x620d984, 0x620d984, 0x509042b4, 0x509042b4, 0x2bf32e11, 0x2bf32e11, 0x7c6fe3a0, 0x7c6fe3a0, 0x18106e6f, 0x18106e6f, 0xba983948, 0xba983948, 0xd85321cc, 0xd85321cc, 0xc22777cd, 0xc22777cd, 0x85b737c8, 0x85b737c8, 0x55590c10, 0x55590c10, 0x371ba701, 0x371ba701, 0x2da6264, 0x2da6264, 0x77c1ff46, 0x77c1ff46, 0xf2485577, 0xf2485577, 0x93e9eeeb, 0x93e9eeeb, 0x1460059, 0x1460059, 0xfbbbaa1, 0xa03c490a, 0x234dcb08, 0x234dcb08, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd803b53b, 0xd803b53b, 0x70b7ae8b, 0x70b7ae8b, 0xa20d9a15, 0xa20d9a15, 0x6113d33b, 0x6113d33b, 0xfd38d301, 0xfd38d301, 0x8b04db4, 0x8b04db4, 0xdae859df, 0xdae859df, 0x80cf138b, 0x80cf138b, 0xdfa6ef9, 0xdfa6ef9, 0x856adaf0, 0x856adaf0, 0x7023cc2d, 0x7023cc2d, 0xad7e7d54, 0xad7e7d54, 0xde8eff49, 0xde8eff49, 0x34355cc3, 0x34355cc3, 0x25adccda, 0x25adccda, 0x6d6c350d, 0x6d6c350d, 0x1c49b499, 0x1c49b499, 0x8188f1b4, 0x8188f1b4, 0x5556dc0c, 0x5556dc0c, 0xbd9ef1f5, 0xbd9ef1f5, 0x5176575b, 0x19da9ee1, 0x6e2f07c, 0x6e2f07c, }, 45 }, - { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xc5faf369, 0x64eb297a, 0xc5faf369, 0x860c3e2e, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x860c3e2e, 0x860c3e2e, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd50b0276, 0x23b87c98, 0xd50b0276, 0xfb0e8709, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xfb0e8709, 0xfb0e8709, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x353bd15d, 0x79836ff2, 0x353bd15d, 0x682cbcd9, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x682cbcd9, 0x682cbcd9, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x22bcc2fc, 0xc6c23ab4, 0x22bcc2fc, 0x72a46652, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x72a46652, 0x72a46652, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3afb9165, 0x767dd6a7, 0x3afb9165, 0x31409f, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x31409f, 0x31409f, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe13f0039, 0xb5783cd1, 0xe13f0039, 0x814ca453, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x814ca453, 0x814ca453, 0xdd28f52b, }, 20 }, - { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x154ac813, 0x5c191673, 0x154ac813, 0xeb0cc57e, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0xeb0cc57e, 0xeb0cc57e, 0x43d1f34, }, 20 }, - { "gfxterm_menu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xc5faf369, 0x64eb297a, 0xc5faf369, 0x860c3e2e, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x860c3e2e, 0x860c3e2e, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xd50b0276, 0x23b87c98, 0xd50b0276, 0xfb0e8709, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xfb0e8709, 0xfb0e8709, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x353bd15d, 0x79836ff2, 0x353bd15d, 0x682cbcd9, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x682cbcd9, 0x682cbcd9, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe967dfb6, 0x7fedccee, 0xe967dfb6, 0xad6c250a, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xad6c250a, 0xad6c250a, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x985bd9b5, 0xd5604814, 0x985bd9b5, 0x2233942a, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x2233942a, 0x2233942a, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x928c0a8e, 0xd25dcf03, 0x928c0a8e, 0x83f9bfdb, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x83f9bfdb, 0x83f9bfdb, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x116c0258, 0xed7d4786, 0x116c0258, 0xfef8bf61, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xfef8bf61, 0xfef8bf61, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xd49b1c35, 0x37f70b09, 0xd49b1c35, 0xa55122d9, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa55122d9, 0xa55122d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x2b3f0273, 0x6da0f134, 0x2b3f0273, 0xd9ed8903, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd9ed8903, 0xd9ed8903, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x1e6b0284, 0x18f0ad39, 0x1e6b0284, 0x1e0bba22, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x1e0bba22, 0x1e0bba22, 0x1c955882, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x1f279ca1, 0x976cb6e3, 0x1f279ca1, 0xdb3505a5, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0xdb3505a5, 0xdb3505a5, 0x4d266f7a, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x21235dde, 0x13b8b442, 0x21235dde, 0xbdd75c39, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xbdd75c39, 0xbdd75c39, 0x1ed9d731, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe967dfb6, 0x7fedccee, 0xe967dfb6, 0xad6c250a, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xad6c250a, 0xad6c250a, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x985bd9b5, 0xd5604814, 0x985bd9b5, 0x2233942a, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x2233942a, 0x2233942a, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x928c0a8e, 0xd25dcf03, 0x928c0a8e, 0x83f9bfdb, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x83f9bfdb, 0x83f9bfdb, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x116c0258, 0xed7d4786, 0x116c0258, 0xfef8bf61, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xfef8bf61, 0xfef8bf61, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xd49b1c35, 0x37f70b09, 0xd49b1c35, 0xa55122d9, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa55122d9, 0xa55122d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x2b3f0273, 0x6da0f134, 0x2b3f0273, 0xd9ed8903, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd9ed8903, 0xd9ed8903, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x1e6b0284, 0x18f0ad39, 0x1e6b0284, 0x1e0bba22, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x1e0bba22, 0x1e0bba22, 0x1c955882, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x1f279ca1, 0x976cb6e3, 0x1f279ca1, 0xdb3505a5, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0xdb3505a5, 0xdb3505a5, 0x4d266f7a, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x21235dde, 0x13b8b442, 0x21235dde, 0xbdd75c39, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xbdd75c39, 0xbdd75c39, 0x1ed9d731, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x22bcc2fc, 0xc6c23ab4, 0x22bcc2fc, 0x72a46652, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x72a46652, 0x72a46652, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3afb9165, 0x767dd6a7, 0x3afb9165, 0x31409f, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x31409f, 0x31409f, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe13f0039, 0xb5783cd1, 0xe13f0039, 0x814ca453, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x814ca453, 0x814ca453, 0xdd28f52b, }, 20 }, - { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x28e6b07d, 0xf54b3d6a, 0x28e6b07d, 0x7d0bdbfb, 0x9a2e0d26, 0xb22b0963, 0xb22b0963, 0xb22b0963, 0xeef3ffa3, 0xeef3ffa3, 0xeef3ffa3, 0x36f73b6, 0x36f73b6, 0x36f73b6, 0x59c36f00, 0x7d0bdbfb, 0x7d0bdbfb, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x15bb581c, 0x7da084c6, 0x15bb581c, 0xcedba42f, 0xbc06c96d, 0xb3a8a15b, 0xb3a8a15b, 0xb3a8a15b, 0xe6f70b51, 0xe6f70b51, 0xe6f70b51, 0x8ce38109, 0x8ce38109, 0x8ce38109, 0xaa4593fe, 0xcedba42f, 0xcedba42f, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x817e5fe2, 0x134e87ff, 0x817e5fe2, 0xb83ddd98, 0xdcd8c986, 0x79244533, 0x79244533, 0x79244533, 0x69ae3a7, 0x69ae3a7, 0x69ae3a7, 0xfc10b74f, 0xfc10b74f, 0xfc10b74f, 0xc9cbf769, 0xb83ddd98, 0xb83ddd98, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x95048302, 0x9f5bac7c, 0x95048302, 0x28413b7c, 0x740d78cf, 0x620e8524, 0x620e8524, 0x620e8524, 0x89ab6f58, 0x89ab6f58, 0x89ab6f58, 0x90218e3d, 0x90218e3d, 0x90218e3d, 0x1c3742c9, 0x28413b7c, 0x28413b7c, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x6cf38a7e, 0x35fcd6e8, 0x6cf38a7e, 0x618c203c, 0xe925e70d, 0xff9c8a81, 0xff9c8a81, 0xff9c8a81, 0x90d55690, 0x90d55690, 0x90d55690, 0xd3df13a0, 0xd3df13a0, 0xd3df13a0, 0xcc5a7bed, 0x618c203c, 0x618c203c, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0xd610d630, 0x98774981, 0xd610d630, 0x4469957c, 0x9869130b, 0xfb592a0d, 0xfb592a0d, 0xfb592a0d, 0x3deb6e13, 0x3deb6e13, 0x3deb6e13, 0xeaf96ec4, 0xeaf96ec4, 0xeaf96ec4, 0xef4a3312, 0x4469957c, 0x4469957c, }, 18 }, - { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xf5c7a904, 0xaf9e8139, 0xf5c7a904, 0xf108ef6b, 0x91c7d0fe, 0xb57ab567, 0xb57ab567, 0xb57ab567, 0x348943b6, 0x348943b6, 0x348943b6, 0x9b076791, 0x9b076791, 0x9b076791, 0x54e48d80, 0xf108ef6b, 0xf108ef6b, }, 18 }, - { "gfxmenu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xff8ab96b, 0x72a93e7f, 0xff8ab96b, 0x47d54a82, 0x42b837cf, 0x6abd338a, 0x6abd338a, 0x6abd338a, 0x3665c54a, 0x3665c54a, 0x3665c54a, 0xdbf9495f, 0xdbf9495f, 0xdbf9495f, 0x59c36f00, 0x47d54a82, 0x47d54a82, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x73ad05f, 0x8434d91c, 0x73ad05f, 0x5316d3c6, 0xd7e75590, 0xd8493da6, 0xd8493da6, 0xd8493da6, 0x8d1697ac, 0x8d1697ac, 0x8d1697ac, 0xe7021df4, 0xe7021df4, 0xe7021df4, 0xaa4593fe, 0x5316d3c6, 0x5316d3c6, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x83e29007, 0xd4329e28, 0x83e29007, 0x8c37fac6, 0x97d4f246, 0x32287ef3, 0x32287ef3, 0x32287ef3, 0x4d96d867, 0x4d96d867, 0x4d96d867, 0xb71c8c8f, 0xb71c8c8f, 0xb71c8c8f, 0xc9cbf769, 0x8c37fac6, 0x8c37fac6, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe535f843, 0x39fb9c6c, 0xe535f843, 0x2fbd1b9, 0x7c892c8d, 0x3a8a1482, 0x3a8a1482, 0x3a8a1482, 0x2d7a2495, 0x2d7a2495, 0x2d7a2495, 0x84d821d, 0x84d821d, 0x84d821d, 0x5387d57f, 0x2fbd1b9, 0x2fbd1b9, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8f8338d3, 0xdcad6ccd, 0x8f8338d3, 0x30c612d8, 0x36353d2b, 0xa9546353, 0xa9546353, 0xa9546353, 0x960ace5a, 0x960ace5a, 0x960ace5a, 0x62e43bb9, 0x62e43bb9, 0x62e43bb9, 0xf83ee7aa, 0x30c612d8, 0x30c612d8, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xb7a13882, 0x68141e3a, 0xb7a13882, 0x65f6d15, 0x3101c32f, 0xc2b93e36, 0xc2b93e36, 0xc2b93e36, 0x1bee651a, 0x1bee651a, 0x1bee651a, 0xf7d3f08f, 0xf7d3f08f, 0xf7d3f08f, 0x724366e5, 0x65f6d15, 0x65f6d15, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x88a3c3aa, 0x8eade265, 0x88a3c3aa, 0xa5bf47d6, 0x9f8ae196, 0x56e34121, 0x56e34121, 0x56e34121, 0x2ccef01f, 0x2ccef01f, 0x2ccef01f, 0x7d1eee3b, 0x7d1eee3b, 0x7d1eee3b, 0x5387d57f, 0xa5bf47d6, 0xa5bf47d6, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8452c39c, 0x65759f4c, 0x8452c39c, 0x7459c042, 0xf9023dca, 0xe78b8902, 0xe78b8902, 0xe78b8902, 0xf0960107, 0xf0960107, 0xf0960107, 0xd52b2285, 0xd52b2285, 0xd52b2285, 0xf83ee7aa, 0x7459c042, 0x7459c042, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x938d42a2, 0x709bc8ab, 0x938d42a2, 0x4db0e2de, 0xd710f4c, 0x4e9cc80d, 0x4e9cc80d, 0x4e9cc80d, 0x9bc8a372, 0x9bc8a372, 0x9bc8a372, 0xbac90ac7, 0xbac90ac7, 0xbac90ac7, 0x724366e5, 0x4db0e2de, 0x4db0e2de, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xc060102b, 0x960bef0c, 0xc060102b, 0x1589677a, 0xe97d0978, 0xc795e31, 0xc795e31, 0xc795e31, 0xab33090, 0xab33090, 0xab33090, 0xbeea3971, 0xbeea3971, 0xbeea3971, 0x1c955882, 0x1589677a, 0x1589677a, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x6a4b2b8d, 0x274440b, 0x6a4b2b8d, 0xdef115d2, 0xed0808ad, 0x8d8ebcbb, 0x8d8ebcbb, 0x8d8ebcbb, 0x2b9b5d26, 0x2b9b5d26, 0x2b9b5d26, 0x790e10e2, 0x790e10e2, 0x790e10e2, 0x4d266f7a, 0xdef115d2, 0xdef115d2, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xdb8085be, 0x51d897c7, 0xdb8085be, 0xa3ce0221, 0x30fbd5f9, 0x12d25f5, 0x12d25f5, 0x12d25f5, 0xa4a480cb, 0xa4a480cb, 0xa4a480cb, 0xf3adca34, 0xf3adca34, 0xf3adca34, 0x1ed9d731, 0xa3ce0221, 0xa3ce0221, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x475beaa4, 0xa62db977, 0x475beaa4, 0x3a62be0, 0x311b5810, 0x7718601f, 0x7718601f, 0x7718601f, 0x60e85008, 0x60e85008, 0x60e85008, 0x45dff680, 0x45dff680, 0x45dff680, 0x5387d57f, 0x3a62be0, 0x3a62be0, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5788a7ac, 0xd4336209, 0x5788a7ac, 0x354678e9, 0x783d77de, 0xe75c29a6, 0xe75c29a6, 0xe75c29a6, 0xd80284af, 0xd80284af, 0xd80284af, 0x2cec714c, 0x2cec714c, 0x2cec714c, 0xf83ee7aa, 0x354678e9, 0x354678e9, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xd1f64ea0, 0x4abd595a, 0xd1f64ea0, 0x97a6bea1, 0xf22a4cdb, 0x192b1c2, 0x192b1c2, 0x192b1c2, 0xd8c5eaee, 0xd8c5eaee, 0xd8c5eaee, 0x34f87f7b, 0x34f87f7b, 0x34f87f7b, 0x724366e5, 0x97a6bea1, 0x97a6bea1, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xfcd5f4bb, 0x36d1826d, 0xfcd5f4bb, 0x43d7de40, 0x84467c83, 0x4d2fdc34, 0x4d2fdc34, 0x4d2fdc34, 0x37026d0a, 0x37026d0a, 0x37026d0a, 0x66d2732e, 0x66d2732e, 0x66d2732e, 0x5387d57f, 0x43d7de40, 0x43d7de40, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x21e820a3, 0x2f9bf273, 0x21e820a3, 0xaa229449, 0x61b241cd, 0x7f3bf505, 0x7f3bf505, 0x7f3bf505, 0x68267d00, 0x68267d00, 0x68267d00, 0x4d9b5e82, 0x4d9b5e82, 0x4d9b5e82, 0xf83ee7aa, 0xaa229449, 0xaa229449, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x6fe66840, 0x64229598, 0x6fe66840, 0xedc02d98, 0x7131f7aa, 0x32dc30eb, 0x32dc30eb, 0x32dc30eb, 0xe7885b94, 0xe7885b94, 0xe7885b94, 0xc689f221, 0xc689f221, 0xc689f221, 0x724366e5, 0xedc02d98, 0xedc02d98, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xdb159e45, 0x9b1475c9, 0xdb159e45, 0xaee6597b, 0x573454, 0xe553631d, 0xe553631d, 0xe553631d, 0xe3990dbc, 0xe3990dbc, 0xe3990dbc, 0x57c0045d, 0x57c0045d, 0x57c0045d, 0x1c955882, 0xaee6597b, 0xaee6597b, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9a43dfc6, 0x67153087, 0x9a43dfc6, 0xe9bd482c, 0xe763cddd, 0x87e579cb, 0x87e579cb, 0x87e579cb, 0x21f09856, 0x21f09856, 0x21f09856, 0x7365d592, 0x7365d592, 0x7365d592, 0x4d266f7a, 0xe9bd482c, 0xe9bd482c, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x78bf287, 0x8e68ddb4, 0x78bf287, 0xb2b0d4a4, 0xcb49fd6e, 0xfa9f0d62, 0xfa9f0d62, 0xfa9f0d62, 0x5f16a85c, 0x5f16a85c, 0x5f16a85c, 0x81fe2a3, 0x81fe2a3, 0x81fe2a3, 0x1ed9d731, 0xb2b0d4a4, 0xb2b0d4a4, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xb7ccf7ca, 0xfe517937, 0xb7ccf7ca, 0xfa1f93fd, 0x83d93b90, 0x95dac67b, 0x95dac67b, 0x95dac67b, 0x7e7f2c07, 0x7e7f2c07, 0x7e7f2c07, 0x67f5cd62, 0x67f5cd62, 0x67f5cd62, 0x1c3742c9, 0xfa1f93fd, 0xfa1f93fd, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x663d292a, 0xa008c39, 0x663d292a, 0xcd82113f, 0x1c0b0f02, 0xab2628e, 0xab2628e, 0xab2628e, 0x65fbbe9f, 0x65fbbe9f, 0x65fbbe9f, 0x26f1fbaf, 0x26f1fbaf, 0x26f1fbaf, 0xcc5a7bed, 0xcd82113f, 0xcd82113f, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xef4a3312, 0xfc2f0ab1, 0x6861f25e, 0xfc2f0ab1, 0x11b6b6f7, 0xcd618f3f, 0xae51b639, 0xae51b639, 0xae51b639, 0x68e3f227, 0x68e3f227, 0x68e3f227, 0xbff1f2f0, 0xbff1f2f0, 0xbff1f2f0, 0xef4a3312, 0x11b6b6f7, 0x11b6b6f7, }, 18 }, - { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe0b5a23e, 0xee551fa6, 0xe0b5a23e, 0xa3436f79, 0x59c36f00, 0x59c36f00, 0x5e67c1f2, 0x5e67c1f2, 0x5e67c1f2, 0x20e7ac94, 0x20e7ac94, 0x20e7ac94, 0xe3c59159, 0xe3c59159, 0xe3c59159, 0x59c36f00, 0xa3436f79, 0xa3436f79, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2bb3c18d, 0xdfae36a1, 0x2bb3c18d, 0x5b644f2, 0xaa4593fe, 0xaa4593fe, 0xccb764da, 0xccb764da, 0xccb764da, 0x6a4269bd, 0x6a4269bd, 0x6a4269bd, 0xe8e58bd6, 0xe8e58bd6, 0xe8e58bd6, 0xaa4593fe, 0x5b644f2, 0x5b644f2, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xdae90963, 0xc865b2ee, 0xdae90963, 0x87fe64e7, 0xc9cbf769, 0xc9cbf769, 0xbdb21287, 0xbdb21287, 0xbdb21287, 0x436ad34b, 0x436ad34b, 0x436ad34b, 0xab3c7c47, 0xab3c7c47, 0xab3c7c47, 0xc9cbf769, 0x87fe64e7, 0x87fe64e7, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd5ca4355, 0xc8fbf114, 0xd5ca4355, 0x85d2e7fb, 0x9813a416, 0x9813a416, 0x4a1e101b, 0x4a1e101b, 0x4a1e101b, 0xdbc59628, 0xdbc59628, 0xdbc59628, 0x47b063ea, 0x47b063ea, 0x47b063ea, 0x9813a416, 0x85d2e7fb, 0x85d2e7fb, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x722a297e, 0xb34f27df, 0x722a297e, 0x48e0f884, 0x5fcf013d, 0x5fcf013d, 0xee9e0d69, 0xee9e0d69, 0xee9e0d69, 0x3c8e151f, 0x3c8e151f, 0x3c8e151f, 0x23a594e2, 0x23a594e2, 0x23a594e2, 0x5fcf013d, 0x48e0f884, 0x48e0f884, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x87be67c4, 0x484106d9, 0x87be67c4, 0xe7cdc3ae, 0xdd28f52b, 0xdd28f52b, 0x2063d7c8, 0x2063d7c8, 0x2063d7c8, 0x15f2e2c, 0x15f2e2c, 0x15f2e2c, 0x1b2e4dbd, 0x1b2e4dbd, 0x1b2e4dbd, 0xdd28f52b, 0xe7cdc3ae, 0xe7cdc3ae, 0xdd28f52b, }, 20 }, - { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbf799219, 0xcec61405, 0xbf799219, 0x413f9f74, 0x43d1f34, 0x43d1f34, 0x9dc6a6fb, 0x9dc6a6fb, 0x9dc6a6fb, 0xe2cc0f53, 0xe2cc0f53, 0xe2cc0f53, 0xaec367a, 0xaec367a, 0xaec367a, 0x43d1f34, 0x413f9f74, 0x413f9f74, 0x43d1f34, }, 20 }, - { "gfxterm_ar", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xe0b5a23e, 0xee551fa6, 0xe0b5a23e, 0xa3436f79, 0x59c36f00, 0x59c36f00, 0x5e67c1f2, 0x5e67c1f2, 0x5e67c1f2, 0x20e7ac94, 0x20e7ac94, 0x20e7ac94, 0xe3c59159, 0xe3c59159, 0xe3c59159, 0x59c36f00, 0xa3436f79, 0xa3436f79, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x2bb3c18d, 0xdfae36a1, 0x2bb3c18d, 0x5b644f2, 0xaa4593fe, 0xaa4593fe, 0xccb764da, 0xccb764da, 0xccb764da, 0x6a4269bd, 0x6a4269bd, 0x6a4269bd, 0xe8e58bd6, 0xe8e58bd6, 0xe8e58bd6, 0xaa4593fe, 0x5b644f2, 0x5b644f2, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xdae90963, 0xc865b2ee, 0xdae90963, 0x87fe64e7, 0xc9cbf769, 0xc9cbf769, 0xbdb21287, 0xbdb21287, 0xbdb21287, 0x436ad34b, 0x436ad34b, 0x436ad34b, 0xab3c7c47, 0xab3c7c47, 0xab3c7c47, 0xc9cbf769, 0x87fe64e7, 0x87fe64e7, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x3b1768ca, 0xf9e5eedd, 0x3b1768ca, 0x7f1c9276, 0x5387d57f, 0x5387d57f, 0x927c1c5d, 0x927c1c5d, 0x927c1c5d, 0x52257091, 0x52257091, 0x52257091, 0xb5fbf207, 0xb5fbf207, 0xb5fbf207, 0x5387d57f, 0x7f1c9276, 0x7f1c9276, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x54190c0f, 0xb6b42319, 0x54190c0f, 0xee714190, 0xf83ee7aa, 0xf83ee7aa, 0x1cbd869f, 0x1cbd869f, 0x1cbd869f, 0x80c4566c, 0x80c4566c, 0x80c4566c, 0xb877fdc4, 0xb877fdc4, 0xb877fdc4, 0xf83ee7aa, 0xee714190, 0xee714190, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x25774ca3, 0x3d74e13a, 0x25774ca3, 0x3402f9f6, 0x724366e5, 0x724366e5, 0x447ccdbb, 0x447ccdbb, 0x447ccdbb, 0x3458f41, 0x3458f41, 0x3458f41, 0x6e6ba80b, 0x6e6ba80b, 0x6e6ba80b, 0x724366e5, 0x3402f9f6, 0x3402f9f6, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9143e2a6, 0x6e596cd4, 0x9143e2a6, 0x7ed75f9f, 0x5387d57f, 0x5387d57f, 0x86a0aae, 0x86a0aae, 0x86a0aae, 0xd6a44573, 0xd6a44573, 0xd6a44573, 0x4527d76d, 0x4527d76d, 0x4527d76d, 0x5387d57f, 0x7ed75f9f, 0x7ed75f9f, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf943d873, 0xced7704, 0xf943d873, 0x8889e69f, 0xf83ee7aa, 0xf83ee7aa, 0x82576edb, 0x82576edb, 0x82576edb, 0xf08d7deb, 0xf08d7deb, 0xf08d7deb, 0xc1182c2d, 0xc1182c2d, 0xc1182c2d, 0xf83ee7aa, 0x8889e69f, 0x8889e69f, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x63bd59d2, 0xf34f52d5, 0x63bd59d2, 0x916fd2a2, 0x724366e5, 0x724366e5, 0x11262bd6, 0x11262bd6, 0x11262bd6, 0x48b6d886, 0x48b6d886, 0x48b6d886, 0x8001b6c4, 0x8001b6c4, 0x8001b6c4, 0x724366e5, 0x916fd2a2, 0x916fd2a2, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xed6af547, 0x9ff43eec, 0xed6af547, 0xed0a4de1, 0x1c955882, 0x1c955882, 0xa9dce4cb, 0xa9dce4cb, 0xa9dce4cb, 0x662ba95c, 0x662ba95c, 0x662ba95c, 0x9842a549, 0x9842a549, 0x9842a549, 0x1c955882, 0xed0a4de1, 0xed0a4de1, 0x1c955882, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xbda49d55, 0xf5b57989, 0xbda49d55, 0x79b60451, 0x4d266f7a, 0x4d266f7a, 0xeb1807b5, 0xeb1807b5, 0xeb1807b5, 0xd6f1c0a, 0xd6f1c0a, 0xd6f1c0a, 0x9556489a, 0x9556489a, 0x9556489a, 0x4d266f7a, 0x79b60451, 0x79b60451, 0x4d266f7a, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x90b1e6bc, 0xabcab9fe, 0x90b1e6bc, 0xc45e75b, 0x1ed9d731, 0x1ed9d731, 0xa6ac3ed0, 0xa6ac3ed0, 0xa6ac3ed0, 0x8c82015, 0x8c82015, 0x8c82015, 0x2ba131a3, 0x2ba131a3, 0x2ba131a3, 0x1ed9d731, 0xc45e75b, 0xc45e75b, 0x1ed9d731, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x3b1768ca, 0xf9e5eedd, 0x3b1768ca, 0x7f1c9276, 0x5387d57f, 0x5387d57f, 0x927c1c5d, 0x927c1c5d, 0x927c1c5d, 0x52257091, 0x52257091, 0x52257091, 0xb5fbf207, 0xb5fbf207, 0xb5fbf207, 0x5387d57f, 0x7f1c9276, 0x7f1c9276, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x54190c0f, 0xb6b42319, 0x54190c0f, 0xee714190, 0xf83ee7aa, 0xf83ee7aa, 0x1cbd869f, 0x1cbd869f, 0x1cbd869f, 0x80c4566c, 0x80c4566c, 0x80c4566c, 0xb877fdc4, 0xb877fdc4, 0xb877fdc4, 0xf83ee7aa, 0xee714190, 0xee714190, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x25774ca3, 0x3d74e13a, 0x25774ca3, 0x3402f9f6, 0x724366e5, 0x724366e5, 0x447ccdbb, 0x447ccdbb, 0x447ccdbb, 0x3458f41, 0x3458f41, 0x3458f41, 0x6e6ba80b, 0x6e6ba80b, 0x6e6ba80b, 0x724366e5, 0x3402f9f6, 0x3402f9f6, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9143e2a6, 0x6e596cd4, 0x9143e2a6, 0x7ed75f9f, 0x5387d57f, 0x5387d57f, 0x86a0aae, 0x86a0aae, 0x86a0aae, 0xd6a44573, 0xd6a44573, 0xd6a44573, 0x4527d76d, 0x4527d76d, 0x4527d76d, 0x5387d57f, 0x7ed75f9f, 0x7ed75f9f, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf943d873, 0xced7704, 0xf943d873, 0x8889e69f, 0xf83ee7aa, 0xf83ee7aa, 0x82576edb, 0x82576edb, 0x82576edb, 0xf08d7deb, 0xf08d7deb, 0xf08d7deb, 0xc1182c2d, 0xc1182c2d, 0xc1182c2d, 0xf83ee7aa, 0x8889e69f, 0x8889e69f, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x63bd59d2, 0xf34f52d5, 0x63bd59d2, 0x916fd2a2, 0x724366e5, 0x724366e5, 0x11262bd6, 0x11262bd6, 0x11262bd6, 0x48b6d886, 0x48b6d886, 0x48b6d886, 0x8001b6c4, 0x8001b6c4, 0x8001b6c4, 0x724366e5, 0x916fd2a2, 0x916fd2a2, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xed6af547, 0x9ff43eec, 0xed6af547, 0xed0a4de1, 0x1c955882, 0x1c955882, 0xa9dce4cb, 0xa9dce4cb, 0xa9dce4cb, 0x662ba95c, 0x662ba95c, 0x662ba95c, 0x9842a549, 0x9842a549, 0x9842a549, 0x1c955882, 0xed0a4de1, 0xed0a4de1, 0x1c955882, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xbda49d55, 0xf5b57989, 0xbda49d55, 0x79b60451, 0x4d266f7a, 0x4d266f7a, 0xeb1807b5, 0xeb1807b5, 0xeb1807b5, 0xd6f1c0a, 0xd6f1c0a, 0xd6f1c0a, 0x9556489a, 0x9556489a, 0x9556489a, 0x4d266f7a, 0x79b60451, 0x79b60451, 0x4d266f7a, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x90b1e6bc, 0xabcab9fe, 0x90b1e6bc, 0xc45e75b, 0x1ed9d731, 0x1ed9d731, 0xa6ac3ed0, 0xa6ac3ed0, 0xa6ac3ed0, 0x8c82015, 0x8c82015, 0x8c82015, 0x2ba131a3, 0x2ba131a3, 0x2ba131a3, 0x1ed9d731, 0xc45e75b, 0xc45e75b, 0x1ed9d731, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xd5ca4355, 0xc8fbf114, 0xd5ca4355, 0x85d2e7fb, 0x9813a416, 0x9813a416, 0x4a1e101b, 0x4a1e101b, 0x4a1e101b, 0xdbc59628, 0xdbc59628, 0xdbc59628, 0x47b063ea, 0x47b063ea, 0x47b063ea, 0x9813a416, 0x85d2e7fb, 0x85d2e7fb, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x722a297e, 0xb34f27df, 0x722a297e, 0x48e0f884, 0x5fcf013d, 0x5fcf013d, 0xee9e0d69, 0xee9e0d69, 0xee9e0d69, 0x3c8e151f, 0x3c8e151f, 0x3c8e151f, 0x23a594e2, 0x23a594e2, 0x23a594e2, 0x5fcf013d, 0x48e0f884, 0x48e0f884, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x87be67c4, 0x484106d9, 0x87be67c4, 0xe7cdc3ae, 0xdd28f52b, 0xdd28f52b, 0x2063d7c8, 0x2063d7c8, 0x2063d7c8, 0x15f2e2c, 0x15f2e2c, 0x15f2e2c, 0x1b2e4dbd, 0x1b2e4dbd, 0x1b2e4dbd, 0xdd28f52b, 0xe7cdc3ae, 0xe7cdc3ae, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x36622078, 0x979da8f3, 0x36622078, 0x7594ed3f, 0x59c36f00, 0x59c36f00, 0xe5e5cf13, 0xe5e5cf13, 0xe5e5cf13, 0x9b65a275, 0x9b65a275, 0x9b65a275, 0x58479fb8, 0x58479fb8, 0x58479fb8, 0x59c36f00, 0x7594ed3f, 0x7594ed3f, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x48ee0ceb, 0xc6eb6d53, 0x48ee0ceb, 0x66eb8994, 0xaa4593fe, 0xaa4593fe, 0x86ac5984, 0x86ac5984, 0x86ac5984, 0x205954e3, 0x205954e3, 0x205954e3, 0xa2feb688, 0xa2feb688, 0xa2feb688, 0xaa4593fe, 0x66eb8994, 0x66eb8994, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xfa53f185, 0xaf8fa3eb, 0xfa53f185, 0xa7449c01, 0xc9cbf769, 0xc9cbf769, 0x50b94b47, 0x50b94b47, 0x50b94b47, 0xae618a8b, 0xae618a8b, 0xae618a8b, 0x46372587, 0x46372587, 0x46372587, 0xc9cbf769, 0xa7449c01, 0xa7449c01, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc6eb6e6e, 0xc5217d5b, 0xc6eb6e6e, 0x96f3cac0, 0x9813a416, 0x9813a416, 0x5752c3fe, 0x5752c3fe, 0x5752c3fe, 0xc68945cd, 0xc68945cd, 0xc68945cd, 0x5afcb00f, 0x5afcb00f, 0x5afcb00f, 0x9813a416, 0x96f3cac0, 0x96f3cac0, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7fd1def2, 0x98a2e53a, 0x7fd1def2, 0x451b0f08, 0x5fcf013d, 0x5fcf013d, 0x9f19ac09, 0x9f19ac09, 0x9f19ac09, 0x4d09b47f, 0x4d09b47f, 0x4d09b47f, 0x52223582, 0x52223582, 0x52223582, 0x5fcf013d, 0x451b0f08, 0x451b0f08, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xaac2ae55, 0x3e7a25f, 0xaac2ae55, 0xcab10a3f, 0xdd28f52b, 0xdd28f52b, 0x5f2b8179, 0x5f2b8179, 0x5f2b8179, 0x7e17789d, 0x7e17789d, 0x7e17789d, 0x64661b0c, 0x64661b0c, 0x64661b0c, 0xdd28f52b, 0xcab10a3f, 0xcab10a3f, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfbdee88, 0x812f047f, 0xfbdee88, 0xf1fbe3e5, 0x43d1f34, 0x43d1f34, 0x6694d5e, 0x6694d5e, 0x6694d5e, 0x7963e4f6, 0x7963e4f6, 0x7963e4f6, 0x9143dddf, 0x9143dddf, 0x9143dddf, 0x43d1f34, 0xf1fbe3e5, 0xf1fbe3e5, 0x43d1f34, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x36622078, 0x979da8f3, 0x36622078, 0x7594ed3f, 0x59c36f00, 0x59c36f00, 0xe5e5cf13, 0xe5e5cf13, 0xe5e5cf13, 0x9b65a275, 0x9b65a275, 0x9b65a275, 0x58479fb8, 0x58479fb8, 0x58479fb8, 0x59c36f00, 0x7594ed3f, 0x7594ed3f, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x48ee0ceb, 0xc6eb6d53, 0x48ee0ceb, 0x66eb8994, 0xaa4593fe, 0xaa4593fe, 0x86ac5984, 0x86ac5984, 0x86ac5984, 0x205954e3, 0x205954e3, 0x205954e3, 0xa2feb688, 0xa2feb688, 0xa2feb688, 0xaa4593fe, 0x66eb8994, 0x66eb8994, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xfa53f185, 0xaf8fa3eb, 0xfa53f185, 0xa7449c01, 0xc9cbf769, 0xc9cbf769, 0x50b94b47, 0x50b94b47, 0x50b94b47, 0xae618a8b, 0xae618a8b, 0xae618a8b, 0x46372587, 0x46372587, 0x46372587, 0xc9cbf769, 0xa7449c01, 0xa7449c01, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd8d870b3, 0x9128b01a, 0xd8d870b3, 0x9cd38a0f, 0x5387d57f, 0x5387d57f, 0x136cad2, 0x136cad2, 0x136cad2, 0xc16fa61e, 0xc16fa61e, 0xc16fa61e, 0x26b12488, 0x26b12488, 0x26b12488, 0x5387d57f, 0x9cd38a0f, 0x9cd38a0f, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xeaeda16f, 0x36d21de0, 0xeaeda16f, 0x5085ecf0, 0xf83ee7aa, 0xf83ee7aa, 0x3eac591b, 0x3eac591b, 0x3eac591b, 0xa2d589e8, 0xa2d589e8, 0xa2d589e8, 0x9a662240, 0x9a662240, 0x9a662240, 0xf83ee7aa, 0x5085ecf0, 0x5085ecf0, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x333a0d08, 0x47d0c238, 0x333a0d08, 0x224fb85d, 0x724366e5, 0x724366e5, 0xf4044671, 0xf4044671, 0xf4044671, 0xb33d048b, 0xb33d048b, 0xb33d048b, 0xde1323c1, 0xde1323c1, 0xde1323c1, 0x724366e5, 0x224fb85d, 0x224fb85d, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a43c1c8, 0xe019a943, 0x4a43c1c8, 0xa5d77cf1, 0x5387d57f, 0x5387d57f, 0x8171a604, 0x8171a604, 0x8171a604, 0x5fbfe9d9, 0x5fbfe9d9, 0x5fbfe9d9, 0xcc3c7bc7, 0xcc3c7bc7, 0xcc3c7bc7, 0x5387d57f, 0xa5d77cf1, 0xa5d77cf1, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb770c3fe, 0x50b21ef7, 0xb770c3fe, 0xc6bafd12, 0xf83ee7aa, 0xf83ee7aa, 0x8df53a5d, 0x8df53a5d, 0x8df53a5d, 0xff2f296d, 0xff2f296d, 0xff2f296d, 0xceba78ab, 0xceba78ab, 0xceba78ab, 0xf83ee7aa, 0xc6bafd12, 0xc6bafd12, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xe8f75cfb, 0x402c0692, 0xe8f75cfb, 0x1a25d78b, 0x724366e5, 0x724366e5, 0xaf01e304, 0xaf01e304, 0xaf01e304, 0xf6911054, 0xf6911054, 0xf6911054, 0x3e267e16, 0x3e267e16, 0x3e267e16, 0x724366e5, 0x1a25d78b, 0x1a25d78b, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x89f843d3, 0xc27ae37d, 0x89f843d3, 0x8998fb75, 0x1c955882, 0x1c955882, 0x698caa77, 0x698caa77, 0x698caa77, 0xa67be7e0, 0xa67be7e0, 0xa67be7e0, 0x5812ebf5, 0x5812ebf5, 0x5812ebf5, 0x1c955882, 0x8998fb75, 0x8998fb75, 0x1c955882, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xa10c24e6, 0x12eeef09, 0xa10c24e6, 0x651ebde2, 0x4d266f7a, 0x4d266f7a, 0x8ed47731, 0x8ed47731, 0x8ed47731, 0x68a36c8e, 0x68a36c8e, 0x68a36c8e, 0xf09a381e, 0xf09a381e, 0xf09a381e, 0x4d266f7a, 0x651ebde2, 0x651ebde2, 0x4d266f7a, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x85a30869, 0xbaa08e30, 0x85a30869, 0x1957098e, 0x1ed9d731, 0x1ed9d731, 0x4ffc007b, 0x4ffc007b, 0x4ffc007b, 0xe1981ebe, 0xe1981ebe, 0xe1981ebe, 0xc2f10f08, 0xc2f10f08, 0xc2f10f08, 0x1ed9d731, 0x1957098e, 0x1957098e, 0x1ed9d731, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd8d870b3, 0x9128b01a, 0xd8d870b3, 0x9cd38a0f, 0x5387d57f, 0x5387d57f, 0x136cad2, 0x136cad2, 0x136cad2, 0xc16fa61e, 0xc16fa61e, 0xc16fa61e, 0x26b12488, 0x26b12488, 0x26b12488, 0x5387d57f, 0x9cd38a0f, 0x9cd38a0f, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xeaeda16f, 0x36d21de0, 0xeaeda16f, 0x5085ecf0, 0xf83ee7aa, 0xf83ee7aa, 0x3eac591b, 0x3eac591b, 0x3eac591b, 0xa2d589e8, 0xa2d589e8, 0xa2d589e8, 0x9a662240, 0x9a662240, 0x9a662240, 0xf83ee7aa, 0x5085ecf0, 0x5085ecf0, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x333a0d08, 0x47d0c238, 0x333a0d08, 0x224fb85d, 0x724366e5, 0x724366e5, 0xf4044671, 0xf4044671, 0xf4044671, 0xb33d048b, 0xb33d048b, 0xb33d048b, 0xde1323c1, 0xde1323c1, 0xde1323c1, 0x724366e5, 0x224fb85d, 0x224fb85d, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a43c1c8, 0xe019a943, 0x4a43c1c8, 0xa5d77cf1, 0x5387d57f, 0x5387d57f, 0x8171a604, 0x8171a604, 0x8171a604, 0x5fbfe9d9, 0x5fbfe9d9, 0x5fbfe9d9, 0xcc3c7bc7, 0xcc3c7bc7, 0xcc3c7bc7, 0x5387d57f, 0xa5d77cf1, 0xa5d77cf1, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb770c3fe, 0x50b21ef7, 0xb770c3fe, 0xc6bafd12, 0xf83ee7aa, 0xf83ee7aa, 0x8df53a5d, 0x8df53a5d, 0x8df53a5d, 0xff2f296d, 0xff2f296d, 0xff2f296d, 0xceba78ab, 0xceba78ab, 0xceba78ab, 0xf83ee7aa, 0xc6bafd12, 0xc6bafd12, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xe8f75cfb, 0x402c0692, 0xe8f75cfb, 0x1a25d78b, 0x724366e5, 0x724366e5, 0xaf01e304, 0xaf01e304, 0xaf01e304, 0xf6911054, 0xf6911054, 0xf6911054, 0x3e267e16, 0x3e267e16, 0x3e267e16, 0x724366e5, 0x1a25d78b, 0x1a25d78b, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x89f843d3, 0xc27ae37d, 0x89f843d3, 0x8998fb75, 0x1c955882, 0x1c955882, 0x698caa77, 0x698caa77, 0x698caa77, 0xa67be7e0, 0xa67be7e0, 0xa67be7e0, 0x5812ebf5, 0x5812ebf5, 0x5812ebf5, 0x1c955882, 0x8998fb75, 0x8998fb75, 0x1c955882, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xa10c24e6, 0x12eeef09, 0xa10c24e6, 0x651ebde2, 0x4d266f7a, 0x4d266f7a, 0x8ed47731, 0x8ed47731, 0x8ed47731, 0x68a36c8e, 0x68a36c8e, 0x68a36c8e, 0xf09a381e, 0xf09a381e, 0xf09a381e, 0x4d266f7a, 0x651ebde2, 0x651ebde2, 0x4d266f7a, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x85a30869, 0xbaa08e30, 0x85a30869, 0x1957098e, 0x1ed9d731, 0x1ed9d731, 0x4ffc007b, 0x4ffc007b, 0x4ffc007b, 0xe1981ebe, 0xe1981ebe, 0xe1981ebe, 0xc2f10f08, 0xc2f10f08, 0xc2f10f08, 0x1ed9d731, 0x1957098e, 0x1957098e, 0x1ed9d731, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xc6eb6e6e, 0xc5217d5b, 0xc6eb6e6e, 0x96f3cac0, 0x9813a416, 0x9813a416, 0x5752c3fe, 0x5752c3fe, 0x5752c3fe, 0xc68945cd, 0xc68945cd, 0xc68945cd, 0x5afcb00f, 0x5afcb00f, 0x5afcb00f, 0x9813a416, 0x96f3cac0, 0x96f3cac0, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7fd1def2, 0x98a2e53a, 0x7fd1def2, 0x451b0f08, 0x5fcf013d, 0x5fcf013d, 0x9f19ac09, 0x9f19ac09, 0x9f19ac09, 0x4d09b47f, 0x4d09b47f, 0x4d09b47f, 0x52223582, 0x52223582, 0x52223582, 0x5fcf013d, 0x451b0f08, 0x451b0f08, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xaac2ae55, 0x3e7a25f, 0xaac2ae55, 0xcab10a3f, 0xdd28f52b, 0xdd28f52b, 0x5f2b8179, 0x5f2b8179, 0x5f2b8179, 0x7e17789d, 0x7e17789d, 0x7e17789d, 0x64661b0c, 0x64661b0c, 0x64661b0c, 0xdd28f52b, 0xcab10a3f, 0xcab10a3f, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x99e53699, 0x9b30b9b8, 0x99e53699, 0xda13fbde, 0x59c36f00, 0x59c36f00, 0xc6c80006, 0xc6c80006, 0xc6c80006, 0xb8486d60, 0xb8486d60, 0xb8486d60, 0x7b6a50ad, 0x7b6a50ad, 0x7b6a50ad, 0x59c36f00, 0xda13fbde, 0xda13fbde, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x5596d8c4, 0xe6c08467, 0x5596d8c4, 0x7b935dbb, 0xaa4593fe, 0xaa4593fe, 0xb2094db6, 0xb2094db6, 0xb2094db6, 0x14fc40d1, 0x14fc40d1, 0x14fc40d1, 0x965ba2ba, 0x965ba2ba, 0x965ba2ba, 0xaa4593fe, 0x7b935dbb, 0x7b935dbb, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8b963803, 0x3a329278, 0x8b963803, 0xd6815587, 0xc9cbf769, 0xc9cbf769, 0x85733bd7, 0x85733bd7, 0x85733bd7, 0x7babfa1b, 0x7babfa1b, 0x7babfa1b, 0x93fd5517, 0x93fd5517, 0x93fd5517, 0xc9cbf769, 0xd6815587, 0xd6815587, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x27813091, 0xd32064ba, 0x27813091, 0x7799943f, 0x9813a416, 0x9813a416, 0x5cfa5159, 0x5cfa5159, 0x5cfa5159, 0xcd21d76a, 0xcd21d76a, 0xcd21d76a, 0x515422a8, 0x515422a8, 0x515422a8, 0x9813a416, 0x7799943f, 0x7799943f, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf107273d, 0xd1d8f23b, 0xf107273d, 0xcbcdf6c7, 0x5fcf013d, 0x5fcf013d, 0x164d5584, 0x164d5584, 0x164d5584, 0xc45d4df2, 0xc45d4df2, 0xc45d4df2, 0xdb76cc0f, 0xdb76cc0f, 0xdb76cc0f, 0x5fcf013d, 0xcbcdf6c7, 0xcbcdf6c7, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa54fb200, 0x92d6596f, 0xa54fb200, 0xc53c166a, 0xdd28f52b, 0xdd28f52b, 0x97b266c9, 0x97b266c9, 0x97b266c9, 0xb68e9f2d, 0xb68e9f2d, 0xb68e9f2d, 0xacfffcbc, 0xacfffcbc, 0xacfffcbc, 0xdd28f52b, 0xc53c166a, 0xc53c166a, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x6d1ede55, 0x4bb31527, 0x6d1ede55, 0x9358d338, 0x43d1f34, 0x43d1f34, 0xa3f91b32, 0xa3f91b32, 0xa3f91b32, 0xdcf3b29a, 0xdcf3b29a, 0xdcf3b29a, 0x34d38bb3, 0x34d38bb3, 0x34d38bb3, 0x43d1f34, 0x9358d338, 0x9358d338, 0x43d1f34, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x99e53699, 0x9b30b9b8, 0x99e53699, 0xda13fbde, 0x59c36f00, 0x59c36f00, 0xc6c80006, 0xc6c80006, 0xc6c80006, 0xb8486d60, 0xb8486d60, 0xb8486d60, 0x7b6a50ad, 0x7b6a50ad, 0x7b6a50ad, 0x59c36f00, 0xda13fbde, 0xda13fbde, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x5596d8c4, 0xe6c08467, 0x5596d8c4, 0x7b935dbb, 0xaa4593fe, 0xaa4593fe, 0xb2094db6, 0xb2094db6, 0xb2094db6, 0x14fc40d1, 0x14fc40d1, 0x14fc40d1, 0x965ba2ba, 0x965ba2ba, 0x965ba2ba, 0xaa4593fe, 0x7b935dbb, 0x7b935dbb, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x8b963803, 0x3a329278, 0x8b963803, 0xd6815587, 0xc9cbf769, 0xc9cbf769, 0x85733bd7, 0x85733bd7, 0x85733bd7, 0x7babfa1b, 0x7babfa1b, 0x7babfa1b, 0x93fd5517, 0x93fd5517, 0x93fd5517, 0xc9cbf769, 0xd6815587, 0xd6815587, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeada5358, 0xa5081c9c, 0xeada5358, 0xaed1a9e4, 0x5387d57f, 0x5387d57f, 0xe7380617, 0xe7380617, 0xe7380617, 0x27616adb, 0x27616adb, 0x27616adb, 0xc0bfe84d, 0xc0bfe84d, 0xc0bfe84d, 0x5387d57f, 0xaed1a9e4, 0xaed1a9e4, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x167e9ac0, 0xc5a57b5f, 0x167e9ac0, 0xac16d75f, 0xf83ee7aa, 0xf83ee7aa, 0xb47ab0cb, 0xb47ab0cb, 0xb47ab0cb, 0x28036038, 0x28036038, 0x28036038, 0x10b0cb90, 0x10b0cb90, 0x10b0cb90, 0xf83ee7aa, 0xac16d75f, 0xac16d75f, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xfd0449a3, 0xb946b16a, 0xfd0449a3, 0xec71fcf6, 0x724366e5, 0x724366e5, 0xab4d15ce, 0xab4d15ce, 0xab4d15ce, 0xec745734, 0xec745734, 0xec745734, 0x815a707e, 0x815a707e, 0x815a707e, 0x724366e5, 0xec71fcf6, 0xec71fcf6, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1eb746a, 0x74afe43, 0x1eb746a, 0xee7fc953, 0x5387d57f, 0x5387d57f, 0x704981d6, 0x704981d6, 0x704981d6, 0xae87ce0b, 0xae87ce0b, 0xae87ce0b, 0x3d045c15, 0x3d045c15, 0x3d045c15, 0x5387d57f, 0xee7fc953, 0xee7fc953, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb9fa44c, 0xff4e04c7, 0xb9fa44c, 0x7a559aa0, 0xf83ee7aa, 0xf83ee7aa, 0xfccbce43, 0xfccbce43, 0xfccbce43, 0x8e11dd73, 0x8e11dd73, 0x8e11dd73, 0xbf848cb5, 0xbf848cb5, 0xbf848cb5, 0xf83ee7aa, 0x7a559aa0, 0x7a559aa0, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xcc83dbb8, 0x7fa3d9db, 0xcc83dbb8, 0x3e5150c8, 0x724366e5, 0x724366e5, 0x3d838d1c, 0x3d838d1c, 0x3d838d1c, 0x64137e4c, 0x64137e4c, 0x64137e4c, 0xaca4100e, 0xaca4100e, 0xaca4100e, 0x724366e5, 0x3e5150c8, 0x3e5150c8, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x2a9a3393, 0xc249bea, 0x2a9a3393, 0x2afa8b35, 0x1c955882, 0x1c955882, 0x9c6441e2, 0x9c6441e2, 0x9c6441e2, 0x53930c75, 0x53930c75, 0x53930c75, 0xadfa0060, 0xadfa0060, 0xadfa0060, 0x1c955882, 0x2afa8b35, 0x2afa8b35, 0x1c955882, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xcf807eaa, 0x4af8ad98, 0xcf807eaa, 0xb92e7ae, 0x4d266f7a, 0x4d266f7a, 0x15d955c1, 0x15d955c1, 0x15d955c1, 0xf3ae4e7e, 0xf3ae4e7e, 0xf3ae4e7e, 0x6b971aee, 0x6b971aee, 0x6b971aee, 0x4d266f7a, 0xb92e7ae, 0xb92e7ae, 0x4d266f7a, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x98e40974, 0xf0ed7ac2, 0x98e40974, 0x4100893, 0x1ed9d731, 0x1ed9d731, 0x7d102c2f, 0x7d102c2f, 0x7d102c2f, 0xd37432ea, 0xd37432ea, 0xd37432ea, 0xf01d235c, 0xf01d235c, 0xf01d235c, 0x1ed9d731, 0x4100893, 0x4100893, 0x1ed9d731, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeada5358, 0xa5081c9c, 0xeada5358, 0xaed1a9e4, 0x5387d57f, 0x5387d57f, 0xe7380617, 0xe7380617, 0xe7380617, 0x27616adb, 0x27616adb, 0x27616adb, 0xc0bfe84d, 0xc0bfe84d, 0xc0bfe84d, 0x5387d57f, 0xaed1a9e4, 0xaed1a9e4, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x167e9ac0, 0xc5a57b5f, 0x167e9ac0, 0xac16d75f, 0xf83ee7aa, 0xf83ee7aa, 0xb47ab0cb, 0xb47ab0cb, 0xb47ab0cb, 0x28036038, 0x28036038, 0x28036038, 0x10b0cb90, 0x10b0cb90, 0x10b0cb90, 0xf83ee7aa, 0xac16d75f, 0xac16d75f, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xfd0449a3, 0xb946b16a, 0xfd0449a3, 0xec71fcf6, 0x724366e5, 0x724366e5, 0xab4d15ce, 0xab4d15ce, 0xab4d15ce, 0xec745734, 0xec745734, 0xec745734, 0x815a707e, 0x815a707e, 0x815a707e, 0x724366e5, 0xec71fcf6, 0xec71fcf6, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1eb746a, 0x74afe43, 0x1eb746a, 0xee7fc953, 0x5387d57f, 0x5387d57f, 0x704981d6, 0x704981d6, 0x704981d6, 0xae87ce0b, 0xae87ce0b, 0xae87ce0b, 0x3d045c15, 0x3d045c15, 0x3d045c15, 0x5387d57f, 0xee7fc953, 0xee7fc953, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb9fa44c, 0xff4e04c7, 0xb9fa44c, 0x7a559aa0, 0xf83ee7aa, 0xf83ee7aa, 0xfccbce43, 0xfccbce43, 0xfccbce43, 0x8e11dd73, 0x8e11dd73, 0x8e11dd73, 0xbf848cb5, 0xbf848cb5, 0xbf848cb5, 0xf83ee7aa, 0x7a559aa0, 0x7a559aa0, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xcc83dbb8, 0x7fa3d9db, 0xcc83dbb8, 0x3e5150c8, 0x724366e5, 0x724366e5, 0x3d838d1c, 0x3d838d1c, 0x3d838d1c, 0x64137e4c, 0x64137e4c, 0x64137e4c, 0xaca4100e, 0xaca4100e, 0xaca4100e, 0x724366e5, 0x3e5150c8, 0x3e5150c8, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x2a9a3393, 0xc249bea, 0x2a9a3393, 0x2afa8b35, 0x1c955882, 0x1c955882, 0x9c6441e2, 0x9c6441e2, 0x9c6441e2, 0x53930c75, 0x53930c75, 0x53930c75, 0xadfa0060, 0xadfa0060, 0xadfa0060, 0x1c955882, 0x2afa8b35, 0x2afa8b35, 0x1c955882, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xcf807eaa, 0x4af8ad98, 0xcf807eaa, 0xb92e7ae, 0x4d266f7a, 0x4d266f7a, 0x15d955c1, 0x15d955c1, 0x15d955c1, 0xf3ae4e7e, 0xf3ae4e7e, 0xf3ae4e7e, 0x6b971aee, 0x6b971aee, 0x6b971aee, 0x4d266f7a, 0xb92e7ae, 0xb92e7ae, 0x4d266f7a, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x98e40974, 0xf0ed7ac2, 0x98e40974, 0x4100893, 0x1ed9d731, 0x1ed9d731, 0x7d102c2f, 0x7d102c2f, 0x7d102c2f, 0xd37432ea, 0xd37432ea, 0xd37432ea, 0xf01d235c, 0xf01d235c, 0xf01d235c, 0x1ed9d731, 0x4100893, 0x4100893, 0x1ed9d731, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x27813091, 0xd32064ba, 0x27813091, 0x7799943f, 0x9813a416, 0x9813a416, 0x5cfa5159, 0x5cfa5159, 0x5cfa5159, 0xcd21d76a, 0xcd21d76a, 0xcd21d76a, 0x515422a8, 0x515422a8, 0x515422a8, 0x9813a416, 0x7799943f, 0x7799943f, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf107273d, 0xd1d8f23b, 0xf107273d, 0xcbcdf6c7, 0x5fcf013d, 0x5fcf013d, 0x164d5584, 0x164d5584, 0x164d5584, 0xc45d4df2, 0xc45d4df2, 0xc45d4df2, 0xdb76cc0f, 0xdb76cc0f, 0xdb76cc0f, 0x5fcf013d, 0xcbcdf6c7, 0xcbcdf6c7, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa54fb200, 0x92d6596f, 0xa54fb200, 0xc53c166a, 0xdd28f52b, 0xdd28f52b, 0x97b266c9, 0x97b266c9, 0x97b266c9, 0xb68e9f2d, 0xb68e9f2d, 0xb68e9f2d, 0xacfffcbc, 0xacfffcbc, 0xacfffcbc, 0xdd28f52b, 0xc53c166a, 0xc53c166a, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xfe511789, 0x421405b3, 0xfe511789, 0xbda7dace, 0x59c36f00, 0x59c36f00, 0x2a367884, 0x2a367884, 0x2a367884, 0x54b615e2, 0x54b615e2, 0x54b615e2, 0x9794282f, 0x9794282f, 0x9794282f, 0x59c36f00, 0xbda7dace, 0xbda7dace, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2616eaaf, 0xd0263182, 0x2616eaaf, 0x8136fd0, 0xaa4593fe, 0xaa4593fe, 0x5b85b7a8, 0x5b85b7a8, 0x5b85b7a8, 0xfd70bacf, 0xfd70bacf, 0xfd70bacf, 0x7fd758a4, 0x7fd758a4, 0x7fd758a4, 0xaa4593fe, 0x8136fd0, 0x8136fd0, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9214e205, 0x211e70db, 0x9214e205, 0xcf038f81, 0xc9cbf769, 0xc9cbf769, 0x5a304c, 0x5a304c, 0x5a304c, 0xfe82f180, 0xfe82f180, 0xfe82f180, 0x16d45e8c, 0x16d45e8c, 0x16d45e8c, 0xc9cbf769, 0xcf038f81, 0xcf038f81, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x8bbe1e38, 0xfef8974b, 0x8bbe1e38, 0xdba6ba96, 0x9813a416, 0x9813a416, 0xdf1a19a3, 0xdf1a19a3, 0xdf1a19a3, 0x4ec19f90, 0x4ec19f90, 0x4ec19f90, 0xd2b46a52, 0xd2b46a52, 0xd2b46a52, 0x9813a416, 0xdba6ba96, 0xdba6ba96, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xda045c37, 0xb8ae26e3, 0xda045c37, 0xe0ce8dcd, 0x5fcf013d, 0x5fcf013d, 0xee7a1c7, 0xee7a1c7, 0xee7a1c7, 0xdcf7b9b1, 0xdcf7b9b1, 0xdcf7b9b1, 0xc3dc384c, 0xc3dc384c, 0xc3dc384c, 0x5fcf013d, 0xe0ce8dcd, 0xe0ce8dcd, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2e35339d, 0x798918b, 0x2e35339d, 0x4e4697f7, 0xdd28f52b, 0xdd28f52b, 0x92c68d60, 0x92c68d60, 0x92c68d60, 0xb3fa7484, 0xb3fa7484, 0xb3fa7484, 0xa98b1715, 0xa98b1715, 0xa98b1715, 0xdd28f52b, 0x4e4697f7, 0x4e4697f7, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xb5c5482e, 0xeec9616, 0xb5c5482e, 0x4b834543, 0x43d1f34, 0x43d1f34, 0xd4fadab2, 0xd4fadab2, 0xd4fadab2, 0xabf0731a, 0xabf0731a, 0xabf0731a, 0x43d04a33, 0x43d04a33, 0x43d04a33, 0x43d1f34, 0x4b834543, 0x4b834543, 0x43d1f34, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xfe511789, 0x421405b3, 0xfe511789, 0xbda7dace, 0x59c36f00, 0x59c36f00, 0x2a367884, 0x2a367884, 0x2a367884, 0x54b615e2, 0x54b615e2, 0x54b615e2, 0x9794282f, 0x9794282f, 0x9794282f, 0x59c36f00, 0xbda7dace, 0xbda7dace, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x2616eaaf, 0xd0263182, 0x2616eaaf, 0x8136fd0, 0xaa4593fe, 0xaa4593fe, 0x5b85b7a8, 0x5b85b7a8, 0x5b85b7a8, 0xfd70bacf, 0xfd70bacf, 0xfd70bacf, 0x7fd758a4, 0x7fd758a4, 0x7fd758a4, 0xaa4593fe, 0x8136fd0, 0x8136fd0, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x9214e205, 0x211e70db, 0x9214e205, 0xcf038f81, 0xc9cbf769, 0xc9cbf769, 0x5a304c, 0x5a304c, 0x5a304c, 0xfe82f180, 0xfe82f180, 0xfe82f180, 0x16d45e8c, 0x16d45e8c, 0x16d45e8c, 0xc9cbf769, 0xcf038f81, 0xcf038f81, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xa841a245, 0x7c4a37aa, 0xa841a245, 0xec4a58f9, 0x5387d57f, 0x5387d57f, 0x8670fc38, 0x8670fc38, 0x8670fc38, 0x462990f4, 0x462990f4, 0x462990f4, 0xa1f71262, 0xa1f71262, 0xa1f71262, 0x5387d57f, 0xec4a58f9, 0xec4a58f9, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc589c63a, 0xda1b2d71, 0xc589c63a, 0x7fe18ba5, 0xf83ee7aa, 0xf83ee7aa, 0x74883fe5, 0x74883fe5, 0x74883fe5, 0xe8f1ef16, 0xe8f1ef16, 0xe8f1ef16, 0xd04244be, 0xd04244be, 0xd04244be, 0xf83ee7aa, 0x7fe18ba5, 0x7fe18ba5, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x5df86da, 0x97465d78, 0x5df86da, 0x14aa338f, 0x724366e5, 0x724366e5, 0x60829227, 0x60829227, 0x60829227, 0x27bbd0dd, 0x27bbd0dd, 0x27bbd0dd, 0x4a95f797, 0x4a95f797, 0x4a95f797, 0x724366e5, 0x14aa338f, 0x14aa338f, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xebf6bdc1, 0xaf2c370b, 0xebf6bdc1, 0x46200f8, 0x5387d57f, 0x5387d57f, 0x81cd0740, 0x81cd0740, 0x81cd0740, 0x5f03489d, 0x5f03489d, 0x5f03489d, 0xcc80da83, 0xcc80da83, 0xcc80da83, 0x5387d57f, 0x46200f8, 0x46200f8, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5455b923, 0x93681ea, 0x5455b923, 0x259f87cf, 0xf83ee7aa, 0xf83ee7aa, 0xf5cd3d43, 0xf5cd3d43, 0xf5cd3d43, 0x87172e73, 0x87172e73, 0x87172e73, 0xb6827fb5, 0xb6827fb5, 0xb6827fb5, 0xf83ee7aa, 0x259f87cf, 0x259f87cf, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xec9a1f85, 0x74e0a22a, 0xec9a1f85, 0x1e4894f5, 0x724366e5, 0x724366e5, 0xa74db0e6, 0xa74db0e6, 0xa74db0e6, 0xfedd43b6, 0xfedd43b6, 0xfedd43b6, 0x366a2df4, 0x366a2df4, 0x366a2df4, 0x724366e5, 0x1e4894f5, 0x1e4894f5, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x8cac1ee1, 0x7824cfba, 0x8cac1ee1, 0x8ccca647, 0x1c955882, 0x1c955882, 0xec40c88e, 0xec40c88e, 0xec40c88e, 0x23b78519, 0x23b78519, 0x23b78519, 0xddde890c, 0xddde890c, 0xddde890c, 0x1c955882, 0x8ccca647, 0x8ccca647, 0x1c955882, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xccb8f998, 0x89af656f, 0xccb8f998, 0x8aa609c, 0x4d266f7a, 0x4d266f7a, 0x863eb372, 0x863eb372, 0x863eb372, 0x6049a8cd, 0x6049a8cd, 0x6049a8cd, 0xf870fc5d, 0xf870fc5d, 0xf870fc5d, 0x4d266f7a, 0x8aa609c, 0x8aa609c, 0x4d266f7a, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xa3bd882a, 0x5adc164, 0xa3bd882a, 0x3f4989cd, 0x1ed9d731, 0x1ed9d731, 0x46a1472c, 0x46a1472c, 0x46a1472c, 0xe8c559e9, 0xe8c559e9, 0xe8c559e9, 0xcbac485f, 0xcbac485f, 0xcbac485f, 0x1ed9d731, 0x3f4989cd, 0x3f4989cd, 0x1ed9d731, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xa841a245, 0x7c4a37aa, 0xa841a245, 0xec4a58f9, 0x5387d57f, 0x5387d57f, 0x8670fc38, 0x8670fc38, 0x8670fc38, 0x462990f4, 0x462990f4, 0x462990f4, 0xa1f71262, 0xa1f71262, 0xa1f71262, 0x5387d57f, 0xec4a58f9, 0xec4a58f9, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc589c63a, 0xda1b2d71, 0xc589c63a, 0x7fe18ba5, 0xf83ee7aa, 0xf83ee7aa, 0x74883fe5, 0x74883fe5, 0x74883fe5, 0xe8f1ef16, 0xe8f1ef16, 0xe8f1ef16, 0xd04244be, 0xd04244be, 0xd04244be, 0xf83ee7aa, 0x7fe18ba5, 0x7fe18ba5, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x5df86da, 0x97465d78, 0x5df86da, 0x14aa338f, 0x724366e5, 0x724366e5, 0x60829227, 0x60829227, 0x60829227, 0x27bbd0dd, 0x27bbd0dd, 0x27bbd0dd, 0x4a95f797, 0x4a95f797, 0x4a95f797, 0x724366e5, 0x14aa338f, 0x14aa338f, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xebf6bdc1, 0xaf2c370b, 0xebf6bdc1, 0x46200f8, 0x5387d57f, 0x5387d57f, 0x81cd0740, 0x81cd0740, 0x81cd0740, 0x5f03489d, 0x5f03489d, 0x5f03489d, 0xcc80da83, 0xcc80da83, 0xcc80da83, 0x5387d57f, 0x46200f8, 0x46200f8, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5455b923, 0x93681ea, 0x5455b923, 0x259f87cf, 0xf83ee7aa, 0xf83ee7aa, 0xf5cd3d43, 0xf5cd3d43, 0xf5cd3d43, 0x87172e73, 0x87172e73, 0x87172e73, 0xb6827fb5, 0xb6827fb5, 0xb6827fb5, 0xf83ee7aa, 0x259f87cf, 0x259f87cf, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xec9a1f85, 0x74e0a22a, 0xec9a1f85, 0x1e4894f5, 0x724366e5, 0x724366e5, 0xa74db0e6, 0xa74db0e6, 0xa74db0e6, 0xfedd43b6, 0xfedd43b6, 0xfedd43b6, 0x366a2df4, 0x366a2df4, 0x366a2df4, 0x724366e5, 0x1e4894f5, 0x1e4894f5, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x8cac1ee1, 0x7824cfba, 0x8cac1ee1, 0x8ccca647, 0x1c955882, 0x1c955882, 0xec40c88e, 0xec40c88e, 0xec40c88e, 0x23b78519, 0x23b78519, 0x23b78519, 0xddde890c, 0xddde890c, 0xddde890c, 0x1c955882, 0x8ccca647, 0x8ccca647, 0x1c955882, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xccb8f998, 0x89af656f, 0xccb8f998, 0x8aa609c, 0x4d266f7a, 0x4d266f7a, 0x863eb372, 0x863eb372, 0x863eb372, 0x6049a8cd, 0x6049a8cd, 0x6049a8cd, 0xf870fc5d, 0xf870fc5d, 0xf870fc5d, 0x4d266f7a, 0x8aa609c, 0x8aa609c, 0x4d266f7a, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xa3bd882a, 0x5adc164, 0xa3bd882a, 0x3f4989cd, 0x1ed9d731, 0x1ed9d731, 0x46a1472c, 0x46a1472c, 0x46a1472c, 0xe8c559e9, 0xe8c559e9, 0xe8c559e9, 0xcbac485f, 0xcbac485f, 0xcbac485f, 0x1ed9d731, 0x3f4989cd, 0x3f4989cd, 0x1ed9d731, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x8bbe1e38, 0xfef8974b, 0x8bbe1e38, 0xdba6ba96, 0x9813a416, 0x9813a416, 0xdf1a19a3, 0xdf1a19a3, 0xdf1a19a3, 0x4ec19f90, 0x4ec19f90, 0x4ec19f90, 0xd2b46a52, 0xd2b46a52, 0xd2b46a52, 0x9813a416, 0xdba6ba96, 0xdba6ba96, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xda045c37, 0xb8ae26e3, 0xda045c37, 0xe0ce8dcd, 0x5fcf013d, 0x5fcf013d, 0xee7a1c7, 0xee7a1c7, 0xee7a1c7, 0xdcf7b9b1, 0xdcf7b9b1, 0xdcf7b9b1, 0xc3dc384c, 0xc3dc384c, 0xc3dc384c, 0x5fcf013d, 0xe0ce8dcd, 0xe0ce8dcd, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2e35339d, 0x798918b, 0x2e35339d, 0x4e4697f7, 0xdd28f52b, 0xdd28f52b, 0x92c68d60, 0x92c68d60, 0x92c68d60, 0xb3fa7484, 0xb3fa7484, 0xb3fa7484, 0xa98b1715, 0xa98b1715, 0xa98b1715, 0xdd28f52b, 0x4e4697f7, 0x4e4697f7, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xef4073b7, 0x7c0ec717, 0xef4073b7, 0xacb6bef0, 0x59c36f00, 0x59c36f00, 0x1b206d14, 0x1b206d14, 0x1b206d14, 0x65a00072, 0x65a00072, 0x65a00072, 0xa6823dbf, 0xa6823dbf, 0xa6823dbf, 0x59c36f00, 0xacb6bef0, 0xacb6bef0, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x439c3f9c, 0xb979a570, 0x439c3f9c, 0x6d99bae3, 0xaa4593fe, 0xaa4593fe, 0x7c7873ca, 0x7c7873ca, 0x7c7873ca, 0xda8d7ead, 0xda8d7ead, 0xda8d7ead, 0x582a9cc6, 0x582a9cc6, 0x582a9cc6, 0xaa4593fe, 0x6d99bae3, 0x6d99bae3, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ba2c945, 0x8734093, 0x5ba2c945, 0x6b5a4c1, 0xc9cbf769, 0xc9cbf769, 0xa3843a5a, 0xa3843a5a, 0xa3843a5a, 0x5d5cfb96, 0x5d5cfb96, 0x5d5cfb96, 0xb50a549a, 0xb50a549a, 0xb50a549a, 0xc9cbf769, 0x6b5a4c1, 0x6b5a4c1, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1d557c7b, 0x8d172abd, 0x1d557c7b, 0x4d4dd8d5, 0x9813a416, 0x9813a416, 0xae45df54, 0xae45df54, 0xae45df54, 0x3f9e5967, 0x3f9e5967, 0x3f9e5967, 0xa3ebaca5, 0xa3ebaca5, 0xa3ebaca5, 0x9813a416, 0x4d4dd8d5, 0x4d4dd8d5, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x75e8bbc6, 0x79f972a, 0x75e8bbc6, 0x4f226a3c, 0x5fcf013d, 0x5fcf013d, 0xe1849dd3, 0xe1849dd3, 0xe1849dd3, 0x339485a5, 0x339485a5, 0x339485a5, 0x2cbf0458, 0x2cbf0458, 0x2cbf0458, 0x5fcf013d, 0x4f226a3c, 0x4f226a3c, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7391ddfb, 0x7d352e1, 0x7391ddfb, 0x13e27991, 0xdd28f52b, 0xdd28f52b, 0x25591550, 0x25591550, 0x25591550, 0x465ecb4, 0x465ecb4, 0x465ecb4, 0x1e148f25, 0x1e148f25, 0x1e148f25, 0xdd28f52b, 0x13e27991, 0x13e27991, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc009461b, 0xbaf1821c, 0xc009461b, 0x3e4f4b76, 0x43d1f34, 0x43d1f34, 0x19165017, 0x19165017, 0x19165017, 0x661cf9bf, 0x661cf9bf, 0x661cf9bf, 0x8e3cc096, 0x8e3cc096, 0x8e3cc096, 0x43d1f34, 0x3e4f4b76, 0x3e4f4b76, 0x43d1f34, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xef4073b7, 0x7c0ec717, 0xef4073b7, 0xacb6bef0, 0x59c36f00, 0x59c36f00, 0x1b206d14, 0x1b206d14, 0x1b206d14, 0x65a00072, 0x65a00072, 0x65a00072, 0xa6823dbf, 0xa6823dbf, 0xa6823dbf, 0x59c36f00, 0xacb6bef0, 0xacb6bef0, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x439c3f9c, 0xb979a570, 0x439c3f9c, 0x6d99bae3, 0xaa4593fe, 0xaa4593fe, 0x7c7873ca, 0x7c7873ca, 0x7c7873ca, 0xda8d7ead, 0xda8d7ead, 0xda8d7ead, 0x582a9cc6, 0x582a9cc6, 0x582a9cc6, 0xaa4593fe, 0x6d99bae3, 0x6d99bae3, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ba2c945, 0x8734093, 0x5ba2c945, 0x6b5a4c1, 0xc9cbf769, 0xc9cbf769, 0xa3843a5a, 0xa3843a5a, 0xa3843a5a, 0x5d5cfb96, 0x5d5cfb96, 0x5d5cfb96, 0xb50a549a, 0xb50a549a, 0xb50a549a, 0xc9cbf769, 0x6b5a4c1, 0x6b5a4c1, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xb36b0c97, 0x8089853c, 0xb36b0c97, 0xf760f62b, 0x5387d57f, 0x5387d57f, 0x26a49a0, 0x26a49a0, 0x26a49a0, 0xc233256c, 0xc233256c, 0xc233256c, 0x25eda7fa, 0x25eda7fa, 0x25eda7fa, 0x5387d57f, 0xf760f62b, 0xf760f62b, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x73036285, 0xc9508972, 0x73036285, 0xc96b2f1a, 0xf83ee7aa, 0xf83ee7aa, 0xd1a3be96, 0xd1a3be96, 0xd1a3be96, 0x4dda6e65, 0x4dda6e65, 0x4dda6e65, 0x7569c5cd, 0x7569c5cd, 0x7569c5cd, 0xf83ee7aa, 0xc96b2f1a, 0xc96b2f1a, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x2f903fa3, 0xb074c7d0, 0x2f903fa3, 0x3ee58af6, 0x724366e5, 0x724366e5, 0xd7d194f8, 0xd7d194f8, 0xd7d194f8, 0x90e8d602, 0x90e8d602, 0x90e8d602, 0xfdc6f148, 0xfdc6f148, 0xfdc6f148, 0x724366e5, 0x3ee58af6, 0x3ee58af6, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa54ffd19, 0xf7cc7ac2, 0xa54ffd19, 0x4adb4020, 0x5387d57f, 0x5387d57f, 0x5dbc1d5, 0x5dbc1d5, 0x5dbc1d5, 0xdb158e08, 0xdb158e08, 0xdb158e08, 0x48961c16, 0x48961c16, 0x48961c16, 0x5387d57f, 0x4adb4020, 0x4adb4020, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc66fad35, 0x8aac8190, 0xc66fad35, 0xb7a593d9, 0xf83ee7aa, 0xf83ee7aa, 0xb36d8105, 0xb36d8105, 0xb36d8105, 0xc1b79235, 0xc1b79235, 0xc1b79235, 0xf022c3f3, 0xf022c3f3, 0xf022c3f3, 0xf83ee7aa, 0xb7a593d9, 0xb7a593d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x7f916214, 0x1c80967c, 0x7f916214, 0x8d43e964, 0x724366e5, 0x724366e5, 0xe456696, 0xe456696, 0xe456696, 0x57d595c6, 0x57d595c6, 0x57d595c6, 0x9f62fb84, 0x9f62fb84, 0x9f62fb84, 0x724366e5, 0x8d43e964, 0x8d43e964, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x4aeca683, 0xffbbb38e, 0x4aeca683, 0x4a8c1e25, 0x1c955882, 0x1c955882, 0xa0d2f3f6, 0xa0d2f3f6, 0xa0d2f3f6, 0x6f25be61, 0x6f25be61, 0x6f25be61, 0x914cb274, 0x914cb274, 0x914cb274, 0x1c955882, 0x4a8c1e25, 0x4a8c1e25, 0x1c955882, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb44532a7, 0x73b09a92, 0xb44532a7, 0x7057aba3, 0x4d266f7a, 0x4d266f7a, 0x83606d88, 0x83606d88, 0x83606d88, 0x65177637, 0x65177637, 0x65177637, 0xfd2e22a7, 0xfd2e22a7, 0xfd2e22a7, 0x4d266f7a, 0x7057aba3, 0x7057aba3, 0x4d266f7a, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x62257381, 0xd5d910, 0x62257381, 0xfed17266, 0x1ed9d731, 0x1ed9d731, 0x12670373, 0x12670373, 0x12670373, 0xbc031db6, 0xbc031db6, 0xbc031db6, 0x9f6a0c00, 0x9f6a0c00, 0x9f6a0c00, 0x1ed9d731, 0xfed17266, 0xfed17266, 0x1ed9d731, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xb36b0c97, 0x8089853c, 0xb36b0c97, 0xf760f62b, 0x5387d57f, 0x5387d57f, 0x26a49a0, 0x26a49a0, 0x26a49a0, 0xc233256c, 0xc233256c, 0xc233256c, 0x25eda7fa, 0x25eda7fa, 0x25eda7fa, 0x5387d57f, 0xf760f62b, 0xf760f62b, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x73036285, 0xc9508972, 0x73036285, 0xc96b2f1a, 0xf83ee7aa, 0xf83ee7aa, 0xd1a3be96, 0xd1a3be96, 0xd1a3be96, 0x4dda6e65, 0x4dda6e65, 0x4dda6e65, 0x7569c5cd, 0x7569c5cd, 0x7569c5cd, 0xf83ee7aa, 0xc96b2f1a, 0xc96b2f1a, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x2f903fa3, 0xb074c7d0, 0x2f903fa3, 0x3ee58af6, 0x724366e5, 0x724366e5, 0xd7d194f8, 0xd7d194f8, 0xd7d194f8, 0x90e8d602, 0x90e8d602, 0x90e8d602, 0xfdc6f148, 0xfdc6f148, 0xfdc6f148, 0x724366e5, 0x3ee58af6, 0x3ee58af6, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa54ffd19, 0xf7cc7ac2, 0xa54ffd19, 0x4adb4020, 0x5387d57f, 0x5387d57f, 0x5dbc1d5, 0x5dbc1d5, 0x5dbc1d5, 0xdb158e08, 0xdb158e08, 0xdb158e08, 0x48961c16, 0x48961c16, 0x48961c16, 0x5387d57f, 0x4adb4020, 0x4adb4020, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc66fad35, 0x8aac8190, 0xc66fad35, 0xb7a593d9, 0xf83ee7aa, 0xf83ee7aa, 0xb36d8105, 0xb36d8105, 0xb36d8105, 0xc1b79235, 0xc1b79235, 0xc1b79235, 0xf022c3f3, 0xf022c3f3, 0xf022c3f3, 0xf83ee7aa, 0xb7a593d9, 0xb7a593d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x7f916214, 0x1c80967c, 0x7f916214, 0x8d43e964, 0x724366e5, 0x724366e5, 0xe456696, 0xe456696, 0xe456696, 0x57d595c6, 0x57d595c6, 0x57d595c6, 0x9f62fb84, 0x9f62fb84, 0x9f62fb84, 0x724366e5, 0x8d43e964, 0x8d43e964, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x4aeca683, 0xffbbb38e, 0x4aeca683, 0x4a8c1e25, 0x1c955882, 0x1c955882, 0xa0d2f3f6, 0xa0d2f3f6, 0xa0d2f3f6, 0x6f25be61, 0x6f25be61, 0x6f25be61, 0x914cb274, 0x914cb274, 0x914cb274, 0x1c955882, 0x4a8c1e25, 0x4a8c1e25, 0x1c955882, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb44532a7, 0x73b09a92, 0xb44532a7, 0x7057aba3, 0x4d266f7a, 0x4d266f7a, 0x83606d88, 0x83606d88, 0x83606d88, 0x65177637, 0x65177637, 0x65177637, 0xfd2e22a7, 0xfd2e22a7, 0xfd2e22a7, 0x4d266f7a, 0x7057aba3, 0x7057aba3, 0x4d266f7a, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x62257381, 0xd5d910, 0x62257381, 0xfed17266, 0x1ed9d731, 0x1ed9d731, 0x12670373, 0x12670373, 0x12670373, 0xbc031db6, 0xbc031db6, 0xbc031db6, 0x9f6a0c00, 0x9f6a0c00, 0x9f6a0c00, 0x1ed9d731, 0xfed17266, 0xfed17266, 0x1ed9d731, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x1d557c7b, 0x8d172abd, 0x1d557c7b, 0x4d4dd8d5, 0x9813a416, 0x9813a416, 0xae45df54, 0xae45df54, 0xae45df54, 0x3f9e5967, 0x3f9e5967, 0x3f9e5967, 0xa3ebaca5, 0xa3ebaca5, 0xa3ebaca5, 0x9813a416, 0x4d4dd8d5, 0x4d4dd8d5, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x75e8bbc6, 0x79f972a, 0x75e8bbc6, 0x4f226a3c, 0x5fcf013d, 0x5fcf013d, 0xe1849dd3, 0xe1849dd3, 0xe1849dd3, 0x339485a5, 0x339485a5, 0x339485a5, 0x2cbf0458, 0x2cbf0458, 0x2cbf0458, 0x5fcf013d, 0x4f226a3c, 0x4f226a3c, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7391ddfb, 0x7d352e1, 0x7391ddfb, 0x13e27991, 0xdd28f52b, 0xdd28f52b, 0x25591550, 0x25591550, 0x25591550, 0x465ecb4, 0x465ecb4, 0x465ecb4, 0x1e148f25, 0x1e148f25, 0x1e148f25, 0xdd28f52b, 0x13e27991, 0x13e27991, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x371337c9, 0x8aa416bc, 0x371337c9, 0x74e5fa8e, 0x59c36f00, 0x59c36f00, 0xb169e11b, 0xb169e11b, 0xb169e11b, 0xcfe98c7d, 0xcfe98c7d, 0xcfe98c7d, 0xccbb1b0, 0xccbb1b0, 0xccbb1b0, 0x59c36f00, 0x74e5fa8e, 0x74e5fa8e, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x38692869, 0xefb9c2f4, 0x38692869, 0x166cad16, 0xaa4593fe, 0xaa4593fe, 0xe4f03f82, 0xe4f03f82, 0xe4f03f82, 0x420532e5, 0x420532e5, 0x420532e5, 0xc0a2d08e, 0xc0a2d08e, 0xc0a2d08e, 0xaa4593fe, 0x166cad16, 0x166cad16, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x7eb7ddfd, 0x19db9bb1, 0x7eb7ddfd, 0x23a0b079, 0xc9cbf769, 0xc9cbf769, 0x4500ac91, 0x4500ac91, 0x4500ac91, 0xbbd86d5d, 0xbbd86d5d, 0xbbd86d5d, 0x538ec251, 0x538ec251, 0x538ec251, 0xc9cbf769, 0x23a0b079, 0x23a0b079, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x35512c6d, 0xe29deaf0, 0x35512c6d, 0x654988c3, 0x9813a416, 0x9813a416, 0xc6920c94, 0xc6920c94, 0xc6920c94, 0x57498aa7, 0x57498aa7, 0x57498aa7, 0xcb3c7f65, 0xcb3c7f65, 0xcb3c7f65, 0x9813a416, 0x654988c3, 0x654988c3, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x73ff9071, 0x72b83f24, 0x73ff9071, 0x4935418b, 0x5fcf013d, 0x5fcf013d, 0x9963ff63, 0x9963ff63, 0x9963ff63, 0x4b73e715, 0x4b73e715, 0x4b73e715, 0x545866e8, 0x545866e8, 0x545866e8, 0x5fcf013d, 0x4935418b, 0x4935418b, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x46811b4e, 0xa463f7aa, 0x46811b4e, 0x26f2bf24, 0xdd28f52b, 0xdd28f52b, 0x452cf740, 0x452cf740, 0x452cf740, 0x64100ea4, 0x64100ea4, 0x64100ea4, 0x7e616d35, 0x7e616d35, 0x7e616d35, 0xdd28f52b, 0x26f2bf24, 0x26f2bf24, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xd89b7256, 0xe60a4e85, 0xd89b7256, 0x26dd7f3b, 0x43d1f34, 0x43d1f34, 0x55b946c0, 0x55b946c0, 0x55b946c0, 0x2ab3ef68, 0x2ab3ef68, 0x2ab3ef68, 0xc293d641, 0xc293d641, 0xc293d641, 0x43d1f34, 0x26dd7f3b, 0x26dd7f3b, 0x43d1f34, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x371337c9, 0x8aa416bc, 0x371337c9, 0x74e5fa8e, 0x59c36f00, 0x59c36f00, 0xb169e11b, 0xb169e11b, 0xb169e11b, 0xcfe98c7d, 0xcfe98c7d, 0xcfe98c7d, 0xccbb1b0, 0xccbb1b0, 0xccbb1b0, 0x59c36f00, 0x74e5fa8e, 0x74e5fa8e, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x38692869, 0xefb9c2f4, 0x38692869, 0x166cad16, 0xaa4593fe, 0xaa4593fe, 0xe4f03f82, 0xe4f03f82, 0xe4f03f82, 0x420532e5, 0x420532e5, 0x420532e5, 0xc0a2d08e, 0xc0a2d08e, 0xc0a2d08e, 0xaa4593fe, 0x166cad16, 0x166cad16, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x7eb7ddfd, 0x19db9bb1, 0x7eb7ddfd, 0x23a0b079, 0xc9cbf769, 0xc9cbf769, 0x4500ac91, 0x4500ac91, 0x4500ac91, 0xbbd86d5d, 0xbbd86d5d, 0xbbd86d5d, 0x538ec251, 0x538ec251, 0x538ec251, 0xc9cbf769, 0x23a0b079, 0x23a0b079, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x60f63dde, 0xcb069f7a, 0x60f63dde, 0x24fdc762, 0x5387d57f, 0x5387d57f, 0xf5998b00, 0xf5998b00, 0xf5998b00, 0x35c0e7cc, 0x35c0e7cc, 0x35c0e7cc, 0xd21e655a, 0xd21e655a, 0xd21e655a, 0x5387d57f, 0x24fdc762, 0x24fdc762, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8fa5f86d, 0xed066d2c, 0x8fa5f86d, 0x35cdb5f2, 0xf83ee7aa, 0xf83ee7aa, 0x26e9dc45, 0x26e9dc45, 0x26e9dc45, 0xba900cb6, 0xba900cb6, 0xba900cb6, 0x8223a71e, 0x8223a71e, 0x8223a71e, 0xf83ee7aa, 0x35cdb5f2, 0x35cdb5f2, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xf3ebce27, 0x64821e83, 0xf3ebce27, 0xe29e7b72, 0x724366e5, 0x724366e5, 0xf2920fc5, 0xf2920fc5, 0xf2920fc5, 0xb5ab4d3f, 0xb5ab4d3f, 0xb5ab4d3f, 0xd8856a75, 0xd8856a75, 0xd8856a75, 0x724366e5, 0xe29e7b72, 0xe29e7b72, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xda2165d2, 0x5f811c6d, 0xda2165d2, 0x35b5d8eb, 0x5387d57f, 0x5387d57f, 0xe5a2fdfd, 0xe5a2fdfd, 0xe5a2fdfd, 0x3b6cb220, 0x3b6cb220, 0x3b6cb220, 0xa8ef203e, 0xa8ef203e, 0xa8ef203e, 0x5387d57f, 0x35b5d8eb, 0x35b5d8eb, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf52ba155, 0x4866b5cd, 0xf52ba155, 0x84e19fb9, 0xf83ee7aa, 0xf83ee7aa, 0xc1a44e99, 0xc1a44e99, 0xc1a44e99, 0xb37e5da9, 0xb37e5da9, 0xb37e5da9, 0x82eb0c6f, 0x82eb0c6f, 0x82eb0c6f, 0xf83ee7aa, 0x84e19fb9, 0x84e19fb9, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x16d37834, 0x72eb8d00, 0x16d37834, 0xe401f344, 0x724366e5, 0x724366e5, 0xc80f0332, 0xc80f0332, 0xc80f0332, 0x919ff062, 0x919ff062, 0x919ff062, 0x59289e20, 0x59289e20, 0x59289e20, 0x724366e5, 0xe401f344, 0xe401f344, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x501ed137, 0x3eb913d3, 0x501ed137, 0x507e6991, 0x1c955882, 0x1c955882, 0xc988465d, 0xc988465d, 0xc988465d, 0x67f0bca, 0x67f0bca, 0x67f0bca, 0xf81607df, 0xf81607df, 0xf81607df, 0x1c955882, 0x507e6991, 0x507e6991, 0x1c955882, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xdbf45ff0, 0x4b12f903, 0xdbf45ff0, 0x1fe6c6f4, 0x4d266f7a, 0x4d266f7a, 0xee77b36d, 0xee77b36d, 0xee77b36d, 0x800a8d2, 0x800a8d2, 0x800a8d2, 0x9039fc42, 0x9039fc42, 0x9039fc42, 0x4d266f7a, 0x1fe6c6f4, 0x1fe6c6f4, 0x4d266f7a, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x6c3a9814, 0xaa19882a, 0x6c3a9814, 0xf0ce99f3, 0x1ed9d731, 0x1ed9d731, 0x5819ad52, 0x5819ad52, 0x5819ad52, 0xf67db397, 0xf67db397, 0xf67db397, 0xd514a221, 0xd514a221, 0xd514a221, 0x1ed9d731, 0xf0ce99f3, 0xf0ce99f3, 0x1ed9d731, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x60f63dde, 0xcb069f7a, 0x60f63dde, 0x24fdc762, 0x5387d57f, 0x5387d57f, 0xf5998b00, 0xf5998b00, 0xf5998b00, 0x35c0e7cc, 0x35c0e7cc, 0x35c0e7cc, 0xd21e655a, 0xd21e655a, 0xd21e655a, 0x5387d57f, 0x24fdc762, 0x24fdc762, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8fa5f86d, 0xed066d2c, 0x8fa5f86d, 0x35cdb5f2, 0xf83ee7aa, 0xf83ee7aa, 0x26e9dc45, 0x26e9dc45, 0x26e9dc45, 0xba900cb6, 0xba900cb6, 0xba900cb6, 0x8223a71e, 0x8223a71e, 0x8223a71e, 0xf83ee7aa, 0x35cdb5f2, 0x35cdb5f2, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xf3ebce27, 0x64821e83, 0xf3ebce27, 0xe29e7b72, 0x724366e5, 0x724366e5, 0xf2920fc5, 0xf2920fc5, 0xf2920fc5, 0xb5ab4d3f, 0xb5ab4d3f, 0xb5ab4d3f, 0xd8856a75, 0xd8856a75, 0xd8856a75, 0x724366e5, 0xe29e7b72, 0xe29e7b72, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xda2165d2, 0x5f811c6d, 0xda2165d2, 0x35b5d8eb, 0x5387d57f, 0x5387d57f, 0xe5a2fdfd, 0xe5a2fdfd, 0xe5a2fdfd, 0x3b6cb220, 0x3b6cb220, 0x3b6cb220, 0xa8ef203e, 0xa8ef203e, 0xa8ef203e, 0x5387d57f, 0x35b5d8eb, 0x35b5d8eb, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf52ba155, 0x4866b5cd, 0xf52ba155, 0x84e19fb9, 0xf83ee7aa, 0xf83ee7aa, 0xc1a44e99, 0xc1a44e99, 0xc1a44e99, 0xb37e5da9, 0xb37e5da9, 0xb37e5da9, 0x82eb0c6f, 0x82eb0c6f, 0x82eb0c6f, 0xf83ee7aa, 0x84e19fb9, 0x84e19fb9, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x16d37834, 0x72eb8d00, 0x16d37834, 0xe401f344, 0x724366e5, 0x724366e5, 0xc80f0332, 0xc80f0332, 0xc80f0332, 0x919ff062, 0x919ff062, 0x919ff062, 0x59289e20, 0x59289e20, 0x59289e20, 0x724366e5, 0xe401f344, 0xe401f344, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x501ed137, 0x3eb913d3, 0x501ed137, 0x507e6991, 0x1c955882, 0x1c955882, 0xc988465d, 0xc988465d, 0xc988465d, 0x67f0bca, 0x67f0bca, 0x67f0bca, 0xf81607df, 0xf81607df, 0xf81607df, 0x1c955882, 0x507e6991, 0x507e6991, 0x1c955882, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xdbf45ff0, 0x4b12f903, 0xdbf45ff0, 0x1fe6c6f4, 0x4d266f7a, 0x4d266f7a, 0xee77b36d, 0xee77b36d, 0xee77b36d, 0x800a8d2, 0x800a8d2, 0x800a8d2, 0x9039fc42, 0x9039fc42, 0x9039fc42, 0x4d266f7a, 0x1fe6c6f4, 0x1fe6c6f4, 0x4d266f7a, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x6c3a9814, 0xaa19882a, 0x6c3a9814, 0xf0ce99f3, 0x1ed9d731, 0x1ed9d731, 0x5819ad52, 0x5819ad52, 0x5819ad52, 0xf67db397, 0xf67db397, 0xf67db397, 0xd514a221, 0xd514a221, 0xd514a221, 0x1ed9d731, 0xf0ce99f3, 0xf0ce99f3, 0x1ed9d731, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x35512c6d, 0xe29deaf0, 0x35512c6d, 0x654988c3, 0x9813a416, 0x9813a416, 0xc6920c94, 0xc6920c94, 0xc6920c94, 0x57498aa7, 0x57498aa7, 0x57498aa7, 0xcb3c7f65, 0xcb3c7f65, 0xcb3c7f65, 0x9813a416, 0x654988c3, 0x654988c3, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x73ff9071, 0x72b83f24, 0x73ff9071, 0x4935418b, 0x5fcf013d, 0x5fcf013d, 0x9963ff63, 0x9963ff63, 0x9963ff63, 0x4b73e715, 0x4b73e715, 0x4b73e715, 0x545866e8, 0x545866e8, 0x545866e8, 0x5fcf013d, 0x4935418b, 0x4935418b, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x46811b4e, 0xa463f7aa, 0x46811b4e, 0x26f2bf24, 0xdd28f52b, 0xdd28f52b, 0x452cf740, 0x452cf740, 0x452cf740, 0x64100ea4, 0x64100ea4, 0x64100ea4, 0x7e616d35, 0x7e616d35, 0x7e616d35, 0xdd28f52b, 0x26f2bf24, 0x26f2bf24, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x791b97c6, 0xd80a4dd5, 0x791b97c6, 0x3aed5a81, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x3aed5a81, 0x3aed5a81, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x6c6b27f2, 0x9ad8591c, 0x6c6b27f2, 0x426ea28d, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0x426ea28d, 0x426ea28d, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb553210b, 0xf9eb9fa4, 0xb553210b, 0xe8444c8f, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0xe8444c8f, 0xe8444c8f, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x979d71de, 0x73e38996, 0x979d71de, 0xc785d570, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0xc785d570, 0xc785d570, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x78d87f9d, 0x345e385f, 0x78d87f9d, 0x4212ae67, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x4212ae67, 0x4212ae67, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x750f8146, 0x2148bdae, 0x750f8146, 0x157c252c, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x157c252c, 0x157c252c, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x58828a1e, 0x11d1547e, 0x58828a1e, 0xa6c48773, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0xa6c48773, 0xa6c48773, 0x43d1f34, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x791b97c6, 0xd80a4dd5, 0x791b97c6, 0x3aed5a81, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x3aed5a81, 0x3aed5a81, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x6c6b27f2, 0x9ad8591c, 0x6c6b27f2, 0x426ea28d, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0x426ea28d, 0x426ea28d, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xb553210b, 0xf9eb9fa4, 0xb553210b, 0xe8444c8f, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0xe8444c8f, 0xe8444c8f, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe0300e88, 0x76ba1dd0, 0xe0300e88, 0xa43bf434, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xa43bf434, 0xa43bf434, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa26081d9, 0xef5b1078, 0xa26081d9, 0x1808cc46, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x1808cc46, 0x1808cc46, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x6f16d50f, 0x2fc71082, 0x6f16d50f, 0x7e63605a, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x7e63605a, 0x7e63605a, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xc959920b, 0x3548d7d5, 0xc959920b, 0x26cd2f32, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x26cd2f32, 0x26cd2f32, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x93c26040, 0x70ae777c, 0x93c26040, 0xe2085eac, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xe2085eac, 0xe2085eac, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x73b37a76, 0x352c8931, 0x73b37a76, 0x8161f106, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0x8161f106, 0x8161f106, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xe12eaf27, 0xe7b5009a, 0xe12eaf27, 0xe14e1781, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0xe14e1781, 0xe14e1781, 0x1c955882, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x5a376c04, 0xd27c4646, 0x5a376c04, 0x9e25f500, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x9e25f500, 0x9e25f500, 0x4d266f7a, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x3f02033b, 0xd99eaa7, 0x3f02033b, 0xa3f602dc, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xa3f602dc, 0xa3f602dc, 0x1ed9d731, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe0300e88, 0x76ba1dd0, 0xe0300e88, 0xa43bf434, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xa43bf434, 0xa43bf434, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa26081d9, 0xef5b1078, 0xa26081d9, 0x1808cc46, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x1808cc46, 0x1808cc46, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x6f16d50f, 0x2fc71082, 0x6f16d50f, 0x7e63605a, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x7e63605a, 0x7e63605a, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xc959920b, 0x3548d7d5, 0xc959920b, 0x26cd2f32, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x26cd2f32, 0x26cd2f32, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x93c26040, 0x70ae777c, 0x93c26040, 0xe2085eac, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xe2085eac, 0xe2085eac, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x73b37a76, 0x352c8931, 0x73b37a76, 0x8161f106, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0x8161f106, 0x8161f106, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xe12eaf27, 0xe7b5009a, 0xe12eaf27, 0xe14e1781, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0xe14e1781, 0xe14e1781, 0x1c955882, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x5a376c04, 0xd27c4646, 0x5a376c04, 0x9e25f500, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x9e25f500, 0x9e25f500, 0x4d266f7a, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x3f02033b, 0xd99eaa7, 0x3f02033b, 0xa3f602dc, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xa3f602dc, 0xa3f602dc, 0x1ed9d731, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x979d71de, 0x73e38996, 0x979d71de, 0xc785d570, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0xc785d570, 0xc785d570, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x78d87f9d, 0x345e385f, 0x78d87f9d, 0x4212ae67, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x4212ae67, 0x4212ae67, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x750f8146, 0x2148bdae, 0x750f8146, 0x157c252c, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x157c252c, 0x157c252c, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xaabbbcdc, 0x5f5dabb0, 0xaabbbcdc, 0xe94d719b, 0x59c36f00, 0x59c36f00, 0x18f47430, 0x18f47430, 0x18f47430, 0x66741956, 0x66741956, 0x66741956, 0xa556249b, 0xa556249b, 0xa556249b, 0x59c36f00, 0xe94d719b, 0xe94d719b, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb6fa31f0, 0xc274fbe9, 0xb6fa31f0, 0x98ffb48f, 0xaa4593fe, 0xaa4593fe, 0x4fb2120a, 0x4fb2120a, 0x4fb2120a, 0xe9471f6d, 0xe9471f6d, 0xe9471f6d, 0x6be0fd06, 0x6be0fd06, 0x6be0fd06, 0xaa4593fe, 0x98ffb48f, 0x98ffb48f, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9c83aa67, 0x67876bdc, 0x9c83aa67, 0xc194c7e3, 0xc9cbf769, 0xc9cbf769, 0xd6fd9f4a, 0xd6fd9f4a, 0xd6fd9f4a, 0x28255e86, 0x28255e86, 0x28255e86, 0xc073f18a, 0xc073f18a, 0xc073f18a, 0xc9cbf769, 0xc194c7e3, 0xc194c7e3, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4878468, 0x58d7f660, 0x4878468, 0x549f20c6, 0x9813a416, 0x9813a416, 0x7c4d228e, 0x7c4d228e, 0x7c4d228e, 0xed96a4bd, 0xed96a4bd, 0xed96a4bd, 0x71e3517f, 0x71e3517f, 0x71e3517f, 0x9813a416, 0x549f20c6, 0x549f20c6, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc24f3617, 0xe92e5f60, 0xc24f3617, 0xf885e7ed, 0x5fcf013d, 0x5fcf013d, 0x9a58adbf, 0x9a58adbf, 0x9a58adbf, 0x4848b5c9, 0x4848b5c9, 0x4848b5c9, 0x57633434, 0x57633434, 0x57633434, 0x5fcf013d, 0xf885e7ed, 0xf885e7ed, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe0056f23, 0xe723a6de, 0xe0056f23, 0x8076cb49, 0xdd28f52b, 0xdd28f52b, 0x7cf3620d, 0x7cf3620d, 0x7cf3620d, 0x5dcf9be9, 0x5dcf9be9, 0x5dcf9be9, 0x47bef878, 0x47bef878, 0x47bef878, 0xdd28f52b, 0x8076cb49, 0x8076cb49, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x74a1734e, 0x3152f141, 0x74a1734e, 0x8ae77e23, 0x43d1f34, 0x43d1f34, 0x83c19830, 0x83c19830, 0x83c19830, 0xfccb3198, 0xfccb3198, 0xfccb3198, 0x14eb08b1, 0x14eb08b1, 0x14eb08b1, 0x43d1f34, 0x8ae77e23, 0x8ae77e23, 0x43d1f34, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xaabbbcdc, 0x5f5dabb0, 0xaabbbcdc, 0xe94d719b, 0x59c36f00, 0x59c36f00, 0x18f47430, 0x18f47430, 0x18f47430, 0x66741956, 0x66741956, 0x66741956, 0xa556249b, 0xa556249b, 0xa556249b, 0x59c36f00, 0xe94d719b, 0xe94d719b, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xb6fa31f0, 0xc274fbe9, 0xb6fa31f0, 0x98ffb48f, 0xaa4593fe, 0xaa4593fe, 0x4fb2120a, 0x4fb2120a, 0x4fb2120a, 0xe9471f6d, 0xe9471f6d, 0xe9471f6d, 0x6be0fd06, 0x6be0fd06, 0x6be0fd06, 0xaa4593fe, 0x98ffb48f, 0x98ffb48f, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x9c83aa67, 0x67876bdc, 0x9c83aa67, 0xc194c7e3, 0xc9cbf769, 0xc9cbf769, 0xd6fd9f4a, 0xd6fd9f4a, 0xd6fd9f4a, 0x28255e86, 0x28255e86, 0x28255e86, 0xc073f18a, 0xc073f18a, 0xc073f18a, 0xc9cbf769, 0xc194c7e3, 0xc194c7e3, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd63f83a3, 0x3dc5a0b4, 0xd63f83a3, 0x9234791f, 0x5387d57f, 0x5387d57f, 0x4cb03e4e, 0x4cb03e4e, 0x4cb03e4e, 0x8ce95282, 0x8ce95282, 0x8ce95282, 0x6b37d014, 0x6b37d014, 0x6b37d014, 0x5387d57f, 0x9234791f, 0x9234791f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x89626ffa, 0xb4d6175c, 0x89626ffa, 0x330a2265, 0xf83ee7aa, 0xf83ee7aa, 0xbbfb89b5, 0xbbfb89b5, 0xbbfb89b5, 0x27825946, 0x27825946, 0x27825946, 0x1f31f2ee, 0x1f31f2ee, 0x1f31f2ee, 0xf83ee7aa, 0x330a2265, 0x330a2265, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x3df87fc2, 0x8c55d02c, 0x3df87fc2, 0x2c8dca97, 0x724366e5, 0x724366e5, 0x3f06ba55, 0x3f06ba55, 0x3f06ba55, 0x783ff8af, 0x783ff8af, 0x783ff8af, 0x1511dfe5, 0x1511dfe5, 0x1511dfe5, 0x724366e5, 0x2c8dca97, 0x2c8dca97, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xe39cde76, 0x443930df, 0xe39cde76, 0xc08634f, 0x5387d57f, 0x5387d57f, 0x44754e5f, 0x44754e5f, 0x44754e5f, 0x9abb0182, 0x9abb0182, 0x9abb0182, 0x938939c, 0x938939c, 0x938939c, 0x5387d57f, 0xc08634f, 0xc08634f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa0b7c23d, 0x8cd3be29, 0xa0b7c23d, 0xd17dfcd1, 0xf83ee7aa, 0xf83ee7aa, 0x5feda75, 0x5feda75, 0x5feda75, 0x7724c945, 0x7724c945, 0x7724c945, 0x46b19883, 0x46b19883, 0x46b19883, 0xf83ee7aa, 0xd17dfcd1, 0xd17dfcd1, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xa994524d, 0xc1900d08, 0xa994524d, 0x5b46d93d, 0x724366e5, 0x724366e5, 0x6d0a4799, 0x6d0a4799, 0x6d0a4799, 0x349ab4c9, 0x349ab4c9, 0x349ab4c9, 0xfc2dda8b, 0xfc2dda8b, 0xfc2dda8b, 0x724366e5, 0x5b46d93d, 0x5b46d93d, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x41755bc6, 0xf207b232, 0x41755bc6, 0x4115e360, 0x1c955882, 0x1c955882, 0x428d20f6, 0x428d20f6, 0x428d20f6, 0x8d7a6d61, 0x8d7a6d61, 0x8d7a6d61, 0x73136174, 0x73136174, 0x73136174, 0x1c955882, 0x4115e360, 0x4115e360, 0x1c955882, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xe47ded44, 0x862f2131, 0xe47ded44, 0x206f7440, 0x4d266f7a, 0x4d266f7a, 0x95d7f079, 0x95d7f079, 0x95d7f079, 0x73a0ebc6, 0x73a0ebc6, 0x73a0ebc6, 0xeb99bf56, 0xeb99bf56, 0xeb99bf56, 0x4d266f7a, 0x206f7440, 0x206f7440, 0x4d266f7a, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x946b2f62, 0x30dad54, 0x946b2f62, 0x89f2e85, 0x1ed9d731, 0x1ed9d731, 0xf20ee132, 0xf20ee132, 0xf20ee132, 0x5c6afff7, 0x5c6afff7, 0x5c6afff7, 0x7f03ee41, 0x7f03ee41, 0x7f03ee41, 0x1ed9d731, 0x89f2e85, 0x89f2e85, 0x1ed9d731, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd63f83a3, 0x3dc5a0b4, 0xd63f83a3, 0x9234791f, 0x5387d57f, 0x5387d57f, 0x4cb03e4e, 0x4cb03e4e, 0x4cb03e4e, 0x8ce95282, 0x8ce95282, 0x8ce95282, 0x6b37d014, 0x6b37d014, 0x6b37d014, 0x5387d57f, 0x9234791f, 0x9234791f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x89626ffa, 0xb4d6175c, 0x89626ffa, 0x330a2265, 0xf83ee7aa, 0xf83ee7aa, 0xbbfb89b5, 0xbbfb89b5, 0xbbfb89b5, 0x27825946, 0x27825946, 0x27825946, 0x1f31f2ee, 0x1f31f2ee, 0x1f31f2ee, 0xf83ee7aa, 0x330a2265, 0x330a2265, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x3df87fc2, 0x8c55d02c, 0x3df87fc2, 0x2c8dca97, 0x724366e5, 0x724366e5, 0x3f06ba55, 0x3f06ba55, 0x3f06ba55, 0x783ff8af, 0x783ff8af, 0x783ff8af, 0x1511dfe5, 0x1511dfe5, 0x1511dfe5, 0x724366e5, 0x2c8dca97, 0x2c8dca97, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xe39cde76, 0x443930df, 0xe39cde76, 0xc08634f, 0x5387d57f, 0x5387d57f, 0x44754e5f, 0x44754e5f, 0x44754e5f, 0x9abb0182, 0x9abb0182, 0x9abb0182, 0x938939c, 0x938939c, 0x938939c, 0x5387d57f, 0xc08634f, 0xc08634f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa0b7c23d, 0x8cd3be29, 0xa0b7c23d, 0xd17dfcd1, 0xf83ee7aa, 0xf83ee7aa, 0x5feda75, 0x5feda75, 0x5feda75, 0x7724c945, 0x7724c945, 0x7724c945, 0x46b19883, 0x46b19883, 0x46b19883, 0xf83ee7aa, 0xd17dfcd1, 0xd17dfcd1, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xa994524d, 0xc1900d08, 0xa994524d, 0x5b46d93d, 0x724366e5, 0x724366e5, 0x6d0a4799, 0x6d0a4799, 0x6d0a4799, 0x349ab4c9, 0x349ab4c9, 0x349ab4c9, 0xfc2dda8b, 0xfc2dda8b, 0xfc2dda8b, 0x724366e5, 0x5b46d93d, 0x5b46d93d, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x41755bc6, 0xf207b232, 0x41755bc6, 0x4115e360, 0x1c955882, 0x1c955882, 0x428d20f6, 0x428d20f6, 0x428d20f6, 0x8d7a6d61, 0x8d7a6d61, 0x8d7a6d61, 0x73136174, 0x73136174, 0x73136174, 0x1c955882, 0x4115e360, 0x4115e360, 0x1c955882, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xe47ded44, 0x862f2131, 0xe47ded44, 0x206f7440, 0x4d266f7a, 0x4d266f7a, 0x95d7f079, 0x95d7f079, 0x95d7f079, 0x73a0ebc6, 0x73a0ebc6, 0x73a0ebc6, 0xeb99bf56, 0xeb99bf56, 0xeb99bf56, 0x4d266f7a, 0x206f7440, 0x206f7440, 0x4d266f7a, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x946b2f62, 0x30dad54, 0x946b2f62, 0x89f2e85, 0x1ed9d731, 0x1ed9d731, 0xf20ee132, 0xf20ee132, 0xf20ee132, 0x5c6afff7, 0x5c6afff7, 0x5c6afff7, 0x7f03ee41, 0x7f03ee41, 0x7f03ee41, 0x1ed9d731, 0x89f2e85, 0x89f2e85, 0x1ed9d731, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x4878468, 0x58d7f660, 0x4878468, 0x549f20c6, 0x9813a416, 0x9813a416, 0x7c4d228e, 0x7c4d228e, 0x7c4d228e, 0xed96a4bd, 0xed96a4bd, 0xed96a4bd, 0x71e3517f, 0x71e3517f, 0x71e3517f, 0x9813a416, 0x549f20c6, 0x549f20c6, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc24f3617, 0xe92e5f60, 0xc24f3617, 0xf885e7ed, 0x5fcf013d, 0x5fcf013d, 0x9a58adbf, 0x9a58adbf, 0x9a58adbf, 0x4848b5c9, 0x4848b5c9, 0x4848b5c9, 0x57633434, 0x57633434, 0x57633434, 0x5fcf013d, 0xf885e7ed, 0xf885e7ed, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe0056f23, 0xe723a6de, 0xe0056f23, 0x8076cb49, 0xdd28f52b, 0xdd28f52b, 0x7cf3620d, 0x7cf3620d, 0x7cf3620d, 0x5dcf9be9, 0x5dcf9be9, 0x5dcf9be9, 0x47bef878, 0x47bef878, 0x47bef878, 0xdd28f52b, 0x8076cb49, 0x8076cb49, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x5ee30ef2, 0xcb34e9e1, 0x5ee30ef2, 0x1d15c3b5, 0x59c36f00, 0x59c36f00, 0x201d9661, 0x201d9661, 0x201d9661, 0x5e9dfb07, 0x5e9dfb07, 0x5e9dfb07, 0x9dbfc6ca, 0x9dbfc6ca, 0x9dbfc6ca, 0x59c36f00, 0x1d15c3b5, 0x1d15c3b5, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8f30caea, 0xabe72645, 0x8f30caea, 0xa1354f95, 0xaa4593fe, 0xaa4593fe, 0xe17bf494, 0xe17bf494, 0xe17bf494, 0x478ef9f3, 0x478ef9f3, 0x478ef9f3, 0xc5291b98, 0xc5291b98, 0xc5291b98, 0xaa4593fe, 0xa1354f95, 0xa1354f95, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x3a734c3, 0x18bd52c, 0x3a734c3, 0x5eb05947, 0xc9cbf769, 0xc9cbf769, 0x128d62c1, 0x128d62c1, 0x128d62c1, 0xec55a30d, 0xec55a30d, 0xec55a30d, 0x4030c01, 0x4030c01, 0x4030c01, 0xc9cbf769, 0x5eb05947, 0x5eb05947, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x34a86f24, 0xfae0384, 0x34a86f24, 0x64b0cb8a, 0x9813a416, 0x9813a416, 0x13b7fe00, 0x13b7fe00, 0x13b7fe00, 0x826c7833, 0x826c7833, 0x826c7833, 0x1e198df1, 0x1e198df1, 0x1e198df1, 0x9813a416, 0x64b0cb8a, 0x64b0cb8a, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7cf1a92b, 0x413f2fa3, 0x7cf1a92b, 0x463b78d1, 0x5fcf013d, 0x5fcf013d, 0x4f98bcd5, 0x4f98bcd5, 0x4f98bcd5, 0x9d88a4a3, 0x9d88a4a3, 0x9d88a4a3, 0x82a3255e, 0x82a3255e, 0x82a3255e, 0x5fcf013d, 0x463b78d1, 0x463b78d1, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7d24f50c, 0x85834892, 0x7d24f50c, 0x1d575166, 0xdd28f52b, 0xdd28f52b, 0x167fd4de, 0x167fd4de, 0x167fd4de, 0x37432d3a, 0x37432d3a, 0x37432d3a, 0x2d324eab, 0x2d324eab, 0x2d324eab, 0xdd28f52b, 0x1d575166, 0x1d575166, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x505523f2, 0x24d00e51, 0x505523f2, 0xae132e9f, 0x43d1f34, 0x43d1f34, 0xcaaadc5e, 0xcaaadc5e, 0xcaaadc5e, 0xb5a075f6, 0xb5a075f6, 0xb5a075f6, 0x5d804cdf, 0x5d804cdf, 0x5d804cdf, 0x43d1f34, 0xae132e9f, 0xae132e9f, 0x43d1f34, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x5ee30ef2, 0xcb34e9e1, 0x5ee30ef2, 0x1d15c3b5, 0x59c36f00, 0x59c36f00, 0x201d9661, 0x201d9661, 0x201d9661, 0x5e9dfb07, 0x5e9dfb07, 0x5e9dfb07, 0x9dbfc6ca, 0x9dbfc6ca, 0x9dbfc6ca, 0x59c36f00, 0x1d15c3b5, 0x1d15c3b5, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x8f30caea, 0xabe72645, 0x8f30caea, 0xa1354f95, 0xaa4593fe, 0xaa4593fe, 0xe17bf494, 0xe17bf494, 0xe17bf494, 0x478ef9f3, 0x478ef9f3, 0x478ef9f3, 0xc5291b98, 0xc5291b98, 0xc5291b98, 0xaa4593fe, 0xa1354f95, 0xa1354f95, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x3a734c3, 0x18bd52c, 0x3a734c3, 0x5eb05947, 0xc9cbf769, 0xc9cbf769, 0x128d62c1, 0x128d62c1, 0x128d62c1, 0xec55a30d, 0xec55a30d, 0xec55a30d, 0x4030c01, 0x4030c01, 0x4030c01, 0xc9cbf769, 0x5eb05947, 0x5eb05947, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeba6cfbb, 0xcfb5c41c, 0xeba6cfbb, 0xafad3507, 0x5387d57f, 0x5387d57f, 0x71f3f018, 0x71f3f018, 0x71f3f018, 0xb1aa9cd4, 0xb1aa9cd4, 0xb1aa9cd4, 0x56741e42, 0x56741e42, 0x56741e42, 0x5387d57f, 0xafad3507, 0xafad3507, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9003ad29, 0xb92d2c38, 0x9003ad29, 0x2a6be0b6, 0xf83ee7aa, 0xf83ee7aa, 0x49d26800, 0x49d26800, 0x49d26800, 0xd5abb8f3, 0xd5abb8f3, 0xd5abb8f3, 0xed18135b, 0xed18135b, 0xed18135b, 0xf83ee7aa, 0x2a6be0b6, 0x2a6be0b6, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x238c7b12, 0x2eefc892, 0x238c7b12, 0x32f9ce47, 0x724366e5, 0x724366e5, 0x3d1942f9, 0x3d1942f9, 0x3d1942f9, 0x7a200003, 0x7a200003, 0x7a200003, 0x170e2749, 0x170e2749, 0x170e2749, 0x724366e5, 0x32f9ce47, 0x32f9ce47, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9e1c123, 0xa92b0ab6, 0x9e1c123, 0xe6757c1a, 0x5387d57f, 0x5387d57f, 0xa443a74a, 0xa443a74a, 0xa443a74a, 0x7a8de897, 0x7a8de897, 0x7a8de897, 0xe90e7a89, 0xe90e7a89, 0xe90e7a89, 0x5387d57f, 0xe6757c1a, 0xe6757c1a, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xabb151dd, 0xfa21aa13, 0xabb151dd, 0xda7b6f31, 0xf83ee7aa, 0xf83ee7aa, 0x9d6ae4fd, 0x9d6ae4fd, 0x9d6ae4fd, 0xefb0f7cd, 0xefb0f7cd, 0xefb0f7cd, 0xde25a60b, 0xde25a60b, 0xde25a60b, 0xf83ee7aa, 0xda7b6f31, 0xda7b6f31, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x6dd9406d, 0xde872977, 0x6dd9406d, 0x9f0bcb1d, 0x724366e5, 0x724366e5, 0x8b3051ad, 0x8b3051ad, 0x8b3051ad, 0xd2a0a2fd, 0xd2a0a2fd, 0xd2a0a2fd, 0x1a17ccbf, 0x1a17ccbf, 0x1a17ccbf, 0x724366e5, 0x9f0bcb1d, 0x9f0bcb1d, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x397d3da2, 0xeb896cf, 0x397d3da2, 0x391d8504, 0x1c955882, 0x1c955882, 0x16aa0778, 0x16aa0778, 0x16aa0778, 0xd95d4aef, 0xd95d4aef, 0xd95d4aef, 0x273446fa, 0x273446fa, 0x273446fa, 0x1c955882, 0x391d8504, 0x391d8504, 0x1c955882, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb4b2e2fa, 0x74314de8, 0xb4b2e2fa, 0x70a07bfe, 0x4d266f7a, 0x4d266f7a, 0xe69c42f4, 0xe69c42f4, 0xe69c42f4, 0xeb594b, 0xeb594b, 0xeb594b, 0x98d20ddb, 0x98d20ddb, 0x98d20ddb, 0x4d266f7a, 0x70a07bfe, 0x70a07bfe, 0x4d266f7a, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xd2db665c, 0xcb12d20c, 0xd2db665c, 0x4e2f67bb, 0x1ed9d731, 0x1ed9d731, 0x1952ab15, 0x1952ab15, 0x1952ab15, 0xb736b5d0, 0xb736b5d0, 0xb736b5d0, 0x945fa466, 0x945fa466, 0x945fa466, 0x1ed9d731, 0x4e2f67bb, 0x4e2f67bb, 0x1ed9d731, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeba6cfbb, 0xcfb5c41c, 0xeba6cfbb, 0xafad3507, 0x5387d57f, 0x5387d57f, 0x71f3f018, 0x71f3f018, 0x71f3f018, 0xb1aa9cd4, 0xb1aa9cd4, 0xb1aa9cd4, 0x56741e42, 0x56741e42, 0x56741e42, 0x5387d57f, 0xafad3507, 0xafad3507, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9003ad29, 0xb92d2c38, 0x9003ad29, 0x2a6be0b6, 0xf83ee7aa, 0xf83ee7aa, 0x49d26800, 0x49d26800, 0x49d26800, 0xd5abb8f3, 0xd5abb8f3, 0xd5abb8f3, 0xed18135b, 0xed18135b, 0xed18135b, 0xf83ee7aa, 0x2a6be0b6, 0x2a6be0b6, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x238c7b12, 0x2eefc892, 0x238c7b12, 0x32f9ce47, 0x724366e5, 0x724366e5, 0x3d1942f9, 0x3d1942f9, 0x3d1942f9, 0x7a200003, 0x7a200003, 0x7a200003, 0x170e2749, 0x170e2749, 0x170e2749, 0x724366e5, 0x32f9ce47, 0x32f9ce47, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9e1c123, 0xa92b0ab6, 0x9e1c123, 0xe6757c1a, 0x5387d57f, 0x5387d57f, 0xa443a74a, 0xa443a74a, 0xa443a74a, 0x7a8de897, 0x7a8de897, 0x7a8de897, 0xe90e7a89, 0xe90e7a89, 0xe90e7a89, 0x5387d57f, 0xe6757c1a, 0xe6757c1a, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xabb151dd, 0xfa21aa13, 0xabb151dd, 0xda7b6f31, 0xf83ee7aa, 0xf83ee7aa, 0x9d6ae4fd, 0x9d6ae4fd, 0x9d6ae4fd, 0xefb0f7cd, 0xefb0f7cd, 0xefb0f7cd, 0xde25a60b, 0xde25a60b, 0xde25a60b, 0xf83ee7aa, 0xda7b6f31, 0xda7b6f31, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x6dd9406d, 0xde872977, 0x6dd9406d, 0x9f0bcb1d, 0x724366e5, 0x724366e5, 0x8b3051ad, 0x8b3051ad, 0x8b3051ad, 0xd2a0a2fd, 0xd2a0a2fd, 0xd2a0a2fd, 0x1a17ccbf, 0x1a17ccbf, 0x1a17ccbf, 0x724366e5, 0x9f0bcb1d, 0x9f0bcb1d, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x397d3da2, 0xeb896cf, 0x397d3da2, 0x391d8504, 0x1c955882, 0x1c955882, 0x16aa0778, 0x16aa0778, 0x16aa0778, 0xd95d4aef, 0xd95d4aef, 0xd95d4aef, 0x273446fa, 0x273446fa, 0x273446fa, 0x1c955882, 0x391d8504, 0x391d8504, 0x1c955882, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb4b2e2fa, 0x74314de8, 0xb4b2e2fa, 0x70a07bfe, 0x4d266f7a, 0x4d266f7a, 0xe69c42f4, 0xe69c42f4, 0xe69c42f4, 0xeb594b, 0xeb594b, 0xeb594b, 0x98d20ddb, 0x98d20ddb, 0x98d20ddb, 0x4d266f7a, 0x70a07bfe, 0x70a07bfe, 0x4d266f7a, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xd2db665c, 0xcb12d20c, 0xd2db665c, 0x4e2f67bb, 0x1ed9d731, 0x1ed9d731, 0x1952ab15, 0x1952ab15, 0x1952ab15, 0xb736b5d0, 0xb736b5d0, 0xb736b5d0, 0x945fa466, 0x945fa466, 0x945fa466, 0x1ed9d731, 0x4e2f67bb, 0x4e2f67bb, 0x1ed9d731, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x34a86f24, 0xfae0384, 0x34a86f24, 0x64b0cb8a, 0x9813a416, 0x9813a416, 0x13b7fe00, 0x13b7fe00, 0x13b7fe00, 0x826c7833, 0x826c7833, 0x826c7833, 0x1e198df1, 0x1e198df1, 0x1e198df1, 0x9813a416, 0x64b0cb8a, 0x64b0cb8a, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7cf1a92b, 0x413f2fa3, 0x7cf1a92b, 0x463b78d1, 0x5fcf013d, 0x5fcf013d, 0x4f98bcd5, 0x4f98bcd5, 0x4f98bcd5, 0x9d88a4a3, 0x9d88a4a3, 0x9d88a4a3, 0x82a3255e, 0x82a3255e, 0x82a3255e, 0x5fcf013d, 0x463b78d1, 0x463b78d1, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7d24f50c, 0x85834892, 0x7d24f50c, 0x1d575166, 0xdd28f52b, 0xdd28f52b, 0x167fd4de, 0x167fd4de, 0x167fd4de, 0x37432d3a, 0x37432d3a, 0x37432d3a, 0x2d324eab, 0x2d324eab, 0x2d324eab, 0xdd28f52b, 0x1d575166, 0x1d575166, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa64abc46, 0x75b6655, 0xa64abc46, 0x8ab5be58, 0x59c36f00, 0x59c36f00, 0xa119c4f4, 0xa119c4f4, 0xa119c4f4, 0xdf99a992, 0xdf99a992, 0xdf99a992, 0x1cbb945f, 0x1cbb945f, 0x1cbb945f, 0x59c36f00, 0x8ab5be58, 0x8ab5be58, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x58be41e7, 0xae0d3f09, 0x58be41e7, 0xda7a6cbf, 0xaa4593fe, 0xaa4593fe, 0x794b67, 0x794b67, 0x794b67, 0xa68c4600, 0xa68c4600, 0xa68c4600, 0x242ba46b, 0x242ba46b, 0x242ba46b, 0xaa4593fe, 0xda7a6cbf, 0xda7a6cbf, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xaaa4d3ad, 0xe61c6d02, 0xaaa4d3ad, 0xff557024, 0xc9cbf769, 0xc9cbf769, 0x780542e8, 0x780542e8, 0x780542e8, 0x86dd8324, 0x86dd8324, 0x86dd8324, 0x6e8b2c28, 0x6e8b2c28, 0x6e8b2c28, 0xc9cbf769, 0xff557024, 0xff557024, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf168f0ba, 0x151608f2, 0xf168f0ba, 0x1f8e266b, 0x9813a416, 0x9813a416, 0x358d1fb0, 0x358d1fb0, 0x358d1fb0, 0xa4569983, 0xa4569983, 0xa4569983, 0x38236c41, 0x38236c41, 0x38236c41, 0x9813a416, 0x1f8e266b, 0x1f8e266b, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x927c4cf9, 0xdefa0b3b, 0x927c4cf9, 0x64636a93, 0x5fcf013d, 0x5fcf013d, 0xae2ee3eb, 0xae2ee3eb, 0xae2ee3eb, 0x7c3efb9d, 0x7c3efb9d, 0x7c3efb9d, 0x63157a60, 0x63157a60, 0x63157a60, 0x5fcf013d, 0x64636a93, 0x64636a93, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2d254926, 0x796275ce, 0x2d254926, 0x17c0c9cb, 0xdd28f52b, 0xdd28f52b, 0x79439443, 0x79439443, 0x79439443, 0x587f6da7, 0x587f6da7, 0x587f6da7, 0x420e0e36, 0x420e0e36, 0x420e0e36, 0xdd28f52b, 0x17c0c9cb, 0x17c0c9cb, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x755377f, 0x4e06e91f, 0x755377f, 0xe42f3a5, 0x43d1f34, 0x43d1f34, 0x3ac2d7b5, 0x3ac2d7b5, 0x3ac2d7b5, 0x45c87e1d, 0x45c87e1d, 0x45c87e1d, 0xade84734, 0xade84734, 0xade84734, 0x43d1f34, 0xe42f3a5, 0xe42f3a5, 0x43d1f34, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xa64abc46, 0x75b6655, 0xa64abc46, 0x8ab5be58, 0x59c36f00, 0x59c36f00, 0xa119c4f4, 0xa119c4f4, 0xa119c4f4, 0xdf99a992, 0xdf99a992, 0xdf99a992, 0x1cbb945f, 0x1cbb945f, 0x1cbb945f, 0x59c36f00, 0x8ab5be58, 0x8ab5be58, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x58be41e7, 0xae0d3f09, 0x58be41e7, 0xda7a6cbf, 0xaa4593fe, 0xaa4593fe, 0x794b67, 0x794b67, 0x794b67, 0xa68c4600, 0xa68c4600, 0xa68c4600, 0x242ba46b, 0x242ba46b, 0x242ba46b, 0xaa4593fe, 0xda7a6cbf, 0xda7a6cbf, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xaaa4d3ad, 0xe61c6d02, 0xaaa4d3ad, 0xff557024, 0xc9cbf769, 0xc9cbf769, 0x780542e8, 0x780542e8, 0x780542e8, 0x86dd8324, 0x86dd8324, 0x86dd8324, 0x6e8b2c28, 0x6e8b2c28, 0x6e8b2c28, 0xc9cbf769, 0xff557024, 0xff557024, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xcffd463e, 0x59775566, 0xcffd463e, 0xb4e87140, 0x5387d57f, 0x5387d57f, 0xc2a27e06, 0xc2a27e06, 0xc2a27e06, 0x2fb12ca, 0x2fb12ca, 0x2fb12ca, 0xe525905c, 0xe525905c, 0xe525905c, 0x5387d57f, 0xb4e87140, 0xb4e87140, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x91d12daf, 0xdceabc0e, 0x91d12daf, 0xf372b81f, 0xf83ee7aa, 0xf83ee7aa, 0x85a69692, 0x85a69692, 0x85a69692, 0x19df4661, 0x19df4661, 0x19df4661, 0x216cedc9, 0x216cedc9, 0x216cedc9, 0xf83ee7aa, 0xf372b81f, 0xf372b81f, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x5f5953b3, 0x1f88963e, 0x5f5953b3, 0x6aeb9112, 0x724366e5, 0x724366e5, 0xc5da2432, 0xc5da2432, 0xc5da2432, 0x82e366c8, 0x82e366c8, 0x82e366c8, 0xefcd4182, 0xefcd4182, 0xefcd4182, 0x724366e5, 0x6aeb9112, 0x6aeb9112, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1227533e, 0xee3616e0, 0x1227533e, 0xc32db32e, 0x5387d57f, 0x5387d57f, 0xa347c834, 0xa347c834, 0xa347c834, 0x7d8987e9, 0x7d8987e9, 0x7d8987e9, 0xee0a15f7, 0xee0a15f7, 0xee0a15f7, 0x5387d57f, 0xc32db32e, 0xc32db32e, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc548a908, 0x2624be34, 0xc548a908, 0x1745599, 0xf83ee7aa, 0xf83ee7aa, 0xaaaf7e14, 0xaaaf7e14, 0xaaaf7e14, 0xd8756d24, 0xd8756d24, 0xd8756d24, 0xe9e03ce2, 0xe9e03ce2, 0xe9e03ce2, 0xf83ee7aa, 0x1745599, 0x1745599, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x30506e44, 0x76cf9d03, 0x30506e44, 0x33485d71, 0x724366e5, 0x724366e5, 0xd12bc953, 0xd12bc953, 0xd12bc953, 0x88bb3a03, 0x88bb3a03, 0x88bb3a03, 0x400c5441, 0x400c5441, 0x400c5441, 0x724366e5, 0x33485d71, 0x33485d71, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xa3238023, 0xa5b82f9e, 0xa3238023, 0x93f8a252, 0x1c955882, 0x1c955882, 0x205b041f, 0x205b041f, 0x205b041f, 0xefac4988, 0xefac4988, 0xefac4988, 0x11c5459d, 0x11c5459d, 0x11c5459d, 0x1c955882, 0x93f8a252, 0x93f8a252, 0x1c955882, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xf651c995, 0x7e1ae3d7, 0xf651c995, 0xdab860af, 0x4d266f7a, 0x4d266f7a, 0x6272be10, 0x6272be10, 0x6272be10, 0x8405a5af, 0x8405a5af, 0x8405a5af, 0x1c3cf13f, 0x1c3cf13f, 0x1c3cf13f, 0x4d266f7a, 0xdab860af, 0xdab860af, 0x4d266f7a, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x2fa6119, 0x30618885, 0x2fa6119, 0xbfbe1b6a, 0x1ed9d731, 0x1ed9d731, 0x11353cf5, 0x11353cf5, 0x11353cf5, 0xbf512230, 0xbf512230, 0xbf512230, 0x9c383386, 0x9c383386, 0x9c383386, 0x1ed9d731, 0xbfbe1b6a, 0xbfbe1b6a, 0x1ed9d731, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x4caf1997, 0xda250acf, 0x4caf1997, 0x2183903f, 0x5387d57f, 0x5387d57f, 0x6be656ff, 0x6be656ff, 0x6be656ff, 0xabbf3a33, 0xabbf3a33, 0xabbf3a33, 0x4c61b8a5, 0x4c61b8a5, 0x4c61b8a5, 0x5387d57f, 0x2183903f, 0x2183903f, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x7b29cc8e, 0x36125d2f, 0x7b29cc8e, 0x1277092, 0xf83ee7aa, 0xf83ee7aa, 0x4830d5b5, 0x4830d5b5, 0x4830d5b5, 0xd4490546, 0xd4490546, 0xd4490546, 0xecfaaeee, 0xecfaaeee, 0xecfaaeee, 0xf83ee7aa, 0x1277092, 0x1277092, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x2e644de2, 0x6eb5886f, 0x2e644de2, 0x3d66c6af, 0x724366e5, 0x724366e5, 0x5d800f18, 0x5d800f18, 0x5d800f18, 0x1ab94de2, 0x1ab94de2, 0x1ab94de2, 0x77976aa8, 0x77976aa8, 0x77976aa8, 0x724366e5, 0x3d66c6af, 0x3d66c6af, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x5f11f8eb, 0xa300bd35, 0x5f11f8eb, 0xe2cba3fa, 0x5387d57f, 0x5387d57f, 0xfa2cee75, 0xfa2cee75, 0xfa2cee75, 0x24e2a1a8, 0x24e2a1a8, 0x24e2a1a8, 0xb76133b6, 0xb76133b6, 0xb76133b6, 0x5387d57f, 0xe2cba3fa, 0xe2cba3fa, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x179340b2, 0xf4ff578e, 0x179340b2, 0xe378eba9, 0xf83ee7aa, 0xf83ee7aa, 0xf787fcc2, 0xf787fcc2, 0xf787fcc2, 0x855deff2, 0x855deff2, 0x855deff2, 0xb4c8be34, 0xb4c8be34, 0xb4c8be34, 0xf83ee7aa, 0xe378eba9, 0xe378eba9, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x5703fa5a, 0x119c091d, 0x5703fa5a, 0xa13f0d1a, 0x724366e5, 0x724366e5, 0xd989a04d, 0xd989a04d, 0xd989a04d, 0x8019531d, 0x8019531d, 0x8019531d, 0x48ae3d5f, 0x48ae3d5f, 0x48ae3d5f, 0x724366e5, 0xa13f0d1a, 0xa13f0d1a, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xf38c2b36, 0xf517848b, 0xf38c2b36, 0xa2621779, 0x1c955882, 0x1c955882, 0x153777fa, 0x153777fa, 0x153777fa, 0xdac03a6d, 0xdac03a6d, 0xdac03a6d, 0x24a93678, 0x24a93678, 0x24a93678, 0x1c955882, 0xa2621779, 0xa2621779, 0x1c955882, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb8253868, 0x306e122a, 0xb8253868, 0x83b58e9b, 0x4d266f7a, 0x4d266f7a, 0x98183444, 0x98183444, 0x98183444, 0x7e6f2ffb, 0x7e6f2ffb, 0x7e6f2ffb, 0xe6567b6b, 0xe6567b6b, 0xe6567b6b, 0x4d266f7a, 0x83b58e9b, 0x83b58e9b, 0x4d266f7a, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x40c62f40, 0x725dc6dc, 0x40c62f40, 0x50dfba34, 0x1ed9d731, 0x1ed9d731, 0x32e89a68, 0x32e89a68, 0x32e89a68, 0x9c8c84ad, 0x9c8c84ad, 0x9c8c84ad, 0xbfe5951b, 0xbfe5951b, 0xbfe5951b, 0x1ed9d731, 0x50dfba34, 0x50dfba34, 0x1ed9d731, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xfaeb56f1, 0x1e95aeb9, 0xfaeb56f1, 0xe4ddf18b, 0x9813a416, 0x9813a416, 0x5da5926f, 0x5da5926f, 0x5da5926f, 0xcc7e145c, 0xcc7e145c, 0xcc7e145c, 0x500be19e, 0x500be19e, 0x500be19e, 0x9813a416, 0xe4ddf18b, 0xe4ddf18b, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa11f0307, 0xed9944c5, 0xa11f0307, 0x93a8828e, 0x5fcf013d, 0x5fcf013d, 0xeabf61dc, 0xeabf61dc, 0xeabf61dc, 0x38af79aa, 0x38af79aa, 0x38af79aa, 0x2784f857, 0x2784f857, 0x2784f857, 0x5fcf013d, 0x93a8828e, 0x93a8828e, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeedd0ec5, 0xba9a322d, 0xeedd0ec5, 0x32205338, 0xdd28f52b, 0xdd28f52b, 0x14854a2b, 0x14854a2b, 0x14854a2b, 0x35b9b3cf, 0x35b9b3cf, 0x35b9b3cf, 0x2fc8d05e, 0x2fc8d05e, 0x2fc8d05e, 0xdd28f52b, 0x32205338, 0x32205338, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe7baf88f, 0x46ab229c, 0xe7baf88f, 0x2422eb85, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x2422eb85, 0x2422eb85, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x86184b5, 0xfed2fa5b, 0x86184b5, 0xf984bb34, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xf984bb34, 0xf984bb34, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x2dda8793, 0x6162393c, 0x2dda8793, 0x2a6bc689, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x2a6bc689, 0x2a6bc689, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf2b1715, 0xeb55ef5d, 0xf2b1715, 0x61e172d4, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x61e172d4, 0x61e172d4, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x2a517b4, 0x4e235076, 0x2a517b4, 0x85b73555, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x85b73555, 0x85b73555, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x53e34b0f, 0x7a477e7, 0x53e34b0f, 0x7b92ba0b, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x7b92ba0b, 0x7b92ba0b, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xcccbb8c0, 0x859866a0, 0xcccbb8c0, 0x2bf5b2f8, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0x2bf5b2f8, 0x2bf5b2f8, 0x43d1f34, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xe7baf88f, 0x46ab229c, 0xe7baf88f, 0x2422eb85, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x2422eb85, 0x2422eb85, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x86184b5, 0xfed2fa5b, 0x86184b5, 0xf984bb34, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xf984bb34, 0xf984bb34, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x2dda8793, 0x6162393c, 0x2dda8793, 0x2a6bc689, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x2a6bc689, 0x2a6bc689, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xc2dae336, 0x5450f06e, 0xc2dae336, 0x2fd25c3, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0x2fd25c3, 0x2fd25c3, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf910eb1d, 0xb42b7abc, 0xf910eb1d, 0x6d5e8f22, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x6d5e8f22, 0x6d5e8f22, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xa038bbb4, 0xe0e97e39, 0xa038bbb4, 0x4211aeac, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x4211aeac, 0x4211aeac, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a2dd1b7, 0xb63c9469, 0x4a2dd1b7, 0xe8aea440, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xe8aea440, 0xe8aea440, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8597e648, 0x66fbf174, 0x8597e648, 0xa99c8f36, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa99c8f36, 0xa99c8f36, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x7c1b6088, 0x3a8493cf, 0x7c1b6088, 0xd5d88a3e, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd5d88a3e, 0xd5d88a3e, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x9f45f149, 0x99de5ef4, 0x9f45f149, 0x84437bc3, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x84437bc3, 0x84437bc3, 0x1c955882, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x60f3276d, 0xe8b80d2f, 0x60f3276d, 0x1d7bae65, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x1d7bae65, 0x1d7bae65, 0x4d266f7a, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x66a98ee6, 0x5432677a, 0x66a98ee6, 0x691b88fb, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0x691b88fb, 0x691b88fb, 0x1ed9d731, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xc26d8183, 0x54e792db, 0xc26d8183, 0x1473f9a0, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0x1473f9a0, 0x1473f9a0, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x3ed65cd5, 0x73edcd74, 0x3ed65cd5, 0xb2351146, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0xb2351146, 0xb2351146, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xc576da57, 0x85a71fda, 0xc576da57, 0x1ef86a3, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x1ef86a3, 0x1ef86a3, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4778be32, 0xbb69fbec, 0x4778be32, 0x892b70c4, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x892b70c4, 0x892b70c4, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9c6c6004, 0x7f007738, 0x9c6c6004, 0x80b05ef0, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0x80b05ef0, 0x80b05ef0, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x84caa3c1, 0xc2555086, 0x84caa3c1, 0xd82d8d02, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd82d8d02, 0xd82d8d02, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xe4dec6e6, 0xe245695b, 0xe4dec6e6, 0x9eed5252, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x9eed5252, 0x9eed5252, 0x1c955882, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x19a935eb, 0x91e21fa9, 0x19a935eb, 0x7358a32a, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x7358a32a, 0x7358a32a, 0x4d266f7a, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xb2b10aa1, 0x802ae33d, 0xb2b10aa1, 0x105ee3bb, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0x105ee3bb, 0x105ee3bb, 0x1ed9d731, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xeedf19a8, 0xaa1e1e0, 0xeedf19a8, 0x70c50dc2, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x70c50dc2, 0x70c50dc2, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa474246a, 0xe8f263a8, 0xa474246a, 0xe7cea168, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0xe7cea168, 0xe7cea168, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x653aabb4, 0x317d975c, 0x653aabb4, 0xab5387a0, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0xab5387a0, 0xab5387a0, 0xdd28f52b, }, 20 }, - { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, }, 5 }, - { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, }, 5 }, - { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x2b154617, 0x692e98df, 0xaf62fb87, 0xed59254f, 0x26164bc6, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x3b0fbc56, 0xd9d57c0e, 0xfb564a17, 0x198c8a4f, 0xbe502625, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0x6e6c9b36, 0x4ae9f137, 0x27664f34, 0x3e32535, 0xfc793332, }, 5 }, - { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x91692eef, 0x89773091, 0xa1551213, 0xb94b0c6d, 0xf1115717, }, 5 }, - { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, }, 5 }, - { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, }, 5 }, - { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x61db45b7, 0x1d867efe, 0x99613325, 0xe53c086c, 0x9543de62, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xa46eb37f, 0xd2a59656, 0x49f8f92d, 0x3f33dc04, 0x7aae512a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xb864a496, 0x6c22313b, 0x1505f93d, 0xc1436c90, 0xe74a6931, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x4af6b480, 0x923db79c, 0xfe8cc449, 0x2647c755, 0x27ee23e3, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x121d5e29, 0xf66c0aed, 0xdf138150, 0x3b62d594, 0x8dec962a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0xae86a12c, 0x4dabbe89, 0x6d30e897, 0x8e1df732, 0x2c0644ab, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x2605d280, 0xc06e3172, 0xef3e6395, 0x9558067, 0xb19ec65b, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x9404ef3b, 0xa4fdf18, 0xad7ef98c, 0x3335c9af, 0xe6f0c255, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xa008b770, 0xb98eb0d8, 0x9304b820, 0x8a82bf88, 0xc610a9d0, }, 5 }, + { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24dc7bce, 0x24dc7bce, 0x338542b, 0x338542b, 0x2016b9d1, 0x2016b9d1, 0xc2619a36, 0xc2619a36, 0x10fce1e, 0x10fce1e, 0x8267298e, 0x8267298e, 0xf44246cf, 0xf44246cf, 0x3ee2860f, 0x3ee2860f, 0x1191f916, 0x1191f916, 0xfa8ce1b5, 0xfa8ce1b5, 0xc1f18b8e, 0xc1f18b8e, 0x43f8c0e8, 0x43f8c0e8, 0xbc0d166a, 0xbc0d166a, 0x7b742e8f, 0x7b742e8f, 0x2c3c7f89, 0x2c3c7f89, 0x80148a7e, 0x80148a7e, 0x21daaadf, 0x21daaadf, 0x15e97fa9, 0x15e97fa9, 0x2428d454, 0x2428d454, 0xb12b0f78, 0xb12b0f78, 0x29648b05, 0x8ce36e6f, 0xd26b03dd, 0xd26b03dd, }, 45 }, + { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd09d4d28, 0xd09d4d28, 0xb41a2f17, 0xb41a2f17, 0x56381354, 0x56381354, 0xf2c5615f, 0xf2c5615f, 0xa41822ae, 0xa41822ae, 0xba2e3e60, 0xba2e3e60, 0x1859aaac, 0x1859aaac, 0x6c354a92, 0x6c354a92, 0x652d3eb, 0x652d3eb, 0xffcf0fd8, 0xffcf0fd8, 0xd3c9187c, 0xd3c9187c, 0xdee59346, 0xdee59346, 0x950f6354, 0x950f6354, 0xa2f7e36a, 0xa2f7e36a, 0x3967359a, 0x3967359a, 0x12738c9a, 0x12738c9a, 0xffb94ca3, 0xffb94ca3, 0xd9384791, 0xd9384791, 0xade1fd25, 0xade1fd25, 0xca109ebe, 0xca109ebe, 0x6e794e, 0x20d769cf, 0x29cc1fdc, 0x29cc1fdc, }, 45 }, + { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6cfe9089, 0x6cfe9089, 0xbe85dea2, 0xbe85dea2, 0x5f57923d, 0x5f57923d, 0xd28ad04b, 0xd28ad04b, 0x9ac91b28, 0x9ac91b28, 0x26977f54, 0x26977f54, 0x56cfda54, 0x56cfda54, 0xae54550f, 0xae54550f, 0x5843182b, 0x5843182b, 0xa1524272, 0xa1524272, 0x86b707db, 0x86b707db, 0x4127540e, 0x4127540e, 0xe89ea08e, 0xe89ea08e, 0x85f4dccc, 0x85f4dccc, 0xf910d16c, 0xf910d16c, 0xd43ff6b8, 0xd43ff6b8, 0xcdec4fd0, 0xcdec4fd0, 0xad650879, 0xad650879, 0x6d8e01c7, 0x6d8e01c7, 0x3ce7c69f, 0x3ce7c69f, 0xed54e2ef, 0x141319e, 0x9003a604, 0x9003a604, }, 45 }, + { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x37f1b28e, 0x37f1b28e, 0x248de37a, 0x248de37a, 0x8b84bbe6, 0x8b84bbe6, 0x62efb943, 0x62efb943, 0x50d082fd, 0x50d082fd, 0x68a0c1, 0x68a0c1, 0xa335f8d0, 0xa335f8d0, 0xf26eaa27, 0xf26eaa27, 0x9f661fa2, 0x9f661fa2, 0x9a9c6bcb, 0x9a9c6bcb, 0xa5427057, 0xa5427057, 0x59aabcc8, 0x59aabcc8, 0xd1563970, 0xd1563970, 0x5f65ea2e, 0x5f65ea2e, 0xce189d5e, 0xce189d5e, 0xa0ac6e61, 0xa0ac6e61, 0xf85ec3, 0xf85ec3, 0xa6a5bea8, 0xa6a5bea8, 0xae55a1ba, 0xae55a1ba, 0x23f4e9e3, 0x23f4e9e3, 0x580abc5c, 0x58b54e7f, 0xafe85bbb, 0xafe85bbb, }, 45 }, + { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6d4812ec, 0x6d4812ec, 0x9d93973a, 0x9d93973a, 0x88cb4e17, 0x88cb4e17, 0x81f14f0a, 0x81f14f0a, 0x7f9f1875, 0x7f9f1875, 0x292f8345, 0x292f8345, 0x524cefe0, 0x524cefe0, 0x5d02251, 0x5d02251, 0x61afaf9e, 0x61afaf9e, 0xc327f8b9, 0xc327f8b9, 0xa1ece03d, 0xa1ece03d, 0xbb98b63c, 0xbb98b63c, 0x61b920db, 0x61b920db, 0xb1571b03, 0xb1571b03, 0xd315b012, 0xd315b012, 0xee77780c, 0xee77780c, 0x9b6ce52e, 0x9b6ce52e, 0x3b18a467, 0x3b18a467, 0x5ab91ffb, 0x5ab91ffb, 0x9255edea, 0x9255edea, 0x9ca85712, 0xa249a7fa, 0x213825f8, 0x213825f8, }, 45 }, + { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10bc4224, 0x10bc4224, 0xb8085994, 0xb8085994, 0x6ab26d0a, 0x6ab26d0a, 0xde71396c, 0xde71396c, 0x425a3956, 0x425a3956, 0xb7d2a7e3, 0xb7d2a7e3, 0x658ab388, 0x658ab388, 0x3fadf9dc, 0x3fadf9dc, 0xb29884ae, 0xb29884ae, 0x3a0830a7, 0x3a0830a7, 0xcf41267a, 0xcf41267a, 0x121c9703, 0x121c9703, 0xd126f87c, 0xd126f87c, 0x3b9d5bf6, 0x3b9d5bf6, 0x2a05cbef, 0x2a05cbef, 0x9ad41c2c, 0x9ad41c2c, 0xebf19db8, 0xebf19db8, 0x79f1b335, 0x79f1b335, 0xad2f9e8d, 0xad2f9e8d, 0x99596c48, 0x99596c48, 0x75b1cae6, 0x3cd081b2, 0x23e8ef2f, 0x23e8ef2f, }, 45 }, + { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8920d2ff, 0x8920d2ff, 0x369cb8d2, 0x369cb8d2, 0x880f23e4, 0x880f23e4, 0xf4a02ce2, 0xf4a02ce2, 0x7933f9a4, 0x7933f9a4, 0x488859f0, 0x488859f0, 0x75855108, 0x75855108, 0xf0463685, 0xf0463685, 0xf3e90b78, 0xf3e90b78, 0xac92b2b6, 0xac92b2b6, 0x63131cc5, 0x63131cc5, 0xfb714a00, 0xfb714a00, 0xc495c9a0, 0xc495c9a0, 0x314b6225, 0x314b6225, 0xc0d56232, 0xc0d56232, 0xa051d312, 0xa051d312, 0x9c0d295c, 0x9c0d295c, 0x3f234b5, 0x3f234b5, 0xa4201189, 0xa4201189, 0x23af1b2f, 0x23af1b2f, 0xc787ef0f, 0x2a3c46f8, 0xf03fe2d9, 0xf03fe2d9, }, 45 }, + { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdff707ef, 0xb938eb6c, 0xdff707ef, 0x9c01caa8, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x9c01caa8, 0x9c01caa8, 0x59c36f00, }, 20 }, + { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x59f141e3, 0xfddbc65b, 0x59f141e3, 0x77f4c49c, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0x77f4c49c, 0x77f4c49c, 0xaa4593fe, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9ac56bc2, 0x2049341a, 0x9ac56bc2, 0xc7d20646, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0xc7d20646, 0xc7d20646, 0xc9cbf769, }, 20 }, + { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd50b603, 0xbef0bf34, 0xd50b603, 0xa306ffdb, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xa306ffdb, 0xa306ffdb, 0x9813a416, }, 20 }, + { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9408bd4d, 0x84fea62c, 0x9408bd4d, 0xe2ae88fe, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xe2ae88fe, 0xe2ae88fe, 0x5fcf013d, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8460b76a, 0xd01813b4, 0x8460b76a, 0x9f656d6d, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0x9f656d6d, 0x9f656d6d, 0xdd28f52b, }, 20 }, + { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x115542af, 0xbac49512, 0x115542af, 0xeeea592f, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xeeea592f, 0xeeea592f, 0x43d1f34, }, 20 }, + { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x60e56714, 0x14275a99, 0x60e56714, 0x35080c92, 0x9a2e0d26, 0x35f491f9, 0x35f491f9, 0x35f491f9, 0x692c6739, 0x692c6739, 0x692c6739, 0x40b4a9ab, 0x40b4a9ab, 0x40b4a9ab, 0x59c36f00, 0x35080c92, 0x35080c92, }, 18 }, + { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x33d94a8c, 0x7b789e53, 0x33d94a8c, 0xe8b9b6bf, 0xa9d58ccd, 0xeee84c5, 0xeee84c5, 0xeee84c5, 0x5bb12ecf, 0x5bb12ecf, 0x5bb12ecf, 0x3282e686, 0x3282e686, 0x3282e686, 0xaa4593fe, 0xe8b9b6bf, 0xe8b9b6bf, }, 18 }, + { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4669404, 0x9afa8e99, 0xe4669404, 0xdd25167e, 0x5411be8b, 0x2cf5262a, 0x2cf5262a, 0x2cf5262a, 0x534b80be, 0x534b80be, 0x534b80be, 0x113fe0c6, 0x113fe0c6, 0x113fe0c6, 0xc9cbf769, 0xdd25167e, 0xdd25167e, }, 18 }, + { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x37ed1568, 0x12f55eef, 0x37ed1568, 0x8aa8ad16, 0x740d78cf, 0x7bd2e3a3, 0x7bd2e3a3, 0x7bd2e3a3, 0x907709df, 0x907709df, 0x907709df, 0x963c092f, 0x963c092f, 0x963c092f, 0x1c3742c9, 0x8aa8ad16, 0x8aa8ad16, }, 18 }, + { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xc5315ac9, 0x7dece9d3, 0xc5315ac9, 0xc84ef08b, 0xbcda144c, 0xd45c93dc, 0xd45c93dc, 0xd45c93dc, 0xbb154fcd, 0xbb154fcd, 0xbb154fcd, 0xb6e3d1ce, 0xb6e3d1ce, 0xb6e3d1ce, 0xcc5a7bed, 0xc84ef08b, 0xc84ef08b, }, 18 }, + { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x40a72ecd, 0x2304571f, 0x40a72ecd, 0xd2de6d81, 0x5d55a141, 0x304db662, 0x304db662, 0x304db662, 0xf6fff27c, 0xf6fff27c, 0xf6fff27c, 0xe29a22c3, 0xe29a22c3, 0xe29a22c3, 0xef4a3312, 0xd2de6d81, 0xd2de6d81, }, 18 }, + { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xe6143ead, 0x19816f75, 0xe6143ead, 0xe2db78c2, 0xa992f629, 0xe0ddd143, 0xe0ddd143, 0xe0ddd143, 0x612e2792, 0x612e2792, 0x612e2792, 0xf78a9efd, 0xf78a9efd, 0xf78a9efd, 0x54e48d80, 0xe2db78c2, 0xe2db78c2, }, 18 }, + { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x3d69d4f7, 0x5b2df52e, 0x3d69d4f7, 0x7e9f19b0, 0x59c36f00, 0x59c36f00, 0xaa418d14, 0xaa418d14, 0xaa418d14, 0xd4c1e072, 0xd4c1e072, 0xd4c1e072, 0xb637f5a0, 0xb637f5a0, 0xb637f5a0, 0x59c36f00, 0x7e9f19b0, 0x7e9f19b0, 0x59c36f00, }, 20 }, + { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xea153935, 0xadda68ff, 0xea153935, 0xc410bc4a, 0xaa4593fe, 0xaa4593fe, 0x63090f39, 0x63090f39, 0x63090f39, 0xc5fc025e, 0xc5fc025e, 0xc5fc025e, 0xe8c4a926, 0xe8c4a926, 0xe8c4a926, 0xaa4593fe, 0xc410bc4a, 0xc410bc4a, 0xaa4593fe, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe677248f, 0x9a146b56, 0xe677248f, 0xbb60490b, 0xc9cbf769, 0xc9cbf769, 0xebd87b6a, 0xebd87b6a, 0xebd87b6a, 0x1500baa6, 0x1500baa6, 0x1500baa6, 0xfc4a05ae, 0xfc4a05ae, 0xfc4a05ae, 0xc9cbf769, 0xbb60490b, 0xbb60490b, 0xc9cbf769, }, 20 }, + { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2fe1d8b3, 0x344dc22f, 0x2fe1d8b3, 0x81b7916b, 0x9813a416, 0x9813a416, 0xb42009b, 0xb42009b, 0xb42009b, 0x9a9986a8, 0x9a9986a8, 0x9a9986a8, 0x8323bb78, 0x8323bb78, 0x8323bb78, 0x9813a416, 0x81b7916b, 0x81b7916b, 0x9813a416, }, 20 }, + { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x2f2ab760, 0x373afa93, 0x2f2ab760, 0x598c82d3, 0x5fcf013d, 0x5fcf013d, 0x8a9a15e2, 0x8a9a15e2, 0x8a9a15e2, 0x588a0d94, 0x588a0d94, 0x588a0d94, 0x4ef9320b, 0x4ef9320b, 0x4ef9320b, 0x5fcf013d, 0x598c82d3, 0x598c82d3, 0x5fcf013d, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xb9de66a8, 0x2b705981, 0xb9de66a8, 0xa2dbbcaf, 0xdd28f52b, 0xdd28f52b, 0x971eb98b, 0x971eb98b, 0x971eb98b, 0xb622406f, 0xb622406f, 0xb622406f, 0xcb9a8be3, 0xcb9a8be3, 0xcb9a8be3, 0xdd28f52b, 0xa2dbbcaf, 0xa2dbbcaf, 0xdd28f52b, }, 20 }, + { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x84029f68, 0x7385ec77, 0x84029f68, 0x7bbd84e8, 0x43d1f34, 0x43d1f34, 0x73cb201f, 0x73cb201f, 0x73cb201f, 0xcc189b7, 0xcc189b7, 0xcc189b7, 0x95908c31, 0x95908c31, 0x95908c31, 0x43d1f34, 0x7bbd84e8, 0x7bbd84e8, 0x43d1f34, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb2446469, 0xca75968f, 0xb2446469, 0xf1b2a92e, 0x59c36f00, 0x59c36f00, 0xc0eac671, 0xc0eac671, 0xc0eac671, 0xbe6aab17, 0xbe6aab17, 0xbe6aab17, 0xdc9cbec5, 0xdc9cbec5, 0xdc9cbec5, 0x59c36f00, 0xf1b2a92e, 0xf1b2a92e, 0x59c36f00, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe219612c, 0x41ad1120, 0xe219612c, 0xcc1ce453, 0xaa4593fe, 0xaa4593fe, 0x1f05167, 0x1f05167, 0x1f05167, 0xa7055c00, 0xa7055c00, 0xa7055c00, 0x8a3df778, 0x8a3df778, 0x8a3df778, 0xaa4593fe, 0xcc1ce453, 0xcc1ce453, 0xaa4593fe, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9f3ca4a3, 0x3df9621e, 0x9f3ca4a3, 0xc22bc927, 0xc9cbf769, 0xc9cbf769, 0x8f0b71ba, 0x8f0b71ba, 0x8f0b71ba, 0x71d3b076, 0x71d3b076, 0x71d3b076, 0x98990f7e, 0x98990f7e, 0x98990f7e, 0xc9cbf769, 0xc22bc927, 0xc22bc927, 0xc9cbf769, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6b1e7755, 0x4532973e, 0x6b1e7755, 0xc5483e8d, 0x9813a416, 0x9813a416, 0xa279dbc8, 0xa279dbc8, 0xa279dbc8, 0x33a25dfb, 0x33a25dfb, 0x33a25dfb, 0x2a18602b, 0x2a18602b, 0x2a18602b, 0x9813a416, 0xc5483e8d, 0xc5483e8d, 0x9813a416, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa3774c63, 0x38dffb0e, 0xa3774c63, 0xd5d179d0, 0x5fcf013d, 0x5fcf013d, 0x28872666, 0x28872666, 0x28872666, 0xfa973e10, 0xfa973e10, 0xfa973e10, 0xece4018f, 0xece4018f, 0xece4018f, 0x5fcf013d, 0xd5d179d0, 0xd5d179d0, 0x5fcf013d, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe9556aa5, 0x77425030, 0xe9556aa5, 0xf250b0a2, 0xdd28f52b, 0xdd28f52b, 0x938cfa6a, 0x938cfa6a, 0x938cfa6a, 0xb2b0038e, 0xb2b0038e, 0xb2b0038e, 0xcf08c802, 0xcf08c802, 0xcf08c802, 0xdd28f52b, 0xf250b0a2, 0xf250b0a2, 0xdd28f52b, }, 20 }, + { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9adc43d0, 0xd8ac5204, 0x9adc43d0, 0x65635850, 0x43d1f34, 0x43d1f34, 0xc182db12, 0xc182db12, 0xc182db12, 0xbe8872ba, 0xbe8872ba, 0xbe8872ba, 0x27d9773c, 0x27d9773c, 0x27d9773c, 0x43d1f34, 0x65635850, 0x65635850, 0x43d1f34, }, 20 }, + { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7fd0187d, 0x7d05975c, 0x7fd0187d, 0x3c26d53a, 0x59c36f00, 0x59c36f00, 0xb4fad8de, 0xb4fad8de, 0xb4fad8de, 0xca7ab5b8, 0xca7ab5b8, 0xca7ab5b8, 0xa88ca06a, 0xa88ca06a, 0xa88ca06a, 0x59c36f00, 0x3c26d53a, 0x3c26d53a, 0x59c36f00, }, 20 }, + { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x54f3fad9, 0xe7a5a67a, 0x54f3fad9, 0x7af67fa6, 0xaa4593fe, 0xaa4593fe, 0xcae58c6a, 0xcae58c6a, 0xcae58c6a, 0x6c10810d, 0x6c10810d, 0x6c10810d, 0x41282a75, 0x41282a75, 0x41282a75, 0xaa4593fe, 0x7af67fa6, 0x7af67fa6, 0xaa4593fe, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x869916b8, 0x373dbcc3, 0x869916b8, 0xdb8e7b3c, 0xc9cbf769, 0xc9cbf769, 0xaa0c75c1, 0xaa0c75c1, 0xaa0c75c1, 0x54d4b40d, 0x54d4b40d, 0x54d4b40d, 0xbd9e0b05, 0xbd9e0b05, 0xbd9e0b05, 0xc9cbf769, 0xdb8e7b3c, 0xdb8e7b3c, 0xc9cbf769, }, 20 }, + { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb2f32f4, 0xff8e66df, 0xb2f32f4, 0xa5797b2c, 0x9813a416, 0x9813a416, 0x9fc65347, 0x9fc65347, 0x9fc65347, 0xe1dd574, 0xe1dd574, 0xe1dd574, 0x17a7e8a4, 0x17a7e8a4, 0x17a7e8a4, 0x9813a416, 0xa5797b2c, 0xa5797b2c, 0x9813a416, }, 20 }, + { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x26280874, 0x6f7dd72, 0x26280874, 0x508e3dc7, 0x5fcf013d, 0x5fcf013d, 0x197943fe, 0x197943fe, 0x197943fe, 0xcb695b88, 0xcb695b88, 0xcb695b88, 0xdd1a6417, 0xdd1a6417, 0xdd1a6417, 0x5fcf013d, 0x508e3dc7, 0x508e3dc7, 0x5fcf013d, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd23ae631, 0xe5a30d5e, 0xd23ae631, 0xc93f3c36, 0xdd28f52b, 0xdd28f52b, 0x7042f8c, 0x7042f8c, 0x7042f8c, 0x2638d668, 0x2638d668, 0x2638d668, 0x5b801de4, 0x5b801de4, 0x5b801de4, 0xdd28f52b, 0xc93f3c36, 0xc93f3c36, 0xdd28f52b, }, 20 }, + { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8d469c0b, 0xabeb5779, 0x8d469c0b, 0x72f9878b, 0x43d1f34, 0x43d1f34, 0xd8397828, 0xd8397828, 0xd8397828, 0xa733d180, 0xa733d180, 0xa733d180, 0x3e62d406, 0x3e62d406, 0x3e62d406, 0x43d1f34, 0x72f9878b, 0x72f9878b, 0x43d1f34, }, 20 }, + { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd668f275, 0x6a2de04f, 0xd668f275, 0x959e3f32, 0x59c36f00, 0x59c36f00, 0xc43520a0, 0xc43520a0, 0xc43520a0, 0xbab54dc6, 0xbab54dc6, 0xbab54dc6, 0xd8435814, 0xd8435814, 0xd8435814, 0x59c36f00, 0x959e3f32, 0x959e3f32, 0x59c36f00, }, 20 }, + { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe170ffb5, 0x17402498, 0xe170ffb5, 0xcf757aca, 0xaa4593fe, 0xaa4593fe, 0x4ec32c62, 0x4ec32c62, 0x4ec32c62, 0xe8362105, 0xe8362105, 0xe8362105, 0xc50e8a7d, 0xc50e8a7d, 0xc50e8a7d, 0xaa4593fe, 0xcf757aca, 0xcf757aca, 0xaa4593fe, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf4aef2d6, 0x47a46008, 0xf4aef2d6, 0xa9b99f52, 0xc9cbf769, 0xc9cbf769, 0x4f1a5666, 0x4f1a5666, 0x4f1a5666, 0xb1c297aa, 0xb1c297aa, 0xb1c297aa, 0x588828a2, 0x588828a2, 0x588828a2, 0xc9cbf769, 0xa9b99f52, 0xa9b99f52, 0xc9cbf769, }, 20 }, + { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc2ed8f74, 0xb7ab0607, 0xc2ed8f74, 0x6cbbc6ac, 0x9813a416, 0x9813a416, 0x535e7ba8, 0x535e7ba8, 0x535e7ba8, 0xc285fd9b, 0xc285fd9b, 0xc285fd9b, 0xdb3fc04b, 0xdb3fc04b, 0xdb3fc04b, 0x9813a416, 0x6cbbc6ac, 0x6cbbc6ac, 0x9813a416, }, 20 }, + { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf62383d8, 0x9489f90c, 0xf62383d8, 0x8085b66b, 0x5fcf013d, 0x5fcf013d, 0xb7f78bc2, 0xb7f78bc2, 0xb7f78bc2, 0x65e793b4, 0x65e793b4, 0x65e793b4, 0x7394ac2b, 0x7394ac2b, 0x7394ac2b, 0x5fcf013d, 0x8085b66b, 0x8085b66b, 0x5fcf013d, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x753d8bc0, 0x5c9029d6, 0x753d8bc0, 0x6e3851c7, 0xdd28f52b, 0xdd28f52b, 0x1a40e22e, 0x1a40e22e, 0x1a40e22e, 0x3b7c1bca, 0x3b7c1bca, 0x3b7c1bca, 0x46c4d046, 0x46c4d046, 0x46c4d046, 0xdd28f52b, 0x6e3851c7, 0x6e3851c7, 0xdd28f52b, }, 20 }, + { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x62a774, 0xbb4b794c, 0x62a774, 0xffddbcf4, 0x43d1f34, 0x43d1f34, 0x83fede87, 0x83fede87, 0x83fede87, 0xfcf4772f, 0xfcf4772f, 0xfcf4772f, 0x65a572a9, 0x65a572a9, 0x65a572a9, 0x43d1f34, 0xffddbcf4, 0xffddbcf4, 0x43d1f34, }, 20 }, + { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x2edc6dc9, 0x166a6552, 0x2edc6dc9, 0x6d2aa08e, 0x59c36f00, 0x59c36f00, 0xd214e1a2, 0xd214e1a2, 0xd214e1a2, 0xac948cc4, 0xac948cc4, 0xac948cc4, 0xce629916, 0xce629916, 0xce629916, 0x59c36f00, 0x6d2aa08e, 0x6d2aa08e, 0x59c36f00, }, 20 }, + { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xc12e1a21, 0x1e6e7468, 0xc12e1a21, 0xef2b9f5e, 0xaa4593fe, 0xaa4593fe, 0x1c792d02, 0x1c792d02, 0x1c792d02, 0xba8c2065, 0xba8c2065, 0xba8c2065, 0x97b48b1d, 0x97b48b1d, 0x97b48b1d, 0xaa4593fe, 0xef2b9f5e, 0xef2b9f5e, 0xaa4593fe, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x510524f7, 0x7f9806b4, 0x510524f7, 0xc124973, 0xc9cbf769, 0xc9cbf769, 0x1a561d55, 0x1a561d55, 0x1a561d55, 0xe48edc99, 0xe48edc99, 0xe48edc99, 0xdc46391, 0xdc46391, 0xdc46391, 0xc9cbf769, 0xc124973, 0xc124973, 0xc9cbf769, }, 20 }, + { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1ee6604, 0xd307a4d9, 0xa1ee6604, 0xfb82fdc, 0x9813a416, 0x9813a416, 0x5b7ed439, 0x5b7ed439, 0x5b7ed439, 0xcaa5520a, 0xcaa5520a, 0xcaa5520a, 0xd31f6fda, 0xd31f6fda, 0xd31f6fda, 0x9813a416, 0xfb82fdc, 0xfb82fdc, 0x9813a416, }, 20 }, + { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x4e2bb6a8, 0x67c92bf4, 0x4e2bb6a8, 0x388d831b, 0x5fcf013d, 0x5fcf013d, 0xe69beaed, 0xe69beaed, 0xe69beaed, 0x348bf29b, 0x348bf29b, 0x348bf29b, 0x22f8cd04, 0x22f8cd04, 0x22f8cd04, 0x5fcf013d, 0x388d831b, 0x388d831b, 0x5fcf013d, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeb6b461d, 0x679ed094, 0xeb6b461d, 0xf06e9c1a, 0xdd28f52b, 0xdd28f52b, 0xdf34624d, 0xdf34624d, 0xdf34624d, 0xfe089ba9, 0xfe089ba9, 0xfe089ba9, 0x83b05025, 0x83b05025, 0x83b05025, 0xdd28f52b, 0xf06e9c1a, 0xf06e9c1a, 0xdd28f52b, }, 20 }, + { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc486143c, 0x7b487645, 0xc486143c, 0x3b390fbc, 0x43d1f34, 0x43d1f34, 0x9576cd6b, 0x9576cd6b, 0x9576cd6b, 0xea7c64c3, 0xea7c64c3, 0xea7c64c3, 0x732d6145, 0x732d6145, 0x732d6145, 0x43d1f34, 0x3b390fbc, 0x3b390fbc, 0x43d1f34, }, 20 }, + { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa024d435, 0x8bc3f107, 0xa024d435, 0xe3d21972, 0x59c36f00, 0x59c36f00, 0x9412860d, 0x9412860d, 0x9412860d, 0xea92eb6b, 0xea92eb6b, 0xea92eb6b, 0x8864feb9, 0x8864feb9, 0x8864feb9, 0x59c36f00, 0xe3d21972, 0xe3d21972, 0x59c36f00, }, 20 }, + { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xbf89b975, 0x481e2ecc, 0xbf89b975, 0x918c3c0a, 0xaa4593fe, 0xaa4593fe, 0xa8509e2c, 0xa8509e2c, 0xa8509e2c, 0xea5934b, 0xea5934b, 0xea5934b, 0x239d3833, 0x239d3833, 0x239d3833, 0xaa4593fe, 0x918c3c0a, 0x918c3c0a, 0xaa4593fe, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x4d84ea04, 0xd1029f5b, 0x4d84ea04, 0x10938780, 0xc9cbf769, 0xc9cbf769, 0x3677fab0, 0x3677fab0, 0x3677fab0, 0xc8af3b7c, 0xc8af3b7c, 0xc8af3b7c, 0x21e58474, 0x21e58474, 0x21e58474, 0xc9cbf769, 0x10938780, 0x10938780, 0xc9cbf769, }, 20 }, + { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x9e5f6ab3, 0xda3fae82, 0x9e5f6ab3, 0x3009236b, 0x9813a416, 0x9813a416, 0x5710fb5f, 0x5710fb5f, 0x5710fb5f, 0xc6cb7d6c, 0xc6cb7d6c, 0xc6cb7d6c, 0xdf7140bc, 0xdf7140bc, 0xdf7140bc, 0x9813a416, 0x3009236b, 0x3009236b, 0x9813a416, }, 20 }, + { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x28f46625, 0xf4bfdc80, 0x28f46625, 0x5e525396, 0x5fcf013d, 0x5fcf013d, 0xb3f9b24b, 0xb3f9b24b, 0xb3f9b24b, 0x61e9aa3d, 0x61e9aa3d, 0x61e9aa3d, 0x779a95a2, 0x779a95a2, 0x779a95a2, 0x5fcf013d, 0x5e525396, 0x5e525396, 0x5fcf013d, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8c12e300, 0xa71b83e7, 0x8c12e300, 0x97173907, 0xdd28f52b, 0xdd28f52b, 0x2f660f28, 0x2f660f28, 0x2f660f28, 0xe5af6cc, 0xe5af6cc, 0xe5af6cc, 0x73e23d40, 0x73e23d40, 0x73e23d40, 0xdd28f52b, 0x97173907, 0x97173907, 0xdd28f52b, }, 20 }, + { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbaaaeec4, 0x7f7cd53b, 0xbaaaeec4, 0x4515f544, 0x43d1f34, 0x43d1f34, 0xd254254f, 0xd254254f, 0xd254254f, 0xad5e8ce7, 0xad5e8ce7, 0xad5e8ce7, 0x340f8961, 0x340f8961, 0x340f8961, 0x43d1f34, 0x4515f544, 0x4515f544, 0x43d1f34, }, 20 }, + { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x63166340, 0x5d98fc3, 0x63166340, 0x20e0ae07, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x20e0ae07, 0x20e0ae07, 0x59c36f00, }, 20 }, + { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe0916467, 0x44bbe3df, 0xe0916467, 0xce94e118, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xce94e118, 0xce94e118, 0xaa4593fe, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x1aad9b94, 0xa021c44c, 0x1aad9b94, 0x47baf610, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x47baf610, 0x47baf610, 0xc9cbf769, }, 20 }, + { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb8710521, 0xbd10c16, 0xb8710521, 0x16274cf9, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0x16274cf9, 0x16274cf9, 0x9813a416, }, 20 }, + { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xd62b53b5, 0xc6dd48d4, 0xd62b53b5, 0xa08d6606, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xa08d6606, 0xa08d6606, 0x5fcf013d, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10503615, 0x442892cb, 0x10503615, 0xb55ec12, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xb55ec12, 0xb55ec12, 0xdd28f52b, }, 20 }, + { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x5c9d00a2, 0xf70cd71f, 0x5c9d00a2, 0xa3221b22, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xa3221b22, 0xa3221b22, 0x43d1f34, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbc89067b, 0xf339b29f, 0xbc89067b, 0xff7fcb3c, 0x59c36f00, 0x59c36f00, 0x5915b839, 0x5915b839, 0x5915b839, 0x2795d55f, 0x2795d55f, 0x2795d55f, 0x4563c08d, 0x4563c08d, 0x4563c08d, 0x59c36f00, 0xff7fcb3c, 0xff7fcb3c, 0x59c36f00, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb19b98f6, 0xb8ffac95, 0xb19b98f6, 0x9f9e1d89, 0xaa4593fe, 0xaa4593fe, 0x6cb5454, 0x6cb5454, 0x6cb5454, 0xa03e5933, 0xa03e5933, 0xa03e5933, 0x8d06f24b, 0x8d06f24b, 0x8d06f24b, 0xaa4593fe, 0x9f9e1d89, 0x9f9e1d89, 0xaa4593fe, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x133d7c3b, 0xd26c8a26, 0x133d7c3b, 0x4e2a11bf, 0xc9cbf769, 0xc9cbf769, 0x36504e54, 0x36504e54, 0x36504e54, 0xc8888f98, 0xc8888f98, 0xc8888f98, 0x21c23090, 0x21c23090, 0x21c23090, 0xc9cbf769, 0x4e2a11bf, 0x4e2a11bf, 0xc9cbf769, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbfc94fbe, 0xe32be512, 0xbfc94fbe, 0x119f0666, 0x9813a416, 0x9813a416, 0x8350694d, 0x8350694d, 0x8350694d, 0x128bef7e, 0x128bef7e, 0x128bef7e, 0xb31d2ae, 0xb31d2ae, 0xb31d2ae, 0x9813a416, 0x119f0666, 0x119f0666, 0x9813a416, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9cf25061, 0xe5e2b458, 0x9cf25061, 0xea5465d2, 0x5fcf013d, 0x5fcf013d, 0xa5bfba08, 0xa5bfba08, 0xa5bfba08, 0x77afa27e, 0x77afa27e, 0x77afa27e, 0x61dc9de1, 0x61dc9de1, 0x61dc9de1, 0x5fcf013d, 0xea5465d2, 0xea5465d2, 0x5fcf013d, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc968ecc5, 0xa3105cfb, 0xc968ecc5, 0xd26d36c2, 0xdd28f52b, 0xdd28f52b, 0xff2fd4b8, 0xff2fd4b8, 0xff2fd4b8, 0xde132d5c, 0xde132d5c, 0xde132d5c, 0xa3abe6d0, 0xa3abe6d0, 0xa3abe6d0, 0xdd28f52b, 0xd26d36c2, 0xd26d36c2, 0xdd28f52b, }, 20 }, + { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf17f3c, 0xf3672115, 0xf17f3c, 0xff4e64bc, 0x43d1f34, 0x43d1f34, 0x6ec799ab, 0x6ec799ab, 0x6ec799ab, 0x11cd3003, 0x11cd3003, 0x11cd3003, 0x889c3585, 0x889c3585, 0x889c3585, 0x43d1f34, 0xff4e64bc, 0xff4e64bc, 0x43d1f34, }, 20 }, + { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x20f2a62b, 0x12808b5f, 0x20f2a62b, 0x63046b6c, 0x59c36f00, 0x59c36f00, 0x23e6cac6, 0x23e6cac6, 0x23e6cac6, 0x5d66a7a0, 0x5d66a7a0, 0x5d66a7a0, 0x3f90b272, 0x3f90b272, 0x3f90b272, 0x59c36f00, 0x63046b6c, 0x63046b6c, 0x59c36f00, }, 20 }, + { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x52fcbd8f, 0x7119870a, 0x52fcbd8f, 0x7cf938f0, 0xaa4593fe, 0xaa4593fe, 0x4bb9a19, 0x4bb9a19, 0x4bb9a19, 0xa24e977e, 0xa24e977e, 0xa24e977e, 0x8f763c06, 0x8f763c06, 0x8f763c06, 0xaa4593fe, 0x7cf938f0, 0x7cf938f0, 0xaa4593fe, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4d74d3f, 0xd2dab4f0, 0xe4d74d3f, 0xb9c020bb, 0xc9cbf769, 0xc9cbf769, 0xa4955f92, 0xa4955f92, 0xa4955f92, 0x5a4d9e5e, 0x5a4d9e5e, 0x5a4d9e5e, 0xb3072156, 0xb3072156, 0xb3072156, 0xc9cbf769, 0xb9c020bb, 0xb9c020bb, 0xc9cbf769, }, 20 }, + { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1c2b9ec, 0x34038c40, 0xa1c2b9ec, 0xf94f034, 0x9813a416, 0x9813a416, 0x438820a6, 0x438820a6, 0x438820a6, 0xd253a695, 0xd253a695, 0xd253a695, 0xcbe99b45, 0xcbe99b45, 0xcbe99b45, 0x9813a416, 0xf94f034, 0xf94f034, 0x9813a416, }, 20 }, + { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x339cc65f, 0xe46f6cec, 0x339cc65f, 0x453af3ec, 0x5fcf013d, 0x5fcf013d, 0xad75b235, 0xad75b235, 0xad75b235, 0x7f65aa43, 0x7f65aa43, 0x7f65aa43, 0x691695dc, 0x691695dc, 0x691695dc, 0x5fcf013d, 0x453af3ec, 0x453af3ec, 0x5fcf013d, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x1c229a1a, 0x83752c05, 0x1c229a1a, 0x727401d, 0xdd28f52b, 0xdd28f52b, 0x4b4f5d0, 0x4b4f5d0, 0x4b4f5d0, 0x25880c34, 0x25880c34, 0x25880c34, 0x5830c7b8, 0x5830c7b8, 0x5830c7b8, 0xdd28f52b, 0x727401d, 0x727401d, 0xdd28f52b, }, 20 }, + { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4d69e76c, 0x11e8d41f, 0x4d69e76c, 0xb2d6fcec, 0x43d1f34, 0x43d1f34, 0x15b4256, 0x15b4256, 0x15b4256, 0x7e51ebfe, 0x7e51ebfe, 0x7e51ebfe, 0xe700ee78, 0xe700ee78, 0xe700ee78, 0x43d1f34, 0xb2d6fcec, 0xb2d6fcec, 0x43d1f34, }, 20 }, + { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xecc0313, 0x6803ef90, 0xecc0313, 0x59e1bdcd, 0x59c36f00, 0x59c36f00, 0xbaf5c463, 0xbaf5c463, 0xbaf5c463, 0xc475a905, 0xc475a905, 0xc475a905, 0xa683bcd7, 0xa683bcd7, 0xa683bcd7, 0x59c36f00, 0x59e1bdcd, 0x59e1bdcd, 0x59c36f00, }, 20 }, + { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xfb839522, 0x5fa9129a, 0xfb839522, 0x4b244f74, 0xaa4593fe, 0xaa4593fe, 0xf644f45d, 0xf644f45d, 0xf644f45d, 0x50b1f93a, 0x50b1f93a, 0x50b1f93a, 0x7d895242, 0x7d895242, 0x7d895242, 0xaa4593fe, 0x4b244f74, 0x4b244f74, 0xaa4593fe, }, 20 }, + { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf84fee63, 0x42c3b1bb, 0xf84fee63, 0xe86af0cd, 0xc9cbf769, 0xc9cbf769, 0x93e5d13b, 0x93e5d13b, 0x93e5d13b, 0x6d3d10f7, 0x6d3d10f7, 0x6d3d10f7, 0x8477afff, 0x8477afff, 0x8477afff, 0xc9cbf769, 0xe86af0cd, 0xe86af0cd, 0xc9cbf769, }, 20 }, + { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xcbed2522, 0x784d2c15, 0xcbed2522, 0xfb9cd90d, 0x9813a416, 0x9813a416, 0x94668b23, 0x94668b23, 0x94668b23, 0x5bd0d10, 0x5bd0d10, 0x5bd0d10, 0x1c0730c0, 0x1c0730c0, 0x1c0730c0, 0x9813a416, 0xfb9cd90d, 0xfb9cd90d, 0x9813a416, }, 20 }, + { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc1ca0a91, 0xd13c11f0, 0xc1ca0a91, 0x6fcde564, 0x5fcf013d, 0x5fcf013d, 0xb6cdf7a2, 0xb6cdf7a2, 0xb6cdf7a2, 0x64ddefd4, 0x64ddefd4, 0x64ddefd4, 0x72aed04b, 0x72aed04b, 0x72aed04b, 0x5fcf013d, 0x6fcde564, 0x6fcde564, 0x5fcf013d, }, 20 }, + { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xca477228, 0x9e3fd6f6, 0xca477228, 0x4423b9f2, 0xdd28f52b, 0xdd28f52b, 0x1ff53543, 0x1ff53543, 0x1ff53543, 0x3ec9cca7, 0x3ec9cca7, 0x3ec9cca7, 0x4371072b, 0x4371072b, 0x4371072b, 0xdd28f52b, 0x4423b9f2, 0x4423b9f2, 0xdd28f52b, }, 20 }, + { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfe345ca6, 0x55a58b1b, 0xfe345ca6, 0x696cda06, 0x43d1f34, 0x43d1f34, 0x72d541bf, 0x72d541bf, 0x72d541bf, 0xddfe817, 0xddfe817, 0xddfe817, 0x948eed91, 0x948eed91, 0x948eed91, 0x43d1f34, 0x696cda06, 0x696cda06, 0x43d1f34, }, 20 }, + { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4cfdf9ab, 0x2a321528, 0x4cfdf9ab, 0xf4b75661, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0xf4b75661, 0xf4b75661, 0x59c36f00, }, 20 }, + { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x287ff948, 0x8c557ef0, 0x287ff948, 0xebf931c7, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xebf931c7, 0xebf931c7, 0xaa4593fe, }, 20 }, + { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ecea36b, 0xe442fcb3, 0x5ecea36b, 0x1cab5f56, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x1cab5f56, 0x1cab5f56, 0xc9cbf769, }, 20 }, + { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf6c7d73a, 0x4567de0d, 0xf6c7d73a, 0xb8d47573, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xb8d47573, 0xb8d47573, 0x9813a416, }, 20 }, + { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x56e3bddb, 0x4615a6ba, 0x56e3bddb, 0xc585b2ec, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xc585b2ec, 0xc585b2ec, 0x5fcf013d, }, 20 }, + { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x5ebfa46, 0x51935e98, 0x5ebfa46, 0xe26d3e18, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xe26d3e18, 0xe26d3e18, 0xdd28f52b, }, 20 }, + { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4995beac, 0xe2046911, 0x4995beac, 0x311de003, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0x311de003, 0x311de003, 0x43d1f34, }, 20 }, + { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, + { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, + { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x4c2cef83, 0x1b215a88, 0xe2378595, 0xb53a309e, 0x15f64d5e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x758f388c, 0xd4442397, 0x33f5784b, 0x923e6350, 0xf97bb902, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xb9f6f52a, 0x4e24e8b7, 0x53beb8e1, 0xa46ca57c, 0x688a184d, }, 5 }, + { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x5bd98ce3, 0x15df7962, 0xc7d467e1, 0x89d29260, 0x662e2c16, }, 5 }, + { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, }, 5 }, + { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, }, 5 }, + { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x335fadcb, 0x1f517b5c, 0x6b4200e5, 0x474cd672, 0x8364f797, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xcf9985f8, 0x1d92c7fc, 0x6e637701, 0xbc683505, 0x898016fb, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xdb824190, 0x378d05dc, 0x670bff9, 0xea7ffbb5, 0x658bcbb3, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x157232bd, 0x5e6bdacd, 0x8341e25d, 0xc8580a2d, 0x3cf9e58c, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0xbfafd7cd, 0x51650951, 0x67d61c04, 0x891cc298, 0xab036ae, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x760580c9, 0xdc6d8205, 0x2739f3a0, 0x8d51f16c, 0xd47d661b, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0xada3b5f, 0x24cd61a6, 0x56f48ead, 0x78e3d454, 0xb28750bb, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x827694e2, 0x9d97c3dd, 0xbdb43a9c, 0xa2556da3, 0xfdf3c81e, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0x664534a5, 0xcd0979a0, 0x3531d85e, 0x9e7d955b, 0xc0aced53, }, 5 }, From f2b54835f2e0aa068f82fec99edad671d5f46c08 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 5 Jan 2016 12:47:30 +0100 Subject: [PATCH 028/207] Disable progress indicator in grub-shell. This disables progress indicator for tests. This in turn fixes test flakiness as they ended up timing-dependent. --- grub-core/lib/progress.c | 6 ++++++ tests/util/grub-shell.in | 2 ++ 2 files changed, 8 insertions(+) diff --git a/grub-core/lib/progress.c b/grub-core/lib/progress.c index 95a4a6281..4b7cbbca6 100644 --- a/grub-core/lib/progress.c +++ b/grub-core/lib/progress.c @@ -38,11 +38,17 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), grub_uint64_t now; static grub_uint64_t last_progress_update_time; grub_file_t file = data; + const char *e; file->progress_offset += length; if (call_depth) return; + e = grub_env_get ("enable_progress_indicator"); + if (e && e[0] == '0') { + return; + } + call_depth = 1; now = grub_get_time_ms (); diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 6d2b1327e..31a1f294d 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -289,6 +289,8 @@ fi cfgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cat <${cfgfile} grubshell=yes +enable_progress_indicator=0 +export enable_progress_indicator EOF From 3f430a0126ae36ec0750125bd498194fa56cc615 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 5 Jan 2016 12:49:12 +0100 Subject: [PATCH 029/207] Move file loading functions to grub-emu. So that we can use it in grub-emu as well as utils. --- grub-core/kern/emu/misc.c | 48 +++++++++++++++++++++++++++++++++++++++ util/misc.c | 48 --------------------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index bb606da28..06985013d 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -149,3 +149,51 @@ grub_get_time_ms (void) return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } + +size_t +grub_util_get_image_size (const char *path) +{ + FILE *f; + size_t ret; + off_t sz; + + f = grub_util_fopen (path, "rb"); + + if (!f) + grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + + fseeko (f, 0, SEEK_END); + + sz = ftello (f); + if (sz < 0) + grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + if (sz != (size_t) sz) + grub_util_error (_("file `%s' is too big"), path); + ret = (size_t) sz; + + fclose (f); + + return ret; +} + +void +grub_util_load_image (const char *path, char *buf) +{ + FILE *fp; + size_t size; + + grub_util_info ("reading %s", path); + + size = grub_util_get_image_size (path); + + fp = grub_util_fopen (path, "rb"); + if (! fp) + grub_util_error (_("cannot open `%s': %s"), path, + strerror (errno)); + + if (fread (buf, 1, size, fp) != size) + grub_util_error (_("cannot read `%s': %s"), path, + strerror (errno)); + + fclose (fp); +} diff --git a/util/misc.c b/util/misc.c index b8ec69108..d545212d9 100644 --- a/util/misc.c +++ b/util/misc.c @@ -74,32 +74,6 @@ grub_util_get_path (const char *dir, const char *file) return path; } -size_t -grub_util_get_image_size (const char *path) -{ - FILE *f; - size_t ret; - off_t sz; - - f = grub_util_fopen (path, "rb"); - - if (!f) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); - - fseeko (f, 0, SEEK_END); - - sz = ftello (f); - if (sz < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); - if (sz != (size_t) sz) - grub_util_error (_("file `%s' is too big"), path); - ret = (size_t) sz; - - fclose (f); - - return ret; -} - char * grub_util_read_image (const char *path) { @@ -126,28 +100,6 @@ grub_util_read_image (const char *path) return img; } -void -grub_util_load_image (const char *path, char *buf) -{ - FILE *fp; - size_t size; - - grub_util_info ("reading %s", path); - - size = grub_util_get_image_size (path); - - fp = grub_util_fopen (path, "rb"); - if (! fp) - grub_util_error (_("cannot open `%s': %s"), path, - strerror (errno)); - - if (fread (buf, 1, size, fp) != size) - grub_util_error (_("cannot read `%s': %s"), path, - strerror (errno)); - - fclose (fp); -} - void grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out, const char *name) From f86fd54cf08cc5d0fb62766f98cc86e3ae4c741e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 5 Jan 2016 12:59:44 +0100 Subject: [PATCH 030/207] Add memdisk support to grub-emu. Use it to add custom files, so that tests which need them work. --- grub-core/kern/emu/main.c | 42 ++++++++++++++++++++++++++++++++++++++- tests/util/grub-shell.in | 11 +++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index 4b509139c..51e8a5715 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -86,11 +86,16 @@ grub_machine_fini (int flags) +#define OPT_MEMDISK 257 + static struct argp_option options[] = { {"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2}, {"device-map", 'm', N_("FILE"), 0, /* TRANSLATORS: There are many devices in device map. */ N_("use FILE as the device map [default=%s]"), 0}, + {"memdisk", OPT_MEMDISK, N_("FILE"), 0, + /* TRANSLATORS: There are many devices in device map. */ + N_("use FILE as memdisk"), 0}, {"directory", 'd', N_("DIR"), 0, N_("use GRUB files in the directory DIR [default=%s]"), 0}, {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, @@ -119,6 +124,7 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) struct arguments { const char *dev_map; + const char *mem_disk; int hold; }; @@ -131,6 +137,9 @@ argp_parser (int key, char *arg, struct argp_state *state) switch (key) { + case OPT_MEMDISK: + arguments->mem_disk = arg; + break; case 'r': free (root_dev); root_dev = xstrdup (arg); @@ -180,9 +189,13 @@ main (int argc, char *argv[]) struct arguments arguments = { .dev_map = DEFAULT_DEVICE_MAP, - .hold = 0 + .hold = 0, + .mem_disk = 0, }; volatile int hold = 0; + size_t total_module_size = sizeof (struct grub_module_info), memdisk_size = 0; + struct grub_module_info *modinfo; + char *mods; grub_util_host_init (&argc, &argv); @@ -194,6 +207,33 @@ main (int argc, char *argv[]) exit(1); } + if (arguments.mem_disk) + { + memdisk_size = ALIGN_UP(grub_util_get_image_size (arguments.mem_disk), 512); + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + + mods = xmalloc (total_module_size); + modinfo = grub_memset (mods, 0, total_module_size); + mods = (char *) (modinfo + 1); + + modinfo->magic = GRUB_MODULE_MAGIC; + modinfo->offset = sizeof (struct grub_module_info); + modinfo->size = total_module_size; + + if (arguments.mem_disk) + { + struct grub_module_header *header = (struct grub_module_header *) mods; + header->type = OBJ_TYPE_MEMDISK; + header->size = memdisk_size + sizeof (*header); + mods += sizeof (*header); + + grub_util_load_image (arguments.mem_disk, mods); + mods += memdisk_size; + } + + grub_modbase = (grub_addr_t) modinfo; + hold = arguments.hold; /* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */ if (hold && verbosity > 0) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 31a1f294d..884c823d8 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -449,7 +449,8 @@ if [ x$boot = xnet ]; then [ -z "$files" ] || copy_extra_files "$netdir" $files timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim elif [ x$boot = xemu ]; then - grubdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + rootdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + grubdir="$rootdir/boot/grub" mkdir -p "$grubdir/fonts" mkdir -p "$grubdir/themes" mkdir -p "$grubdir/locale" @@ -462,8 +463,12 @@ elif [ x$boot = xemu ]; then done cp "${cfgfile}" "$grubdir/grub.cfg" cp "${source}" "$grubdir/testcase.cfg" - @builddir@/grub-core/grub-emu -m "$device_map" -d "$grubdir" | tr -d "\r" | do_trim - rm -rf "$grubdir" + [ -z "$files" ] || copy_extra_files "$rootdir" $files + roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + (cd "$rootdir"; tar cf "$roottar" .) + @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim + test -n "$debug" || rm -rf "$rootdir" + test -n "$debug" || rm -f "$roottar" else timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | do_trim fi From 9f8f9e62afc4f14802d6bd6bb69719bbc245a8c2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 5 Jan 2016 16:36:21 +0100 Subject: [PATCH 031/207] minixfs_test: Check if mkfs.minixfs supports -B option. --- tests/minixfs_test.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/minixfs_test.in b/tests/minixfs_test.in index 8075ba890..1784b1261 100644 --- a/tests/minixfs_test.in +++ b/tests/minixfs_test.in @@ -16,10 +16,20 @@ if ! which mkfs.minix >/dev/null 2>&1; then fi if ! mkfs.minix -h | grep -- -v > /dev/null; then + echo "mkfs.minix doesn't support minix2fs; cannot test minix*fs." + exit 77 +fi + +if ! mkfs.minix -h | grep -- -3 > /dev/null; then echo "mkfs.minix doesn't support minix3fs; cannot test minix*fs." exit 77 fi +if ! mkfs.minix -h | grep -- -B > /dev/null; then + echo "mkfs.minix doesn't support variable block size; cannot test minix*fs." + exit 77 +fi + "@builddir@/grub-fs-tester" minix "@builddir@/grub-fs-tester" minix2 "@builddir@/grub-fs-tester" minix3 From 716c9f2675e27949fb9ff13a76736d9330503b32 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 15:51:03 +0100 Subject: [PATCH 032/207] Adjust bootcheck tests for multiboot/coreboot/qemu to match real support. coreboot has ACPI while 2 others don't. *BSD need ACPI and have trouble without it. Don't even attempt to boot *BSD on multiboot or qemu targets. On coreboot boot all *BSD except 32-bit NetBSD which apparently does some early BIOS calls. --- Makefile.am | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3872b220c..a3719458e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -353,25 +353,25 @@ BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd- endif if COND_i386_multiboot -# FreeBSD requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 +# *BSD requires ACPI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 +endif + + +if COND_i386_qemu +# *BSD requires ACPI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 endif if COND_i386_coreboot -# Freebsd requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 -endif - -if COND_i386_qemu -# FreeBSD requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_i386_pc #pc chainloader by definition is only for i386-pc #ntldr and bootmgr require BIOS. -#legacy protocol makes early BIOS calls. -# NetBSD crashes early on non-BIOS +#legacy protocol (linux16) makes early BIOS calls. +# 32-bit NetBSD crashes early on non-BIOS BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 bootcheck-pc-chainloader bootcheck-ntldr bootcheck-linux16-i386 bootcheck-linux16-x86_64 bootcheck-knetbsd-i386 endif From 607d66116a67e5a13eb0d46076f26dedc988e6a4 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 15:53:42 +0100 Subject: [PATCH 033/207] iee1275/datetime: Fix off-by-1 error. --- grub-core/lib/ieee1275/datetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c index 74578f15a..b81fba2ed 100644 --- a/grub-core/lib/ieee1275/datetime.c +++ b/grub-core/lib/ieee1275/datetime.c @@ -95,7 +95,7 @@ grub_get_datetime (struct grub_datetime *datetime) datetime->year = args.year; datetime->month = args.month; - datetime->day = args.day; + datetime->day = args.day + 1; datetime->hour = args.hour; datetime->minute = args.minute; datetime->second = args.second; @@ -140,7 +140,7 @@ grub_set_datetime (struct grub_datetime *datetime) args.year = datetime->year; args.month = datetime->month; - args.day = datetime->day; + args.day = datetime->day - 1; args.hour = datetime->hour; args.minute = datetime->minute; args.second = datetime->second; From 86e3b4ba1af430c8d58598876b714eb99c5f535f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 15:54:06 +0100 Subject: [PATCH 034/207] hddboot_test: reenable on OVMF OVMF now supports booting from disks. --- tests/hddboot_test.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in index 2cbbf97ec..c229716a6 100644 --- a/tests/hddboot_test.in +++ b/tests/hddboot_test.in @@ -29,9 +29,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in # FIXME: currently grub-shell uses only -kernel for loongson mipsel-loongson) exit 0;; - # FIXME: OVMF skips HDDs for automatic boot and has no USB support - *-efi) - exit 0;; esac if [ "$(echo hello | "${grubshell}" --boot=hd)" != "Hello World" ]; then From 44876dd64e75b47f99d574bc3db1c87db670645c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 15:54:42 +0100 Subject: [PATCH 035/207] grub-shell: On i386-ieee1275 don't try to switch to console. console goes to serial as well, so this doesn't stop garbage from going to serial. But it creates garbage itself. --- tests/util/grub-shell.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 884c823d8..040ef04cd 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -331,7 +331,8 @@ cat <>${cfgfile} source "\$prefix/testcase.cfg" # Stop serial output to suppress "ACPI shutdown failed" error. EOF -if [ x$console != x ]; then +# Attempt to switch to console on i386-ieee1275 causes "screen not found" message +if [ x$console != x ] && [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" != xi386-ieee1275 ]; then echo "terminal_output $console" >>${cfgfile} fi echo "${halt_cmd}" >>${cfgfile} From db5eb6225dddaaa90e2e54642f31ca14fadf145b Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 15:55:45 +0100 Subject: [PATCH 036/207] grub-shell: Use new cbfstool syntax. --- tests/util/grub-shell.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 040ef04cd..8f475cd58 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -402,7 +402,7 @@ fi if [ x$boot = xcoreboot ]; then imgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cp "${GRUB_COREBOOT_ROM}" "${imgfile}" - "${GRUB_CBFSTOOL}" "${imgfile}" add-payload "${rom_directory}/coreboot.elf" fallback/payload + "${GRUB_CBFSTOOL}" "${imgfile}" add-payload -f "${rom_directory}/coreboot.elf" -n fallback/payload bootdev="-bios ${imgfile}" device="cdrom " test -z "$debug" || echo "Coreboot image: ${imgfile}" >&2 From 06c94739a57f9241868fe76d8e0a797eb547540a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 19:26:45 +0100 Subject: [PATCH 037/207] Disable NetBSD bootcheck on EFI until it supports ACPI on EFI. --- Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index a3719458e..70a8af873 100644 --- a/Makefile.am +++ b/Makefile.am @@ -345,11 +345,13 @@ bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null if COND_i386_efi -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 +# NetBSD has no support for finding ACPI on EFI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_x86_64_efi -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 +# NetBSD has no support for finding ACPI on EFI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_i386_multiboot From 6e4174f6f9197619baa41ddc7d718f3c634f0aab Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 19:27:56 +0100 Subject: [PATCH 038/207] arm64: Disable tests that need native drivers. --- tests/ahci_test.in | 2 +- tests/ehci_test.in | 2 +- tests/ohci_test.in | 2 +- tests/pata_test.in | 2 +- tests/uhci_test.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ahci_test.in b/tests/ahci_test.in index e7d26ac07..40441768e 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) exit 0;; esac diff --git a/tests/ehci_test.in b/tests/ehci_test.in index 5cfe726df..8de56ee98 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) exit 0;; esac diff --git a/tests/ohci_test.in b/tests/ohci_test.in index f841bd25c..da517629f 100644 --- a/tests/ohci_test.in +++ b/tests/ohci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) exit 0;; esac diff --git a/tests/pata_test.in b/tests/pata_test.in index 07d17b781..4bf644fe6 100644 --- a/tests/pata_test.in +++ b/tests/pata_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in *-arc) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) exit 0;; i386-ieee1275) disk=hdb diff --git a/tests/uhci_test.in b/tests/uhci_test.in index 3dea51c01..5ec503033 100644 --- a/tests/uhci_test.in +++ b/tests/uhci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) exit 0;; esac From 62328a95c9825fff749cd79a7ccc1060986ca7b2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 19:28:47 +0100 Subject: [PATCH 039/207] Allow GRUB_QEMU_OPTS to override machine. --- tests/util/grub-shell.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 8f475cd58..c52c8c7eb 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -97,13 +97,13 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips-qemu_mips) boot=mips_qemu qemu=qemu-system-mips - qemuopts="$qemuopts -M mips" + qemuopts="-M mips $qemuopts" console=vga_text ;; mips-arc) boot=cd qemu=qemu-system-mips64 - qemuopts="$qemuopts -M indy" + qemuopts="-M indy $qemuopts" serial_port=arc/serial0/line0 console= trim=1 @@ -111,7 +111,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-arc) boot=cd qemu=qemu-system-mips64el - qemuopts="$qemuopts -M magnum -no-reboot" + qemuopts="-M magnum $qemuopts -no-reboot" serial_port=arc/multi0/serial0 console=console halt_cmd=reboot @@ -120,13 +120,13 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-qemu_mips) boot=mipsel_qemu qemu=qemu-system-mipsel - qemuopts="$qemuopts -M mips" + qemuopts="-M mips $qemuopts" console=vga_text ;; mipsel-loongson) boot=mipsel_fulong2e qemu=qemu-system-mips64el - qemuopts="$qemuopts -M fulong2e" + qemuopts="-M fulong2e $qemuopts" console= trim=1 ;; From a2dcab70f8df956c15bf13e7cc1b815b751b8c12 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 19:29:53 +0100 Subject: [PATCH 040/207] x86_64-efi: Automatically add -bios OVMF.fd to qemu in tests. --- tests/util/grub-shell.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index c52c8c7eb..59061677d 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -170,6 +170,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in boot=cd console=console trim=1 + qemuopts="-bios OVMF.fd $qemuopts" ;; *) boot=hd From 7eb27a49e92623587f400ff58de3e9b1a31ba894 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Thu, 7 Jan 2016 20:53:41 +0100 Subject: [PATCH 041/207] arm-efi: Reduce timer event frequency by 10 Timer event to keep grub msec counter was running at 1000HZ. This was too fast for UEFI timer driver and resulted in a 10x slowdown in grub time versus wallclock. Reduce the timer event frequency and increase tick increment accordingly to keep better time. --- grub-core/kern/arm/efi/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c index 2572ca8b7..06df60e2f 100644 --- a/grub-core/kern/arm/efi/init.c +++ b/grub-core/kern/arm/efi/init.c @@ -38,7 +38,7 @@ static void increment_timer (grub_efi_event_t event __attribute__ ((unused)), void *context __attribute__ ((unused))) { - tmr++; + tmr += 10; } void @@ -52,7 +52,7 @@ grub_machine_init (void) efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL, GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); - efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 10000); + efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000); grub_install_get_time_ms (grub_efi_get_time_ms); } From 9efd79f376a873af14e380b7143efd2343bde24c Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 21:02:53 +0100 Subject: [PATCH 042/207] grub-shell: Support arm64-efi --- tests/util/grub-shell.in | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 59061677d..cff597ea1 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -65,7 +65,7 @@ serial_port=com0 serial_null= halt_cmd=halt pseries=n -disk=hda +disk="hda " case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in *-emu) device_map=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 @@ -145,7 +145,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in qemu=qemu-system-i386 console=console trim=1 - disk=hdb + disk="hdb " ;; i386-qemu) boot=qemu @@ -164,6 +164,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in boot=cd console=console trim=1 + qemuopts="-bios OVMF32.fd $qemuopts" ;; x86_64-efi) qemu=qemu-system-x86_64 @@ -172,6 +173,15 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in trim=1 qemuopts="-bios OVMF.fd $qemuopts" ;; + arm64-efi) + qemu=qemu-system-aarch64 + boot=hd + console=console + trim=1 + qemuopts="-machine virt -cpu cortex-a57 -bios /usr/share/qemu-efi/QEMU_EFI.fd $qemuopts" + disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" + serial_port=efi0 + ;; *) boot=hd qemu=qemu-system-i386 @@ -227,13 +237,13 @@ for option in "$@"; do echo "Too many disks" 1>&2 exit 1; fi - qemuopts="$qemuopts -$disk $dsk" - if [ "$disk" = hda ]; then - disk=hdb; - elif [ "$disk" = hdb ]; then + qemuopts="$qemuopts -$disk$dsk" + if [ "$disk" = "hda " ]; then + disk="hdb "; + elif [ "$disk" = "hdb " ]; then # CDROM is hdc - disk=hdd - elif [ "$disk" = hdd ]; then + disk="hdd " + elif [ "$disk" = "hdd " ]; then # CDROM is hdc disk=error fi @@ -360,7 +370,9 @@ if [ x$boot != xnet ] && [ x$boot != xemu ]; then ${files} >/dev/null 2>&1 fi if [ x$boot = xhd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then + device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file=" + elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then device="hdb " else device="hda " @@ -368,7 +380,9 @@ if [ x$boot = xhd ]; then bootdev="-boot c" fi if [ x$boot = xcd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then + device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file=" + elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then device="-drive if=ide,media=cdrom,file=" else device="cdrom " From e4c49cab9b5d4ba77881b3829402b8b7fdb84382 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 Jan 2016 21:10:05 +0100 Subject: [PATCH 043/207] arm64/setjmp: Add missing move for arg1 == 0 case. --- grub-core/lib/arm64/setjmp.S | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/lib/arm64/setjmp.S b/grub-core/lib/arm64/setjmp.S index eabfd99b2..ffcabf6e4 100644 --- a/grub-core/lib/arm64/setjmp.S +++ b/grub-core/lib/arm64/setjmp.S @@ -50,6 +50,7 @@ FUNCTION(grub_longjmp) ldp x29, x30, [x0], #16 ldr x2, [x0] mov sp, x2 + mov x0, #1 cmp x1, #0 csel x0, x1, x0, ne ret From b4787552b02c7a3a124f1d2178309383c36f5c03 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 8 Jan 2016 09:49:08 +0100 Subject: [PATCH 044/207] Tests: Support arm-efi --- tests/ahci_test.in | 2 +- tests/ehci_test.in | 2 +- tests/ohci_test.in | 2 +- tests/partmap_test.in | 3 +++ tests/pata_test.in | 2 +- tests/uhci_test.in | 2 +- tests/util/grub-shell.in | 15 ++++++++++++--- 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/ahci_test.in b/tests/ahci_test.in index 40441768e..1d01d1f59 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/ehci_test.in b/tests/ehci_test.in index 8de56ee98..7dd8d3e8f 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/ohci_test.in b/tests/ohci_test.in index da517629f..7fede6f26 100644 --- a/tests/ohci_test.in +++ b/tests/ohci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/partmap_test.in b/tests/partmap_test.in index 4230ba228..f8dc456fb 100644 --- a/tests/partmap_test.in +++ b/tests/partmap_test.in @@ -88,6 +88,9 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-arc) disk=arc/scsi0/disk0/rdisk0 ;; + arm*-efi) + disk=hd3 + ;; *) disk=hd0 ;; diff --git a/tests/pata_test.in b/tests/pata_test.in index 4bf644fe6..c1d0f63ea 100644 --- a/tests/pata_test.in +++ b/tests/pata_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in *-arc) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; i386-ieee1275) disk=hdb diff --git a/tests/uhci_test.in b/tests/uhci_test.in index 5ec503033..89e2c1805 100644 --- a/tests/uhci_test.in +++ b/tests/uhci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275 | arm64-efi) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index cff597ea1..5ba2c299c 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -182,6 +182,15 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" serial_port=efi0 ;; + arm-efi) + qemu=qemu-system-arm + boot=hd + console=console + trim=1 + qemuopts="-machine virt -bios /usr/share/ovmf-arm/QEMU_EFI.fd $qemuopts" + disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" + serial_port=efi0 + ;; *) boot=hd qemu=qemu-system-i386 @@ -233,7 +242,7 @@ for option in "$@"; do echo "(hd$disk) $dsk" >> "$device_map" disk="$((disk+1))" else - if [ $disk = error ]; then + if [ "$disk" = error ]; then echo "Too many disks" 1>&2 exit 1; fi @@ -370,7 +379,7 @@ if [ x$boot != xnet ] && [ x$boot != xemu ]; then ${files} >/dev/null 2>&1 fi if [ x$boot = xhd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file=" elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then device="hdb " @@ -380,7 +389,7 @@ if [ x$boot = xhd ]; then bootdev="-boot c" fi if [ x$boot = xcd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ]; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file=" elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then device="-drive if=ide,media=cdrom,file=" From efc04d65c74912972b00b1ebf15312685e317a05 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 8 Jan 2016 11:05:16 +0300 Subject: [PATCH 045/207] grub-module-verifier: fix unintended sign extension Found by: Coverity scan. CID: 156533, 156532 --- util/grub-module-verifierXX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c index 25988ebc2..f612d51f3 100644 --- a/util/grub-module-verifierXX.c +++ b/util/grub-module-verifierXX.c @@ -337,7 +337,7 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_mod /* Make sure that every section is within the core. */ if (size < grub_target_to_host (e->e_shoff) - + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) + + (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) { grub_util_error ("ELF sections outside core"); } From 8ab2675ede4313ea62cf88c22fa2760de2020423 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 8 Jan 2016 11:16:56 +0300 Subject: [PATCH 046/207] hfs: fix memory leak Found by: Coverity scan. CID: 156531 --- grub-core/fs/hfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c index 0ebc71b62..fc3683178 100644 --- a/grub-core/fs/hfs.c +++ b/grub-core/fs/hfs.c @@ -1308,6 +1308,7 @@ grub_hfs_open (struct grub_file *file, const char *name) if (grub_hfs_find_dir (data, name, &found, GRUB_FSHELP_REG)) { grub_free (data); + grub_free (found); grub_dl_unref (my_mod); return grub_errno; } From 97c41e121620796a77f04965a0c839f87eb50290 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 10:53:31 +0300 Subject: [PATCH 047/207] efiemu: fix unintended sign extension Found by: Coverity scan. CID: 73883, 73637 --- grub-core/efiemu/loadcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/efiemu/loadcore.c b/grub-core/efiemu/loadcore.c index 6968b3719..e68e7e4d1 100644 --- a/grub-core/efiemu/loadcore.c +++ b/grub-core/efiemu/loadcore.c @@ -343,7 +343,7 @@ SUFFIX (grub_efiemu_loadcore_init) (void *core, const char *filename, return grub_error (GRUB_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); /* Make sure that every section is within the core. */ - if ((grub_size_t) core_size < e->e_shoff + e->e_shentsize * e->e_shnum) + if ((grub_size_t) core_size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); From 12bf87466f80cbc2b81d64ff46b8db9d76fcbaf6 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 10:59:51 +0300 Subject: [PATCH 048/207] efiemu: change code to avoid Coverity false positive CID: 73623 --- grub-core/efiemu/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/efiemu/main.c b/grub-core/efiemu/main.c index f2140ad29..f6813b1ed 100644 --- a/grub-core/efiemu/main.c +++ b/grub-core/efiemu/main.c @@ -196,7 +196,7 @@ grub_efiemu_load_file (const char *filename) { grub_file_close (file); grub_efiemu_unload (); - return grub_errno; + return err; } grub_dprintf ("efiemu", "mm initialized\n"); From 67d9ce82acce5caa62f45cbd47b6008b76cc6e4a Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 11:05:33 +0300 Subject: [PATCH 049/207] efiemu: check return value of grub_efiemu_write_value Found by: Coverity scan. CID: 73590 --- grub-core/efiemu/prepare.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/grub-core/efiemu/prepare.c b/grub-core/efiemu/prepare.c index 84c3368a8..99ddb5abb 100644 --- a/grub-core/efiemu/prepare.c +++ b/grub-core/efiemu/prepare.c @@ -83,10 +83,16 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); /* Put pointer to the list of configuration tables in system table */ - grub_efiemu_write_value - (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, - conftable_handle, 0, 1, - sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + err = grub_efiemu_write_value + (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, + conftable_handle, 0, 1, + sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + if (err) + { + grub_efiemu_unload (); + return err; + } + SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; /* Fill the list of configuration tables */ From 57e7f1b775f6c152eff1dd88a8c1399799828112 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 13:10:10 +0300 Subject: [PATCH 050/207] setup: fix memory leak Found by: Coverity scan. CID: 73680, 73715 --- util/setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/setup.c b/util/setup.c index 8f20e9983..d74567d0a 100644 --- a/util/setup.c +++ b/util/setup.c @@ -353,6 +353,10 @@ SETUP (const char *dir, } grub_util_info ("guessed root_dev `%s' from " "dir `%s'", root_dev->disk->name, dir); + + for (cur = root_devices; *cur; cur++) + free (*cur); + free (root_devices); } grub_util_info ("setting the root device to `%s'", root); From 0e075ac3856cb14d722504e1386ebf73cd170fe9 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 13:28:42 +0300 Subject: [PATCH 051/207] util/setup: fix grub_util_path_list leak Add helper grub_util_free_path_list and use it where appropriate. Found by: Coverity scan. CID: 73727 --- include/grub/util/resolve.h | 1 + util/grub-install-common.c | 2 ++ util/mkimage.c | 10 ++-------- util/resolve.c | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/grub/util/resolve.h b/include/grub/util/resolve.h index f42df32f9..8923a6e6c 100644 --- a/include/grub/util/resolve.h +++ b/include/grub/util/resolve.h @@ -31,5 +31,6 @@ struct grub_util_path_list * grub_util_resolve_dependencies (const char *prefix, const char *dep_list_file, char *modules[]); +void grub_util_free_path_list (struct grub_util_path_list *path_list); #endif /* ! GRUB_UTIL_RESOLVE_HEADER */ diff --git a/util/grub-install-common.c b/util/grub-install-common.c index 25983089f..452b230da 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -765,6 +765,8 @@ grub_install_copy_files (const char *src, grub_install_compress_file (srcf, dstf, 1); free (dstf); } + + grub_util_free_path_list (path_list); } const char *pkglib_DATA[] = {"efiemu32.o", "efiemu64.o", diff --git a/util/mkimage.c b/util/mkimage.c index dc4046185..c3365bbbd 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -996,7 +996,7 @@ grub_install_generate_image (const char *dir, const char *prefix, size_t prefix_size = 0; char *kernel_path; size_t offset; - struct grub_util_path_list *path_list, *p, *next; + struct grub_util_path_list *path_list, *p; size_t bss_size; grub_uint64_t start_address; void *rel_section = 0; @@ -1904,11 +1904,5 @@ grub_install_generate_image (const char *dir, const char *prefix, free (kernel_path); free (rel_section); - while (path_list) - { - next = path_list->next; - free ((void *) path_list->name); - free (path_list); - path_list = next; - } + grub_util_free_path_list (path_list); } diff --git a/util/resolve.c b/util/resolve.c index 002bfbd72..3e887d2ff 100644 --- a/util/resolve.c +++ b/util/resolve.c @@ -271,3 +271,17 @@ grub_util_resolve_dependencies (const char *prefix, return prev; } } + +void +grub_util_free_path_list (struct grub_util_path_list *path_list) +{ + struct grub_util_path_list *next; + + while (path_list) + { + next = path_list->next; + free ((void *) path_list->name); + free (path_list); + path_list = next; + } +} From fa2af21ec8fd4410f6a9bb7412c6402e1b6565ca Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 13:43:04 +0300 Subject: [PATCH 052/207] gfxmenu: fix memory leak Found by: Coverity scan. CID: 73766 --- grub-core/gfxmenu/font.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/gfxmenu/font.c b/grub-core/gfxmenu/font.c index 64d52670b..756c24f20 100644 --- a/grub-core/gfxmenu/font.c +++ b/grub-core/gfxmenu/font.c @@ -45,6 +45,7 @@ grub_font_draw_string (const char *str, grub_font_t font, grub_uint32_t *logical; grub_ssize_t logical_len, visual_len; struct grub_unicode_glyph *visual, *ptr; + grub_err_t err; logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0); if (logical_len < 0) @@ -56,24 +57,28 @@ grub_font_draw_string (const char *str, grub_font_t font, if (visual_len < 0) return grub_errno; + err = GRUB_ERR_NONE; for (ptr = visual, x = left_x; ptr < visual + visual_len; ptr++) { - grub_err_t err; struct grub_font_glyph *glyph; glyph = grub_font_construct_glyph (font, ptr); if (!glyph) - return grub_errno; + { + err = grub_errno; + goto out; + } err = grub_font_draw_glyph (glyph, color, x, baseline_y); - x += glyph->device_width; if (err) - return err; + goto out; + x += glyph->device_width; } +out: for (ptr = visual; ptr < visual + visual_len; ptr++) grub_unicode_destroy_glyph (ptr); grub_free (visual); - return GRUB_ERR_NONE; + return err; } /* Get the width in pixels of the specified UTF-8 string, when rendered in From d5cc487d3963a65e87ac7d816b390afcd3ffabf0 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 13:49:37 +0300 Subject: [PATCH 053/207] grub-probe: fix memory leak Found by: Coverity scan. CID: 73783 --- util/grub-probe.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/grub-probe.c b/util/grub-probe.c index b1f533626..36b7f8bcb 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -668,6 +668,13 @@ probe (const char *path, char **device_names, char delim) for (curdrive = drives_names; *curdrive; curdrive++) free (*curdrive); free (drives_names); + + if (path != NULL) + { + for (curdev = device_names; *curdev; curdev++) + free (*curdev); + free (device_names); + } } static struct argp_option options[] = { From 725548a2855e357cd5cd243dddef355295e63110 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 14:13:36 +0300 Subject: [PATCH 054/207] grub-mklayout: check subscript bounds Found by: Coverity scan. CID: 73686 --- util/grub-mklayout.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c index 1a4f1b4c8..d171c2700 100644 --- a/util/grub-mklayout.c +++ b/util/grub-mklayout.c @@ -384,6 +384,13 @@ write_keymaps (FILE *in, FILE *out, const char *out_filename) sscanf (line, "keycode %u = %60s %60s %60s %60s", &keycode_linux, normal, shift, normalalt, shiftalt); + if (keycode_linux >= ARRAY_SIZE (linux_to_usb_map)) + { + /* TRANSLATORS: scan code is keyboard key numeric identifier. */ + fprintf (stderr, _("Unknown keyboard scan code 0x%02x\n"), keycode_linux); + continue; + } + /* Not used. */ if (keycode_linux == 0x77 /* Pause */ /* Some obscure keys */ From bd60f5a207f9d8e594520d32f909aafdb4f5fffb Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 18:15:27 +0300 Subject: [PATCH 055/207] rescue_parser: restructure code to avoid Coverity false positive If line contains single word, line and argv[0] are aliases, so no NULL dereference is possible, but Coverity does not know it. Change code to avoid ambiguity and also remove redundant call to grub_strchr. CID: 86725 --- grub-core/kern/rescue_parser.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/grub-core/kern/rescue_parser.c b/grub-core/kern/rescue_parser.c index ab3d04160..633836699 100644 --- a/grub-core/kern/rescue_parser.c +++ b/grub-core/kern/rescue_parser.c @@ -43,13 +43,17 @@ grub_rescue_parse_line (char *line, /* In case of an assignment set the environment accordingly instead of calling a function. */ - if (n == 1 && grub_strchr (line, '=')) + if (n == 1) { char *val = grub_strchr (args[0], '='); - val[0] = 0; - grub_env_set (args[0], val + 1); - val[0] = '='; - goto quit; + + if (val) + { + val[0] = 0; + grub_env_set (args[0], val + 1); + val[0] = '='; + goto quit; + } } /* Get the command name. */ @@ -72,6 +76,7 @@ grub_rescue_parse_line (char *line, } quit: + /* Arguments are returned in single memory chunk separated by zeroes */ grub_free (args[0]); grub_free (args); From aafd205c926df01b039e588134e3798913bcbe3f Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 18:55:55 +0300 Subject: [PATCH 056/207] xfs: fix possible inode corruption in directory scan grub_xfs_iterate_dir did not restore first character after inline name when match was found. Dependning on XFS format this character could be inode number and we could return to the same node later in find_file if processing cycled symlinks. CID: 86724 --- grub-core/fs/xfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index a03526b32..ca9c0c37a 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -775,7 +775,10 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, c = de->name[de->len]; de->name[de->len] = '\0'; if (iterate_dir_call_hook (ino, de->name, &ctx)) - return 1; + { + de->name[de->len] = c; + return 1; + } de->name[de->len] = c; de = grub_xfs_inline_next_de(dir->data, head, de); From 9fecb0588ee9a8059a75fb3ec9acf3948b54e4f9 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 19:41:26 +0300 Subject: [PATCH 057/207] kern/elf: fix unintended sign extension Found by: Coverity scan. CID: 73729, 73735, 73758, 73760 --- grub-core/kern/elfXX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/elfXX.c b/grub-core/kern/elfXX.c index b91c39d9e..1859d1880 100644 --- a/grub-core/kern/elfXX.c +++ b/grub-core/kern/elfXX.c @@ -12,7 +12,7 @@ grub_elfXX_load_phdrs (grub_elf_t elf) if (elf->phdrs) return GRUB_ERR_NONE; - phdrs_size = elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; + phdrs_size = (grub_uint32_t) elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", (unsigned long long) elf->ehdr.ehdrXX.e_phoff, From 31f6506c57b976148fd1d3d4e72943712b6e0c8d Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 19:58:51 +0300 Subject: [PATCH 058/207] loader/multiboot: fix unintended sign extension Found by: Coveruty scan. CID: 73700, 73763 --- grub-core/loader/multiboot_elfxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c index 6a220bdc1..a7bebcb3c 100644 --- a/grub-core/loader/multiboot_elfxx.c +++ b/grub-core/loader/multiboot_elfxx.c @@ -72,7 +72,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) + if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); phdr_base = (char *) buffer + ehdr->e_phoff; From dc27d254f2cb7f4b0fef52fb8c9e9f89881b1f4c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 20:54:54 +0300 Subject: [PATCH 059/207] util/getroot: delete dead code is_part cannot be non-zero at this point. Found by: Coveruty scan. CID: 73838 --- util/getroot.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/util/getroot.c b/util/getroot.c index 36f1730c0..92c0d709b 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -383,9 +383,6 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_info ("%s starts from %" GRUB_HOST_PRIuLONG_LONG, os_dev, (unsigned long long) ctx.start); - if (ctx.start == 0 && !is_part) - return name; - grub_util_info ("opening the device %s", name); disk = grub_disk_open (name); free (name); From 670c43af27dee281bb61e2a50855b61f96b7e1fa Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 21:05:44 +0300 Subject: [PATCH 060/207] mkimage: fix unintended sign extension Found by: Coverity scan. CID: 73691, 73717 --- util/grub-mkimagexx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index a1ddc6269..0e0c6f7a1 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -1465,7 +1465,7 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, section_entsize = grub_target_to_host16 (e->e_shentsize); num_sections = grub_target_to_host16 (e->e_shnum); - if (kernel_size < section_offset + section_entsize * num_sections) + if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections) grub_util_error (_("premature end of file %s"), kernel_path); sections = (Elf_Shdr *) (kernel_img + section_offset); From 5a5a3c69630ea117f54c07e891007fe3374581ba Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 21:25:22 +0300 Subject: [PATCH 061/207] setup: fix NULL pointer dereference Check return value of grub_guess_root_devices Found by: Coverity scan. CID: 73638, 73751 --- util/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/setup.c b/util/setup.c index d74567d0a..8aa5a39a7 100644 --- a/util/setup.c +++ b/util/setup.c @@ -312,6 +312,9 @@ SETUP (const char *dir, char **cur; int found = 0; + if (!root_devices) + grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), dir); + for (cur = root_devices; *cur; cur++) { char *drive; From 269a522c7db1f383ccf0998a7cf9c4b1797ea0d9 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 10 Jan 2016 10:41:04 +0300 Subject: [PATCH 062/207] hostdisk: fix device detection Condition was apparently reversed so GRUB assumed all devices were files. This later made it skip BLKFLSBUF ioctl on Linux which caused various page cache coherency issues. Observed were - failure to validate blocklist install (read content did not match just written) - failure to detect Linux MD on disk after online hot addition (GRUB got stale superblock) Closes: 46691 --- grub-core/kern/emu/hostdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 610518d0c..87e3e2512 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -161,9 +161,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) { struct stat st; # if GRUB_DISK_DEVS_ARE_CHAR - if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) + if (fstat (fd, &st) >= 0 && S_ISCHR (st.st_mode)) # else - if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) + if (fstat (fd, &st) >= 0 && S_ISBLK (st.st_mode)) # endif data->is_disk = 1; } From 528256932b8586587c7b339418d3865206717b60 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 10 Jan 2016 11:33:13 +0300 Subject: [PATCH 063/207] net: remove dead and redundant code server cannot be NULL at this point (we return error earlier if it is). Also structure is zalloc'ed, so no need to explicitly initialize members to 0. Found by: Coverity scan. CID: 73837 --- grub-core/net/net.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index a0472d5d4..85b0cf774 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1322,20 +1322,13 @@ grub_net_open_real (const char *name) if (!ret) return NULL; ret->protocol = proto; - if (server) + ret->server = grub_strdup (server); + if (!ret->server) { - ret->server = grub_strdup (server); - if (!ret->server) - { - grub_free (ret); - return NULL; - } + grub_free (ret); + return NULL; } - else - ret->server = NULL; ret->fs = &grub_net_fs; - ret->offset = 0; - ret->eof = 0; return ret; } } From 962b69d9503bdd91120d2c0fcfd17ae6d37db71c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 10 Jan 2016 11:51:34 +0300 Subject: [PATCH 064/207] grub-mkimage: remove redundant NULL check Found by: Coverity scan. CID: 73737 --- util/grub-mkimage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c index 1e0bcf1bf..10375f4d2 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -304,8 +304,7 @@ main (int argc, char *argv[]) grub_util_file_sync (fp); fclose (fp); - if (arguments.dir) - free (arguments.dir); + free (arguments.dir); if (arguments.output) free (arguments.output); From 66768b99f15033bf55bc6c360cae6a6660be5c5f Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 10 Jan 2016 16:08:06 +0300 Subject: [PATCH 065/207] grub-install: include ehci in list of native modules This matches behavior of "nativedisk" command. Reported and tested by Smith Henry --- util/grub-install.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/grub-install.c b/util/grub-install.c index eabd6de4d..6c89c2b0c 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1282,6 +1282,7 @@ main (int argc, char *argv[]) grub_install_push_module ("ahci"); grub_install_push_module ("ohci"); grub_install_push_module ("uhci"); + grub_install_push_module ("ehci"); grub_install_push_module ("usbms"); } else if (disk_module && disk_module[0]) From 8fe17d91afc610d99458102a2a81abfdd542f4c0 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 20:26:30 +0300 Subject: [PATCH 066/207] acpi: fix memory leak Found by: Coverity scan. CID: 96673 --- grub-core/commands/acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index ece49b4a9..b5c2f27c1 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -593,6 +593,9 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) if (! table->addr) { free_tables (); + grub_free (exclude); + grub_free (load_only); + grub_free (table); return grub_errno; } table->next = acpi_tables; From 1bff60e5aac71552aafe0dc5e08ff62ef32ee711 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 20:37:43 +0300 Subject: [PATCH 067/207] nativedisk: fix memory leak Based on Coverity scan. CID: 96660 Extended to also cover other error return places. --- grub-core/commands/nativedisk.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/grub-core/commands/nativedisk.c b/grub-core/commands/nativedisk.c index b3bc4639c..345f97c4d 100644 --- a/grub-core/commands/nativedisk.c +++ b/grub-core/commands/nativedisk.c @@ -198,7 +198,10 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), return grub_errno; if (get_uuid (NULL, &uuid_root, 0)) - return grub_errno; + { + grub_free (mods); + return grub_errno; + } prefdev = grub_file_get_device_name (prefix); if (grub_errno) @@ -210,6 +213,8 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), if (get_uuid (prefdev, &uuid_prefix, 0)) { grub_free (uuid_root); + grub_free (prefdev); + grub_free (mods); return grub_errno; } @@ -289,12 +294,15 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), } grub_free (uuid_root); grub_free (uuid_prefix); + grub_free (prefdev); + grub_free (mods); return GRUB_ERR_NONE; fail: grub_free (uuid_root); grub_free (uuid_prefix); + grub_free (prefdev); for (i = 0; i < mods_loaded; i++) if (mods[i]) @@ -302,6 +310,8 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), mods[i]->fini = 0; grub_dl_unload (mods[i]); } + grub_free (mods); + return grub_errno; } From 5db2190f2cd12706d1df00303dc9eaf7a78b08e1 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 20:41:44 +0300 Subject: [PATCH 068/207] parttool: fix memory leak Found by: Coverity scan. CID: 96652 --- grub-core/commands/parttool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c index 42c590e1a..693e2cb42 100644 --- a/grub-core/commands/parttool.c +++ b/grub-core/commands/parttool.c @@ -283,6 +283,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), } if (! cur) { + grub_free (parsed); grub_device_close (dev); return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), args[i]); From f3c84fa79847ee365742153a2f3cd47e678aef4a Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 20:53:26 +0300 Subject: [PATCH 069/207] password_pbkdf2: fix memory leak Found by: Coverity scan. CID: 96656 --- grub-core/commands/password_pbkdf2.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/grub-core/commands/password_pbkdf2.c b/grub-core/commands/password_pbkdf2.c index c6a77c8c5..da636e621 100644 --- a/grub-core/commands/password_pbkdf2.c +++ b/grub-core/commands/password_pbkdf2.c @@ -45,6 +45,7 @@ check_password (const char *user, const char *entered, void *pin) grub_uint8_t *buf; struct pbkdf2_password *pass = pin; gcry_err_code_t err; + grub_err_t ret; buf = grub_malloc (pass->buflen); if (!buf) @@ -55,17 +56,17 @@ check_password (const char *user, const char *entered, void *pin) pass->salt, pass->saltlen, pass->c, buf, pass->buflen); if (err) + ret = grub_crypto_gcry_error (err); + else if (grub_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) + ret = GRUB_ACCESS_DENIED; + else { - grub_free (buf); - return grub_crypto_gcry_error (err); + grub_auth_authenticate (user); + ret = GRUB_ERR_NONE; } - if (grub_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) - return GRUB_ACCESS_DENIED; - - grub_auth_authenticate (user); - - return GRUB_ERR_NONE; + grub_free (buf); + return ret; } static inline int From 6c35ce72bad698051f82b087cd026f8e5331f915 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:10:12 +0300 Subject: [PATCH 070/207] verify: fix memory leak Found by: Coverity scan. CID: 96643 --- grub-core/commands/verify.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c index 9620a3b4c..67cb1c785 100644 --- a/grub-core/commands/verify.c +++ b/grub-core/commands/verify.c @@ -324,19 +324,19 @@ grub_load_public_key (grub_file_t f) if (grub_file_read (f, &l, sizeof (l)) != sizeof (l)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } lb = (grub_be_to_cpu16 (l) + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT; if (lb > READBUF_SIZE - sizeof (grub_uint16_t)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } if (grub_file_read (f, buffer + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } grub_memcpy (buffer, &l, sizeof (l)); @@ -346,10 +346,16 @@ grub_load_public_key (grub_file_t f) buffer, lb + sizeof (grub_uint16_t), 0)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } } + if (i < pkalgos[pk].nmpipub) + { + grub_free (sk); + goto fail; + } + GRUB_MD_SHA1->final (fingerprint_context); grub_memcpy (sk->fingerprint, GRUB_MD_SHA1->read (fingerprint_context), 20); From e9d71db53a1f3e14abfdcf879f734ce1211175f0 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:16:34 +0300 Subject: [PATCH 071/207] efidisk: fix memory leak Found by: Coverity scan. CID: 96644 --- grub-core/disk/efi/efidisk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index a8783a3c1..1c00e3ec8 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -85,6 +85,12 @@ make_devices (void) { /* Uggh. */ grub_free (handles); + while (devices) + { + d = devices->next; + grub_free (devices); + devices = d; + } return 0; } From dbb0f9fa4fe7a9c3721178edf2421825dce5ad07 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:25:40 +0300 Subject: [PATCH 072/207] efiemu: fix memory leak Found by: Coverity scan. CID: 156610 --- grub-core/efiemu/loadcore.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/efiemu/loadcore.c b/grub-core/efiemu/loadcore.c index e68e7e4d1..44085ef81 100644 --- a/grub-core/efiemu/loadcore.c +++ b/grub-core/efiemu/loadcore.c @@ -154,7 +154,10 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE : GRUB_EFI_RUNTIME_SERVICES_DATA); if (seg->handle < 0) - return grub_errno; + { + grub_free (seg); + return grub_errno; + } seg->off = 0; } From a4b1326f0d0382be62bb224ea5532ab3fae1b440 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:33:34 +0300 Subject: [PATCH 073/207] gfxmenu: fix memory leak Found by: Coverity scan. CID: 96657 --- grub-core/gfxmenu/gfxmenu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/gfxmenu/gfxmenu.c b/grub-core/gfxmenu/gfxmenu.c index f49fce802..8a17dda2c 100644 --- a/grub-core/gfxmenu/gfxmenu.c +++ b/grub-core/gfxmenu/gfxmenu.c @@ -63,14 +63,14 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested) return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "theme"); - instance = grub_zalloc (sizeof (*instance)); - if (!instance) - return grub_errno; - err = grub_video_get_info (&mode_info); if (err) return err; + instance = grub_zalloc (sizeof (*instance)); + if (!instance) + return grub_errno; + if (theme_path[0] != '/' && theme_path[0] != '(') { const char *prefix; From 9daf7aae8b917155b253951b83cbc8e5bed7f636 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:41:48 +0300 Subject: [PATCH 074/207] truecrypt: fix memory leak Found by: Coverity scan. CID: 156611 --- grub-core/loader/i386/pc/truecrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/pc/truecrypt.c b/grub-core/loader/i386/pc/truecrypt.c index 159eab1a7..9ea4fde42 100644 --- a/grub-core/loader/i386/pc/truecrypt.c +++ b/grub-core/loader/i386/pc/truecrypt.c @@ -205,7 +205,7 @@ grub_cmd_truecrypt (grub_command_t cmd __attribute__ ((unused)), fail: if (!grub_errno) - return grub_error (GRUB_ERR_BAD_OS, "bad truecrypt ISO"); + grub_error (GRUB_ERR_BAD_OS, "bad truecrypt ISO"); if (file) grub_file_close (file); From 29862fdc3a921b9d3cf34ae15e779907d554b6ce Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 21:43:43 +0300 Subject: [PATCH 075/207] xnu: fix memory leak Found by: Coverity scan. CID: 96663 --- grub-core/loader/i386/xnu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index 2fe1fdc1f..a4a6f932e 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -338,7 +338,7 @@ grub_xnu_devprop_add_property_utf16 (struct grub_xnu_devprop_device_descriptor * utf8 = grub_malloc (namelen * 4 + 1); if (!utf8) { - grub_free (utf8); + grub_free (utf16); return grub_errno; } From 26533fe6bca59e340fe33c658c0a3c8aca3f04ff Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 22:36:53 +0300 Subject: [PATCH 076/207] normal: fix memory leak Found by: Coverity scan. CID: 96641, 96670, 96667 --- grub-core/normal/menu_entry.c | 7 ++++++- grub-core/normal/term.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c index 2b732250d..b80d161dd 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -476,7 +476,10 @@ insert_string (struct screen *screen, const char *s, int update) (grub_uint8_t *) s, (p - s), 0); if (! ensure_space (current_linep, size)) - return 0; + { + grub_free (unicode_msg); + return 0; + } grub_memmove (current_linep->buf + screen->column + size, current_linep->buf + screen->column, @@ -1265,6 +1268,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (! screen->lines[i].pos) { grub_print_error (); + destroy_screen (screen); grub_errno = GRUB_ERR_NONE; return; } @@ -1274,6 +1278,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (!screen->terms) { grub_print_error (); + destroy_screen (screen); grub_errno = GRUB_ERR_NONE; return; } diff --git a/grub-core/normal/term.c b/grub-core/normal/term.c index 4c2238b25..ac5d69f0f 100644 --- a/grub-core/normal/term.c +++ b/grub-core/normal/term.c @@ -77,8 +77,6 @@ print_more (void) grub_term_output_t term; grub_uint32_t *unicode_str, *unicode_last_position; - pos = grub_term_save_pos (); - /* TRANSLATORS: This has to fit on one line. It's ok to include few words but don't write poems. */ grub_utf8_to_ucs4_alloc (_("--MORE--"), &unicode_str, @@ -90,6 +88,8 @@ print_more (void) return; } + pos = grub_term_save_pos (); + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); FOR_ACTIVE_TERM_OUTPUTS(term) From b95e92678882f56056c64ae29092bc9cf129905f Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 12 Jan 2016 22:50:30 +0300 Subject: [PATCH 077/207] script: fix memory leak Found by: Coverity scan. CID: 96637 --- grub-core/script/execute.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c index bb70ebf17..a8502d907 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -681,18 +681,14 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, } *op = '\0'; - if (grub_script_argv_append (&result, p, op - p)) - { - grub_free (p); - need_cleanup = 1; - /* Fall through to cleanup */ - } + need_cleanup = grub_script_argv_append (&result, p, op - p); + grub_free (p); + /* Fall through to cleanup */ } else { - if (append (&result, values[i], 1)) - need_cleanup = 1; - /* Fall through to cleanup */ + need_cleanup = append (&result, values[i], 1); + /* Fall through to cleanup */ } } From 4f8fe948b95d662cdf02effcda6cdfff36b1c4b1 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 13 Jan 2016 20:15:07 +0300 Subject: [PATCH 078/207] loader: Unintended sign extension CID: 96707, 96699, 96693, 96691, 96711, 96709, 96708, 96703, 96702, 96700, 96698, 96696, 96695, 96692, 96710, 96705 --- grub-core/kern/dl.c | 2 +- grub-core/loader/i386/bsdXX.c | 24 ++++++++++++------------ grub-core/loader/multiboot_elfxx.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 3a438e92f..59a6ef4ca 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -605,7 +605,7 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size) } /* Make sure that every section is within the core. */ - if (size < e->e_shoff + e->e_shentsize * e->e_shnum) + if (size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) { grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core"); return 0; diff --git a/grub-core/loader/i386/bsdXX.c b/grub-core/loader/i386/bsdXX.c index 9f57cfa82..0d14deeb7 100644 --- a/grub-core/loader/i386/bsdXX.c +++ b/grub-core/loader/i386/bsdXX.c @@ -48,15 +48,15 @@ read_headers (grub_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) if (e->e_ident[EI_CLASS] != SUFFIX (ELFCLASS)) return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - *shdr = grub_malloc (e->e_shnum * e->e_shentsize); + *shdr = grub_malloc ((grub_uint32_t) e->e_shnum * e->e_shentsize); if (! *shdr) return grub_errno; if (grub_file_seek (file, e->e_shoff) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, *shdr, e->e_shnum * e->e_shentsize) - != e->e_shnum * e->e_shentsize) + if (grub_file_read (file, *shdr, (grub_uint32_t) e->e_shnum * e->e_shentsize) + != (grub_uint32_t) e->e_shnum * e->e_shentsize) { if (grub_errno) return grub_errno; @@ -200,8 +200,8 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, if (chunk_size < sizeof (e)) chunk_size = sizeof (e); - chunk_size += e.e_phnum * e.e_phentsize; - chunk_size += e.e_shnum * e.e_shentsize; + chunk_size += (grub_uint32_t) e.e_phnum * e.e_phentsize; + chunk_size += (grub_uint32_t) e.e_shnum * e.e_shentsize; { grub_relocator_chunk_t ch; @@ -253,14 +253,14 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, curload = module + sizeof (e); load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_shoff, - e.e_shnum * e.e_shentsize); + (grub_uint32_t) e.e_shnum * e.e_shentsize); e.e_shoff = curload - module; - curload += e.e_shnum * e.e_shentsize; + curload += (grub_uint32_t) e.e_shnum * e.e_shentsize; load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_phoff, - e.e_phnum * e.e_phentsize); + (grub_uint32_t) e.e_phnum * e.e_phentsize); e.e_phoff = curload - module; - curload += e.e_phnum * e.e_phentsize; + curload += (grub_uint32_t) e.e_phnum * e.e_phentsize; *kern_end = curload; @@ -462,7 +462,7 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, chunk_size = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) + ALIGN_UP (strsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + e.e_shnum * e.e_shentsize; + + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; symtarget = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t)); { @@ -498,10 +498,10 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, s2 = (Elf_Shdr *) curload; grub_memcpy (curload, s, e.e_shentsize); if (s == symsh) - s2->sh_offset = sizeof (e) + e.e_shnum * e.e_shentsize; + s2->sh_offset = sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; else if (s == strsh) s2->sh_offset = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + e.e_shnum * e.e_shentsize; + + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; else s2->sh_offset = 0; s2->sh_addr = s2->sh_offset; diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c index a7bebcb3c..e3a39b609 100644 --- a/grub-core/loader/multiboot_elfxx.c +++ b/grub-core/loader/multiboot_elfxx.c @@ -164,7 +164,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi { grub_uint8_t *shdr, *shdrptr; - shdr = grub_malloc (ehdr->e_shnum * ehdr->e_shentsize); + shdr = grub_malloc ((grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize); if (!shdr) return grub_errno; @@ -174,7 +174,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi return grub_errno; } - if (grub_file_read (file, shdr, ehdr->e_shnum * ehdr->e_shentsize) + if (grub_file_read (file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) != (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize) { if (!grub_errno) From eefa3239c2aa9531e45a9a3a98cb605b2b563827 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 16 Jan 2016 20:34:02 +0300 Subject: [PATCH 079/207] legacycfg: fix memory leaks and add NULL check Memory leaks found by Coverity scan. CID: 96642, 96645 --- grub-core/commands/legacycfg.c | 43 +++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c index d42d7779e..dd9d9f18f 100644 --- a/grub-core/commands/legacycfg.c +++ b/grub-core/commands/legacycfg.c @@ -253,6 +253,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), struct grub_command *cmd; char **cutargs; int cutargc; + grub_err_t err = GRUB_ERR_NONE; for (i = 0; i < 2; i++) { @@ -314,6 +315,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); cutargs = grub_malloc (sizeof (cutargs[0]) * (argc - 1)); + if (!cutargs) + return grub_errno; cutargc = argc - 1; grub_memcpy (cutargs + 1, args + 2, sizeof (cutargs[0]) * (argc - 2)); cutargs[0] = args[0]; @@ -333,7 +336,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, cutargc, cutargs)) { kernel_type = LINUX; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -348,7 +351,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, argc, args)) { kernel_type = MULTIBOOT; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -413,7 +416,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, cutargc, cutargs)) { kernel_type = KFREEBSD; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -422,6 +425,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), char **bsdargs; int bsdargc; char bsddevname[sizeof ("wdXXXXXXXXXXXXY")]; + int found = 0; + if (bsd_device == -1) { bsdargs = cutargs; @@ -432,6 +437,11 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), char rbuf[3] = "-r"; bsdargc = cutargc + 2; bsdargs = grub_malloc (sizeof (bsdargs[0]) * bsdargc); + if (!bsdargs) + { + err = grub_errno; + goto out; + } grub_memcpy (bsdargs, args, argc * sizeof (bsdargs[0])); bsdargs[argc] = rbuf; bsdargs[argc + 1] = bsddevname; @@ -447,7 +457,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, bsdargc, bsdargs)) { kernel_type = KNETBSD; - return GRUB_ERR_NONE; + found = 1; + goto free_bsdargs; } } grub_errno = GRUB_ERR_NONE; @@ -460,20 +471,28 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, bsdargc, bsdargs)) { kernel_type = KOPENBSD; - return GRUB_ERR_NONE; + found = 1; + goto free_bsdargs; } } grub_errno = GRUB_ERR_NONE; } + +free_bsdargs: if (bsdargs != cutargs) grub_free (bsdargs); + if (found) + goto out; } } } while (0); - return grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", - args[0]); + err = grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", + args[0]); +out: + grub_free (cutargs); + return err; } static grub_err_t @@ -534,15 +553,17 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused char **newargs; grub_err_t err; char nounzipbuf[10] = "--nounzip"; + + cmd = grub_command_find ("module"); + if (!cmd) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "module"); + newargs = grub_malloc ((argc + 1) * sizeof (newargs[0])); if (!newargs) return grub_errno; grub_memcpy (newargs + 1, args, argc * sizeof (newargs[0])); newargs[0] = nounzipbuf; - cmd = grub_command_find ("module"); - if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), - "module"); err = cmd->func (cmd, argc + 1, newargs); grub_free (newargs); From 9b4256bf059f30e3f707cd3eb0d8e6db96b19a3f Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 16 Jan 2016 20:48:33 +0300 Subject: [PATCH 080/207] net: fix memory leaks Found by: Coverity scan. CID: 96638, 96648 --- grub-core/net/net.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 85b0cf774..d07029b34 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -299,12 +299,6 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, char *ptr; grub_net_network_level_address_t addr; - name = grub_malloc (grub_strlen (card->name) - + GRUB_NET_MAX_STR_HWADDR_LEN - + sizeof (":link")); - if (!name) - return NULL; - addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; addr.ipv6[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48); addr.ipv6[1] = grub_net_ipv6_get_id (hwaddr); @@ -317,6 +311,12 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, return inf; } + name = grub_malloc (grub_strlen (card->name) + + GRUB_NET_MAX_STR_HWADDR_LEN + + sizeof (":link")); + if (!name) + return NULL; + ptr = grub_stpcpy (name, card->name); if (grub_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) { @@ -1421,7 +1421,10 @@ grub_net_fs_open (struct grub_file *file_out, const char *name) file->device->net->packs.last = NULL; file->device->net->name = grub_strdup (name); if (!file->device->net->name) - return grub_errno; + { + grub_free (file); + return grub_errno; + } err = file->device->net->protocol->open (file, name); if (err) From d4561cd080b6511e62bfbf27f443262fd7a5e5be Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 16 Jan 2016 20:59:50 +0300 Subject: [PATCH 081/207] tcp: fix memory leaks Found by: Coverity scan. CID: 96639, 96647 --- grub-core/net/tcp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c index 576f68498..e8ad34b84 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -606,10 +606,15 @@ grub_net_tcp_open (char *server, nb = grub_netbuff_alloc (sizeof (*tcph) + 128); if (!nb) - return NULL; + { + grub_free (socket); + return NULL; + } + err = grub_netbuff_reserve (nb, 128); if (err) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } @@ -617,12 +622,14 @@ grub_net_tcp_open (char *server, err = grub_netbuff_put (nb, sizeof (*tcph)); if (err) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } socket->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); if (!socket->pq) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } @@ -978,6 +985,7 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, cmp); if (!sock->pq) { + grub_free (sock); grub_netbuff_free (nb); return grub_errno; } From 77002c65d3532384682dd1ac861f4349089c5704 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 16 Jan 2016 21:27:57 +0300 Subject: [PATCH 082/207] tftp: fix memory leaks in open If protocol open fails, file is immediately freed, so data was leaked. Found by: Coverity scan. CID: 96659 --- grub-core/net/tftp.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index 1319671ff..7d90bf66e 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -326,7 +326,10 @@ tftp_open (struct grub_file *file, const char *filename) grub_netbuff_reserve (&nb, 1500); err = grub_netbuff_push (&nb, sizeof (*tftph)); if (err) - return err; + { + grub_free (data); + return err; + } tftph = (struct tftphdr *) nb.data; @@ -361,19 +364,26 @@ tftp_open (struct grub_file *file, const char *filename) err = grub_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); if (err) - return err; + { + grub_free (data); + return err; + } file->not_easily_seekable = 1; file->data = data; data->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); if (!data->pq) - return grub_errno; + { + grub_free (data); + return grub_errno; + } err = grub_net_resolve_address (file->device->net->server, &addr); if (err) { destroy_pq (data); + grub_free (data); return err; } @@ -383,6 +393,7 @@ tftp_open (struct grub_file *file, const char *filename) if (!data->sock) { destroy_pq (data); + grub_free (data); return grub_errno; } @@ -396,6 +407,7 @@ tftp_open (struct grub_file *file, const char *filename) { grub_net_udp_close (data->sock); destroy_pq (data); + grub_free (data); return err; } grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), @@ -412,6 +424,7 @@ tftp_open (struct grub_file *file, const char *filename) { grub_net_udp_close (data->sock); destroy_pq (data); + grub_free (data); return grub_errno; } From f826d914e2fc390b6e7b6767e6aefcea8dbe95a7 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 16 Jan 2016 21:47:28 +0300 Subject: [PATCH 083/207] grub-probe: fix memory leak Found by: Coverity scan. CID: 73783 --- util/grub-probe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/grub-probe.c b/util/grub-probe.c index 36b7f8bcb..8ac527d2f 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -279,7 +279,7 @@ probe (const char *path, char **device_names, char delim) printf ("%s", *curdev); putchar (delim); } - return; + goto free_device_names; } if (print == PRINT_DISK) @@ -297,7 +297,7 @@ probe (const char *path, char **device_names, char delim) putchar (delim); free (disk); } - return; + goto free_device_names; } for (curdev = device_names; *curdev; curdev++) @@ -669,6 +669,7 @@ probe (const char *path, char **device_names, char delim) free (*curdrive); free (drives_names); +free_device_names: if (path != NULL) { for (curdev = device_names; *curdev; curdev++) From 95440b41d33c30ebd12d16f042d60ca700a8f4d8 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 16 Jan 2016 20:37:15 +0000 Subject: [PATCH 084/207] ahci, ehci: Fix typos --- grub-core/bus/usb/ehci.c | 2 +- grub-core/disk/ahci.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c index 8ece40086..c986c24f6 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -1121,7 +1121,7 @@ grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, token = grub_le_to_cpu32 (td->token); to_transfer = (token & GRUB_EHCI_TOTAL_MASK) >> GRUB_EHCI_TOTAL_OFF; - /* Check state of TD - if it did not transfered + /* Check state of TD - if it did not transfer * whole data then set last_trans - it should be last executed TD * in case when something went wrong. */ if (transfer && (td->size != to_transfer)) diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c index fc640d5d4..494a1b773 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -32,7 +32,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct grub_ahci_cmd_head { grub_uint32_t config; - grub_uint32_t transfered; + grub_uint32_t transferred; grub_uint64_t command_table_base; grub_uint32_t unused[4]; }; @@ -954,7 +954,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, grub_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); - dev->command_list[0].transfered = 0; + dev->command_list[0].transferred = 0; dev->command_list[0].command_table_base = grub_dma_get_phys (dev->command_table_chunk); @@ -1044,7 +1044,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, dev->hba->ports[dev->port].command_issue, dev->hba->ports[dev->port].intstatus, dev->hba->ports[dev->port].task_file_data, - dev->command_list[0].transfered, + dev->command_list[0].transferred, dev->hba->ports[dev->port].sata_error, ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x00], ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x18]); From 92bbf2571463e230682406a9d631580f928af11f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 16 Jan 2016 20:40:55 +0000 Subject: [PATCH 085/207] loader/bsd: Fix signed/unsigned comparison --- grub-core/loader/i386/bsdXX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/bsdXX.c b/grub-core/loader/i386/bsdXX.c index 0d14deeb7..af6741d15 100644 --- a/grub-core/loader/i386/bsdXX.c +++ b/grub-core/loader/i386/bsdXX.c @@ -56,7 +56,7 @@ read_headers (grub_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) return grub_errno; if (grub_file_read (file, *shdr, (grub_uint32_t) e->e_shnum * e->e_shentsize) - != (grub_uint32_t) e->e_shnum * e->e_shentsize) + != (grub_ssize_t) ((grub_uint32_t) e->e_shnum * e->e_shentsize)) { if (grub_errno) return grub_errno; From 47e67d809cca22b77ea73ab4dbe04cfd5b11bae1 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 20 Jan 2016 15:56:55 +0000 Subject: [PATCH 086/207] Remove pragmas related to -Wunreachable-code -Wunreachable-code has been a no-op since GCC 4.5; GRUB hasn't been compiled with it since 2012; and GCC 6 produces "error: '-Wunreachable-code' is not an option that controls warnings" for these. Fixes Debian bug #812047. --- grub-core/lib/pbkdf2.c | 1 - grub-core/script/parser.y | 1 - 2 files changed, 2 deletions(-) diff --git a/grub-core/lib/pbkdf2.c b/grub-core/lib/pbkdf2.c index 01cee3951..28aa96c46 100644 --- a/grub-core/lib/pbkdf2.c +++ b/grub-core/lib/pbkdf2.c @@ -31,7 +31,6 @@ GRUB_MOD_LICENSE ("GPLv2+"); desired derived output length DKLEN. Output buffer is DK which must have room for at least DKLEN octets. The output buffer will be filled with the derived data. */ -#pragma GCC diagnostic ignored "-Wunreachable-code" gcry_err_code_t grub_crypto_pbkdf2 (const struct gcry_md_spec *md, diff --git a/grub-core/script/parser.y b/grub-core/script/parser.y index 1d60e9de2..4f0ab8319 100644 --- a/grub-core/script/parser.y +++ b/grub-core/script/parser.y @@ -30,7 +30,6 @@ #include "grub_script.tab.h" -#pragma GCC diagnostic ignored "-Wunreachable-code" #pragma GCC diagnostic ignored "-Wmissing-declarations" %} From 7c6c2ad42c3a3a2cbe73ef7808cc6b85fc895ac0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 8 Jan 2016 16:22:19 +0100 Subject: [PATCH 087/207] i386-ieee1275: Increase maximum heap size to accomodate highres graphi tests --- grub-core/kern/ieee1275/init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c index 4303509f2..12590225e 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -46,11 +46,19 @@ #define HEAP_MIN_SIZE (unsigned long) (2 * 1024 * 1024) /* The maximum heap size we're going to claim */ +#ifdef __i386__ +#define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) +#else #define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) +#endif /* If possible, we will avoid claiming heap above this address, because it seems to cause relocation problems with OSes that link at 4 MiB */ +#ifdef __i386__ +#define HEAP_MAX_ADDR (unsigned long) (64 * 1024 * 1024) +#else #define HEAP_MAX_ADDR (unsigned long) (32 * 1024 * 1024) +#endif extern char _start[]; extern char _end[]; From cc2ed410391773c2b6f094d9d699ac219adbc499 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 8 Jan 2016 16:22:47 +0100 Subject: [PATCH 088/207] arm: Ignore qemu clock bug --- grub-core/tests/sleep_test.c | 9 ++++++++- tests/grub_cmd_sleep.in | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/grub-core/tests/sleep_test.c b/grub-core/tests/sleep_test.c index 3dda30312..3d11c717c 100644 --- a/grub-core/tests/sleep_test.c +++ b/grub-core/tests/sleep_test.c @@ -33,12 +33,19 @@ sleep_test (void) { struct grub_datetime st, en; grub_int32_t stu = 0, enu = 0; + int is_delayok; grub_test_assert (!grub_get_datetime (&st), "Couldn't retrieve start time"); grub_millisleep (10000); grub_test_assert (!grub_get_datetime (&en), "Couldn't retrieve end time"); grub_test_assert (grub_datetime2unixtime (&st, &stu), "Invalid date"); grub_test_assert (grub_datetime2unixtime (&en, &enu), "Invalid date"); - grub_test_assert (enu - stu >= 9 && enu - stu <= 11, "Interval out of range: %d", enu-stu); + is_delayok = (enu - stu >= 9 && enu - stu <= 11); +#ifdef __arm__ + /* Ignore QEMU bug */ + if (enu - stu >= 15 && enu - stu <= 17) + is_delayok = 1; +#endif + grub_test_assert (is_delayok, "Interval out of range: %d", enu-stu); } diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in index 1c84fbfbb..eb362aa24 100644 --- a/tests/grub_cmd_sleep.in +++ b/tests/grub_cmd_sleep.in @@ -14,6 +14,11 @@ dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell` dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)" dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)" +# Ignore QEMU bug +if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then + exit 0; +fi + if [ $((dt2 - dt1)) -gt 11 ] || [ $((dt2 - dt1)) -lt 9 ]; then echo "Interval not in range $dt2-$dt1 != 10" exit 1 From 0edd750e50698854068358ea53528100a9192902 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 10:18:47 +0100 Subject: [PATCH 089/207] xen_boot: Remove obsolete module type distinctions. --- grub-core/loader/arm64/xen_boot.c | 148 ++++++------------------------ 1 file changed, 30 insertions(+), 118 deletions(-) diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index d1a218929..a914eb8e2 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -37,16 +37,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define XEN_HYPERVISOR_NAME "xen_hypervisor" - -#define MODULE_DEFAULT_ALIGN (0x0) -#define MODULE_IMAGE_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_INITRD_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_XSM_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_CUSTOM_MIN_ALIGN MODULE_DEFAULT_ALIGN - -#define MODULE_IMAGE_COMPATIBLE "multiboot,kernel\0multiboot,module" -#define MODULE_INITRD_COMPATIBLE "multiboot,ramdisk\0multiboot,module" -#define MODULE_XSM_COMPATIBLE "xen,xsm-policy\0multiboot,module" #define MODULE_CUSTOM_COMPATIBLE "multiboot,module" /* This maximum size is defined in Power.org ePAPR V1.1 @@ -74,14 +64,6 @@ enum module_type }; typedef enum module_type module_type_t; -struct fdt_node_info -{ - module_type_t type; - - const char *compat_string; - grub_size_t compat_string_size; -}; - struct xen_hypervisor_header { struct grub_arm64_linux_kernel_header efi_head; @@ -98,7 +80,7 @@ struct xen_boot_binary { struct xen_boot_binary *next; struct xen_boot_binary **prev; - const char *name; + int is_hypervisor; grub_addr_t start; grub_size_t size; @@ -106,8 +88,6 @@ struct xen_boot_binary char *cmdline; int cmdline_size; - - struct fdt_node_info node_info; }; static grub_dl_t my_mod; @@ -116,19 +96,6 @@ static int loaded; static struct xen_boot_binary *xen_hypervisor; static struct xen_boot_binary *module_head; -static const grub_size_t module_default_align[] = { - MODULE_IMAGE_MIN_ALIGN, - MODULE_INITRD_MIN_ALIGN, - MODULE_XSM_MIN_ALIGN, - MODULE_CUSTOM_MIN_ALIGN -}; - -static const compat_string_struct_t default_compat_string[] = { - FDT_COMPATIBLE (MODULE_IMAGE_COMPATIBLE), - FDT_COMPATIBLE (MODULE_INITRD_COMPATIBLE), - FDT_COMPATIBLE (MODULE_XSM_COMPATIBLE), - FDT_COMPATIBLE (MODULE_CUSTOM_COMPATIBLE) -}; static __inline grub_addr_t xen_boot_address_align (grub_addr_t start, grub_size_t align) @@ -136,20 +103,6 @@ xen_boot_address_align (grub_addr_t start, grub_size_t align) return (align ? (ALIGN_UP (start, align)) : start); } -/* set module type according to command name. */ -static grub_err_t -set_module_type (grub_command_t cmd, struct xen_boot_binary *module) -{ - if (!grub_strcmp (cmd->name, "xen_linux")) - module->node_info.type = MODULE_IMAGE; - else if (!grub_strcmp (cmd->name, "xen_initrd")) - module->node_info.type = MODULE_INITRD; - else if (!grub_strcmp (cmd->name, "xen_xsm")) - module->node_info.type = MODULE_XSM; - - return GRUB_ERR_NONE; -} - static grub_err_t prepare_xen_hypervisor_params (void *xen_boot_fdt) { @@ -203,15 +156,11 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name); retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible", - module->node_info.compat_string, - (grub_uint32_t) module-> - node_info.compat_string_size); + MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1); if (retval) return grub_error (GRUB_ERR_IO, "failed to update FDT"); - grub_dprintf ("xen_loader", "Module %s compatible = %s size = 0x%lx\n", - module->name, module->node_info.compat_string, - module->node_info.compat_string_size); + grub_dprintf ("xen_loader", "Module\n"); retval = grub_fdt_set_reg64 (xen_boot_fdt, module_node, xen_boot_address_align (module->start, @@ -223,7 +172,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) if (module->cmdline && module->cmdline_size > 0) { grub_dprintf ("xen_loader", - "Module %s cmdline : %s @ %p size:%d\n", module->name, + "Module cmdline : %s @ %p size:%d\n", module->cmdline, module->cmdline, module->cmdline_size); retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "bootargs", @@ -233,8 +182,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) } else { - grub_dprintf ("xen_loader", "Module %s has not bootargs!\n", - module->name); + grub_dprintf ("xen_loader", "Module has no bootargs!\n"); } return GRUB_ERR_NONE; @@ -251,8 +199,8 @@ finalize_params_xen_boot (void) additional_size += FDT_NODE_NAME_MAX_SIZE + xen_hypervisor->cmdline_size; FOR_LIST_ELEMENTS (module, module_head) { - additional_size += 6 * FDT_NODE_NAME_MAX_SIZE + module-> - node_info.compat_string_size + module->cmdline_size; + additional_size += 6 * FDT_NODE_NAME_MAX_SIZE + sizeof(MODULE_CUSTOM_COMPATIBLE) - 1 + + module->cmdline_size; } xen_boot_fdt = grub_fdt_load (additional_size); @@ -275,8 +223,7 @@ finalize_params_xen_boot (void) { if (module->start && module->size > 0) { - grub_dprintf ("xen_loader", "Module %s @ 0x%lx size:0x%lx\n", - module->name, + grub_dprintf ("xen_loader", "Module @ 0x%lx size:0x%lx\n", xen_boot_address_align (module->start, module->align), module->size); if (prepare_xen_module_params (module, xen_boot_fdt) != GRUB_ERR_NONE) @@ -284,7 +231,7 @@ finalize_params_xen_boot (void) } else { - grub_dprintf ("xen_loader", "Module info error: %s!\n", module->name); + grub_dprintf ("xen_loader", "Module info error!\n"); goto fail; } } @@ -327,19 +274,16 @@ single_binary_unload (struct xen_boot_binary *binary) { grub_free (binary->cmdline); grub_dprintf ("xen_loader", - "Module %s cmdline memory free @ %p size: %d\n", - binary->name, binary->cmdline, binary->cmdline_size); + "Module cmdline memory free @ %p size: %d\n", + binary->cmdline, binary->cmdline_size); } - if (binary->node_info.type == MODULE_CUSTOM) - grub_free ((void *) binary->node_info.compat_string); - - if (grub_strcmp (binary->name, XEN_HYPERVISOR_NAME)) + if (!binary->is_hypervisor) grub_list_remove (GRUB_AS_LIST (binary)); grub_dprintf ("xen_loader", - "Module %s struct memory free @ %p size: 0x%lx\n", - binary->name, binary, sizeof (binary)); + "Module struct memory free @ %p size: 0x%lx\n", + binary, sizeof (binary)); grub_free (binary); return; @@ -377,8 +321,7 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, int argc, char *argv[]) { binary->size = grub_file_size (file); - grub_dprintf ("xen_loader", "Xen_boot %s file size: 0x%lx\n", - binary->name, binary->size); + grub_dprintf ("xen_loader", "Xen_boot file size: 0x%lx\n", binary->size); binary->start = (grub_addr_t) grub_efi_allocate_pages (0, @@ -391,8 +334,8 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, return; } - grub_dprintf ("xen_loader", "Xen_boot %s numpages: 0x%lx\n", - binary->name, GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); + grub_dprintf ("xen_loader", "Xen_boot numpages: 0x%lx\n", + GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); if (grub_file_read (file, (void *) xen_boot_address_align (binary->start, binary->align), @@ -416,7 +359,7 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, binary->cmdline_size); grub_dprintf ("xen_loader", - "Xen_boot %s cmdline @ %p %s, size: %d\n", binary->name, + "Xen_boot cmdline @ %p %s, size: %d\n", binary->cmdline, binary->cmdline, binary->cmdline_size); } else @@ -430,7 +373,8 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, } static grub_err_t -grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) +grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), + int argc, char *argv[]) { struct xen_boot_binary *module = NULL; @@ -454,34 +398,10 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) if (!module) return grub_errno; - /* process all the options and get module type */ - if (set_module_type (cmd, module) != GRUB_ERR_NONE) - goto fail; - switch (module->node_info.type) - { - case MODULE_IMAGE: - case MODULE_INITRD: - case MODULE_XSM: - module->node_info.compat_string = - default_compat_string[module->node_info.type].compat_string; - module->node_info.compat_string_size = - default_compat_string[module->node_info.type].size; - break; + module->is_hypervisor = 0; + module->align = 4096; - case MODULE_CUSTOM: - /* we have set the node_info in set_module_type */ - break; - - default: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid argument")); - } - module->name = module->node_info.compat_string; - module->align = module_default_align[module->node_info.type]; - - grub_dprintf ("xen_loader", "Init %s module and node info:\n" - "compatible %s\ncompat_string_size 0x%lx\n", - module->name, module->node_info.compat_string, - module->node_info.compat_string_size); + grub_dprintf ("xen_loader", "Init module and node info\n"); file = grub_file_open (argv[0]); if (!file) @@ -491,7 +411,7 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) if (grub_errno == GRUB_ERR_NONE) grub_list_push (GRUB_AS_LIST_P (&module_head), GRUB_AS_LIST (module)); -fail: + fail: if (file) grub_file_close (file); if (grub_errno != GRUB_ERR_NONE) @@ -535,7 +455,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), if (!xen_hypervisor) return grub_errno; - xen_hypervisor->name = XEN_HYPERVISOR_NAME; + xen_hypervisor->is_hypervisor = 1; xen_hypervisor->align = (grub_size_t) sh.optional_header.section_alignment; xen_boot_binary_load (xen_hypervisor, file, argc, argv); @@ -559,29 +479,21 @@ fail: } static grub_command_t cmd_xen_hypervisor; -static grub_command_t cmd_xen_linux, cmd_xen_initrd, cmd_xen_xsm; +static grub_command_t cmd_xen_module; GRUB_MOD_INIT (xen_boot) { cmd_xen_hypervisor = grub_register_command ("xen_hypervisor", grub_cmd_xen_hypervisor, 0, N_("Load a xen hypervisor.")); - cmd_xen_linux = - grub_register_command ("xen_linux", grub_cmd_xen_module, 0, - N_("Load a xen linux kernel for dom0.")); - cmd_xen_initrd = - grub_register_command ("xen_initrd", grub_cmd_xen_module, 0, - N_("Load a xen initrd for dom0.")); - cmd_xen_xsm = - grub_register_command ("xen_xsm", grub_cmd_xen_module, 0, - N_("Load a xen security module.")); + cmd_xen_module = + grub_register_command ("xen_module", grub_cmd_xen_module, 0, + N_("Load a xen module.")); my_mod = mod; } GRUB_MOD_FINI (xen_boot) { grub_unregister_command (cmd_xen_hypervisor); - grub_unregister_command (cmd_xen_linux); - grub_unregister_command (cmd_xen_initrd); - grub_unregister_command (cmd_xen_xsm); + grub_unregister_command (cmd_xen_module); } From 64e2d139fe1c9133b0eda0a9da8e8c2c03368dea Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 22 Jan 2016 11:05:32 +0100 Subject: [PATCH 090/207] Restore terminal settings on grub-emu exit. --- grub-core/kern/emu/main.c | 6 ++++++ grub-core/kern/emu/misc.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index 51e8a5715..953a93c8a 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -65,6 +65,12 @@ grub_reboot (void) longjmp (main_env, 1); } +void +grub_exit (void) +{ + grub_reboot (); +} + void grub_machine_init (void) { diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index 06985013d..d361feb00 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -134,11 +134,13 @@ xasprintf (const char *fmt, ...) } #endif +#if !defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL) void grub_exit (void) { exit (1); } +#endif grub_uint64_t grub_get_time_ms (void) From dab148891ee64ba5420a11bdddad9983fc387954 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 13:27:36 +0100 Subject: [PATCH 091/207] Document expr1 expr2 syntax for test command --- docs/grub.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi index 9a25a0bdb..f9173cc27 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -5042,6 +5042,8 @@ the length of @var{string} is zero @var{expression} is false @item @var{expression1} @code{-a} @var{expression2} both @var{expression1} and @var{expression2} are true +@item @var{expression1} @var{expression2} +both @var{expression1} and @var{expression2} are true. This syntax is not POSIX-compliant and is not recommended. @item @var{expression1} @code{-o} @var{expression2} either @var{expression1} or @var{expression2} is true @end table From ae3b83a4d4df75a01198a2fed7542391e7c449e0 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Fri, 22 Jan 2016 13:32:30 +0100 Subject: [PATCH 092/207] efiemu: Handle persistent RAM and unknown possible future additions. --- grub-core/efiemu/mm.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c index d4a4f3aad..13af4ad0d 100644 --- a/grub-core/efiemu/mm.c +++ b/grub-core/efiemu/mm.c @@ -99,7 +99,8 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, grub_size_t align_overhead; struct grub_efiemu_memrequest *ret, *cur, *prev; /* Check that the request is correct */ - if (type >= GRUB_EFI_MAX_MEMORY_TYPE || type <= GRUB_EFI_LOADER_CODE) + if (type <= GRUB_EFI_LOADER_CODE || type == GRUB_EFI_PERSISTENT_MEMORY || + type >= GRUB_EFI_MAX_MEMORY_TYPE) return -2; /* Add new size to requested size */ @@ -166,6 +167,13 @@ efiemu_alloc_requests (void) GRUB_EFI_MEMORY_MAPPED_IO, GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, GRUB_EFI_PAL_CODE + + /* + * These are not allocatable: + * GRUB_EFI_RESERVED_MEMORY_TYPE + * GRUB_EFI_PERSISTENT_MEMORY + * >= GRUB_EFI_MAX_MEMORY_TYPE + */ }; /* Compute total memory needed */ @@ -402,6 +410,10 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_ACPI_MEMORY_NVS); + case GRUB_MEMORY_PRAM: + case GRUB_MEMORY_PMEM: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_PERSISTENT_MEMORY); default: grub_dprintf ("efiemu", "Unknown memory type %d. Assuming unusable\n", type); @@ -445,7 +457,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) case GRUB_EFI_MEMORY_MAPPED_IO: case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: case GRUB_EFI_PAL_CODE: - case GRUB_EFI_MAX_MEMORY_TYPE: + default: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_MEMORY_RESERVED, hook_data); break; @@ -468,6 +480,12 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_MEMORY_NVS, hook_data); break; + + case GRUB_EFI_PERSISTENT_MEMORY: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_PMEM, hook_data); + break; + } return 0; @@ -503,7 +521,8 @@ grub_efiemu_mmap_sort_and_uniq (void) [GRUB_EFI_ACPI_MEMORY_NVS] = 3, [GRUB_EFI_MEMORY_MAPPED_IO] = 4, [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, - [GRUB_EFI_PAL_CODE] = 4 + [GRUB_EFI_PAL_CODE] = 4, + [GRUB_EFI_PERSISTENT_MEMORY] = 4 }; int i, j, k, done; From 5f2b285bf8d645bf0c7a46dd5434d83824f23278 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 13:50:53 +0100 Subject: [PATCH 093/207] Document cpuid -p --- docs/grub.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/grub.texi b/docs/grub.texi index f9173cc27..0afdd8ccd 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -4073,12 +4073,15 @@ after @command{configfile} returns. @node cpuid @subsection cpuid -@deffn Command cpuid [-l] +@deffn Command cpuid [-l] [-p] Check for CPU features. This command is only available on x86 systems. With the @option{-l} option, return true if the CPU supports long mode (64-bit). +With the @option{-p} option, return true if the CPU supports Physical +Address Extension (PAE). + If invoked without options, this command currently behaves as if it had been invoked with @option{-l}. This may change in the future. @end deffn From b6a03dfd327489d53ee07c6d7d593b99c7b7cb62 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 14:10:30 +0100 Subject: [PATCH 094/207] efiemu: Fix compilation failure --- grub-core/efiemu/mm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c index 13af4ad0d..e606dbffc 100644 --- a/grub-core/efiemu/mm.c +++ b/grub-core/efiemu/mm.c @@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_ACPI_MEMORY_NVS); - case GRUB_MEMORY_PRAM: - case GRUB_MEMORY_PMEM: + case GRUB_MEMORY_PERSISTENT: + case GRUB_MEMORY_PERSISTENT_LEGACY: return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_PERSISTENT_MEMORY); default: @@ -483,7 +483,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) case GRUB_EFI_PERSISTENT_MEMORY: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, - GRUB_MEMORY_PMEM, hook_data); + GRUB_MEMORY_PERSISTENT, hook_data); break; } From 605eecc985b677d196b558d4d8cec6592a68e462 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 19:09:37 +0100 Subject: [PATCH 095/207] arm64: Add support for relocations needed for linaro gcc --- grub-core/kern/arm64/dl.c | 18 ++++++++++++++ grub-core/kern/arm64/dl_helper.c | 40 ++++++++++++++++++++++++++++++++ include/grub/arm64/reloc.h | 8 +++++++ include/grub/elf.h | 3 +++ util/grub-mkimagexx.c | 31 +++++++++++++++++++++++++ util/grub-module-verifier.c | 8 ++++++- 6 files changed, 107 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/arm64/dl.c b/grub-core/kern/arm64/dl.c index e19ba6a0d..cf50d7250 100644 --- a/grub-core/kern/arm64/dl.c +++ b/grub-core/kern/arm64/dl.c @@ -132,6 +132,12 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, *abs_place = (grub_uint64_t) sym_addr; } break; + case R_AARCH64_ADD_ABS_LO12_NC: + grub_arm64_set_abs_lo12 (place, sym_addr); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + grub_arm64_set_abs_lo12_ldst64 (place, sym_addr); + break; case R_AARCH64_CALL26: case R_AARCH64_JUMP26: { @@ -154,6 +160,18 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, grub_arm64_set_xxxx26_offset (place, offset); } break; + case R_AARCH64_ADR_PREL_PG_HI21: + { + grub_int64_t offset = (sym_addr & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL); + + if (!grub_arm64_check_hi21_signed (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "HI21 out of range"); + + grub_arm64_set_hi21 (place, offset); + } + break; + default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), diff --git a/grub-core/kern/arm64/dl_helper.c b/grub-core/kern/arm64/dl_helper.c index d213ab93e..f031b1ae9 100644 --- a/grub-core/kern/arm64/dl_helper.c +++ b/grub-core/kern/arm64/dl_helper.c @@ -53,3 +53,43 @@ grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset) *place &= insmask; *place |= grub_cpu_to_le32 (offset >> 2) & ~insmask; } + +int +grub_arm64_check_hi21_signed (grub_int64_t offset) +{ + if (offset != (grub_int64_t)(grub_int32_t)offset) + return 0; + return 1; +} + +void +grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0x9f00001f); + grub_uint32_t val; + + offset >>= 12; + + val = ((offset & 3) << 29) | (((offset >> 2) & 0x7ffff) << 5); + + *place &= insmask; + *place |= grub_cpu_to_le32 (val) & ~insmask; +} + +void +grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xffc003ff); + + *place &= insmask; + *place |= grub_cpu_to_le32 (target << 10) & ~insmask; +} + +void +grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfff803ff); + + *place &= insmask; + *place |= grub_cpu_to_le32 (target << 7) & ~insmask; +} diff --git a/include/grub/arm64/reloc.h b/include/grub/arm64/reloc.h index 4aed3d715..452c14822 100644 --- a/include/grub/arm64/reloc.h +++ b/include/grub/arm64/reloc.h @@ -22,5 +22,13 @@ int grub_arm_64_check_xxxx26_offset (grub_int64_t offset); void grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset); +int +grub_arm64_check_hi21_signed (grub_int64_t offset); +void +grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset); +void +grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target); +void +grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target); #endif diff --git a/include/grub/elf.h b/include/grub/elf.h index caa796390..db15acecf 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -2068,6 +2068,9 @@ typedef Elf32_Addr Elf32_Conflict; #define R_AARCH64_NONE 0 /* No relocation. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ +#define R_AARCH64_ADR_PREL_PG_HI21 275 +#define R_AARCH64_ADD_ABS_LO12_NC 277 +#define R_AARCH64_LDST64_ABS_LO12_NC 286 #define R_AARCH64_JUMP26 282 /* 26-bit relative. */ #define R_AARCH64_CALL26 283 /* 26-bit relative. */ #define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */ diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 0e0c6f7a1..06b6a724d 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -836,6 +836,14 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, *target = grub_host_to_target64 (grub_target_to_host64 (*target) + sym_addr); } break; + case R_AARCH64_ADD_ABS_LO12_NC: + grub_arm64_set_abs_lo12 ((grub_uint32_t *) target, + sym_addr); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + grub_arm64_set_abs_lo12_ldst64 ((grub_uint32_t *) target, + sym_addr); + break; case R_AARCH64_JUMP26: case R_AARCH64_CALL26: { @@ -848,6 +856,17 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, sym_addr); } break; + case R_AARCH64_ADR_PREL_PG_HI21: + { + sym_addr &= ~0xfffULL; + sym_addr -= (offset + SUFFIX (entry_point)) & ~0xfffULL; + if (!grub_arm64_check_hi21_signed (sym_addr)) + grub_util_error ("%s", "CALL26 Relocation out of range"); + + grub_arm64_set_hi21((grub_uint32_t *)target, + sym_addr); + } + break; default: grub_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); @@ -1200,6 +1219,15 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, case R_AARCH64_CALL26: case R_AARCH64_JUMP26: break; + /* Page-relative relocations do not require fixup entries. */ + case R_AARCH64_ADR_PREL_PG_HI21: + /* We page-align the whole kernel, so no need + for fixup entries. + */ + case R_AARCH64_ADD_ABS_LO12_NC: + case R_AARCH64_LDST64_ABS_LO12_NC: + break; + default: grub_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); @@ -1343,6 +1371,9 @@ SUFFIX (locate_sections) (const char *kernel_path, Elf_Shdr *s; *all_align = 1; + /* Page-aligning simplifies relocation handling. */ + if (image_target->elf_target == EM_AARCH64) + *all_align = 4096; section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c index e217dcddc..405c91170 100644 --- a/util/grub-module-verifier.c +++ b/util/grub-module-verifier.c @@ -107,7 +107,13 @@ struct grub_module_verifier_arch archs[] = { R_AARCH64_CALL26, R_AARCH64_JUMP26, -1 - } }, + }, (int[]){ + R_AARCH64_ADR_PREL_PG_HI21, + R_AARCH64_ADD_ABS_LO12_NC, + R_AARCH64_LDST64_ABS_LO12_NC, + -1 + } + }, }; From ff84a9b868ea36da23248da780b8e85bdc4c183d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 19:28:08 +0100 Subject: [PATCH 096/207] Error out if mtools invocation fails. --- util/grub-mkrescue.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c index da0dc021a..238d4840e 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -787,9 +787,14 @@ main (int argc, char *argv[]) free (efidir_efi_boot); efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img"); - grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", + int rv; + rv = grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", efiimgfat, "::", NULL }); - grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); + if (rv != 0) + grub_util_error ("`%s` invocation failed\n", "mformat"); + rv = grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); + if (rv != 0) + grub_util_error ("`%s` invocation failed\n", "mformat"); xorriso_push ("--efi-boot"); xorriso_push ("efi.img"); xorriso_push ("-efi-boot-part"); From 7290bb5623cd8d9b50b756d0ea40eb6a269985e7 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 1 Feb 2016 20:13:48 +0300 Subject: [PATCH 097/207] 10_linux: avoid multi-device root= kernel argument If root filesystem is multidev btrfs, do not attempt to pass all devices as kernel root= argument. This results in splitting command line in GRUB due to embedded newline and even if we managed to quote it, kernel does not know how to interpret it anyway. Multidev btrfs requires user space device scanning, so passing single device would not work too. This still respects user settings GRUB_DISABLE_LINUX_UUID. Not sure what we should do in this case. Closes: 45709 --- util/grub.d/10_linux.in | 4 +++- util/grub.d/20_linux_xen.in | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 859b608f6..5a78513ae 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in ;; esac +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || uses_abstraction "${GRUB_DEVICE}" lvm; then + || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index f532fb98f..46045db1a 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in ;; esac +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || uses_abstraction "${GRUB_DEVICE}" lvm; then + || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} From 67dba97e4598eaf2deb14da044fbfb1c119cf76f Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 3 Feb 2016 20:34:55 +0300 Subject: [PATCH 098/207] support modules without symbol table all_video module does not have any code or data and exists solely for .moddeps section to pull in dependencies. This makes all symbols unneeded. While in current binutils (last released version as of this commit is 2.26) ``strip --strip-unneeded'' unintentionally adds section symbols for each existing section, this behavior was considered a bug and changed in commit 14f2c699ddca1e2f706342dffc59a6c7e23e844c to completely strip symbol table in this case. Older binutils (verified with 2.17) and some other toolchains (at least elftoolchain r3223M), both used in FreeBSD, remove symbol table in all_video as well. Relax run-time check and do not return error for modules without symbol table. Add additional checks to module verifier to make sure such modules a) have non-empty .moddeps section. Without either externally visible symbols or .moddeps modules are completely useless and should not be built. b) do not have any relocations. Closes: 46986 v2: add run-time check for empty symbol table if relocations are present as suggested by Vladimir. --- grub-core/kern/dl.c | 8 +++++++- util/grub-module-verifierXX.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 59a6ef4ca..e394cd96f 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -333,8 +333,11 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) if (s->sh_type == SHT_SYMTAB) break; + /* Module without symbol table may still be used to pull in dependencies. + We verify at build time that such modules do not contain any relocations + that may reference symbol table. */ if (i == e->e_shnum) - return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table")); + return GRUB_ERR_NONE; #ifdef GRUB_MODULES_MACHINE_READONLY mod->symtab = grub_malloc (s->sh_size); @@ -576,6 +579,9 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { + if (!mod->symtab) + return grub_error (GRUB_ERR_BAD_MODULE, "relocation without symbol table"); + err = grub_arch_dl_relocate_symbols (mod, ehdr, s, seg); if (err) return err; diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c index f612d51f3..9c04caa63 100644 --- a/util/grub-module-verifierXX.c +++ b/util/grub-module-verifierXX.c @@ -176,7 +176,7 @@ get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word break; if (i == grub_target_to_host16 (e->e_shnum)) - grub_util_error ("no symbol table"); + return NULL; sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); *size = grub_target_to_host (s->sh_size); @@ -191,7 +191,21 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) Elf_Word size, entsize; unsigned i; + /* Module without symbol table and without .moddeps section is useless + at boot time, so catch it early to prevent build errors */ sym = get_symtab (arch, e, &size, &entsize); + if (!sym) + { + Elf_Shdr *s = find_section (arch, e, ".moddeps"); + + if (!s) + grub_util_error ("no symbol table and no .moddeps section"); + + if (!s->sh_size) + grub_util_error ("no symbol table and empty .moddeps section"); + + return; + } for (i = 0; i < size / entsize; @@ -243,6 +257,8 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e Elf_Word symtabsize, symtabentsize; symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); + if (!symtab) + grub_util_error ("relocation without symbol table"); for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); From 2d425ffdd57845e4c967b468f8cee164d2ddc85f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 11 Feb 2016 11:58:28 +0100 Subject: [PATCH 099/207] xnu: supply ramsize to the kernel. Without this info recent kernels crash as they allocate no heap. --- grub-core/loader/i386/xnu.c | 23 +++++++++++++++++++++++ include/grub/i386/xnu.h | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index a4a6f932e..7962b0e1d 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -897,6 +897,28 @@ grub_xnu_set_video (struct grub_xnu_boot_params_common *params) return GRUB_ERR_NONE; } +static int +total_ram_hook (grub_uint64_t addr __attribute__ ((unused)), grub_uint64_t size, + grub_memory_type_t type, + void *data) +{ + grub_uint64_t *result = data; + + if (type != GRUB_MEMORY_AVAILABLE) + return 0; + *result += size; + return 0; +} + +static grub_uint64_t +get_total_ram (void) +{ + grub_uint64_t result = 0; + + grub_mmap_iterate (total_ram_hook, &result); + return result; +} + /* Boot xnu. */ grub_err_t grub_xnu_boot (void) @@ -973,6 +995,7 @@ grub_xnu_boot (void) { bootparams_common = &bootparams->v2.common; bootparams->v2.fsbfreq = fsbfreq; + bootparams->v2.ram_size = get_total_ram(); } else bootparams_common = &bootparams->v1.common; diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h index a076b8a97..062a7ddbe 100644 --- a/include/grub/i386/xnu.h +++ b/include/grub/i386/xnu.h @@ -89,7 +89,8 @@ struct grub_xnu_boot_params_v2 grub_uint64_t efi_runtime_first_page_virtual; grub_uint32_t efi_system_table; - grub_uint32_t unused2[11]; + grub_uint32_t unused2[9]; + grub_uint64_t ram_size; grub_uint64_t fsbfreq; grub_uint32_t unused3[734]; } GRUB_PACKED; From df4df4d887fab794139adea5e7deee98ded046da Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 11 Feb 2016 12:30:45 +0100 Subject: [PATCH 100/207] xnu: Include relocated EFI in heap size. --- grub-core/loader/i386/xnu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index 7962b0e1d..7b11c65f0 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -1103,7 +1103,7 @@ grub_xnu_boot (void) bootparams_common->efi_mmap = memory_map_target; bootparams_common->efi_mmap_size = memory_map_size; bootparams_common->heap_start = grub_xnu_heap_target_start; - bootparams_common->heap_size = grub_xnu_heap_size; + bootparams_common->heap_size = curruntimepage * GRUB_XNU_PAGESIZE - grub_xnu_heap_target_start; /* Parameters for asm helper. */ grub_xnu_stack = bootparams_common->heap_start From 281baeecd3613eadb985f81cfe1b00ef937eb9e2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 09:10:08 +0100 Subject: [PATCH 101/207] Fix emu compilation error on arm. --- grub-core/kern/emu/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index 953a93c8a..f91280f68 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -201,7 +201,7 @@ main (int argc, char *argv[]) volatile int hold = 0; size_t total_module_size = sizeof (struct grub_module_info), memdisk_size = 0; struct grub_module_info *modinfo; - char *mods; + void *mods; grub_util_host_init (&argc, &argv); @@ -232,10 +232,10 @@ main (int argc, char *argv[]) struct grub_module_header *header = (struct grub_module_header *) mods; header->type = OBJ_TYPE_MEMDISK; header->size = memdisk_size + sizeof (*header); - mods += sizeof (*header); + mods = header + 1; grub_util_load_image (arguments.mem_disk, mods); - mods += memdisk_size; + mods = (char *) mods + memdisk_size; } grub_modbase = (grub_addr_t) modinfo; From 8ad190cac258f2070a94f1250c0fb91eca6f7685 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 09:11:06 +0100 Subject: [PATCH 102/207] Make unaligned types public. This simplifies code which has to handle those types. --- include/grub/types.h | 74 ++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/include/grub/types.h b/include/grub/types.h index e732efb5c..b93e48201 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -254,55 +254,49 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t _x) #endif /* ! WORDS_BIGENDIAN */ -static inline grub_uint16_t grub_get_unaligned16 (const void *ptr) +struct grub_unaligned_uint16 { - struct grub_unaligned_uint16_t - { - grub_uint16_t d; - } GRUB_PACKED; - const struct grub_unaligned_uint16_t *dd - = (const struct grub_unaligned_uint16_t *) ptr; - return dd->d; -} - -static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val) + grub_uint16_t val; +} GRUB_PACKED; +struct grub_unaligned_uint32 { - struct grub_unaligned_uint16_t - { - grub_uint16_t d; - } GRUB_PACKED; - struct grub_unaligned_uint16_t *dd = (struct grub_unaligned_uint16_t *) ptr; - dd->d = val; -} - -static inline grub_uint32_t grub_get_unaligned32 (const void *ptr) -{ - struct grub_unaligned_uint32_t - { - grub_uint32_t d; - } GRUB_PACKED; - const struct grub_unaligned_uint32_t *dd - = (const struct grub_unaligned_uint32_t *) ptr; - return dd->d; -} - -static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val) -{ - struct grub_unaligned_uint32_t - { - grub_uint32_t d; - } GRUB_PACKED; - struct grub_unaligned_uint32_t *dd = (struct grub_unaligned_uint32_t *) ptr; - dd->d = val; -} - + grub_uint32_t val; +} GRUB_PACKED; struct grub_unaligned_uint64 { grub_uint64_t val; } GRUB_PACKED; +typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t; +typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t; typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t; +static inline grub_uint16_t grub_get_unaligned16 (const void *ptr) +{ + const struct grub_unaligned_uint16 *dd + = (const struct grub_unaligned_uint16 *) ptr; + return dd->val; +} + +static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val) +{ + struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr; + dd->val = val; +} + +static inline grub_uint32_t grub_get_unaligned32 (const void *ptr) +{ + const struct grub_unaligned_uint32 *dd + = (const struct grub_unaligned_uint32 *) ptr; + return dd->val; +} + +static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val) +{ + struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr; + dd->val = val; +} + static inline grub_uint64_t grub_get_unaligned64 (const void *ptr) { const struct grub_unaligned_uint64 *dd From b29638222ec75c93f19e16f7ee4b091fe6cc1650 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 11:35:48 +0100 Subject: [PATCH 103/207] Make grub_acpi_find_fadt accessible generically --- grub-core/kern/acpi.c | 85 +++++++++++++++++++++++++++++++ grub-core/kern/i386/tsc_pmtimer.c | 85 ------------------------------- include/grub/acpi.h | 2 +- 3 files changed, 86 insertions(+), 86 deletions(-) diff --git a/grub-core/kern/acpi.c b/grub-core/kern/acpi.c index 02c1f4f6f..5746ac00c 100644 --- a/grub-core/kern/acpi.c +++ b/grub-core/kern/acpi.c @@ -32,3 +32,88 @@ grub_byte_checksum (void *base, grub_size_t size) ret += *ptr; return ret; } + +static void * +grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) +{ + grub_size_t s; + grub_unaligned_uint32_t *ptr; + + if (!rsdt) + return 0; + + if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) + return 0; + + ptr = (grub_unaligned_uint32_t *) (rsdt + 1); + s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); + for (; s; s--, ptr++) + { + struct grub_acpi_table_header *tbl; + tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; + if (grub_memcmp (tbl->signature, sig, 4) == 0) + return tbl; + } + return 0; +} + +static void * +grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) +{ + grub_size_t s; + grub_unaligned_uint64_t *ptr; + + if (!xsdt) + return 0; + + if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) + return 0; + + ptr = (grub_unaligned_uint64_t *) (xsdt + 1); + s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); + for (; s; s--, ptr++) + { + struct grub_acpi_table_header *tbl; +#if GRUB_CPU_SIZEOF_VOID_P != 8 + if (ptr->val >> 32) + continue; +#endif + tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; + if (grub_memcmp (tbl->signature, sig, 4) == 0) + return tbl; + } + return 0; +} + +struct grub_acpi_fadt * +grub_acpi_find_fadt (void) +{ + struct grub_acpi_fadt *fadt = 0; + struct grub_acpi_rsdp_v10 *rsdpv1; + struct grub_acpi_rsdp_v20 *rsdpv2; + rsdpv1 = grub_machine_acpi_get_rsdpv1 (); + if (rsdpv1) + fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv1->rsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + rsdpv2 = grub_machine_acpi_get_rsdpv2 (); + if (rsdpv2) + fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + if (rsdpv2 +#if GRUB_CPU_SIZEOF_VOID_P != 8 + && !(rsdpv2->xsdt_addr >> 32) +#endif + ) + fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv2->xsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + return 0; +} diff --git a/grub-core/kern/i386/tsc_pmtimer.c b/grub-core/kern/i386/tsc_pmtimer.c index 6a47ab7be..2495e6fd4 100644 --- a/grub-core/kern/i386/tsc_pmtimer.c +++ b/grub-core/kern/i386/tsc_pmtimer.c @@ -27,91 +27,6 @@ #include #include -static void * -grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) -{ - grub_size_t s; - grub_uint32_t *ptr; - - if (!rsdt) - return 0; - - if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) - return 0; - - ptr = (grub_uint32_t *) (rsdt + 1); - s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); - for (; s; s--, ptr++) - { - struct grub_acpi_table_header *tbl; - tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; - if (grub_memcmp (tbl->signature, sig, 4) == 0) - return tbl; - } - return 0; -} - -static void * -grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) -{ - grub_size_t s; - grub_uint64_t *ptr; - - if (!xsdt) - return 0; - - if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) - return 0; - - ptr = (grub_uint64_t *) (xsdt + 1); - s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); - for (; s; s--, ptr++) - { - struct grub_acpi_table_header *tbl; -#if GRUB_CPU_SIZEOF_VOID_P != 8 - if (*ptr >> 32) - continue; -#endif - tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; - if (grub_memcmp (tbl->signature, sig, 4) == 0) - return tbl; - } - return 0; -} - -struct grub_acpi_fadt * -grub_acpi_find_fadt (void) -{ - struct grub_acpi_fadt *fadt = 0; - struct grub_acpi_rsdp_v10 *rsdpv1; - struct grub_acpi_rsdp_v20 *rsdpv2; - rsdpv1 = grub_machine_acpi_get_rsdpv1 (); - if (rsdpv1) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv1->rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - rsdpv2 = grub_machine_acpi_get_rsdpv2 (); - if (rsdpv2) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - if (rsdpv2 -#if GRUB_CPU_SIZEOF_VOID_P != 8 - && !(rsdpv2->xsdt_addr >> 32) -#endif - ) - fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->xsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - return 0; -} - int grub_tsc_calibrate_from_pmtimer (void) { diff --git a/include/grub/acpi.h b/include/grub/acpi.h index a4224e046..66148f684 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -242,6 +242,6 @@ enum }; struct grub_acpi_fadt * -grub_acpi_find_fadt (void); +EXPORT_FUNC(grub_acpi_find_fadt) (void); #endif /* ! GRUB_ACPI_HEADER */ From 1933d3737133314c97e42f6ad928f00ed6e71120 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 11:38:51 +0100 Subject: [PATCH 104/207] Make grub_cpu_is_tsc_supported generally available. --- grub-core/kern/i386/tsc.c | 16 ---------------- include/grub/i386/tsc.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c index 82cdea491..2e85289d8 100644 --- a/grub-core/kern/i386/tsc.c +++ b/grub-core/kern/i386/tsc.c @@ -43,22 +43,6 @@ grub_tsc_get_time_ms (void) return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; } -static __inline int -grub_cpu_is_tsc_supported (void) -{ -#ifndef GRUB_MACHINE_XEN - grub_uint32_t a,b,c,d; - if (! grub_cpu_is_cpuid_supported ()) - return 0; - - grub_cpuid(1,a,b,c,d); - - return (d & (1 << 4)) != 0; -#else - return 1; -#endif -} - static int calibrate_tsc_hardcode (void) { diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index 71fa7ca2f..a0aa2c573 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -51,4 +51,20 @@ grub_get_tsc (void) return (((grub_uint64_t) hi) << 32) | lo; } +static __inline int +grub_cpu_is_tsc_supported (void) +{ +#ifndef GRUB_MACHINE_XEN + grub_uint32_t a,b,c,d; + if (! grub_cpu_is_cpuid_supported ()) + return 0; + + grub_cpuid(1,a,b,c,d); + + return (d & (1 << 4)) != 0; +#else + return 1; +#endif +} + #endif /* ! KERNEL_CPU_TSC_HEADER */ From d9a3bfead8236377c2f46eb75c4fd7fef93696ea Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 11:40:51 +0100 Subject: [PATCH 105/207] Split pmtimer wait and tsc measurement from pmtimer tsc calibration. --- grub-core/Makefile.am | 2 ++ grub-core/kern/i386/tsc_pmtimer.c | 47 ++++++++++++++++++++----------- include/grub/i386/pmtimer.h | 37 ++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 include/grub/i386/pmtimer.h diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 90502cb1e..04e9395fd 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -107,6 +107,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h endif if COND_i386_coreboot @@ -162,6 +163,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h endif if COND_ia64_efi diff --git a/grub-core/kern/i386/tsc_pmtimer.c b/grub-core/kern/i386/tsc_pmtimer.c index 2495e6fd4..c9c361699 100644 --- a/grub-core/kern/i386/tsc_pmtimer.c +++ b/grub-core/kern/i386/tsc_pmtimer.c @@ -24,44 +24,35 @@ #include #include #include +#include #include #include -int -grub_tsc_calibrate_from_pmtimer (void) +grub_uint64_t +grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, + grub_uint16_t num_pm_ticks) { grub_uint32_t start; grub_uint32_t last; grub_uint32_t cur, end; - struct grub_acpi_fadt *fadt; - grub_port_t p; grub_uint64_t start_tsc; grub_uint64_t end_tsc; int num_iter = 0; - fadt = grub_acpi_find_fadt (); - if (!fadt) - return 0; - p = fadt->pmtimer; - if (!p) - return 0; - - start = grub_inl (p) & 0xffffff; + start = grub_inl (pmtimer) & 0xffffff; last = start; - /* It's 3.579545 MHz clock. Wait 1 ms. */ - end = start + 3580; + end = start + num_pm_ticks; start_tsc = grub_get_tsc (); while (1) { - cur = grub_inl (p) & 0xffffff; + cur = grub_inl (pmtimer) & 0xffffff; if (cur < last) cur |= 0x1000000; num_iter++; if (cur >= end) { end_tsc = grub_get_tsc (); - grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); - return 1; + return end_tsc - start_tsc; } /* Check for broken PM timer. 50000000 TSCs is between 5 ms (10GHz) and 200 ms (250 MHz) @@ -73,3 +64,25 @@ grub_tsc_calibrate_from_pmtimer (void) } } } + +int +grub_tsc_calibrate_from_pmtimer (void) +{ + struct grub_acpi_fadt *fadt; + grub_port_t pmtimer; + grub_uint64_t tsc_diff; + + fadt = grub_acpi_find_fadt (); + if (!fadt) + return 0; + pmtimer = fadt->pmtimer; + if (!pmtimer) + return 0; + + /* It's 3.579545 MHz clock. Wait 1 ms. */ + tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer, 3580); + if (tsc_diff == 0) + return 0; + grub_tsc_rate = grub_divmod64 ((1ULL << 32), tsc_diff, 0); + return 1; +} diff --git a/include/grub/i386/pmtimer.h b/include/grub/i386/pmtimer.h new file mode 100644 index 000000000..ac091806a --- /dev/null +++ b/include/grub/i386/pmtimer.h @@ -0,0 +1,37 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef KERNEL_CPU_PMTIMER_HEADER +#define KERNEL_CPU_PMTIMER_HEADER 1 + +#include +#include + +/* + Preconditions: + * Caller has ensured that both pmtimer and tsc are supported + * 1 <= num_pm_ticks <= 3580 + Return: + * Number of TSC ticks elapsed + * 0 on failure. +*/ +grub_uint64_t +EXPORT_FUNC(grub_pmtimer_wait_count_tsc) (grub_port_t pmtimer, + grub_uint16_t num_pm_ticks); + +#endif From e5c930019104f4ad958c8c327097a1efed144374 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:33:41 +0100 Subject: [PATCH 106/207] printf: Fix and test %% behaviour in presence of subsequenbt args. --- grub-core/kern/misc.c | 7 +++++++ tests/printf_unit_test.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 906d2c2f7..e3f851633 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -740,6 +740,12 @@ parse_printf_args (const char *fmt0, struct printf_args *args, fmt++; c = *fmt++; + if (c == '%') + { + n--; + continue; + } + if (c == 'l') { c = *fmt++; @@ -876,6 +882,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, if (c == '%') { write_char (str, &count, max_len,c); + n--; continue; } diff --git a/tests/printf_unit_test.c b/tests/printf_unit_test.c index eb76bd002..d7b12c6db 100644 --- a/tests/printf_unit_test.c +++ b/tests/printf_unit_test.c @@ -66,6 +66,9 @@ printf_test (void) grub_snprintf (real, sizeof (real), "%3$d %2$lld %1$d", 1, 2LL, 3); snprintf (expected, sizeof (expected), "%3$d %2$lld %1$d", 1, 2LL, 3); grub_test_assert (strcmp (real, expected) == 0, MSG); + grub_snprintf (real, sizeof (real), "%%0%dd ", 1); + snprintf (expected, sizeof (expected), "%%0%dd ", 1); + grub_test_assert (strcmp (real, expected) == 0, MSG); } GRUB_UNIT_TEST ("printf_unit_test", printf_test); From 342d6edb970dd8af21feea3acf02905a5d117e38 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:34:54 +0100 Subject: [PATCH 107/207] yylex: use grub_fatal for exit. lexer calls yylex_fatal on fatal internal errors. yylex_fatal itself is declared as noreturn and calls exit. Returning from noreturn function has unpredictable consequences. --- grub-core/script/yylex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/script/yylex.l b/grub-core/script/yylex.l index 9c2cfe115..95b219170 100644 --- a/grub-core/script/yylex.l +++ b/grub-core/script/yylex.l @@ -92,7 +92,7 @@ typedef size_t yy_size_t; #define stdout 0 #define fprintf(...) 0 -#define exit(...) +#define exit(...) grub_fatal("fatal error in lexer") #endif } From e72de13b9e36dd0ab32eddb1848d403e3bbe7862 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:39:38 +0100 Subject: [PATCH 108/207] Add RNG module. --- grub-core/Makefile.core.def | 16 +++++ grub-core/lib/i386/random.c | 103 +++++++++++++++++++++++++++++++ grub-core/lib/random.c | 120 ++++++++++++++++++++++++++++++++++++ include/grub/random.h | 33 ++++++++++ 4 files changed, 272 insertions(+) create mode 100644 grub-core/lib/i386/random.c create mode 100644 grub-core/lib/random.c create mode 100644 include/grub/random.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 0cc40bb2b..18e3208be 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1686,6 +1686,22 @@ module = { x86 = loader/xnu.c; enable = x86; +} + +module = { + name = random; + x86 = lib/i386/random.c; + common = lib/random.c; + + i386_multiboot = kern/i386/tsc_pmtimer.c; + i386_coreboot = kern/i386/tsc_pmtimer.c; + i386_pc = kern/i386/tsc_pmtimer.c; + + enable = i386_multiboot; + enable = i386_coreboot; + enable = i386_pc; + enable = i386_efi; + enable = x86_64_efi; }; module = { diff --git a/grub-core/lib/i386/random.c b/grub-core/lib/i386/random.c new file mode 100644 index 000000000..cd83d2f8f --- /dev/null +++ b/grub-core/lib/i386/random.c @@ -0,0 +1,103 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +static int have_tsc = -1, have_pmtimer = -1; +static grub_port_t pmtimer_port; + +static int +detect_pmtimer (void) +{ + struct grub_acpi_fadt *fadt; + fadt = grub_acpi_find_fadt (); + if (!fadt) + return 0; + pmtimer_port = fadt->pmtimer; + if (!pmtimer_port) + return 0; + return 1; +} + +static int +pmtimer_tsc_get_random_bit (void) +{ + /* It's hard to come up with figures about pmtimer and tsc jitter but + 50 ppm seems to be typical. So we need 10^6/50 tsc cycles to get drift + of one tsc cycle. With TSC at least of 800 MHz it means 1/(50*800) + = 1/40000 s or about 3579545 / 40000 = 90 pmtimer ticks. + This gives us rate of 40000 bit/s or 5 kB/s. + */ + grub_uint64_t tsc_diff; + tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer_port, 90); + if (tsc_diff == 0) + { + have_pmtimer = 0; + return -1; + } + return tsc_diff & 1; +} + +static int +pmtimer_tsc_get_random_byte (void) +{ + grub_uint8_t ret = 0; + int i, c; + for (i = 0; i < 8; i++) + { + c = pmtimer_tsc_get_random_bit (); + if (c < 0) + return -1; + ret |= c << i; + } + return ret; +} + +static int +pmtimer_fill_buffer (void *buffer, grub_size_t sz) +{ + grub_uint8_t *p = buffer; + int c; + while (sz) + { + c = pmtimer_tsc_get_random_byte (); + if (c < 0) + return 0; + *p++ = c; + sz--; + } + return 1; +} + +int +grub_crypto_arch_get_random (void *buffer, grub_size_t sz) +{ + if (have_tsc == -1) + have_tsc = grub_cpu_is_tsc_supported (); + if (!have_tsc) + return 0; + if (have_pmtimer == -1) + have_pmtimer = detect_pmtimer (); + if (!have_pmtimer) + return 0; + return pmtimer_fill_buffer (buffer, sz); +} diff --git a/grub-core/lib/random.c b/grub-core/lib/random.c new file mode 100644 index 000000000..43b966438 --- /dev/null +++ b/grub-core/lib/random.c @@ -0,0 +1,120 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +GRUB_MOD_LICENSE ("GPLv3+"); + +grub_err_t +grub_crypto_get_random (void *buffer, grub_size_t sz) +{ + /* This is an arbitrer between different methods. + TODO: Add more methods in the future. */ + /* TODO: Add some PRNG smartness to reduce damage from bad entropy. */ + if (grub_crypto_arch_get_random (buffer, sz)) + return GRUB_ERR_NONE; + return grub_error (GRUB_ERR_IO, "no random sources found"); +} + +static int +get_num_digits (int val) +{ + int ret = 0; + while (val != 0) + { + ret++; + val /= 10; + } + if (ret == 0) + return 1; + return ret; +} + +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + +static grub_err_t +grub_cmd_hexdump_random (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) +{ + grub_size_t length = 64; + grub_err_t err; + void *buffer; + grub_uint8_t *ptr; + int stats[256]; + int i, digits = 2; + char template[10]; + + if (argc >= 1) + length = grub_strtoull (args[0], 0, 0); + + if (length == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "length pust be positive"); + + buffer = grub_malloc (length); + if (!buffer) + return grub_errno; + + err = grub_crypto_get_random (buffer, length); + if (err) + { + grub_free (buffer); + return err; + } + + hexdump (0, buffer, length); + grub_memset(stats, 0, sizeof(stats)); + for (ptr = buffer; ptr < (grub_uint8_t *) buffer + length; ptr++) + stats[*ptr]++; + grub_printf ("Statistics:\n"); + for (i = 0; i < 256; i++) + { + int z = get_num_digits (stats[i]); + if (z > digits) + digits = z; + } + + grub_snprintf (template, sizeof (template), "%%0%dd ", digits); + + for (i = 0; i < 256; i++) + { + grub_printf ("%s", template);//, stats[i]); + if ((i & 0xf) == 0xf) + grub_printf ("\n"); + } + + grub_free (buffer); + + return 0; +} + +static grub_command_t cmd; + +GRUB_MOD_INIT (random) +{ + cmd = grub_register_command ("hexdump_random", grub_cmd_hexdump_random, + N_("[LENGTH]"), + N_("Hexdump random data.")); +} + +GRUB_MOD_FINI (random) +{ + grub_unregister_command (cmd); +} diff --git a/include/grub/random.h b/include/grub/random.h new file mode 100644 index 000000000..4b75c0e2b --- /dev/null +++ b/include/grub/random.h @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_RANDOM_HEADER +#define GRUB_RANDOM_HEADER 1 + +#include +#include + +/* Not peer-reviewed. May not be any better than string of zeros. */ +grub_err_t +grub_crypto_get_random (void *buffer, grub_size_t sz); + +/* Do not use directly. Use grub_crypto_get_random instead. */ +int +grub_crypto_arch_get_random (void *buffer, grub_size_t sz); + +#endif From 22aa31bcc33ff480a8d94931d08235c12b4eecd8 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:40:10 +0100 Subject: [PATCH 109/207] xnu: Supply random seed. Now we're able to load kernels up to El Capitan. --- grub-core/Makefile.core.def | 13 +++++++++++-- grub-core/loader/i386/xnu.c | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 18e3208be..58438c48d 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1685,8 +1685,17 @@ module = { x86 = loader/i386/xnu.c; x86 = loader/xnu.c; - enable = x86; -} + /* Code is pretty generic but relies on RNG which + is available only on few platforms. It's not a + big deal as xnu needs ACPI anyway and we have + RNG on all platforms with ACPI. + */ + enable = i386_multiboot; + enable = i386_coreboot; + enable = i386_pc; + enable = i386_efi; + enable = x86_64_efi; +}; module = { name = random; diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index 7b11c65f0..59ef73a73 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -35,6 +35,7 @@ #include #include #include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -577,11 +578,31 @@ static grub_err_t grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out) { struct grub_xnu_devtree_key *efikey; + struct grub_xnu_devtree_key *chosenkey; struct grub_xnu_devtree_key *cfgtablekey; struct grub_xnu_devtree_key *curval; struct grub_xnu_devtree_key *runtimesrvkey; struct grub_xnu_devtree_key *platformkey; unsigned i, j; + grub_err_t err; + + chosenkey = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + if (! chosenkey) + return grub_errno; + + /* Random seed. */ + curval = grub_xnu_create_value (&(chosenkey->first_child), "random-seed"); + if (! curval) + return grub_errno; + curval->datasize = 64; + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_errno; + /* Our random is not peer-reviewed but xnu uses this seed only for + ASLR in kernel. */ + err = grub_crypto_get_random (curval->data, curval->datasize); + if (err) + return err; /* The value "model". */ /* FIXME: may this value be sometimes different? */ From 127cfea8bec7a06b27c0df393728e20e276e9543 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:41:28 +0100 Subject: [PATCH 110/207] default_payload: Include syslinuxcfg, all filesystems and xnu. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 70a8af873..71c23e50d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -410,7 +410,7 @@ bootcheck: $(BOOTCHECKS) if COND_i386_coreboot default_payload.elf: grub-mkstandalone grub-mkimage - pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif endif From 6f4189ffc19283b7a7ea8129d38a63bd4285f337 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:42:04 +0100 Subject: [PATCH 111/207] powerpc: Trim header in tests. --- tests/util/grub-shell.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 5ba2c299c..663cde663 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -82,6 +82,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in serial_port=escc-ch-b serial_null="-serial null" netbootext=elf + trim=1 ;; sparc64-ieee1275) From 4598cafa7d0a71ba39fbe59a8df1a9195994feec Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 12:43:02 +0100 Subject: [PATCH 112/207] arm64: Use cpu timer for timekeeping. --- grub-core/Makefile.core.def | 2 +- grub-core/kern/arm64/efi/init.c | 60 +++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 grub-core/kern/arm64/efi/init.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 58438c48d..887450110 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -213,7 +213,7 @@ kernel = { arm_efi = kern/arm/efi/init.c; arm_efi = kern/arm/efi/misc.c; - arm64_efi = kern/arm/efi/init.c; + arm64_efi = kern/arm64/efi/init.c; i386_pc = kern/i386/pc/init.c; i386_pc = kern/i386/pc/mmap.c; diff --git a/grub-core/kern/arm64/efi/init.c b/grub-core/kern/arm64/efi/init.c new file mode 100644 index 000000000..6224999ec --- /dev/null +++ b/grub-core/kern/arm64/efi/init.c @@ -0,0 +1,60 @@ +/* init.c - initialize an arm-based EFI system */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +static grub_uint64_t timer_frequency_in_khz; + +static grub_uint64_t +grub_efi_get_time_ms (void) +{ + grub_uint64_t tmr; + asm volatile("mrs %0, cntvct_el0" : "=r" (tmr)); + + return tmr / timer_frequency_in_khz; +} + + +void +grub_machine_init (void) +{ + grub_uint64_t timer_frequency; + + grub_efi_init (); + + asm volatile("mrs %0, cntfrq_el0" : "=r" (timer_frequency)); + timer_frequency_in_khz = timer_frequency / 1000; + + grub_install_get_time_ms (grub_efi_get_time_ms); +} + +void +grub_machine_fini (int flags) +{ + if (!(flags & GRUB_LOADER_FLAG_NORETURN)) + return; + + grub_efi_fini (); +} From 7c35f65aaca8539d3fccea17e3ff6fc0e71143a4 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 15:42:26 +0100 Subject: [PATCH 113/207] xnu: Add new kernel path to autoconfig. --- util/grub.d/10_xnu.in | 3 +++ util/grub.d/30_os-prober.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/util/grub.d/10_xnu.in b/util/grub.d/10_xnu.in index 51ee2f427..9c40b4536 100644 --- a/util/grub.d/10_xnu.in +++ b/util/grub.d/10_xnu.in @@ -56,6 +56,9 @@ EOF fi if [ /kernelcache -nt /System/Library/Extensions ]; then $1 /kernelcache boot-uuid=\${uuid} rd=*uuid + elif [ -f /System/Library/Kernels/kernel ]; then + $1 /System/Library/Kernels/kernel boot-uuid=\${uuid} rd=*uuid + xnu_kextdir /System/Library/Extensions else $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 5604ce2b6..515a68c7a 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -71,6 +71,9 @@ EOF fi if [ /kernelcache -nt /System/Library/Extensions ]; then $1 /kernelcache boot-uuid=\${uuid} rd=*uuid + elif [ -f /System/Library/Kernels/kernel ]; then + $1 /System/Library/Kernels/kernel boot-uuid=\${uuid} rd=*uuid + xnu_kextdir /System/Library/Extensions else $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then From 6e1ace590afd02abbdfdf05cff0672fc3906365a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 15:46:05 +0100 Subject: [PATCH 114/207] Change -v to -V for version of shell utils. --- util/grub-kbdcomp.in | 4 ++-- util/grub-mkconfig.in | 2 +- util/grub-reboot.in | 4 ++-- util/grub-set-default.in | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in index 715c483af..a15ec24e5 100644 --- a/util/grub-kbdcomp.in +++ b/util/grub-kbdcomp.in @@ -25,7 +25,7 @@ usage () { gettext "Make GRUB keyboard layout file."; echo echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")" echo gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self" @@ -54,7 +54,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; -o | --output) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 3183744bf..203b07696 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -85,7 +85,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; -o | --output) diff --git a/util/grub-reboot.in b/util/grub-reboot.in index 225fe5f21..4d4f75704 100644 --- a/util/grub-reboot.in +++ b/util/grub-reboot.in @@ -47,7 +47,7 @@ usage () { gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self" gettext "Set the default boot menu entry for GRUB, for the next boot only."; echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo @@ -81,7 +81,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; diff --git a/util/grub-set-default.in b/util/grub-set-default.in index 83a7be12f..6036f81e5 100644 --- a/util/grub-set-default.in +++ b/util/grub-set-default.in @@ -49,7 +49,7 @@ usage () { gettext_printf "This requires setting GRUB_DEFAULT=saved in %s/default/grub.\n" "$sysconfdir" echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo @@ -79,7 +79,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; From eba6db6323caf2c25e3531902b73c4a1a40a2d1a Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Fri, 12 Feb 2016 15:58:22 +0100 Subject: [PATCH 115/207] relocator: Fix integer underflow. --- grub-core/lib/relocator.c | 50 +++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c index f759c7f41..ea3ebc719 100644 --- a/grub-core/lib/relocator.c +++ b/grub-core/lib/relocator.c @@ -736,26 +736,36 @@ malloc_in_range (struct grub_relocator *rel, } isinsideafter = (!ncollisions && (nstarted || ((nlefto || nstartedfw) && !nblockfw))); - if (!isinsidebefore && isinsideafter) - starta = from_low_priv ? ALIGN_UP (events[j].pos, align) - : ALIGN_DOWN (events[j].pos - size, align) + size; - if (isinsidebefore && !isinsideafter && from_low_priv) - { - target = starta; - if (target < start) - target = start; - if (target + size <= end && target + size <= events[j].pos) - /* Found an usable address. */ - goto found; - } - if (isinsidebefore && !isinsideafter && !from_low_priv) - { - target = starta - size; - if (target > end - size) - target = end - size; - if (target >= start && target >= events[j].pos) - goto found; - } + if (from_low_priv) { + if (!isinsidebefore && isinsideafter) + starta = ALIGN_UP (events[j].pos, align); + + if (isinsidebefore && !isinsideafter) + { + target = starta; + if (target < start) + target = start; + if (target + size <= end && target + size <= events[j].pos) + /* Found an usable address. */ + goto found; + } + } else { + if (!isinsidebefore && isinsideafter) + { + if (events[j].pos >= size) + starta = ALIGN_DOWN (events[j].pos - size, align) + size; + else + starta = 0; + } + if (isinsidebefore && !isinsideafter && starta >= size) + { + target = starta - size; + if (target > end - size) + target = end - size; + if (target >= start && target >= events[j].pos) + goto found; + } + } } } From feef882f98f335b2725edc53af76f5ff50551949 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 16:08:04 +0100 Subject: [PATCH 116/207] grub-shell: Update 32-bit OVMF binary name. --- tests/util/grub-shell.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 663cde663..7848b4222 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -165,7 +165,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in boot=cd console=console trim=1 - qemuopts="-bios OVMF32.fd $qemuopts" + qemuopts="-bios OVMF-ia32.fd $qemuopts" ;; x86_64-efi) qemu=qemu-system-x86_64 From ce01054ec3f8f8d03fba434de94ab00118c16593 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 12 Feb 2016 16:31:23 +0100 Subject: [PATCH 117/207] lz4: Fix pointer overflow --- grub-core/fs/zfs/zfs_lz4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c index 1212a8986..2f73449f0 100644 --- a/grub-core/fs/zfs/zfs_lz4.c +++ b/grub-core/fs/zfs/zfs_lz4.c @@ -184,6 +184,8 @@ LZ4_uncompress_unknownOutputSize(const char *source, } } /* copy literals */ + if ((grub_addr_t) length > ~(grub_addr_t)op) + goto _output_error; cpy = op + length; if ((cpy > oend - COPYLENGTH) || (ip + length > iend - COPYLENGTH)) { From a2ab8c2172367e25f79617cad878102bd5f8a336 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 17:51:52 +0100 Subject: [PATCH 118/207] TODO: Remove obsolete link --- TODO | 4 ---- 1 file changed, 4 deletions(-) diff --git a/TODO b/TODO index 6ec1521cd..a9b6d3523 100644 --- a/TODO +++ b/TODO @@ -7,7 +7,3 @@ glance. So write to first. For bug tracking, refer to: http://savannah.gnu.org/bugs/?group=grub - -Our wiki also lists some areas that need work: - - http://grub.enbug.org/ From f96b34224e50dbba055f7744406038d5beccf2a6 Mon Sep 17 00:00:00 2001 From: Andreas Freimuth Date: Fri, 12 Feb 2016 19:19:11 +0100 Subject: [PATCH 119/207] Add Thinkpad T410s button cmos address. --- docs/grub.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi index 0afdd8ccd..82f6fa459 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -2538,6 +2538,8 @@ team are: 85:3 @item Asus EeePC 1005PE 84:1 (unconfirmed) +@item LENOVO ThinkPad T410s (2912W1C) +101:3 @end table To take full advantage of this function, install GRUB into the MBR From 080a20861c08397bfef5eb1471b6124a82a0777c Mon Sep 17 00:00:00 2001 From: Eric Snowberg Date: Fri, 12 Feb 2016 23:16:03 +0100 Subject: [PATCH 120/207] OBP available region contains grub. Start at grub_phys_end. This prevents a problem where grub was being overwritten since grub_phys_start does not start at a zero offset within the memory map. --- grub-core/loader/sparc64/ieee1275/linux.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c index d44d7a113..67ef04883 100644 --- a/grub-core/loader/sparc64/ieee1275/linux.c +++ b/grub-core/loader/sparc64/ieee1275/linux.c @@ -203,20 +203,20 @@ alloc_phys_choose (grub_uint64_t addr, grub_uint64_t len, if (addr + ctx->size >= end) return 0; - if (addr >= grub_phys_start && addr < grub_phys_end) - { - addr = ALIGN_UP (grub_phys_end, FOUR_MB); - if (addr + ctx->size >= end) - return 0; - } - if ((addr + ctx->size) >= grub_phys_start - && (addr + ctx->size) < grub_phys_end) + /* OBP available region contains grub. Start at grub_phys_end. */ + /* grub_phys_start does not start at the beginning of the memory region */ + if ((grub_phys_start >= addr && grub_phys_end < end) || + (addr > grub_phys_start && addr < grub_phys_end)) { addr = ALIGN_UP (grub_phys_end, FOUR_MB); if (addr + ctx->size >= end) return 0; } + grub_dprintf("loader", + "addr = 0x%lx grub_phys_start = 0x%lx grub_phys_end = 0x%lx\n", + addr, grub_phys_start, grub_phys_end); + if (loaded) { grub_addr_t linux_end = ALIGN_UP (linux_paddr + linux_size, FOUR_MB); From 25492a0f047cb7a6583ae195568599c296a604d6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 10 Jan 2016 13:48:26 +0100 Subject: [PATCH 121/207] Add wbinvd around bios call. Via C3 has problems with cache coherency when transitioning between the modes, so flush it around bios calls. --- grub-core/kern/i386/int.S | 11 +++++++++++ grub-core/kern/i386/pc/init.c | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/grub-core/kern/i386/int.S b/grub-core/kern/i386/int.S index 7edace404..862a54202 100644 --- a/grub-core/kern/i386/int.S +++ b/grub-core/kern/i386/int.S @@ -44,6 +44,13 @@ FUNCTION(grub_bios_interrupt) movl 24(%edx), %esi movl 28(%edx), %edx + /* + Via C3 CPUs have cache coherence problems, so we need to call + wbinvd at these 2 points. As wbinvd slows down boot, don't do + it on non-VIA. 9090 is nop nop. */ +VARIABLE(grub_bios_via_workaround1) + .byte 0x90, 0x90 + PROT_TO_REAL .code16 pushf @@ -92,6 +99,10 @@ intno: movw %ax, LOCAL(bios_register_es) popf + +VARIABLE(grub_bios_via_workaround2) + .byte 0x90, 0x90 + REAL_TO_PROT .code32 diff --git a/grub-core/kern/i386/pc/init.c b/grub-core/kern/i386/pc/init.c index 3c8160aab..27bc68b8a 100644 --- a/grub-core/kern/i386/pc/init.c +++ b/grub-core/kern/i386/pc/init.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -184,6 +185,26 @@ mmap_iterate_hook (grub_uint64_t addr, grub_uint64_t size, return 0; } +extern grub_uint16_t grub_bios_via_workaround1, grub_bios_via_workaround2; + +/* Via needs additional wbinvd. */ +static void +grub_via_workaround_init (void) +{ + grub_uint32_t manufacturer[3], max_cpuid; + if (! grub_cpu_is_cpuid_supported ()) + return; + + grub_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); + + if (grub_memcmp (manufacturer, "CentaurHauls", 12) != 0) + return; + + grub_bios_via_workaround1 = 0x090f; + grub_bios_via_workaround2 = 0x090f; + asm volatile ("wbinvd"); +} + void grub_machine_init (void) { @@ -193,6 +214,9 @@ grub_machine_init (void) #endif grub_addr_t modend; + /* This has to happen before any BIOS calls. */ + grub_via_workaround_init (); + grub_modbase = GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR + (_edata - _start); /* Initialize the console as early as possible. */ From 5cae910665ac0de9e409e3b606232cd66854081e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 17:56:41 +0100 Subject: [PATCH 122/207] Fix warnings when compiling with -O3 --- conf/Makefile.common | 2 +- grub-core/commands/i386/cmostest.c | 6 +++--- grub-core/fs/ntfscomp.c | 2 +- grub-core/fs/zfs/zfs.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 11296b550..6db04343a 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -65,7 +65,7 @@ grubconfdir = $(sysconfdir)/grub.d platformdir = $(pkglibdir)/$(target_cpu)-$(platform) starfielddir = $(pkgdatadir)/themes/starfield -CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion +CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-maybe-uninitialized CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib CFLAGS_POSIX = -fno-builtin diff --git a/grub-core/commands/i386/cmostest.c b/grub-core/commands/i386/cmostest.c index e5dea0769..c839b704d 100644 --- a/grub-core/commands/i386/cmostest.c +++ b/grub-core/commands/i386/cmostest.c @@ -45,7 +45,7 @@ static grub_err_t grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; @@ -67,7 +67,7 @@ static grub_err_t grub_cmd_cmosclean (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; @@ -85,7 +85,7 @@ static grub_err_t grub_cmd_cmosset (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; diff --git a/grub-core/fs/ntfscomp.c b/grub-core/fs/ntfscomp.c index 2e1ce51a8..3cd97d337 100644 --- a/grub-core/fs/ntfscomp.c +++ b/grub-core/fs/ntfscomp.c @@ -104,7 +104,7 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) if (tag & 1) { grub_uint32_t i, len, delta, code, lmask, dshift; - grub_uint16_t word; + grub_uint16_t word = 0; if (decomp_get16 (cc, &word)) return grub_errno; diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index c4ead29fb..6e1fff9e9 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -3132,7 +3132,7 @@ make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data) { void *osp; blkptr_t *bp; - grub_size_t ospsize; + grub_size_t ospsize = 0; grub_err_t err; grub_dprintf ("zfs", "endian = %d\n", mdn->endian); From fabde8324d1fccb79778d180aee30894c0b10c63 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 17:58:05 +0100 Subject: [PATCH 123/207] Remove -Wno-maybe-uninitialized as it may not be present. --- conf/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 6db04343a..11296b550 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -65,7 +65,7 @@ grubconfdir = $(sysconfdir)/grub.d platformdir = $(pkglibdir)/$(target_cpu)-$(platform) starfielddir = $(pkgdatadir)/themes/starfield -CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-maybe-uninitialized +CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib CFLAGS_POSIX = -fno-builtin From 59ec05bcf8bb443853c109039752cefdfc1c5e13 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 18:09:44 +0100 Subject: [PATCH 124/207] mm: Avoid integer overflow. --- grub-core/kern/mm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c index 1c3d02388..ee88ff611 100644 --- a/grub-core/kern/mm.c +++ b/grub-core/kern/mm.c @@ -325,6 +325,15 @@ grub_memalign (grub_size_t align, grub_size_t size) if (!grub_mm_base) goto fail; + if (size > ~(grub_size_t) align) + goto fail; + + /* We currently assume at least a 32-bit grub_size_t, + so limiting allocations to - 1MiB + in name of sanity is beneficial. */ + if ((size + align) > ~(grub_size_t) 0x100000) + goto fail; + align = (align >> GRUB_MM_ALIGN_LOG2); if (align == 0) align = 1; From 8d69065f5282e1f9e0b09a166586ce3a6b897581 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 18:10:31 +0100 Subject: [PATCH 125/207] default_payload.elf: Add modules from $(EXTRA_PAYLOAD_MODULES). This allows coreboot building system to add extra modules depending on user config. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 71c23e50d..cccd466aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -410,7 +410,7 @@ bootcheck: $(BOOTCHECKS) if COND_i386_coreboot default_payload.elf: grub-mkstandalone grub-mkimage - pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif endif From 01d50c25398d124c275f05ca2926657e2198bed4 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 18:11:51 +0100 Subject: [PATCH 126/207] default_payload.elf: Include password_pbkdf2. Withoout this module we may end up in a system where no password is accepted. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index cccd466aa..f132a8839 100644 --- a/Makefile.am +++ b/Makefile.am @@ -410,7 +410,7 @@ bootcheck: $(BOOTCHECKS) if COND_i386_coreboot default_payload.elf: grub-mkstandalone grub-mkimage - pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif endif From e3745f908706c07fa249616255ed993ef5704351 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 17 Feb 2016 18:19:18 +0100 Subject: [PATCH 127/207] default_payload.elf: Always rebuild and remove before build. It's difficult to know all dependencies. Since it's manual and cheap target anyway, simply always rebuild it. --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f132a8839..288e621d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -409,7 +409,8 @@ BOOTCHECK_TIMEOUT=180 bootcheck: $(BOOTCHECKS) if COND_i386_coreboot -default_payload.elf: grub-mkstandalone grub-mkimage +default_payload.elf: grub-mkstandalone grub-mkimage FORCE + rm $@ pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif From 625934ec0f208836c6f2dbe7bd8ad658cbdd8537 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 29 Jan 2016 15:26:58 +0100 Subject: [PATCH 128/207] menu_entry: Disable cursor during update_screen() When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF). To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen(). Signed-off-by: Thomas Huth --- grub-core/normal/menu_entry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c index b80d161dd..eeeee5580 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -254,6 +254,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, mode = ALL_LINES; } + grub_term_setcursor (term_screen->term, 0); + if (mode != NO_LINE) { /* Draw lines. This code is tricky, because this must calculate logical @@ -361,6 +363,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, } + grub_term_setcursor (term_screen->term, 1); + grub_term_refresh (term_screen->term); } From bc220962e366b1b46769ed6f9fa5be603ba58ab5 Mon Sep 17 00:00:00 2001 From: Eric Snowberg Date: Mon, 15 Feb 2016 10:53:45 -0800 Subject: [PATCH 129/207] ieee1275: prevent buffer over-read Prevent buffer over-read in grub_machine_mmap_iterate. This was causing phys_base from being calculated properly. This then caused the wrong value to be placed in ramdisk_image within struct linux_hdrs. Which prevented the ramdisk from loading on boot. Newer SPARC systems contain more than 8 available memory entries. For example on a T5-8 with 2TB of memory, the memory layout could look like this: T5-8 Memory reg 00000000 30000000 0000003f b0000000 00000800 00000000 00000040 00000000 00001000 00000000 00000040 00000000 00001800 00000000 00000040 00000000 00002000 00000000 00000040 00000000 00002800 00000000 00000040 00000000 00003000 00000000 00000040 00000000 00003800 00000000 00000040 00000000 available 00003800 00000000 0000003f ffcae000 00003000 00000000 00000040 00000000 00002800 00000000 00000040 00000000 00002000 00000000 00000040 00000000 00001800 00000000 00000040 00000000 00001000 00000000 00000040 00000000 00000800 00000000 00000040 00000000 00000000 70000000 0000003f 70000000 00000000 6eef8000 00000000 00002000 00000000 30400000 00000000 3eaf6000 name memory Signed-off-by: Eric Snowberg --- grub-core/kern/ieee1275/mmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/ieee1275/mmap.c b/grub-core/kern/ieee1275/mmap.c index 911bb0011..d7f6a1bde 100644 --- a/grub-core/kern/ieee1275/mmap.c +++ b/grub-core/kern/ieee1275/mmap.c @@ -25,7 +25,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) { grub_ieee1275_phandle_t root; grub_ieee1275_phandle_t memory; - grub_uint32_t available[32]; + grub_uint32_t available[128]; grub_ssize_t available_size; grub_uint32_t address_cells = 1; grub_uint32_t size_cells = 1; @@ -49,6 +49,9 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) sizeof available, &available_size)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine /memory/available property"); + if (available_size > sizeof (available)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "/memory response buffer exceeded"); if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) { From be4e9d20a559ea0ddab5c1abe512a3d875742389 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 20 Feb 2016 09:12:15 +0100 Subject: [PATCH 130/207] Refresh before abort This ensures that abort message is actually visible to the user. --- grub-core/kern/misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index e3f851633..d1a54df6c 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1106,6 +1106,8 @@ grub_fatal (const char *fmt, ...) grub_vprintf (_(fmt), ap); va_end (ap); + grub_refresh (); + grub_abort (); } From 0678b5d629a4c9a7258d24a0af10920d0e965da7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 22 Feb 2016 03:25:50 +0100 Subject: [PATCH 131/207] usb_keyboard: Remove useless include This prevents non-PCI machines from having USB. --- grub-core/term/usb_keyboard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/grub-core/term/usb_keyboard.c b/grub-core/term/usb_keyboard.c index 3b7484635..e67b8f785 100644 --- a/grub-core/term/usb_keyboard.c +++ b/grub-core/term/usb_keyboard.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include From 054d1325e9ece974aecb478e6b43ca6c37d0bb3e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 22 Feb 2016 03:32:50 +0100 Subject: [PATCH 132/207] Improve EHCI logging Add dprintf's on common error paths and remove some entries which are too noisy. --- grub-core/bus/usb/ehci.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c index c986c24f6..ae1efb214 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -1289,16 +1289,26 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, grub_ehci_td_t td_prev = NULL; int i; struct grub_ehci_transfer_controller_data *cdata; + grub_uint32_t status; /* Check if EHCI is running and AL is enabled */ - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_HC_HALTED) != 0) + status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + if ((status & GRUB_EHCI_ST_HC_HALTED) != 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ - return GRUB_USB_ERR_INTERNAL; - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) + { + grub_dprintf ("ehci", "setup_transfer: halted, status = 0x%x\n", + status); + return GRUB_USB_ERR_INTERNAL; + } + status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + if ((status & (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ - return GRUB_USB_ERR_INTERNAL; + { + grub_dprintf ("ehci", "setup_transfer: no AS/PS, status = 0x%x\n", + status); + return GRUB_USB_ERR_INTERNAL; + } /* Allocate memory for controller transfer data. */ cdata = grub_malloc (sizeof (*cdata)); @@ -1310,6 +1320,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, cdata->qh_virt = grub_ehci_find_qh (e, transfer); if (!cdata->qh_virt) { + grub_dprintf ("ehci", "setup_transfer: no QH\n"); grub_free (cdata); return GRUB_USB_ERR_INTERNAL; } @@ -1319,6 +1330,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, cdata->td_alt_virt = grub_ehci_alloc_td (e); if (!cdata->td_alt_virt) { + grub_dprintf ("ehci", "setup_transfer: no TDs\n"); grub_free (cdata); return GRUB_USB_ERR_INTERNAL; } @@ -1345,6 +1357,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, grub_ehci_free_tds (e, cdata->td_first_virt, NULL, &actual); grub_free (cdata); + grub_dprintf ("ehci", "setup_transfer: no TD\n"); return GRUB_USB_ERR_INTERNAL; } @@ -1777,11 +1790,6 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed) status = grub_ehci_port_read (e, port); - grub_dprintf ("ehci", "detect_dev: EHCI STATUS: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); - grub_dprintf ("ehci", "detect_dev: iobase=%p, port=%d, status=0x%02x\n", - e->iobase, port, status); - /* Connect Status Change bit - it detects change of connection */ if (status & GRUB_EHCI_PORT_CONNECT_CH) { From 15dfea842c03fd373b0b39e98716051815416e95 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 23 Feb 2016 09:12:14 +0300 Subject: [PATCH 133/207] multiboot2: zero reserved field in memory map Documentation says, bootloader should set reserved field to zero. Reported by Wink Saville --- grub-core/loader/multiboot_mbi2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index d7c19bc99..f147d674d 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -420,6 +420,7 @@ grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, (*mmap_entry)->addr = addr; (*mmap_entry)->len = size; (*mmap_entry)->type = type; + (*mmap_entry)->zero = 0; (*mmap_entry)++; return 0; From 1b782e902e69516f82158203674d4951a40c82d4 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 23 Feb 2016 23:14:41 +0300 Subject: [PATCH 134/207] search: actually skip floppy with --no-floppy grub_device_iterate() ignores device when iterator returns 1, not 0. Reported by Carlos E. R. --- grub-core/commands/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c index 440303a4e..7dd32e445 100644 --- a/grub-core/commands/search.c +++ b/grub-core/commands/search.c @@ -64,7 +64,7 @@ iterate_device (const char *name, void *data) /* Skip floppy drives when requested. */ if (ctx->no_floppy && name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') - return 0; + return 1; #ifdef DO_SEARCH_FS_UUID #define compare_fn grub_strcasecmp From 94c56a4c65c9b2c0cb99f225fadffc2ca990c9d1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 23 Feb 2016 08:57:31 +0100 Subject: [PATCH 135/207] ieee1275: fix signed comparison --- grub-core/kern/ieee1275/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/ieee1275/mmap.c b/grub-core/kern/ieee1275/mmap.c index d7f6a1bde..bf325eadf 100644 --- a/grub-core/kern/ieee1275/mmap.c +++ b/grub-core/kern/ieee1275/mmap.c @@ -49,7 +49,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) sizeof available, &available_size)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine /memory/available property"); - if (available_size > sizeof (available)) + if (available_size < 0 || (grub_size_t) available_size > sizeof (available)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "/memory response buffer exceeded"); From eb9f401fc1e919fa29602d4d7b9b4378338e16e9 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 10 Feb 2016 13:21:00 -0800 Subject: [PATCH 136/207] net: fix ipv6 routing ipv6 routing in grub2 is broken, we cannot talk to anything outside our local network or anything that doesn't route in our global namespace. This patch fixes this by doing a couple of things 1) Read the router information off of the router advertisement. If we have a router lifetime we need to take the source address and create a route from it. 2) Changes the routing stuff slightly to allow you to specify a gateway _and_ an interface. Since the router advertisements come in on the link local address we need to associate it with the global address on the card. So when we are processing the router advertisement, either use the SLAAC interface we create and add the route to that interface, or loop through the global addresses we currently have on our interface and associate it with one of those addresses. We need to have a special case here for the default route so that it gets used, we do this by setting the masksize to 0 to mean it encompasses all networks. The routing code will automatically select the best route so if there is a closer match we will use that. With this patch I can now talk to ipv6 addresses outside of my local network. Thanks, Signed-off-by: Josef Bacik --- grub-core/net/bootp.c | 2 +- grub-core/net/drivers/ieee1275/ofnet.c | 4 +- grub-core/net/icmp6.c | 63 +++++++++++++++++++++++++- grub-core/net/net.c | 40 ++++++---------- include/grub/net.h | 25 +++++++++- 5 files changed, 103 insertions(+), 31 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 4fdeac3ef..a088244b4 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -82,7 +82,7 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) grub_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4)); rname = grub_xasprintf ("%s:default", name); if (rname) - grub_net_add_route_gw (rname, target, gw); + grub_net_add_route_gw (rname, target, gw, NULL); grub_free (rname); } break; diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index eff9085ed..6bd3b922e 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -151,7 +151,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask; grub_net_link_level_address_t hw_addr; grub_net_interface_flags_t flags = 0; - struct grub_net_network_level_interface *inter; + struct grub_net_network_level_interface *inter = NULL; hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; @@ -221,7 +221,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, target.ipv4.masksize = 0; rname = grub_xasprintf ("%s:default", ((*card)->name)); if (rname) - grub_net_add_route_gw (rname, target, gateway_addr); + grub_net_add_route_gw (rname, target, gateway_addr, inter); else return grub_errno; } diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c index 7953e68ec..2cbd95dce 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -115,6 +115,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, grub_uint8_t ttl) { struct icmp_header *icmph; + struct grub_net_network_level_interface *orig_inf = inf; grub_err_t err; grub_uint16_t checksum; @@ -345,14 +346,31 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, { grub_uint8_t *ptr; struct option_header *ohdr; + struct router_adv *radv; + struct grub_net_network_level_interface *route_inf = NULL; + int default_route = 0; if (icmph->code) break; + radv = (struct router_adv *)nb->data; err = grub_netbuff_pull (nb, sizeof (struct router_adv)); if (err) { grub_netbuff_free (nb); return err; } + if (grub_be_to_cpu16 (radv->router_lifetime) > 0) + { + struct grub_net_route *route; + + FOR_NET_ROUTES (route) + { + if (!grub_memcmp (&route->gw, source, sizeof (route->gw))) + break; + } + if (route == NULL) + default_route = 1; + } + for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; ptr += ohdr->len * 8) { @@ -413,7 +431,11 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, /* Update lease time if needed here once we have lease times. */ if (inf) - continue; + { + if (!route_inf) + route_inf = inf; + continue; + } grub_dprintf ("net", "creating slaac\n"); @@ -429,12 +451,51 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, inf = grub_net_add_addr (name, card, &addr, &slaac->address, 0); + if (!route_inf) + route_inf = inf; grub_net_add_route (name, netaddr, inf); grub_free (name); } } } } + if (default_route) + { + char *name; + grub_net_network_level_netaddress_t netaddr; + name = grub_xasprintf ("%s:ra:default6", card->name); + if (!name) + { + grub_errno = GRUB_ERR_NONE; + goto next; + } + /* Default routes take alll of the traffic, so make the mask huge */ + netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + netaddr.ipv6.masksize = 0; + netaddr.ipv6.base[0] = 0; + netaddr.ipv6.base[1] = 0; + + /* May not have gotten slaac info, find a global address on this + card. */ + if (route_inf == NULL) + { + FOR_NET_NETWORK_LEVEL_INTERFACES (inf) + { + if (inf->card == card && inf != orig_inf + && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && grub_net_hwaddr_cmp(&inf->hwaddress, + &orig_inf->hwaddress) == 0) + { + route_inf = inf; + break; + } + } + } + if (route_inf != NULL) + grub_net_add_route_gw (name, netaddr, *source, route_inf); + grub_free (name); + } +next: if (ptr != nb->tail) break; } diff --git a/grub-core/net/net.c b/grub-core/net/net.c index d07029b34..942459527 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -37,21 +37,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); char *grub_net_default_server; -struct grub_net_route -{ - struct grub_net_route *next; - struct grub_net_route **prev; - grub_net_network_level_netaddress_t target; - char *name; - struct grub_net_network_level_protocol *prot; - int is_gateway; - union - { - struct grub_net_network_level_interface *interface; - grub_net_network_level_address_t gw; - }; -}; - struct grub_net_route *grub_net_routes = NULL; struct grub_net_network_level_interface *grub_net_network_level_interfaces = NULL; struct grub_net_card *grub_net_cards = NULL; @@ -410,14 +395,6 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), return err; } -static inline void -grub_net_route_register (struct grub_net_route *route) -{ - grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), - GRUB_AS_LIST (route)); -} - -#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) static int parse_ip (const char *val, grub_uint32_t *ip, const char **rest) @@ -524,6 +501,8 @@ match_net (const grub_net_network_level_netaddress_t *net, case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { grub_uint64_t mask[2]; + if (net->ipv6.masksize == 0) + return 1; if (net->ipv6.masksize <= 64) { mask[0] = 0xffffffffffffffffULL << (64 - net->ipv6.masksize); @@ -687,7 +666,14 @@ grub_net_route_address (grub_net_network_level_address_t addr, return GRUB_ERR_NONE; } if (depth == 0) - *gateway = bestroute->gw; + { + *gateway = bestroute->gw; + if (bestroute->interface != NULL) + { + *interf = bestroute->interface; + return GRUB_ERR_NONE; + } + } curtarget = bestroute->gw; } @@ -1109,7 +1095,8 @@ grub_net_add_route (const char *name, grub_err_t grub_net_add_route_gw (const char *name, grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw) + grub_net_network_level_address_t gw, + struct grub_net_network_level_interface *inter) { struct grub_net_route *route; @@ -1127,6 +1114,7 @@ grub_net_add_route_gw (const char *name, route->target = target; route->is_gateway = 1; route->gw = gw; + route->interface = inter; grub_net_route_register (route); @@ -1152,7 +1140,7 @@ grub_cmd_addroute (struct grub_command *cmd __attribute__ ((unused)), err = grub_net_resolve_address (args[3], &gw); if (err) return err; - return grub_net_add_route_gw (args[0], target, gw); + return grub_net_add_route_gw (args[0], target, gw, NULL); } else { diff --git a/include/grub/net.h b/include/grub/net.h index 538baa33e..2192fa186 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -191,6 +191,18 @@ typedef struct grub_net_network_level_netaddress }; } grub_net_network_level_netaddress_t; +struct grub_net_route +{ + struct grub_net_route *next; + struct grub_net_route **prev; + grub_net_network_level_netaddress_t target; + char *name; + struct grub_net_network_level_protocol *prot; + int is_gateway; + struct grub_net_network_level_interface *interface; + grub_net_network_level_address_t gw; +}; + #define FOR_PACKETS(cont,var) for (var = (cont).first; var; var = var->next) static inline grub_err_t @@ -367,6 +379,16 @@ grub_net_card_unregister (struct grub_net_card *card); #define FOR_NET_CARDS_SAFE(var, next) for (var = grub_net_cards, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) +extern struct grub_net_route *grub_net_routes; + +static inline void +grub_net_route_register (struct grub_net_route *route) +{ + grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), + GRUB_AS_LIST (route)); +} + +#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) struct grub_net_session * grub_net_open_tcp (char *address, grub_uint16_t port); @@ -392,7 +414,8 @@ grub_net_add_route (const char *name, grub_err_t grub_net_add_route_gw (const char *name, grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw); + grub_net_network_level_address_t gw, + struct grub_net_network_level_interface *inter); #define GRUB_NET_BOOTP_MAC_ADDR_LEN 16 From 5486a4e12b7ad18f06156bb042a350a39d355c22 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 26 Feb 2016 11:12:35 +0100 Subject: [PATCH 137/207] Makefile: Don't delete default_payload.elf if it doesn't exist. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 288e621d3..00a9663b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -410,7 +410,7 @@ bootcheck: $(BOOTCHECKS) if COND_i386_coreboot default_payload.elf: grub-mkstandalone grub-mkimage FORCE - rm $@ + test -f $@ && rm $@ || true pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif From 06a3b0b214d077cc2a52a6295175de3c79c04113 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 26 Feb 2016 11:37:47 +0100 Subject: [PATCH 138/207] Regenerate checksums --- grub-core/tests/checksums.h | 196 ++++++++++++++++++------------------ 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/grub-core/tests/checksums.h b/grub-core/tests/checksums.h index b42d63d25..2320158d4 100644 --- a/grub-core/tests/checksums.h +++ b/grub-core/tests/checksums.h @@ -1,101 +1,101 @@ - { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24dc7bce, 0x24dc7bce, 0x338542b, 0x338542b, 0x2016b9d1, 0x2016b9d1, 0xc2619a36, 0xc2619a36, 0x10fce1e, 0x10fce1e, 0x8267298e, 0x8267298e, 0xf44246cf, 0xf44246cf, 0x3ee2860f, 0x3ee2860f, 0x1191f916, 0x1191f916, 0xfa8ce1b5, 0xfa8ce1b5, 0xc1f18b8e, 0xc1f18b8e, 0x43f8c0e8, 0x43f8c0e8, 0xbc0d166a, 0xbc0d166a, 0x7b742e8f, 0x7b742e8f, 0x2c3c7f89, 0x2c3c7f89, 0x80148a7e, 0x80148a7e, 0x21daaadf, 0x21daaadf, 0x15e97fa9, 0x15e97fa9, 0x2428d454, 0x2428d454, 0xb12b0f78, 0xb12b0f78, 0x29648b05, 0x8ce36e6f, 0xd26b03dd, 0xd26b03dd, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd09d4d28, 0xd09d4d28, 0xb41a2f17, 0xb41a2f17, 0x56381354, 0x56381354, 0xf2c5615f, 0xf2c5615f, 0xa41822ae, 0xa41822ae, 0xba2e3e60, 0xba2e3e60, 0x1859aaac, 0x1859aaac, 0x6c354a92, 0x6c354a92, 0x652d3eb, 0x652d3eb, 0xffcf0fd8, 0xffcf0fd8, 0xd3c9187c, 0xd3c9187c, 0xdee59346, 0xdee59346, 0x950f6354, 0x950f6354, 0xa2f7e36a, 0xa2f7e36a, 0x3967359a, 0x3967359a, 0x12738c9a, 0x12738c9a, 0xffb94ca3, 0xffb94ca3, 0xd9384791, 0xd9384791, 0xade1fd25, 0xade1fd25, 0xca109ebe, 0xca109ebe, 0x6e794e, 0x20d769cf, 0x29cc1fdc, 0x29cc1fdc, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6cfe9089, 0x6cfe9089, 0xbe85dea2, 0xbe85dea2, 0x5f57923d, 0x5f57923d, 0xd28ad04b, 0xd28ad04b, 0x9ac91b28, 0x9ac91b28, 0x26977f54, 0x26977f54, 0x56cfda54, 0x56cfda54, 0xae54550f, 0xae54550f, 0x5843182b, 0x5843182b, 0xa1524272, 0xa1524272, 0x86b707db, 0x86b707db, 0x4127540e, 0x4127540e, 0xe89ea08e, 0xe89ea08e, 0x85f4dccc, 0x85f4dccc, 0xf910d16c, 0xf910d16c, 0xd43ff6b8, 0xd43ff6b8, 0xcdec4fd0, 0xcdec4fd0, 0xad650879, 0xad650879, 0x6d8e01c7, 0x6d8e01c7, 0x3ce7c69f, 0x3ce7c69f, 0xed54e2ef, 0x141319e, 0x9003a604, 0x9003a604, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x37f1b28e, 0x37f1b28e, 0x248de37a, 0x248de37a, 0x8b84bbe6, 0x8b84bbe6, 0x62efb943, 0x62efb943, 0x50d082fd, 0x50d082fd, 0x68a0c1, 0x68a0c1, 0xa335f8d0, 0xa335f8d0, 0xf26eaa27, 0xf26eaa27, 0x9f661fa2, 0x9f661fa2, 0x9a9c6bcb, 0x9a9c6bcb, 0xa5427057, 0xa5427057, 0x59aabcc8, 0x59aabcc8, 0xd1563970, 0xd1563970, 0x5f65ea2e, 0x5f65ea2e, 0xce189d5e, 0xce189d5e, 0xa0ac6e61, 0xa0ac6e61, 0xf85ec3, 0xf85ec3, 0xa6a5bea8, 0xa6a5bea8, 0xae55a1ba, 0xae55a1ba, 0x23f4e9e3, 0x23f4e9e3, 0x580abc5c, 0x58b54e7f, 0xafe85bbb, 0xafe85bbb, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6d4812ec, 0x6d4812ec, 0x9d93973a, 0x9d93973a, 0x88cb4e17, 0x88cb4e17, 0x81f14f0a, 0x81f14f0a, 0x7f9f1875, 0x7f9f1875, 0x292f8345, 0x292f8345, 0x524cefe0, 0x524cefe0, 0x5d02251, 0x5d02251, 0x61afaf9e, 0x61afaf9e, 0xc327f8b9, 0xc327f8b9, 0xa1ece03d, 0xa1ece03d, 0xbb98b63c, 0xbb98b63c, 0x61b920db, 0x61b920db, 0xb1571b03, 0xb1571b03, 0xd315b012, 0xd315b012, 0xee77780c, 0xee77780c, 0x9b6ce52e, 0x9b6ce52e, 0x3b18a467, 0x3b18a467, 0x5ab91ffb, 0x5ab91ffb, 0x9255edea, 0x9255edea, 0x9ca85712, 0xa249a7fa, 0x213825f8, 0x213825f8, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10bc4224, 0x10bc4224, 0xb8085994, 0xb8085994, 0x6ab26d0a, 0x6ab26d0a, 0xde71396c, 0xde71396c, 0x425a3956, 0x425a3956, 0xb7d2a7e3, 0xb7d2a7e3, 0x658ab388, 0x658ab388, 0x3fadf9dc, 0x3fadf9dc, 0xb29884ae, 0xb29884ae, 0x3a0830a7, 0x3a0830a7, 0xcf41267a, 0xcf41267a, 0x121c9703, 0x121c9703, 0xd126f87c, 0xd126f87c, 0x3b9d5bf6, 0x3b9d5bf6, 0x2a05cbef, 0x2a05cbef, 0x9ad41c2c, 0x9ad41c2c, 0xebf19db8, 0xebf19db8, 0x79f1b335, 0x79f1b335, 0xad2f9e8d, 0xad2f9e8d, 0x99596c48, 0x99596c48, 0x75b1cae6, 0x3cd081b2, 0x23e8ef2f, 0x23e8ef2f, }, 45 }, - { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8920d2ff, 0x8920d2ff, 0x369cb8d2, 0x369cb8d2, 0x880f23e4, 0x880f23e4, 0xf4a02ce2, 0xf4a02ce2, 0x7933f9a4, 0x7933f9a4, 0x488859f0, 0x488859f0, 0x75855108, 0x75855108, 0xf0463685, 0xf0463685, 0xf3e90b78, 0xf3e90b78, 0xac92b2b6, 0xac92b2b6, 0x63131cc5, 0x63131cc5, 0xfb714a00, 0xfb714a00, 0xc495c9a0, 0xc495c9a0, 0x314b6225, 0x314b6225, 0xc0d56232, 0xc0d56232, 0xa051d312, 0xa051d312, 0x9c0d295c, 0x9c0d295c, 0x3f234b5, 0x3f234b5, 0xa4201189, 0xa4201189, 0x23af1b2f, 0x23af1b2f, 0xc787ef0f, 0x2a3c46f8, 0xf03fe2d9, 0xf03fe2d9, }, 45 }, - { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdff707ef, 0xb938eb6c, 0xdff707ef, 0x9c01caa8, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x9c01caa8, 0x9c01caa8, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x59f141e3, 0xfddbc65b, 0x59f141e3, 0x77f4c49c, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0x77f4c49c, 0x77f4c49c, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9ac56bc2, 0x2049341a, 0x9ac56bc2, 0xc7d20646, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0xc7d20646, 0xc7d20646, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd50b603, 0xbef0bf34, 0xd50b603, 0xa306ffdb, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xa306ffdb, 0xa306ffdb, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9408bd4d, 0x84fea62c, 0x9408bd4d, 0xe2ae88fe, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xe2ae88fe, 0xe2ae88fe, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8460b76a, 0xd01813b4, 0x8460b76a, 0x9f656d6d, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0x9f656d6d, 0x9f656d6d, 0xdd28f52b, }, 20 }, - { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x115542af, 0xbac49512, 0x115542af, 0xeeea592f, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xeeea592f, 0xeeea592f, 0x43d1f34, }, 20 }, - { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x60e56714, 0x14275a99, 0x60e56714, 0x35080c92, 0x9a2e0d26, 0x35f491f9, 0x35f491f9, 0x35f491f9, 0x692c6739, 0x692c6739, 0x692c6739, 0x40b4a9ab, 0x40b4a9ab, 0x40b4a9ab, 0x59c36f00, 0x35080c92, 0x35080c92, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x33d94a8c, 0x7b789e53, 0x33d94a8c, 0xe8b9b6bf, 0xa9d58ccd, 0xeee84c5, 0xeee84c5, 0xeee84c5, 0x5bb12ecf, 0x5bb12ecf, 0x5bb12ecf, 0x3282e686, 0x3282e686, 0x3282e686, 0xaa4593fe, 0xe8b9b6bf, 0xe8b9b6bf, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4669404, 0x9afa8e99, 0xe4669404, 0xdd25167e, 0x5411be8b, 0x2cf5262a, 0x2cf5262a, 0x2cf5262a, 0x534b80be, 0x534b80be, 0x534b80be, 0x113fe0c6, 0x113fe0c6, 0x113fe0c6, 0xc9cbf769, 0xdd25167e, 0xdd25167e, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x37ed1568, 0x12f55eef, 0x37ed1568, 0x8aa8ad16, 0x740d78cf, 0x7bd2e3a3, 0x7bd2e3a3, 0x7bd2e3a3, 0x907709df, 0x907709df, 0x907709df, 0x963c092f, 0x963c092f, 0x963c092f, 0x1c3742c9, 0x8aa8ad16, 0x8aa8ad16, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xc5315ac9, 0x7dece9d3, 0xc5315ac9, 0xc84ef08b, 0xbcda144c, 0xd45c93dc, 0xd45c93dc, 0xd45c93dc, 0xbb154fcd, 0xbb154fcd, 0xbb154fcd, 0xb6e3d1ce, 0xb6e3d1ce, 0xb6e3d1ce, 0xcc5a7bed, 0xc84ef08b, 0xc84ef08b, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x40a72ecd, 0x2304571f, 0x40a72ecd, 0xd2de6d81, 0x5d55a141, 0x304db662, 0x304db662, 0x304db662, 0xf6fff27c, 0xf6fff27c, 0xf6fff27c, 0xe29a22c3, 0xe29a22c3, 0xe29a22c3, 0xef4a3312, 0xd2de6d81, 0xd2de6d81, }, 18 }, - { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xe6143ead, 0x19816f75, 0xe6143ead, 0xe2db78c2, 0xa992f629, 0xe0ddd143, 0xe0ddd143, 0xe0ddd143, 0x612e2792, 0x612e2792, 0x612e2792, 0xf78a9efd, 0xf78a9efd, 0xf78a9efd, 0x54e48d80, 0xe2db78c2, 0xe2db78c2, }, 18 }, - { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x3d69d4f7, 0x5b2df52e, 0x3d69d4f7, 0x7e9f19b0, 0x59c36f00, 0x59c36f00, 0xaa418d14, 0xaa418d14, 0xaa418d14, 0xd4c1e072, 0xd4c1e072, 0xd4c1e072, 0xb637f5a0, 0xb637f5a0, 0xb637f5a0, 0x59c36f00, 0x7e9f19b0, 0x7e9f19b0, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xea153935, 0xadda68ff, 0xea153935, 0xc410bc4a, 0xaa4593fe, 0xaa4593fe, 0x63090f39, 0x63090f39, 0x63090f39, 0xc5fc025e, 0xc5fc025e, 0xc5fc025e, 0xe8c4a926, 0xe8c4a926, 0xe8c4a926, 0xaa4593fe, 0xc410bc4a, 0xc410bc4a, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe677248f, 0x9a146b56, 0xe677248f, 0xbb60490b, 0xc9cbf769, 0xc9cbf769, 0xebd87b6a, 0xebd87b6a, 0xebd87b6a, 0x1500baa6, 0x1500baa6, 0x1500baa6, 0xfc4a05ae, 0xfc4a05ae, 0xfc4a05ae, 0xc9cbf769, 0xbb60490b, 0xbb60490b, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2fe1d8b3, 0x344dc22f, 0x2fe1d8b3, 0x81b7916b, 0x9813a416, 0x9813a416, 0xb42009b, 0xb42009b, 0xb42009b, 0x9a9986a8, 0x9a9986a8, 0x9a9986a8, 0x8323bb78, 0x8323bb78, 0x8323bb78, 0x9813a416, 0x81b7916b, 0x81b7916b, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x2f2ab760, 0x373afa93, 0x2f2ab760, 0x598c82d3, 0x5fcf013d, 0x5fcf013d, 0x8a9a15e2, 0x8a9a15e2, 0x8a9a15e2, 0x588a0d94, 0x588a0d94, 0x588a0d94, 0x4ef9320b, 0x4ef9320b, 0x4ef9320b, 0x5fcf013d, 0x598c82d3, 0x598c82d3, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xb9de66a8, 0x2b705981, 0xb9de66a8, 0xa2dbbcaf, 0xdd28f52b, 0xdd28f52b, 0x971eb98b, 0x971eb98b, 0x971eb98b, 0xb622406f, 0xb622406f, 0xb622406f, 0xcb9a8be3, 0xcb9a8be3, 0xcb9a8be3, 0xdd28f52b, 0xa2dbbcaf, 0xa2dbbcaf, 0xdd28f52b, }, 20 }, - { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x84029f68, 0x7385ec77, 0x84029f68, 0x7bbd84e8, 0x43d1f34, 0x43d1f34, 0x73cb201f, 0x73cb201f, 0x73cb201f, 0xcc189b7, 0xcc189b7, 0xcc189b7, 0x95908c31, 0x95908c31, 0x95908c31, 0x43d1f34, 0x7bbd84e8, 0x7bbd84e8, 0x43d1f34, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb2446469, 0xca75968f, 0xb2446469, 0xf1b2a92e, 0x59c36f00, 0x59c36f00, 0xc0eac671, 0xc0eac671, 0xc0eac671, 0xbe6aab17, 0xbe6aab17, 0xbe6aab17, 0xdc9cbec5, 0xdc9cbec5, 0xdc9cbec5, 0x59c36f00, 0xf1b2a92e, 0xf1b2a92e, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe219612c, 0x41ad1120, 0xe219612c, 0xcc1ce453, 0xaa4593fe, 0xaa4593fe, 0x1f05167, 0x1f05167, 0x1f05167, 0xa7055c00, 0xa7055c00, 0xa7055c00, 0x8a3df778, 0x8a3df778, 0x8a3df778, 0xaa4593fe, 0xcc1ce453, 0xcc1ce453, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9f3ca4a3, 0x3df9621e, 0x9f3ca4a3, 0xc22bc927, 0xc9cbf769, 0xc9cbf769, 0x8f0b71ba, 0x8f0b71ba, 0x8f0b71ba, 0x71d3b076, 0x71d3b076, 0x71d3b076, 0x98990f7e, 0x98990f7e, 0x98990f7e, 0xc9cbf769, 0xc22bc927, 0xc22bc927, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6b1e7755, 0x4532973e, 0x6b1e7755, 0xc5483e8d, 0x9813a416, 0x9813a416, 0xa279dbc8, 0xa279dbc8, 0xa279dbc8, 0x33a25dfb, 0x33a25dfb, 0x33a25dfb, 0x2a18602b, 0x2a18602b, 0x2a18602b, 0x9813a416, 0xc5483e8d, 0xc5483e8d, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa3774c63, 0x38dffb0e, 0xa3774c63, 0xd5d179d0, 0x5fcf013d, 0x5fcf013d, 0x28872666, 0x28872666, 0x28872666, 0xfa973e10, 0xfa973e10, 0xfa973e10, 0xece4018f, 0xece4018f, 0xece4018f, 0x5fcf013d, 0xd5d179d0, 0xd5d179d0, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe9556aa5, 0x77425030, 0xe9556aa5, 0xf250b0a2, 0xdd28f52b, 0xdd28f52b, 0x938cfa6a, 0x938cfa6a, 0x938cfa6a, 0xb2b0038e, 0xb2b0038e, 0xb2b0038e, 0xcf08c802, 0xcf08c802, 0xcf08c802, 0xdd28f52b, 0xf250b0a2, 0xf250b0a2, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9adc43d0, 0xd8ac5204, 0x9adc43d0, 0x65635850, 0x43d1f34, 0x43d1f34, 0xc182db12, 0xc182db12, 0xc182db12, 0xbe8872ba, 0xbe8872ba, 0xbe8872ba, 0x27d9773c, 0x27d9773c, 0x27d9773c, 0x43d1f34, 0x65635850, 0x65635850, 0x43d1f34, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7fd0187d, 0x7d05975c, 0x7fd0187d, 0x3c26d53a, 0x59c36f00, 0x59c36f00, 0xb4fad8de, 0xb4fad8de, 0xb4fad8de, 0xca7ab5b8, 0xca7ab5b8, 0xca7ab5b8, 0xa88ca06a, 0xa88ca06a, 0xa88ca06a, 0x59c36f00, 0x3c26d53a, 0x3c26d53a, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x54f3fad9, 0xe7a5a67a, 0x54f3fad9, 0x7af67fa6, 0xaa4593fe, 0xaa4593fe, 0xcae58c6a, 0xcae58c6a, 0xcae58c6a, 0x6c10810d, 0x6c10810d, 0x6c10810d, 0x41282a75, 0x41282a75, 0x41282a75, 0xaa4593fe, 0x7af67fa6, 0x7af67fa6, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x869916b8, 0x373dbcc3, 0x869916b8, 0xdb8e7b3c, 0xc9cbf769, 0xc9cbf769, 0xaa0c75c1, 0xaa0c75c1, 0xaa0c75c1, 0x54d4b40d, 0x54d4b40d, 0x54d4b40d, 0xbd9e0b05, 0xbd9e0b05, 0xbd9e0b05, 0xc9cbf769, 0xdb8e7b3c, 0xdb8e7b3c, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb2f32f4, 0xff8e66df, 0xb2f32f4, 0xa5797b2c, 0x9813a416, 0x9813a416, 0x9fc65347, 0x9fc65347, 0x9fc65347, 0xe1dd574, 0xe1dd574, 0xe1dd574, 0x17a7e8a4, 0x17a7e8a4, 0x17a7e8a4, 0x9813a416, 0xa5797b2c, 0xa5797b2c, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x26280874, 0x6f7dd72, 0x26280874, 0x508e3dc7, 0x5fcf013d, 0x5fcf013d, 0x197943fe, 0x197943fe, 0x197943fe, 0xcb695b88, 0xcb695b88, 0xcb695b88, 0xdd1a6417, 0xdd1a6417, 0xdd1a6417, 0x5fcf013d, 0x508e3dc7, 0x508e3dc7, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd23ae631, 0xe5a30d5e, 0xd23ae631, 0xc93f3c36, 0xdd28f52b, 0xdd28f52b, 0x7042f8c, 0x7042f8c, 0x7042f8c, 0x2638d668, 0x2638d668, 0x2638d668, 0x5b801de4, 0x5b801de4, 0x5b801de4, 0xdd28f52b, 0xc93f3c36, 0xc93f3c36, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8d469c0b, 0xabeb5779, 0x8d469c0b, 0x72f9878b, 0x43d1f34, 0x43d1f34, 0xd8397828, 0xd8397828, 0xd8397828, 0xa733d180, 0xa733d180, 0xa733d180, 0x3e62d406, 0x3e62d406, 0x3e62d406, 0x43d1f34, 0x72f9878b, 0x72f9878b, 0x43d1f34, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd668f275, 0x6a2de04f, 0xd668f275, 0x959e3f32, 0x59c36f00, 0x59c36f00, 0xc43520a0, 0xc43520a0, 0xc43520a0, 0xbab54dc6, 0xbab54dc6, 0xbab54dc6, 0xd8435814, 0xd8435814, 0xd8435814, 0x59c36f00, 0x959e3f32, 0x959e3f32, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe170ffb5, 0x17402498, 0xe170ffb5, 0xcf757aca, 0xaa4593fe, 0xaa4593fe, 0x4ec32c62, 0x4ec32c62, 0x4ec32c62, 0xe8362105, 0xe8362105, 0xe8362105, 0xc50e8a7d, 0xc50e8a7d, 0xc50e8a7d, 0xaa4593fe, 0xcf757aca, 0xcf757aca, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf4aef2d6, 0x47a46008, 0xf4aef2d6, 0xa9b99f52, 0xc9cbf769, 0xc9cbf769, 0x4f1a5666, 0x4f1a5666, 0x4f1a5666, 0xb1c297aa, 0xb1c297aa, 0xb1c297aa, 0x588828a2, 0x588828a2, 0x588828a2, 0xc9cbf769, 0xa9b99f52, 0xa9b99f52, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc2ed8f74, 0xb7ab0607, 0xc2ed8f74, 0x6cbbc6ac, 0x9813a416, 0x9813a416, 0x535e7ba8, 0x535e7ba8, 0x535e7ba8, 0xc285fd9b, 0xc285fd9b, 0xc285fd9b, 0xdb3fc04b, 0xdb3fc04b, 0xdb3fc04b, 0x9813a416, 0x6cbbc6ac, 0x6cbbc6ac, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf62383d8, 0x9489f90c, 0xf62383d8, 0x8085b66b, 0x5fcf013d, 0x5fcf013d, 0xb7f78bc2, 0xb7f78bc2, 0xb7f78bc2, 0x65e793b4, 0x65e793b4, 0x65e793b4, 0x7394ac2b, 0x7394ac2b, 0x7394ac2b, 0x5fcf013d, 0x8085b66b, 0x8085b66b, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x753d8bc0, 0x5c9029d6, 0x753d8bc0, 0x6e3851c7, 0xdd28f52b, 0xdd28f52b, 0x1a40e22e, 0x1a40e22e, 0x1a40e22e, 0x3b7c1bca, 0x3b7c1bca, 0x3b7c1bca, 0x46c4d046, 0x46c4d046, 0x46c4d046, 0xdd28f52b, 0x6e3851c7, 0x6e3851c7, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x62a774, 0xbb4b794c, 0x62a774, 0xffddbcf4, 0x43d1f34, 0x43d1f34, 0x83fede87, 0x83fede87, 0x83fede87, 0xfcf4772f, 0xfcf4772f, 0xfcf4772f, 0x65a572a9, 0x65a572a9, 0x65a572a9, 0x43d1f34, 0xffddbcf4, 0xffddbcf4, 0x43d1f34, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x2edc6dc9, 0x166a6552, 0x2edc6dc9, 0x6d2aa08e, 0x59c36f00, 0x59c36f00, 0xd214e1a2, 0xd214e1a2, 0xd214e1a2, 0xac948cc4, 0xac948cc4, 0xac948cc4, 0xce629916, 0xce629916, 0xce629916, 0x59c36f00, 0x6d2aa08e, 0x6d2aa08e, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xc12e1a21, 0x1e6e7468, 0xc12e1a21, 0xef2b9f5e, 0xaa4593fe, 0xaa4593fe, 0x1c792d02, 0x1c792d02, 0x1c792d02, 0xba8c2065, 0xba8c2065, 0xba8c2065, 0x97b48b1d, 0x97b48b1d, 0x97b48b1d, 0xaa4593fe, 0xef2b9f5e, 0xef2b9f5e, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x510524f7, 0x7f9806b4, 0x510524f7, 0xc124973, 0xc9cbf769, 0xc9cbf769, 0x1a561d55, 0x1a561d55, 0x1a561d55, 0xe48edc99, 0xe48edc99, 0xe48edc99, 0xdc46391, 0xdc46391, 0xdc46391, 0xc9cbf769, 0xc124973, 0xc124973, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1ee6604, 0xd307a4d9, 0xa1ee6604, 0xfb82fdc, 0x9813a416, 0x9813a416, 0x5b7ed439, 0x5b7ed439, 0x5b7ed439, 0xcaa5520a, 0xcaa5520a, 0xcaa5520a, 0xd31f6fda, 0xd31f6fda, 0xd31f6fda, 0x9813a416, 0xfb82fdc, 0xfb82fdc, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x4e2bb6a8, 0x67c92bf4, 0x4e2bb6a8, 0x388d831b, 0x5fcf013d, 0x5fcf013d, 0xe69beaed, 0xe69beaed, 0xe69beaed, 0x348bf29b, 0x348bf29b, 0x348bf29b, 0x22f8cd04, 0x22f8cd04, 0x22f8cd04, 0x5fcf013d, 0x388d831b, 0x388d831b, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeb6b461d, 0x679ed094, 0xeb6b461d, 0xf06e9c1a, 0xdd28f52b, 0xdd28f52b, 0xdf34624d, 0xdf34624d, 0xdf34624d, 0xfe089ba9, 0xfe089ba9, 0xfe089ba9, 0x83b05025, 0x83b05025, 0x83b05025, 0xdd28f52b, 0xf06e9c1a, 0xf06e9c1a, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc486143c, 0x7b487645, 0xc486143c, 0x3b390fbc, 0x43d1f34, 0x43d1f34, 0x9576cd6b, 0x9576cd6b, 0x9576cd6b, 0xea7c64c3, 0xea7c64c3, 0xea7c64c3, 0x732d6145, 0x732d6145, 0x732d6145, 0x43d1f34, 0x3b390fbc, 0x3b390fbc, 0x43d1f34, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa024d435, 0x8bc3f107, 0xa024d435, 0xe3d21972, 0x59c36f00, 0x59c36f00, 0x9412860d, 0x9412860d, 0x9412860d, 0xea92eb6b, 0xea92eb6b, 0xea92eb6b, 0x8864feb9, 0x8864feb9, 0x8864feb9, 0x59c36f00, 0xe3d21972, 0xe3d21972, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xbf89b975, 0x481e2ecc, 0xbf89b975, 0x918c3c0a, 0xaa4593fe, 0xaa4593fe, 0xa8509e2c, 0xa8509e2c, 0xa8509e2c, 0xea5934b, 0xea5934b, 0xea5934b, 0x239d3833, 0x239d3833, 0x239d3833, 0xaa4593fe, 0x918c3c0a, 0x918c3c0a, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x4d84ea04, 0xd1029f5b, 0x4d84ea04, 0x10938780, 0xc9cbf769, 0xc9cbf769, 0x3677fab0, 0x3677fab0, 0x3677fab0, 0xc8af3b7c, 0xc8af3b7c, 0xc8af3b7c, 0x21e58474, 0x21e58474, 0x21e58474, 0xc9cbf769, 0x10938780, 0x10938780, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x9e5f6ab3, 0xda3fae82, 0x9e5f6ab3, 0x3009236b, 0x9813a416, 0x9813a416, 0x5710fb5f, 0x5710fb5f, 0x5710fb5f, 0xc6cb7d6c, 0xc6cb7d6c, 0xc6cb7d6c, 0xdf7140bc, 0xdf7140bc, 0xdf7140bc, 0x9813a416, 0x3009236b, 0x3009236b, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x28f46625, 0xf4bfdc80, 0x28f46625, 0x5e525396, 0x5fcf013d, 0x5fcf013d, 0xb3f9b24b, 0xb3f9b24b, 0xb3f9b24b, 0x61e9aa3d, 0x61e9aa3d, 0x61e9aa3d, 0x779a95a2, 0x779a95a2, 0x779a95a2, 0x5fcf013d, 0x5e525396, 0x5e525396, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8c12e300, 0xa71b83e7, 0x8c12e300, 0x97173907, 0xdd28f52b, 0xdd28f52b, 0x2f660f28, 0x2f660f28, 0x2f660f28, 0xe5af6cc, 0xe5af6cc, 0xe5af6cc, 0x73e23d40, 0x73e23d40, 0x73e23d40, 0xdd28f52b, 0x97173907, 0x97173907, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbaaaeec4, 0x7f7cd53b, 0xbaaaeec4, 0x4515f544, 0x43d1f34, 0x43d1f34, 0xd254254f, 0xd254254f, 0xd254254f, 0xad5e8ce7, 0xad5e8ce7, 0xad5e8ce7, 0x340f8961, 0x340f8961, 0x340f8961, 0x43d1f34, 0x4515f544, 0x4515f544, 0x43d1f34, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x63166340, 0x5d98fc3, 0x63166340, 0x20e0ae07, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x20e0ae07, 0x20e0ae07, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe0916467, 0x44bbe3df, 0xe0916467, 0xce94e118, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xce94e118, 0xce94e118, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x1aad9b94, 0xa021c44c, 0x1aad9b94, 0x47baf610, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x47baf610, 0x47baf610, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb8710521, 0xbd10c16, 0xb8710521, 0x16274cf9, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0x16274cf9, 0x16274cf9, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xd62b53b5, 0xc6dd48d4, 0xd62b53b5, 0xa08d6606, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xa08d6606, 0xa08d6606, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10503615, 0x442892cb, 0x10503615, 0xb55ec12, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xb55ec12, 0xb55ec12, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x5c9d00a2, 0xf70cd71f, 0x5c9d00a2, 0xa3221b22, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xa3221b22, 0xa3221b22, 0x43d1f34, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbc89067b, 0xf339b29f, 0xbc89067b, 0xff7fcb3c, 0x59c36f00, 0x59c36f00, 0x5915b839, 0x5915b839, 0x5915b839, 0x2795d55f, 0x2795d55f, 0x2795d55f, 0x4563c08d, 0x4563c08d, 0x4563c08d, 0x59c36f00, 0xff7fcb3c, 0xff7fcb3c, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb19b98f6, 0xb8ffac95, 0xb19b98f6, 0x9f9e1d89, 0xaa4593fe, 0xaa4593fe, 0x6cb5454, 0x6cb5454, 0x6cb5454, 0xa03e5933, 0xa03e5933, 0xa03e5933, 0x8d06f24b, 0x8d06f24b, 0x8d06f24b, 0xaa4593fe, 0x9f9e1d89, 0x9f9e1d89, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x133d7c3b, 0xd26c8a26, 0x133d7c3b, 0x4e2a11bf, 0xc9cbf769, 0xc9cbf769, 0x36504e54, 0x36504e54, 0x36504e54, 0xc8888f98, 0xc8888f98, 0xc8888f98, 0x21c23090, 0x21c23090, 0x21c23090, 0xc9cbf769, 0x4e2a11bf, 0x4e2a11bf, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbfc94fbe, 0xe32be512, 0xbfc94fbe, 0x119f0666, 0x9813a416, 0x9813a416, 0x8350694d, 0x8350694d, 0x8350694d, 0x128bef7e, 0x128bef7e, 0x128bef7e, 0xb31d2ae, 0xb31d2ae, 0xb31d2ae, 0x9813a416, 0x119f0666, 0x119f0666, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9cf25061, 0xe5e2b458, 0x9cf25061, 0xea5465d2, 0x5fcf013d, 0x5fcf013d, 0xa5bfba08, 0xa5bfba08, 0xa5bfba08, 0x77afa27e, 0x77afa27e, 0x77afa27e, 0x61dc9de1, 0x61dc9de1, 0x61dc9de1, 0x5fcf013d, 0xea5465d2, 0xea5465d2, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc968ecc5, 0xa3105cfb, 0xc968ecc5, 0xd26d36c2, 0xdd28f52b, 0xdd28f52b, 0xff2fd4b8, 0xff2fd4b8, 0xff2fd4b8, 0xde132d5c, 0xde132d5c, 0xde132d5c, 0xa3abe6d0, 0xa3abe6d0, 0xa3abe6d0, 0xdd28f52b, 0xd26d36c2, 0xd26d36c2, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf17f3c, 0xf3672115, 0xf17f3c, 0xff4e64bc, 0x43d1f34, 0x43d1f34, 0x6ec799ab, 0x6ec799ab, 0x6ec799ab, 0x11cd3003, 0x11cd3003, 0x11cd3003, 0x889c3585, 0x889c3585, 0x889c3585, 0x43d1f34, 0xff4e64bc, 0xff4e64bc, 0x43d1f34, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x20f2a62b, 0x12808b5f, 0x20f2a62b, 0x63046b6c, 0x59c36f00, 0x59c36f00, 0x23e6cac6, 0x23e6cac6, 0x23e6cac6, 0x5d66a7a0, 0x5d66a7a0, 0x5d66a7a0, 0x3f90b272, 0x3f90b272, 0x3f90b272, 0x59c36f00, 0x63046b6c, 0x63046b6c, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x52fcbd8f, 0x7119870a, 0x52fcbd8f, 0x7cf938f0, 0xaa4593fe, 0xaa4593fe, 0x4bb9a19, 0x4bb9a19, 0x4bb9a19, 0xa24e977e, 0xa24e977e, 0xa24e977e, 0x8f763c06, 0x8f763c06, 0x8f763c06, 0xaa4593fe, 0x7cf938f0, 0x7cf938f0, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4d74d3f, 0xd2dab4f0, 0xe4d74d3f, 0xb9c020bb, 0xc9cbf769, 0xc9cbf769, 0xa4955f92, 0xa4955f92, 0xa4955f92, 0x5a4d9e5e, 0x5a4d9e5e, 0x5a4d9e5e, 0xb3072156, 0xb3072156, 0xb3072156, 0xc9cbf769, 0xb9c020bb, 0xb9c020bb, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1c2b9ec, 0x34038c40, 0xa1c2b9ec, 0xf94f034, 0x9813a416, 0x9813a416, 0x438820a6, 0x438820a6, 0x438820a6, 0xd253a695, 0xd253a695, 0xd253a695, 0xcbe99b45, 0xcbe99b45, 0xcbe99b45, 0x9813a416, 0xf94f034, 0xf94f034, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x339cc65f, 0xe46f6cec, 0x339cc65f, 0x453af3ec, 0x5fcf013d, 0x5fcf013d, 0xad75b235, 0xad75b235, 0xad75b235, 0x7f65aa43, 0x7f65aa43, 0x7f65aa43, 0x691695dc, 0x691695dc, 0x691695dc, 0x5fcf013d, 0x453af3ec, 0x453af3ec, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x1c229a1a, 0x83752c05, 0x1c229a1a, 0x727401d, 0xdd28f52b, 0xdd28f52b, 0x4b4f5d0, 0x4b4f5d0, 0x4b4f5d0, 0x25880c34, 0x25880c34, 0x25880c34, 0x5830c7b8, 0x5830c7b8, 0x5830c7b8, 0xdd28f52b, 0x727401d, 0x727401d, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4d69e76c, 0x11e8d41f, 0x4d69e76c, 0xb2d6fcec, 0x43d1f34, 0x43d1f34, 0x15b4256, 0x15b4256, 0x15b4256, 0x7e51ebfe, 0x7e51ebfe, 0x7e51ebfe, 0xe700ee78, 0xe700ee78, 0xe700ee78, 0x43d1f34, 0xb2d6fcec, 0xb2d6fcec, 0x43d1f34, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xecc0313, 0x6803ef90, 0xecc0313, 0x59e1bdcd, 0x59c36f00, 0x59c36f00, 0xbaf5c463, 0xbaf5c463, 0xbaf5c463, 0xc475a905, 0xc475a905, 0xc475a905, 0xa683bcd7, 0xa683bcd7, 0xa683bcd7, 0x59c36f00, 0x59e1bdcd, 0x59e1bdcd, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xfb839522, 0x5fa9129a, 0xfb839522, 0x4b244f74, 0xaa4593fe, 0xaa4593fe, 0xf644f45d, 0xf644f45d, 0xf644f45d, 0x50b1f93a, 0x50b1f93a, 0x50b1f93a, 0x7d895242, 0x7d895242, 0x7d895242, 0xaa4593fe, 0x4b244f74, 0x4b244f74, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf84fee63, 0x42c3b1bb, 0xf84fee63, 0xe86af0cd, 0xc9cbf769, 0xc9cbf769, 0x93e5d13b, 0x93e5d13b, 0x93e5d13b, 0x6d3d10f7, 0x6d3d10f7, 0x6d3d10f7, 0x8477afff, 0x8477afff, 0x8477afff, 0xc9cbf769, 0xe86af0cd, 0xe86af0cd, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xcbed2522, 0x784d2c15, 0xcbed2522, 0xfb9cd90d, 0x9813a416, 0x9813a416, 0x94668b23, 0x94668b23, 0x94668b23, 0x5bd0d10, 0x5bd0d10, 0x5bd0d10, 0x1c0730c0, 0x1c0730c0, 0x1c0730c0, 0x9813a416, 0xfb9cd90d, 0xfb9cd90d, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc1ca0a91, 0xd13c11f0, 0xc1ca0a91, 0x6fcde564, 0x5fcf013d, 0x5fcf013d, 0xb6cdf7a2, 0xb6cdf7a2, 0xb6cdf7a2, 0x64ddefd4, 0x64ddefd4, 0x64ddefd4, 0x72aed04b, 0x72aed04b, 0x72aed04b, 0x5fcf013d, 0x6fcde564, 0x6fcde564, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xca477228, 0x9e3fd6f6, 0xca477228, 0x4423b9f2, 0xdd28f52b, 0xdd28f52b, 0x1ff53543, 0x1ff53543, 0x1ff53543, 0x3ec9cca7, 0x3ec9cca7, 0x3ec9cca7, 0x4371072b, 0x4371072b, 0x4371072b, 0xdd28f52b, 0x4423b9f2, 0x4423b9f2, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfe345ca6, 0x55a58b1b, 0xfe345ca6, 0x696cda06, 0x43d1f34, 0x43d1f34, 0x72d541bf, 0x72d541bf, 0x72d541bf, 0xddfe817, 0xddfe817, 0xddfe817, 0x948eed91, 0x948eed91, 0x948eed91, 0x43d1f34, 0x696cda06, 0x696cda06, 0x43d1f34, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4cfdf9ab, 0x2a321528, 0x4cfdf9ab, 0xf4b75661, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0xf4b75661, 0xf4b75661, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x287ff948, 0x8c557ef0, 0x287ff948, 0xebf931c7, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xebf931c7, 0xebf931c7, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ecea36b, 0xe442fcb3, 0x5ecea36b, 0x1cab5f56, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x1cab5f56, 0x1cab5f56, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf6c7d73a, 0x4567de0d, 0xf6c7d73a, 0xb8d47573, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xb8d47573, 0xb8d47573, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x56e3bddb, 0x4615a6ba, 0x56e3bddb, 0xc585b2ec, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xc585b2ec, 0xc585b2ec, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x5ebfa46, 0x51935e98, 0x5ebfa46, 0xe26d3e18, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xe26d3e18, 0xe26d3e18, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4995beac, 0xe2046911, 0x4995beac, 0x311de003, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0x311de003, 0x311de003, 0x43d1f34, }, 20 }, + { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24285504, 0x24285504, 0x3cc7ae1, 0x3cc7ae1, 0x20e2971b, 0x20e2971b, 0xc295b4fc, 0xc295b4fc, 0x1fbe0d4, 0x1fbe0d4, 0x82930744, 0x82930744, 0xf4b66805, 0xf4b66805, 0x3e16a8c5, 0x3e16a8c5, 0x1165d7dc, 0x1165d7dc, 0xfa78cf7f, 0xfa78cf7f, 0xc105a544, 0xc105a544, 0x430cee22, 0x430cee22, 0xbcf938a0, 0xbcf938a0, 0x7b800045, 0x7b800045, 0x2cc85143, 0x2cc85143, 0x80e0a4b4, 0x80e0a4b4, 0x212e8415, 0x212e8415, 0x151d5163, 0x151d5163, 0x24dcfa9e, 0x24dcfa9e, 0xb1df21b2, 0xb1df21b2, 0x2990a5cf, 0x8c1740a5, 0xd29f2d17, 0xd29f2d17, }, 45 }, + { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2b224886, 0x2b224886, 0x4fa52ab9, 0x4fa52ab9, 0xad8716fa, 0xad8716fa, 0x97a64f1, 0x97a64f1, 0x5fa72700, 0x5fa72700, 0x41913bce, 0x41913bce, 0xe3e6af02, 0xe3e6af02, 0x978a4f3c, 0x978a4f3c, 0xfdedd645, 0xfdedd645, 0x4700a76, 0x4700a76, 0x28761dd2, 0x28761dd2, 0x255a96e8, 0x255a96e8, 0x6eb066fa, 0x6eb066fa, 0x5948e6c4, 0x5948e6c4, 0xc2d83034, 0xc2d83034, 0xe9cc8934, 0xe9cc8934, 0x406490d, 0x406490d, 0x2287423f, 0x2287423f, 0x565ef88b, 0x565ef88b, 0x31af9b10, 0x31af9b10, 0xfbd17ce0, 0xdb686c61, 0xd2731a72, 0xd2731a72, }, 45 }, + { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x999febcd, 0x999febcd, 0x4be4a5e6, 0x4be4a5e6, 0xaa36e979, 0xaa36e979, 0x27ebab0f, 0x27ebab0f, 0x6fa8606c, 0x6fa8606c, 0xd3f60410, 0xd3f60410, 0xa3aea110, 0xa3aea110, 0x5b352e4b, 0x5b352e4b, 0xad22636f, 0xad22636f, 0x54333936, 0x54333936, 0x73d67c9f, 0x73d67c9f, 0xb4462f4a, 0xb4462f4a, 0x1dffdbca, 0x1dffdbca, 0x7095a788, 0x7095a788, 0xc71aa28, 0xc71aa28, 0x215e8dfc, 0x215e8dfc, 0x388d3494, 0x388d3494, 0x5804733d, 0x5804733d, 0x98ef7a83, 0x98ef7a83, 0xc986bddb, 0xc986bddb, 0x183599ab, 0xf4204ada, 0x6562dd40, 0x6562dd40, }, 45 }, + { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xea25e7f1, 0xea25e7f1, 0xf959b605, 0xf959b605, 0x5650ee99, 0x5650ee99, 0xbf3bec3c, 0xbf3bec3c, 0x8d04d782, 0x8d04d782, 0xddbcf5be, 0xddbcf5be, 0x7ee1adaf, 0x7ee1adaf, 0x2fbaff58, 0x2fbaff58, 0x42b24add, 0x42b24add, 0x47483eb4, 0x47483eb4, 0x78962528, 0x78962528, 0x847ee9b7, 0x847ee9b7, 0xc826c0f, 0xc826c0f, 0x82b1bf51, 0x82b1bf51, 0x13ccc821, 0x13ccc821, 0x7d783b1e, 0x7d783b1e, 0xdd2c0bbc, 0xdd2c0bbc, 0x7b71ebd7, 0x7b71ebd7, 0x7381f4c5, 0x7381f4c5, 0xfe20bc9c, 0xfe20bc9c, 0x85dee923, 0x85611b00, 0x723c0ec4, 0x723c0ec4, }, 45 }, + { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xbc52dc5f, 0xbc52dc5f, 0x4c895989, 0x4c895989, 0x59d180a4, 0x59d180a4, 0x50eb81b9, 0x50eb81b9, 0xae85d6c6, 0xae85d6c6, 0xf8354df6, 0xf8354df6, 0x83562153, 0x83562153, 0xd4caece2, 0xd4caece2, 0xb0b5612d, 0xb0b5612d, 0x123d360a, 0x123d360a, 0x70f62e8e, 0x70f62e8e, 0x6a82788f, 0x6a82788f, 0xb0a3ee68, 0xb0a3ee68, 0x604dd5b0, 0x604dd5b0, 0x20f7ea1, 0x20f7ea1, 0x3f6db6bf, 0x3f6db6bf, 0x4a762b9d, 0x4a762b9d, 0xea026ad4, 0xea026ad4, 0x8ba3d148, 0x8ba3d148, 0x434f2359, 0x434f2359, 0x4db299a1, 0x73536949, 0xf022eb4b, 0xf022eb4b, }, 45 }, + { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7cfd676, 0x7cfd676, 0xaf7bcdc6, 0xaf7bcdc6, 0x7dc1f958, 0x7dc1f958, 0xc902ad3e, 0xc902ad3e, 0x5529ad04, 0x5529ad04, 0xa0a133b1, 0xa0a133b1, 0x72f927da, 0x72f927da, 0x28de6d8e, 0x28de6d8e, 0xa5eb10fc, 0xa5eb10fc, 0x2d7ba4f5, 0x2d7ba4f5, 0xd832b228, 0xd832b228, 0x56f0351, 0x56f0351, 0xc6556c2e, 0xc6556c2e, 0x2ceecfa4, 0x2ceecfa4, 0x3d765fbd, 0x3d765fbd, 0x8da7887e, 0x8da7887e, 0xfc8209ea, 0xfc8209ea, 0x6e822767, 0x6e822767, 0xba5c0adf, 0xba5c0adf, 0x8e2af81a, 0x8e2af81a, 0x62c25eb4, 0x2ba315e0, 0x349b7b7d, 0x349b7b7d, }, 45 }, + { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x361fdea5, 0x361fdea5, 0x89a3b488, 0x89a3b488, 0x37302fbe, 0x37302fbe, 0x4b9f20b8, 0x4b9f20b8, 0xc60cf5fe, 0xc60cf5fe, 0xf7b755aa, 0xf7b755aa, 0xcaba5d52, 0xcaba5d52, 0x4f793adf, 0x4f793adf, 0x4cd60722, 0x4cd60722, 0x13adbeec, 0x13adbeec, 0xdc2c109f, 0xdc2c109f, 0x444e465a, 0x444e465a, 0x7baac5fa, 0x7baac5fa, 0x8e746e7f, 0x8e746e7f, 0x7fea6e68, 0x7fea6e68, 0x1f6edf48, 0x1f6edf48, 0x23322506, 0x23322506, 0xbccd38ef, 0xbccd38ef, 0x1b1f1dd3, 0x1b1f1dd3, 0x9c901775, 0x9c901775, 0x78b8e355, 0x95034aa2, 0x4f00ee83, 0x4f00ee83, }, 45 }, + { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdf032925, 0xb9ccc5a6, 0xdf032925, 0x9cf5e462, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0x9cf5e462, 0x9cf5e462, 0x59c36f00, }, 20 }, + { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa24e444d, 0x664c3f5, 0xa24e444d, 0x8c4bc132, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x8c4bc132, 0x8c4bc132, 0xaa4593fe, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6fa41086, 0xd5284f5e, 0x6fa41086, 0x32b37d02, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0x32b37d02, 0x32b37d02, 0xc9cbf769, }, 20 }, + { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd084e37c, 0x6324ea4b, 0xd084e37c, 0x7ed2aaa4, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0x7ed2aaa4, 0x7ed2aaa4, 0x9813a416, }, 20 }, + { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x451273fe, 0x55e4689f, 0x451273fe, 0x33b4464d, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x33b4464d, 0x33b4464d, 0x5fcf013d, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x93132338, 0xc76b87e6, 0x93132338, 0x8816f93f, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0x8816f93f, 0x8816f93f, 0xdd28f52b, }, 20 }, + { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xae6a4ef5, 0x5fb9948, 0xae6a4ef5, 0x51d55575, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x51d55575, 0x51d55575, 0x43d1f34, }, 20 }, + { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x60e56714, 0x14275a99, 0x60e56714, 0x35080c92, 0x9a2e0d26, 0xc53fe194, 0xc53fe194, 0xc53fe194, 0x99e71754, 0x99e71754, 0x99e71754, 0xb07fd9c6, 0xb07fd9c6, 0xb07fd9c6, 0x59c36f00, 0x35080c92, 0x35080c92, }, 18 }, + { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x33d94a8c, 0x7b789e53, 0x33d94a8c, 0xe8b9b6bf, 0xa9d58ccd, 0x8cf0d333, 0x8cf0d333, 0x8cf0d333, 0xd9af7939, 0xd9af7939, 0xd9af7939, 0xb09cb170, 0xb09cb170, 0xb09cb170, 0xaa4593fe, 0xe8b9b6bf, 0xe8b9b6bf, }, 18 }, + { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4669404, 0x9afa8e99, 0xe4669404, 0xdd25167e, 0x5411be8b, 0x3589841c, 0x3589841c, 0x3589841c, 0x4a372288, 0x4a372288, 0x4a372288, 0x84342f0, 0x84342f0, 0x84342f0, 0xc9cbf769, 0xdd25167e, 0xdd25167e, }, 18 }, + { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x37ed1568, 0x12f55eef, 0x37ed1568, 0x8aa8ad16, 0x740d78cf, 0x1a9dc2bc, 0x1a9dc2bc, 0x1a9dc2bc, 0xf13828c0, 0xf13828c0, 0xf13828c0, 0xf7732830, 0xf7732830, 0xf7732830, 0x1c3742c9, 0x8aa8ad16, 0x8aa8ad16, }, 18 }, + { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xc5315ac9, 0x7dece9d3, 0xc5315ac9, 0xc84ef08b, 0xbcda144c, 0x321e548b, 0x321e548b, 0x321e548b, 0x5d57889a, 0x5d57889a, 0x5d57889a, 0x50a11699, 0x50a11699, 0x50a11699, 0xcc5a7bed, 0xc84ef08b, 0xc84ef08b, }, 18 }, + { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x40a72ecd, 0x2304571f, 0x40a72ecd, 0xd2de6d81, 0x5d55a141, 0x8ccafa03, 0x8ccafa03, 0x8ccafa03, 0x4a78be1d, 0x4a78be1d, 0x4a78be1d, 0x5e1d6ea2, 0x5e1d6ea2, 0x5e1d6ea2, 0xef4a3312, 0xd2de6d81, 0xd2de6d81, }, 18 }, + { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xe6143ead, 0x19816f75, 0xe6143ead, 0xe2db78c2, 0xa992f629, 0x5fefa0d1, 0x5fefa0d1, 0x5fefa0d1, 0xde1c5600, 0xde1c5600, 0xde1c5600, 0x48b8ef6f, 0x48b8ef6f, 0x48b8ef6f, 0x54e48d80, 0xe2db78c2, 0xe2db78c2, }, 18 }, + { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x25ba43d4, 0x43fe620d, 0x25ba43d4, 0x664c8e93, 0x59c36f00, 0x59c36f00, 0xb2921a37, 0xb2921a37, 0xb2921a37, 0xcc127751, 0xcc127751, 0xcc127751, 0xaee46283, 0xaee46283, 0xaee46283, 0x59c36f00, 0x664c8e93, 0x664c8e93, 0x59c36f00, }, 20 }, + { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2aa2a72b, 0x6d6df6e1, 0x2aa2a72b, 0x4a72254, 0xaa4593fe, 0xaa4593fe, 0xa3be9127, 0xa3be9127, 0xa3be9127, 0x54b9c40, 0x54b9c40, 0x54b9c40, 0x28733738, 0x28733738, 0x28733738, 0xaa4593fe, 0x4a72254, 0x4a72254, 0xaa4593fe, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9e799f98, 0xe21ad041, 0x9e799f98, 0xc36ef21c, 0xc9cbf769, 0xc9cbf769, 0x93d6c07d, 0x93d6c07d, 0x93d6c07d, 0x6d0e01b1, 0x6d0e01b1, 0x6d0e01b1, 0x8444beb9, 0x8444beb9, 0x8444beb9, 0xc9cbf769, 0xc36ef21c, 0xc36ef21c, 0xc9cbf769, }, 20 }, + { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7ffc43fd, 0x64505961, 0x7ffc43fd, 0xd1aa0a25, 0x9813a416, 0x9813a416, 0x5b5f9bd5, 0x5b5f9bd5, 0x5b5f9bd5, 0xca841de6, 0xca841de6, 0xca841de6, 0xd33e2036, 0xd33e2036, 0xd33e2036, 0x9813a416, 0xd1aa0a25, 0xd1aa0a25, 0x9813a416, }, 20 }, + { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x570ca3fc, 0x4f1cee0f, 0x570ca3fc, 0x21aa964f, 0x5fcf013d, 0x5fcf013d, 0xf2bc017e, 0xf2bc017e, 0xf2bc017e, 0x20ac1908, 0x20ac1908, 0x20ac1908, 0x36df2697, 0x36df2697, 0x36df2697, 0x5fcf013d, 0x21aa964f, 0x21aa964f, 0x5fcf013d, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xcf9798d3, 0x5d39a7fa, 0xcf9798d3, 0xd49242d4, 0xdd28f52b, 0xdd28f52b, 0xe15747f0, 0xe15747f0, 0xe15747f0, 0xc06bbe14, 0xc06bbe14, 0xc06bbe14, 0xbdd37598, 0xbdd37598, 0xbdd37598, 0xdd28f52b, 0xd49242d4, 0xd49242d4, 0xdd28f52b, }, 20 }, + { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xae6154e8, 0x59e627f7, 0xae6154e8, 0x51de4f68, 0x43d1f34, 0x43d1f34, 0x59a8eb9f, 0x59a8eb9f, 0x59a8eb9f, 0x26a24237, 0x26a24237, 0x26a24237, 0xbff347b1, 0xbff347b1, 0xbff347b1, 0x43d1f34, 0x51de4f68, 0x51de4f68, 0x43d1f34, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb2b04aa3, 0xca81b845, 0xb2b04aa3, 0xf14687e4, 0x59c36f00, 0x59c36f00, 0xc01ee8bb, 0xc01ee8bb, 0xc01ee8bb, 0xbe9e85dd, 0xbe9e85dd, 0xbe9e85dd, 0xdc68900f, 0xdc68900f, 0xdc68900f, 0x59c36f00, 0xf14687e4, 0xf14687e4, 0x59c36f00, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x19a66482, 0xba12148e, 0x19a66482, 0x37a3e1fd, 0xaa4593fe, 0xaa4593fe, 0xfa4f54c9, 0xfa4f54c9, 0xfa4f54c9, 0x5cba59ae, 0x5cba59ae, 0x5cba59ae, 0x7182f2d6, 0x7182f2d6, 0x7182f2d6, 0xaa4593fe, 0x37a3e1fd, 0x37a3e1fd, 0xaa4593fe, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6a5ddfe7, 0xc898195a, 0x6a5ddfe7, 0x374ab263, 0xc9cbf769, 0xc9cbf769, 0x7a6a0afe, 0x7a6a0afe, 0x7a6a0afe, 0x84b2cb32, 0x84b2cb32, 0x84b2cb32, 0x6df8743a, 0x6df8743a, 0x6df8743a, 0xc9cbf769, 0x374ab263, 0x374ab263, 0xc9cbf769, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb6ca222a, 0x98e6c241, 0xb6ca222a, 0x189c6bf2, 0x9813a416, 0x9813a416, 0x7fad8eb7, 0x7fad8eb7, 0x7fad8eb7, 0xee760884, 0xee760884, 0xee760884, 0xf7cc3554, 0xf7cc3554, 0xf7cc3554, 0x9813a416, 0x189c6bf2, 0x189c6bf2, 0x9813a416, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x726d82d0, 0xe9c535bd, 0x726d82d0, 0x4cbb763, 0x5fcf013d, 0x5fcf013d, 0xf99de8d5, 0xf99de8d5, 0xf99de8d5, 0x2b8df0a3, 0x2b8df0a3, 0x2b8df0a3, 0x3dfecf3c, 0x3dfecf3c, 0x3dfecf3c, 0x5fcf013d, 0x4cbb763, 0x4cbb763, 0x5fcf013d, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xfe26fef7, 0x6031c462, 0xfe26fef7, 0xe52324f0, 0xdd28f52b, 0xdd28f52b, 0x84ff6e38, 0x84ff6e38, 0x84ff6e38, 0xa5c397dc, 0xa5c397dc, 0xa5c397dc, 0xd87b5c50, 0xd87b5c50, 0xd87b5c50, 0xdd28f52b, 0xe52324f0, 0xe52324f0, 0xdd28f52b, }, 20 }, + { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x25e34f8a, 0x67935e5e, 0x25e34f8a, 0xda5c540a, 0x43d1f34, 0x43d1f34, 0x7ebdd748, 0x7ebdd748, 0x7ebdd748, 0x1b77ee0, 0x1b77ee0, 0x1b77ee0, 0x98e67b66, 0x98e67b66, 0x98e67b66, 0x43d1f34, 0xda5c540a, 0xda5c540a, 0x43d1f34, }, 20 }, + { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x67038f5e, 0x65d6007f, 0x67038f5e, 0x24f54219, 0x59c36f00, 0x59c36f00, 0xac294ffd, 0xac294ffd, 0xac294ffd, 0xd2a9229b, 0xd2a9229b, 0xd2a9229b, 0xb05f3749, 0xb05f3749, 0xb05f3749, 0x59c36f00, 0x24f54219, 0x24f54219, 0x59c36f00, }, 20 }, + { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x944464c7, 0x27123864, 0x944464c7, 0xba41e1b8, 0xaa4593fe, 0xaa4593fe, 0xa521274, 0xa521274, 0xa521274, 0xaca71f13, 0xaca71f13, 0xaca71f13, 0x819fb46b, 0x819fb46b, 0x819fb46b, 0xaa4593fe, 0xba41e1b8, 0xba41e1b8, 0xaa4593fe, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xfe97adaf, 0x4f3307d4, 0xfe97adaf, 0xa380c02b, 0xc9cbf769, 0xc9cbf769, 0xd202ced6, 0xd202ced6, 0xd202ced6, 0x2cda0f1a, 0x2cda0f1a, 0x2cda0f1a, 0xc590b012, 0xc590b012, 0xc590b012, 0xc9cbf769, 0xa380c02b, 0xa380c02b, 0xc9cbf769, }, 20 }, + { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x5b32a9ba, 0xaf93fd91, 0x5b32a9ba, 0xf564e062, 0x9813a416, 0x9813a416, 0xcfdbc809, 0xcfdbc809, 0xcfdbc809, 0x5e004e3a, 0x5e004e3a, 0x5e004e3a, 0x47ba73ea, 0x47ba73ea, 0x47ba73ea, 0x9813a416, 0xf564e062, 0xf564e062, 0x9813a416, }, 20 }, + { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x5e0e1ce8, 0x7ed1c9ee, 0x5e0e1ce8, 0x28a8295b, 0x5fcf013d, 0x5fcf013d, 0x615f5762, 0x615f5762, 0x615f5762, 0xb34f4f14, 0xb34f4f14, 0xb34f4f14, 0xa53c708b, 0xa53c708b, 0xa53c708b, 0x5fcf013d, 0x28a8295b, 0x28a8295b, 0x5fcf013d, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa473184a, 0x93eaf325, 0xa473184a, 0xbf76c24d, 0xdd28f52b, 0xdd28f52b, 0x714dd1f7, 0x714dd1f7, 0x714dd1f7, 0x50712813, 0x50712813, 0x50712813, 0x2dc9e39f, 0x2dc9e39f, 0x2dc9e39f, 0xdd28f52b, 0xbf76c24d, 0xbf76c24d, 0xdd28f52b, }, 20 }, + { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xa725578b, 0x81889cf9, 0xa725578b, 0x589a4c0b, 0x43d1f34, 0x43d1f34, 0xf25ab3a8, 0xf25ab3a8, 0xf25ab3a8, 0x8d501a00, 0x8d501a00, 0x8d501a00, 0x14011f86, 0x14011f86, 0x14011f86, 0x43d1f34, 0x589a4c0b, 0x589a4c0b, 0x43d1f34, }, 20 }, + { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd69cdcbf, 0x6ad9ce85, 0xd69cdcbf, 0x956a11f8, 0x59c36f00, 0x59c36f00, 0xc4c10e6a, 0xc4c10e6a, 0xc4c10e6a, 0xba41630c, 0xba41630c, 0xba41630c, 0xd8b776de, 0xd8b776de, 0xd8b776de, 0x59c36f00, 0x956a11f8, 0x956a11f8, 0x59c36f00, }, 20 }, + { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x1acffa1b, 0xecff2136, 0x1acffa1b, 0x34ca7f64, 0xaa4593fe, 0xaa4593fe, 0xb57c29cc, 0xb57c29cc, 0xb57c29cc, 0x138924ab, 0x138924ab, 0x138924ab, 0x3eb18fd3, 0x3eb18fd3, 0x3eb18fd3, 0xaa4593fe, 0x34ca7f64, 0x34ca7f64, 0xaa4593fe, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x1cf8992, 0xb2c51b4c, 0x1cf8992, 0x5cd8e416, 0xc9cbf769, 0xc9cbf769, 0xba7b2d22, 0xba7b2d22, 0xba7b2d22, 0x44a3ecee, 0x44a3ecee, 0x44a3ecee, 0xade953e6, 0xade953e6, 0xade953e6, 0xc9cbf769, 0x5cd8e416, 0x5cd8e416, 0xc9cbf769, }, 20 }, + { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1f39da0b, 0x6a7f5378, 0x1f39da0b, 0xb16f93d3, 0x9813a416, 0x9813a416, 0x8e8a2ed7, 0x8e8a2ed7, 0x8e8a2ed7, 0x1f51a8e4, 0x1f51a8e4, 0x1f51a8e4, 0x6eb9534, 0x6eb9534, 0x6eb9534, 0x9813a416, 0xb16f93d3, 0xb16f93d3, 0x9813a416, }, 20 }, + { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x27394d6b, 0x459337bf, 0x27394d6b, 0x519f78d8, 0x5fcf013d, 0x5fcf013d, 0x66ed4571, 0x66ed4571, 0x66ed4571, 0xb4fd5d07, 0xb4fd5d07, 0xb4fd5d07, 0xa28e6298, 0xa28e6298, 0xa28e6298, 0x5fcf013d, 0x519f78d8, 0x519f78d8, 0x5fcf013d, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x624e1f92, 0x4be3bd84, 0x624e1f92, 0x794bc595, 0xdd28f52b, 0xdd28f52b, 0xd33767c, 0xd33767c, 0xd33767c, 0x2c0f8f98, 0x2c0f8f98, 0x2c0f8f98, 0x51b74414, 0x51b74414, 0x51b74414, 0xdd28f52b, 0x794bc595, 0x794bc595, 0xdd28f52b, }, 20 }, + { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbf5dab2e, 0x4747516, 0xbf5dab2e, 0x40e2b0ae, 0x43d1f34, 0x43d1f34, 0x3cc1d2dd, 0x3cc1d2dd, 0x3cc1d2dd, 0x43cb7b75, 0x43cb7b75, 0x43cb7b75, 0xda9a7ef3, 0xda9a7ef3, 0xda9a7ef3, 0x43d1f34, 0x40e2b0ae, 0x40e2b0ae, 0x43d1f34, }, 20 }, + { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x2e284303, 0x169e4b98, 0x2e284303, 0x6dde8e44, 0x59c36f00, 0x59c36f00, 0xd2e0cf68, 0xd2e0cf68, 0xd2e0cf68, 0xac60a20e, 0xac60a20e, 0xac60a20e, 0xce96b7dc, 0xce96b7dc, 0xce96b7dc, 0x59c36f00, 0x6dde8e44, 0x6dde8e44, 0x59c36f00, }, 20 }, + { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3a911f8f, 0xe5d171c6, 0x3a911f8f, 0x14949af0, 0xaa4593fe, 0xaa4593fe, 0xe7c628ac, 0xe7c628ac, 0xe7c628ac, 0x413325cb, 0x413325cb, 0x413325cb, 0x6c0b8eb3, 0x6c0b8eb3, 0x6c0b8eb3, 0xaa4593fe, 0x14949af0, 0x14949af0, 0xaa4593fe, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa4645fb3, 0x8af97df0, 0xa4645fb3, 0xf9733237, 0xc9cbf769, 0xc9cbf769, 0xef376611, 0xef376611, 0xef376611, 0x11efa7dd, 0x11efa7dd, 0x11efa7dd, 0xf8a518d5, 0xf8a518d5, 0xf8a518d5, 0xc9cbf769, 0xf9733237, 0xf9733237, 0xc9cbf769, }, 20 }, + { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7c3a337b, 0xed3f1a6, 0x7c3a337b, 0xd26c7aa3, 0x9813a416, 0x9813a416, 0x86aa8146, 0x86aa8146, 0x86aa8146, 0x17710775, 0x17710775, 0x17710775, 0xecb3aa5, 0xecb3aa5, 0xecb3aa5, 0x9813a416, 0xd26c7aa3, 0xd26c7aa3, 0x9813a416, }, 20 }, + { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9f31781b, 0xb6d3e547, 0x9f31781b, 0xe9974da8, 0x5fcf013d, 0x5fcf013d, 0x3781245e, 0x3781245e, 0x3781245e, 0xe5913c28, 0xe5913c28, 0xe5913c28, 0xf3e203b7, 0xf3e203b7, 0xf3e203b7, 0x5fcf013d, 0xe9974da8, 0xe9974da8, 0x5fcf013d, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xfc18d24f, 0x70ed44c6, 0xfc18d24f, 0xe71d0848, 0xdd28f52b, 0xdd28f52b, 0xc847f61f, 0xc847f61f, 0xc847f61f, 0xe97b0ffb, 0xe97b0ffb, 0xe97b0ffb, 0x94c3c477, 0x94c3c477, 0x94c3c477, 0xdd28f52b, 0xe71d0848, 0xe71d0848, 0xdd28f52b, }, 20 }, + { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x7bb91866, 0xc4777a1f, 0x7bb91866, 0x840603e6, 0x43d1f34, 0x43d1f34, 0x2a49c131, 0x2a49c131, 0x2a49c131, 0x55436899, 0x55436899, 0x55436899, 0xcc126d1f, 0xcc126d1f, 0xcc126d1f, 0x43d1f34, 0x840603e6, 0x840603e6, 0x43d1f34, }, 20 }, + { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa0d0faff, 0x8b37dfcd, 0xa0d0faff, 0xe32637b8, 0x59c36f00, 0x59c36f00, 0x94e6a8c7, 0x94e6a8c7, 0x94e6a8c7, 0xea66c5a1, 0xea66c5a1, 0xea66c5a1, 0x8890d073, 0x8890d073, 0x8890d073, 0x59c36f00, 0xe32637b8, 0xe32637b8, 0x59c36f00, }, 20 }, + { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x4436bcdb, 0xb3a12b62, 0x4436bcdb, 0x6a3339a4, 0xaa4593fe, 0xaa4593fe, 0x53ef9b82, 0x53ef9b82, 0x53ef9b82, 0xf51a96e5, 0xf51a96e5, 0xf51a96e5, 0xd8223d9d, 0xd8223d9d, 0xd8223d9d, 0xaa4593fe, 0x6a3339a4, 0x6a3339a4, 0xaa4593fe, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb8e59140, 0x2463e41f, 0xb8e59140, 0xe5f2fcc4, 0xc9cbf769, 0xc9cbf769, 0xc31681f4, 0xc31681f4, 0xc31681f4, 0x3dce4038, 0x3dce4038, 0x3dce4038, 0xd484ff30, 0xd484ff30, 0xd484ff30, 0xc9cbf769, 0xe5f2fcc4, 0xe5f2fcc4, 0xc9cbf769, }, 20 }, + { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x438b3fcc, 0x7ebfbfd, 0x438b3fcc, 0xeddd7614, 0x9813a416, 0x9813a416, 0x8ac4ae20, 0x8ac4ae20, 0x8ac4ae20, 0x1b1f2813, 0x1b1f2813, 0x1b1f2813, 0x2a515c3, 0x2a515c3, 0x2a515c3, 0x9813a416, 0xeddd7614, 0xeddd7614, 0x9813a416, }, 20 }, + { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf9eea896, 0x25a51233, 0xf9eea896, 0x8f489d25, 0x5fcf013d, 0x5fcf013d, 0x62e37cf8, 0x62e37cf8, 0x62e37cf8, 0xb0f3648e, 0xb0f3648e, 0xb0f3648e, 0xa6805b11, 0xa6805b11, 0xa6805b11, 0x5fcf013d, 0x8f489d25, 0x8f489d25, 0x5fcf013d, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x9b617752, 0xb06817b5, 0x9b617752, 0x8064ad55, 0xdd28f52b, 0xdd28f52b, 0x38159b7a, 0x38159b7a, 0x38159b7a, 0x1929629e, 0x1929629e, 0x1929629e, 0x6491a912, 0x6491a912, 0x6491a912, 0xdd28f52b, 0x8064ad55, 0x8064ad55, 0xdd28f52b, }, 20 }, + { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x595e29e, 0xc043d961, 0x595e29e, 0xfa2af91e, 0x43d1f34, 0x43d1f34, 0x6d6b2915, 0x6d6b2915, 0x6d6b2915, 0x126180bd, 0x126180bd, 0x126180bd, 0x8b30853b, 0x8b30853b, 0x8b30853b, 0x43d1f34, 0xfa2af91e, 0xfa2af91e, 0x43d1f34, }, 20 }, + { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x63e24d8a, 0x52da109, 0x63e24d8a, 0x201480cd, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0x201480cd, 0x201480cd, 0x59c36f00, }, 20 }, + { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x1b2e61c9, 0xbf04e671, 0x1b2e61c9, 0x352be4b6, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x352be4b6, 0x352be4b6, 0xaa4593fe, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xefcce0d0, 0x5540bf08, 0xefcce0d0, 0xb2db8d54, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0xb2db8d54, 0xb2db8d54, 0xc9cbf769, }, 20 }, + { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x65a5505e, 0xd6055969, 0x65a5505e, 0xcbf31986, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0xcbf31986, 0xcbf31986, 0x9813a416, }, 20 }, + { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7319d06, 0x17c78667, 0x7319d06, 0x7197a8b5, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x7197a8b5, 0x7197a8b5, 0x5fcf013d, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x723a247, 0x535b0699, 0x723a247, 0x1c267840, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0x1c267840, 0x1c267840, 0xdd28f52b, }, 20 }, + { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xe3a20cf8, 0x4833db45, 0xe3a20cf8, 0x1c1d1778, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x1c1d1778, 0x1c1d1778, 0x43d1f34, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24b38cd5, 0x6b033831, 0x24b38cd5, 0x67454192, 0x59c36f00, 0x59c36f00, 0xc12f3297, 0xc12f3297, 0xc12f3297, 0xbfaf5ff1, 0xbfaf5ff1, 0xbfaf5ff1, 0xdd594a23, 0xdd594a23, 0xdd594a23, 0x59c36f00, 0x67454192, 0x67454192, 0x59c36f00, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x54f09885, 0x5d94ace6, 0x54f09885, 0x7af51dfa, 0xaa4593fe, 0xaa4593fe, 0xe3a05427, 0xe3a05427, 0xe3a05427, 0x45555940, 0x45555940, 0x45555940, 0x686df238, 0x686df238, 0x686df238, 0xaa4593fe, 0x7af51dfa, 0x7af51dfa, 0xaa4593fe, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x53c2ee74, 0x92931869, 0x53c2ee74, 0xed583f0, 0xc9cbf769, 0xc9cbf769, 0x76afdc1b, 0x76afdc1b, 0x76afdc1b, 0x88771dd7, 0x88771dd7, 0x88771dd7, 0x613da2df, 0x613da2df, 0x613da2df, 0xc9cbf769, 0xed583f0, 0xed583f0, 0xc9cbf769, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4e5ded6f, 0x12bf47c3, 0x4e5ded6f, 0xe00ba4b7, 0x9813a416, 0x9813a416, 0x72c4cb9c, 0x72c4cb9c, 0x72c4cb9c, 0xe31f4daf, 0xe31f4daf, 0xe31f4daf, 0xfaa5707f, 0xfaa5707f, 0xfaa5707f, 0x9813a416, 0xe00ba4b7, 0xe00ba4b7, 0x9813a416, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3566adf6, 0x4c7649cf, 0x3566adf6, 0x43c09845, 0x5fcf013d, 0x5fcf013d, 0xc2b479f, 0xc2b479f, 0xc2b479f, 0xde3b5fe9, 0xde3b5fe9, 0xde3b5fe9, 0xc8486076, 0xc8486076, 0xc8486076, 0x5fcf013d, 0x43c09845, 0x43c09845, 0x5fcf013d, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xec1bda0d, 0x86636a33, 0xec1bda0d, 0xf71e000a, 0xdd28f52b, 0xdd28f52b, 0xda5ce270, 0xda5ce270, 0xda5ce270, 0xfb601b94, 0xfb601b94, 0xfb601b94, 0x86d8d018, 0x86d8d018, 0x86d8d018, 0xdd28f52b, 0xf71e000a, 0xf71e000a, 0xdd28f52b, }, 20 }, + { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x619415be, 0x92024b97, 0x619415be, 0x9e2b0e3e, 0x43d1f34, 0x43d1f34, 0xfa2f329, 0xfa2f329, 0xfa2f329, 0x70a85a81, 0x70a85a81, 0x70a85a81, 0xe9f95f07, 0xe9f95f07, 0xe9f95f07, 0x43d1f34, 0x9e2b0e3e, 0x9e2b0e3e, 0x43d1f34, }, 20 }, + { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x200688e1, 0x1274a595, 0x200688e1, 0x63f045a6, 0x59c36f00, 0x59c36f00, 0x2312e40c, 0x2312e40c, 0x2312e40c, 0x5d92896a, 0x5d92896a, 0x5d92896a, 0x3f649cb8, 0x3f649cb8, 0x3f649cb8, 0x59c36f00, 0x63f045a6, 0x63f045a6, 0x59c36f00, }, 20 }, + { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa943b821, 0x8aa682a4, 0xa943b821, 0x87463d5e, 0xaa4593fe, 0xaa4593fe, 0xff049fb7, 0xff049fb7, 0xff049fb7, 0x59f192d0, 0x59f192d0, 0x59f192d0, 0x74c939a8, 0x74c939a8, 0x74c939a8, 0xaa4593fe, 0x87463d5e, 0x87463d5e, 0xaa4593fe, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x11b6367b, 0x27bbcfb4, 0x11b6367b, 0x4ca15bff, 0xc9cbf769, 0xc9cbf769, 0x51f424d6, 0x51f424d6, 0x51f424d6, 0xaf2ce51a, 0xaf2ce51a, 0xaf2ce51a, 0x46665a12, 0x46665a12, 0x46665a12, 0xc9cbf769, 0x4ca15bff, 0x4ca15bff, 0xc9cbf769, }, 20 }, + { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7c16ec93, 0xe9d7d93f, 0x7c16ec93, 0xd240a54b, 0x9813a416, 0x9813a416, 0x9e5c75d9, 0x9e5c75d9, 0x9e5c75d9, 0xf87f3ea, 0xf87f3ea, 0xf87f3ea, 0x163dce3a, 0x163dce3a, 0x163dce3a, 0x9813a416, 0xd240a54b, 0xd240a54b, 0x9813a416, }, 20 }, + { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xe28608ec, 0x3575a25f, 0xe28608ec, 0x94203d5f, 0x5fcf013d, 0x5fcf013d, 0x7c6f7c86, 0x7c6f7c86, 0x7c6f7c86, 0xae7f64f0, 0xae7f64f0, 0xae7f64f0, 0xb80c5b6f, 0xb80c5b6f, 0xb80c5b6f, 0x5fcf013d, 0x94203d5f, 0x94203d5f, 0x5fcf013d, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xb510e48, 0x9406b857, 0xb510e48, 0x1054d44f, 0xdd28f52b, 0xdd28f52b, 0x13c76182, 0x13c76182, 0x13c76182, 0x32fb9866, 0x32fb9866, 0x32fb9866, 0x4f4353ea, 0x4f4353ea, 0x4f4353ea, 0xdd28f52b, 0x1054d44f, 0x1054d44f, 0xdd28f52b, }, 20 }, + { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf256eb36, 0xaed7d845, 0xf256eb36, 0xde9f0b6, 0x43d1f34, 0x43d1f34, 0xbe644e0c, 0xbe644e0c, 0xbe644e0c, 0xc16ee7a4, 0xc16ee7a4, 0xc16ee7a4, 0x583fe222, 0x583fe222, 0x583fe222, 0x43d1f34, 0xde9f0b6, 0xde9f0b6, 0x43d1f34, }, 20 }, + { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe382dd9, 0x68f7c15a, 0xe382dd9, 0x59159307, 0x59c36f00, 0x59c36f00, 0xba01eaa9, 0xba01eaa9, 0xba01eaa9, 0xc48187cf, 0xc48187cf, 0xc48187cf, 0xa677921d, 0xa677921d, 0xa677921d, 0x59c36f00, 0x59159307, 0x59159307, 0x59c36f00, }, 20 }, + { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3c908c, 0xa4161734, 0x3c908c, 0xb09b4ada, 0xaa4593fe, 0xaa4593fe, 0xdfbf1f3, 0xdfbf1f3, 0xdfbf1f3, 0xab0efc94, 0xab0efc94, 0xab0efc94, 0x863657ec, 0x863657ec, 0x863657ec, 0xaa4593fe, 0xb09b4ada, 0xb09b4ada, 0xaa4593fe, }, 20 }, + { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd2e9527, 0xb7a2caff, 0xd2e9527, 0x1d0b8b89, 0xc9cbf769, 0xc9cbf769, 0x6684aa7f, 0x6684aa7f, 0x6684aa7f, 0x985c6bb3, 0x985c6bb3, 0x985c6bb3, 0x7116d4bb, 0x7116d4bb, 0x7116d4bb, 0xc9cbf769, 0x1d0b8b89, 0x1d0b8b89, 0xc9cbf769, }, 20 }, + { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1639705d, 0xa599796a, 0x1639705d, 0x26488c72, 0x9813a416, 0x9813a416, 0x49b2de5c, 0x49b2de5c, 0x49b2de5c, 0xd869586f, 0xd869586f, 0xd869586f, 0xc1d365bf, 0xc1d365bf, 0xc1d365bf, 0x9813a416, 0x26488c72, 0x26488c72, 0x9813a416, }, 20 }, + { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x10d0c422, 0x26df43, 0x10d0c422, 0xbed72bd7, 0x5fcf013d, 0x5fcf013d, 0x67d73911, 0x67d73911, 0x67d73911, 0xb5c72167, 0xb5c72167, 0xb5c72167, 0xa3b41ef8, 0xa3b41ef8, 0xa3b41ef8, 0x5fcf013d, 0xbed72bd7, 0xbed72bd7, 0x5fcf013d, }, 20 }, + { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xdd34e67a, 0x894c42a4, 0xdd34e67a, 0x53502da0, 0xdd28f52b, 0xdd28f52b, 0x886a111, 0x886a111, 0x886a111, 0x29ba58f5, 0x29ba58f5, 0x29ba58f5, 0x54029379, 0x54029379, 0x54029379, 0xdd28f52b, 0x53502da0, 0x53502da0, 0xdd28f52b, }, 20 }, + { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x410b50fc, 0xea9a8741, 0x410b50fc, 0xd653d65c, 0x43d1f34, 0x43d1f34, 0xcdea4de5, 0xcdea4de5, 0xcdea4de5, 0xb2e0e44d, 0xb2e0e44d, 0xb2e0e44d, 0x2bb1e1cb, 0x2bb1e1cb, 0x2bb1e1cb, 0x43d1f34, 0xd653d65c, 0xd653d65c, 0x43d1f34, }, 20 }, + { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4c09d761, 0x2ac63be2, 0x4c09d761, 0xf44378ab, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0xf44378ab, 0xf44378ab, 0x59c36f00, }, 20 }, + { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd3c0fce6, 0x77ea7b5e, 0xd3c0fce6, 0x10463469, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x10463469, 0x10463469, 0xaa4593fe, }, 20 }, + { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xabafd82f, 0x112387f7, 0xabafd82f, 0xe9ca2412, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0xe9ca2412, 0xe9ca2412, 0xc9cbf769, }, 20 }, + { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2b138245, 0x98b38b72, 0x2b138245, 0x6500200c, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0x6500200c, 0x6500200c, 0x9813a416, }, 20 }, + { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x87f97368, 0x970f6809, 0x87f97368, 0x149f7c5f, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x149f7c5f, 0x149f7c5f, 0x5fcf013d, }, 20 }, + { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x12986e14, 0x46e0caca, 0x12986e14, 0xf51eaa4a, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0xf51eaa4a, 0xf51eaa4a, 0xdd28f52b, }, 20 }, + { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf6aab2f6, 0x5d3b654b, 0xf6aab2f6, 0x8e22ec59, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x8e22ec59, 0x8e22ec59, 0x43d1f34, }, 20 }, { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, From b00e4c2bd9fd051678a8aadafa95ad14b3c866ba Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 26 Feb 2016 21:44:37 +0300 Subject: [PATCH 139/207] efidisk: prevent errors from diskfilter scan of removable drives Map EFI_NO_MEDIA to GRUB_ERR_OUT_OF_RANGE that is ignored by diskfilter. This actually matches pretty close (we obviously attempt to read outside of media) and avoids adding more error codes. This affects only internally initiated scans. If read/write from removable is explicitly requested, we still return an error and text explanation is more clear for user than generic error. Reported and tested by Andreas Loew --- grub-core/disk/efi/efidisk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index 1c00e3ec8..ea753446d 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -547,7 +547,9 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, buf, 0); - if (status != GRUB_EFI_SUCCESS) + if (status == GRUB_EFI_NO_MEDIA) + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", disk->name)); + else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx from `%s'"), (unsigned long long) sector, @@ -568,7 +570,9 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); - if (status != GRUB_EFI_SUCCESS) + if (status == GRUB_EFI_NO_MEDIA) + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", disk->name)); + else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx to `%s'"), (unsigned long long) sector, disk->name); From 109189ce01ea6467055ca56b725ce263597db6d4 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 27 Feb 2016 15:16:48 +0300 Subject: [PATCH 140/207] efidisk: fix misplaced parenthesis in b00e4c2 --- grub-core/disk/efi/efidisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index ea753446d..75bb4a9ca 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -548,7 +548,7 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, buf, 0); if (status == GRUB_EFI_NO_MEDIA) - return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", disk->name)); + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx from `%s'"), @@ -571,7 +571,7 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); if (status == GRUB_EFI_NO_MEDIA) - return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'", disk->name)); + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx to `%s'"), From 070e190305986dff1d528af08b964667f29dc914 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 26 Feb 2016 11:56:28 +0100 Subject: [PATCH 141/207] Use console rather than serial_efi0 on arm64-efi in tests --- tests/util/grub-shell.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 7848b4222..ab19dbbf5 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -74,6 +74,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in disk=0 # To skip "Welcome to GRUB" and color setttings trim=1 + serial_port= ;; powerpc-ieee1275) boot=hd @@ -181,7 +182,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in trim=1 qemuopts="-machine virt -cpu cortex-a57 -bios /usr/share/qemu-efi/QEMU_EFI.fd $qemuopts" disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" - serial_port=efi0 + serial_port= ;; arm-efi) qemu=qemu-system-arm @@ -322,7 +323,7 @@ fi if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ]; then echo insmod escc >>${cfgfile} fi -if [ "${grub_modinfo_platform}" != emu ]; then +if [ "${serial_port}" != "" ]; then echo "serial ${serial_port}" >>${cfgfile} term="serial_${serial_port}" else From 8c26dace6f4db4245b57f05257c07b1253eb7490 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 26 Feb 2016 12:26:56 +0100 Subject: [PATCH 142/207] cat: Don't switch terminal mode when there is nothing to highlight. This just pollutes serial console. --- grub-core/commands/cat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/grub-core/commands/cat.c b/grub-core/commands/cat.c index 8a7f1af78..88d904436 100644 --- a/grub-core/commands/cat.c +++ b/grub-core/commands/cat.c @@ -140,10 +140,13 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); } - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - for (j = 0; j < utcount; j++) - grub_printf ("<%x>", (unsigned int) utbuf[j]); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + if (utcount) + { + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + for (j = 0; j < utcount; j++) + grub_printf ("<%x>", (unsigned int) utbuf[j]); + grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + } grub_xputs ("\n"); grub_refresh (); From 2ebef43cf6276168c72b63f7bd66fad3b030973e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 26 Feb 2016 14:56:22 +0100 Subject: [PATCH 143/207] bsd: Ensure that kernel is loaded before loading module. kernel_type may be set to the type of failed kernel. This patching-up is easier than to reflow kernel loading routines. --- grub-core/loader/i386/bsd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c index bc377b362..7f96515da 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -1889,6 +1889,10 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), grub_err_t err; void *src; + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no FreeBSD loaded"); @@ -1992,6 +1996,10 @@ grub_cmd_netbsd_module (grub_command_t cmd, { grub_uint32_t type; + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_NETBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no NetBSD loaded"); @@ -2070,6 +2078,10 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)), if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_OPENBSD) return grub_error (GRUB_ERR_BAD_OS, "no kOpenBSD loaded"); From 36212460d3565b18439a3a8130b28e6c97702c6a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 18 Feb 2016 20:26:44 +0100 Subject: [PATCH 144/207] mkimage.c: Split into separate files. util/grub-mkimagexx.c is included in a special way into mkimage.c. Interoperation between defines makes this very tricky. Instead just have a clean interface and compile util/grub-mkimage*.c separately from mkimage.c --- Makefile.util.def | 10 ++ include/grub/util/mkimage.h | 170 ++++++++++++++++++++++ util/grub-mkimage32.c | 22 +++ util/grub-mkimage64.c | 22 +++ util/grub-mkimagexx.c | 244 ++++++++++++++++++++++---------- util/mkimage.c | 275 ++---------------------------------- 6 files changed, 406 insertions(+), 337 deletions(-) create mode 100644 include/grub/util/mkimage.h create mode 100644 util/grub-mkimage32.c create mode 100644 util/grub-mkimage64.c diff --git a/Makefile.util.def b/Makefile.util.def index db7e8ec2a..ed9b4c697 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -172,6 +172,8 @@ program = { common = util/grub-mkimage.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/resolve.c; common = grub-core/kern/emu/argp_common.c; common = grub-core/osdep/init.c; @@ -510,6 +512,8 @@ program = { common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -552,6 +556,8 @@ program = { common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -595,6 +601,8 @@ program = { common = util/grub-install.c; common = util/probe.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -632,6 +640,8 @@ program = { common = util/grub-mknetdir.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h new file mode 100644 index 000000000..564adbce7 --- /dev/null +++ b/include/grub/util/mkimage.h @@ -0,0 +1,170 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_UTIL_MKIMAGE_HEADER +#define GRUB_UTIL_MKIMAGE_HEADER 1 + +/* Private header. Use only in mkimage-related sources. */ +char * +grub_mkimage_load_image32 (const char *kernel_path, size_t *exec_size, + size_t *kernel_sz, size_t *bss_size, + size_t total_module_size, grub_uint64_t *start, + void **reloc_section, size_t *reloc_size, + size_t *align, + const struct grub_install_image_target_desc *image_target); +char * +grub_mkimage_load_image64 (const char *kernel_path, size_t *exec_size, + size_t *kernel_sz, size_t *bss_size, + size_t total_module_size, grub_uint64_t *start, + void **reloc_section, size_t *reloc_size, + size_t *align, + const struct grub_install_image_target_desc *image_target); +void +grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf32_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size); +void +grub_mkimage_generate_elf64 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf64_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size); + +struct grub_install_image_target_desc +{ + const char *dirname; + const char *names[6]; + grub_size_t voidp_sizeof; + int bigendian; + enum { + IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, + IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_SPARC64_CDCORE, + IMAGE_I386_IEEE1275, + IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH, + IMAGE_FULOONG2F_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, + IMAGE_QEMU_MIPS_FLASH, IMAGE_UBOOT, IMAGE_XEN, IMAGE_I386_PC_ELTORITO + } id; + enum + { + PLATFORM_FLAGS_NONE = 0, + PLATFORM_FLAGS_DECOMPRESSORS = 2, + PLATFORM_FLAGS_MODULES_BEFORE_KERNEL = 4, + } flags; + unsigned total_module_size; + unsigned decompressor_compressed_size; + unsigned decompressor_uncompressed_size; + unsigned decompressor_uncompressed_addr; + unsigned link_align; + grub_uint16_t elf_target; + unsigned section_align; + signed vaddr_offset; + grub_uint64_t link_addr; + unsigned mod_gap, mod_align; + grub_compression_t default_compression; + grub_uint16_t pe_target; +}; + +#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x))) +#define grub_host_to_target32(x) (grub_host_to_target32_real (image_target, (x))) +#define grub_target_to_host64(x) (grub_target_to_host64_real (image_target, (x))) +#define grub_host_to_target64(x) (grub_host_to_target64_real (image_target, (x))) +#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (image_target, (x))) +#define grub_target_to_host16(x) (grub_target_to_host16_real (image_target, (x))) +#define grub_host_to_target16(x) (grub_host_to_target16_real (image_target, (x))) + +static inline grub_uint32_t +grub_target_to_host32_real (const struct grub_install_image_target_desc *image_target, + grub_uint32_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu32 (in); + else + return grub_le_to_cpu32 (in); +} + +static inline grub_uint64_t +grub_target_to_host64_real (const struct grub_install_image_target_desc *image_target, + grub_uint64_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu64 (in); + else + return grub_le_to_cpu64 (in); +} + +static inline grub_uint64_t +grub_host_to_target64_real (const struct grub_install_image_target_desc *image_target, + grub_uint64_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be64 (in); + else + return grub_cpu_to_le64 (in); +} + +static inline grub_uint32_t +grub_host_to_target32_real (const struct grub_install_image_target_desc *image_target, + grub_uint32_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be32 (in); + else + return grub_cpu_to_le32 (in); +} + +static inline grub_uint16_t +grub_target_to_host16_real (const struct grub_install_image_target_desc *image_target, + grub_uint16_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu16 (in); + else + return grub_le_to_cpu16 (in); +} + +static inline grub_uint16_t +grub_host_to_target16_real (const struct grub_install_image_target_desc *image_target, + grub_uint16_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be16 (in); + else + return grub_cpu_to_le16 (in); +} + +static inline grub_uint64_t +grub_host_to_target_addr_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +{ + if (image_target->voidp_sizeof == 8) + return grub_host_to_target64_real (image_target, in); + else + return grub_host_to_target32_real (image_target, in); +} + +static inline grub_uint64_t +grub_target_to_host_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +{ + if (image_target->voidp_sizeof == 8) + return grub_target_to_host64_real (image_target, in); + else + return grub_target_to_host32_real (image_target, in); +} + +#define grub_target_to_host(val) grub_target_to_host_real(image_target, (val)) + +#endif diff --git a/util/grub-mkimage32.c b/util/grub-mkimage32.c new file mode 100644 index 000000000..9b31397bc --- /dev/null +++ b/util/grub-mkimage32.c @@ -0,0 +1,22 @@ +#define MKIMAGE_ELF32 1 + +# define SUFFIX(x) x ## 32 +# define ELFCLASSXX ELFCLASS32 +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Phdr Elf32_Phdr +# define Elf_Nhdr Elf32_Nhdr +# define Elf_Addr Elf32_Addr +# define Elf_Sym Elf32_Sym +# define Elf_Off Elf32_Off +# define Elf_Shdr Elf32_Shdr +# define Elf_Rela Elf32_Rela +# define Elf_Rel Elf32_Rel +# define Elf_Word Elf32_Word +# define Elf_Half Elf32_Half +# define Elf_Section Elf32_Section +# define ELF_R_SYM(val) ELF32_R_SYM(val) +# define ELF_R_TYPE(val) ELF32_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) +#define XEN_NOTE_SIZE 132 + +#include "grub-mkimagexx.c" diff --git a/util/grub-mkimage64.c b/util/grub-mkimage64.c new file mode 100644 index 000000000..d83345924 --- /dev/null +++ b/util/grub-mkimage64.c @@ -0,0 +1,22 @@ +#define MKIMAGE_ELF64 1 + +# define SUFFIX(x) x ## 64 +# define ELFCLASSXX ELFCLASS64 +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Phdr Elf64_Phdr +# define Elf_Nhdr Elf64_Nhdr +# define Elf_Addr Elf64_Addr +# define Elf_Sym Elf64_Sym +# define Elf_Off Elf64_Off +# define Elf_Shdr Elf64_Shdr +# define Elf_Rela Elf64_Rela +# define Elf_Rel Elf64_Rel +# define Elf_Word Elf64_Word +# define Elf_Half Elf64_Half +# define Elf_Section Elf64_Section +# define ELF_R_SYM(val) ELF64_R_SYM(val) +# define ELF_R_TYPE(val) ELF64_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) +#define XEN_NOTE_SIZE 120 + +#include "grub-mkimagexx.c" diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 06b6a724d..03874be57 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -17,58 +17,172 @@ * along with GRUB. If not, see . */ -#undef ELF_R_SYM -#undef ELF_R_TYPE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#if defined(MKIMAGE_ELF32) -# define SUFFIX(x) x ## 32 -# define ELFCLASSXX ELFCLASS32 -# define Elf_Ehdr Elf32_Ehdr -# define Elf_Phdr Elf32_Phdr -# define Elf_Nhdr Elf32_Nhdr -# define Elf_Addr Elf32_Addr -# define Elf_Sym Elf32_Sym -# define Elf_Off Elf32_Off -# define Elf_Shdr Elf32_Shdr -# define Elf_Rela Elf32_Rela -# define Elf_Rel Elf32_Rel -# define Elf_Word Elf32_Word -# define Elf_Half Elf32_Half -# define Elf_Section Elf32_Section -# define ELF_R_SYM(val) ELF32_R_SYM(val) -# define ELF_R_TYPE(val) ELF32_R_TYPE(val) -# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) -#define XEN_NOTE_SIZE 132 -#elif defined(MKIMAGE_ELF64) -# define SUFFIX(x) x ## 64 -# define ELFCLASSXX ELFCLASS64 -# define Elf_Ehdr Elf64_Ehdr -# define Elf_Phdr Elf64_Phdr -# define Elf_Nhdr Elf64_Nhdr -# define Elf_Addr Elf64_Addr -# define Elf_Sym Elf64_Sym -# define Elf_Off Elf64_Off -# define Elf_Shdr Elf64_Shdr -# define Elf_Rela Elf64_Rela -# define Elf_Rel Elf64_Rel -# define Elf_Word Elf64_Word -# define Elf_Half Elf64_Half -# define Elf_Section Elf64_Section -# define ELF_R_SYM(val) ELF64_R_SYM(val) -# define ELF_R_TYPE(val) ELF64_R_TYPE(val) -# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) -#define XEN_NOTE_SIZE 120 -#else -#error "I'm confused" -#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wcast-align" static Elf_Addr SUFFIX (entry_point); -static void -SUFFIX (generate_elf) (const struct grub_install_image_target_desc *image_target, - int note, char **core_img, size_t *core_size, - Elf_Addr target_addr, grub_size_t align, - size_t kernel_size, size_t bss_size) +/* These structures are defined according to the CHRP binding to IEEE1275, + "Client Program Format" section. */ + +struct grub_ieee1275_note_desc +{ + grub_uint32_t real_mode; + grub_uint32_t real_base; + grub_uint32_t real_size; + grub_uint32_t virt_base; + grub_uint32_t virt_size; + grub_uint32_t load_base; +}; + +#define GRUB_IEEE1275_NOTE_NAME "PowerPC" +#define GRUB_IEEE1275_NOTE_TYPE 0x1275 + +struct grub_ieee1275_note +{ + Elf32_Nhdr header; + char name[ALIGN_UP(sizeof (GRUB_IEEE1275_NOTE_NAME), 4)]; + struct grub_ieee1275_note_desc descriptor; +}; + +#define GRUB_XEN_NOTE_NAME "Xen" + +struct fixup_block_list +{ + struct fixup_block_list *next; + int state; + struct grub_pe32_fixup_block b; +}; + +#define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) + +#ifdef MKIMAGE_ELF32 + +/* + * R_ARM_THM_CALL/THM_JUMP24 + * + * Relocate Thumb (T32) instruction set relative branches: + * B.W, BL and BLX + */ +static grub_err_t +grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + offset = grub_arm_thm_call_get_offset (target); + + grub_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); + + offset += sym_addr; + + grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", + target, sym_addr, offset); + + /* Keep traditional (pre-Thumb2) limits on blx. In any case if the kernel + is bigger than 2M (currently under 150K) then we probably have a problem + somewhere else. */ + if (offset < -0x200000 || offset >= 0x200000) + return grub_error (GRUB_ERR_BAD_MODULE, + "THM_CALL Relocation out of range."); + + grub_dprintf ("dl", " relative destination = %p", + (char *) target + offset); + + return grub_arm_thm_call_set_offset (target, offset); +} + +/* + * R_ARM_THM_JUMP19 + * + * Relocate conditional Thumb (T32) B.W + */ +static grub_err_t +grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + if (!(sym_addr & 1)) + return grub_error (GRUB_ERR_BAD_MODULE, + "Relocation targeting wrong execution state"); + + offset = grub_arm_thm_jump19_get_offset (target); + + /* Adjust and re-truncate offset */ + offset += sym_addr; + + if (!grub_arm_thm_jump19_check_offset (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "THM_JUMP19 Relocation out of range."); + + grub_arm_thm_jump19_set_offset (target, offset); + + return GRUB_ERR_NONE; +} + +/* + * R_ARM_JUMP24 + * + * Relocate ARM (A32) B + */ +static grub_err_t +grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + if (sym_addr & 1) + return grub_error (GRUB_ERR_BAD_MODULE, + "Relocation targeting wrong execution state"); + + offset = grub_arm_jump24_get_offset (target); + offset += sym_addr; + + if (!grub_arm_jump24_check_offset (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "JUMP24 Relocation out of range."); + + + grub_arm_jump24_set_offset (target, offset); + + return GRUB_ERR_NONE; +} + +#endif + +void +SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size) { char *elf_img; size_t program_size; @@ -1457,13 +1571,13 @@ SUFFIX (locate_sections) (const char *kernel_path, return section_addresses; } -static char * -SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, - size_t *kernel_sz, size_t *bss_size, - size_t total_module_size, grub_uint64_t *start, - void **reloc_section, size_t *reloc_size, - size_t *align, - const struct grub_install_image_target_desc *image_target) +char * +SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, + size_t *kernel_sz, size_t *bss_size, + size_t total_module_size, grub_uint64_t *start, + void **reloc_section, size_t *reloc_size, + size_t *align, + const struct grub_install_image_target_desc *image_target) { char *kernel_img, *out_img; const char *strtab; @@ -1671,23 +1785,3 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, return out_img; } - - -#undef SUFFIX -#undef ELFCLASSXX -#undef Elf_Ehdr -#undef Elf_Phdr -#undef Elf_Nhdr -#undef Elf_Shdr -#undef Elf_Addr -#undef Elf_Sym -#undef Elf_Off -#undef Elf_Rela -#undef Elf_Rel -#undef ELF_R_TYPE -#undef ELF_R_SYM -#undef Elf_Word -#undef Elf_Half -#undef Elf_Section -#undef ELF_ST_TYPE -#undef XEN_NOTE_SIZE diff --git a/util/mkimage.c b/util/mkimage.c index c3365bbbd..86bb78190 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -46,6 +46,7 @@ #include #include #include +#include #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) @@ -53,45 +54,13 @@ #include #endif +#pragma GCC diagnostic ignored "-Wcast-align" + #define TARGET_NO_FIELD 0xffffffff /* use 2015-01-01T00:00:00+0000 as a stock timestamp */ #define STABLE_EMBEDDING_TIMESTAMP 1420070400 -struct grub_install_image_target_desc -{ - const char *dirname; - const char *names[6]; - grub_size_t voidp_sizeof; - int bigendian; - enum { - IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, - IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_SPARC64_CDCORE, - IMAGE_I386_IEEE1275, - IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH, - IMAGE_FULOONG2F_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, - IMAGE_QEMU_MIPS_FLASH, IMAGE_UBOOT, IMAGE_XEN, IMAGE_I386_PC_ELTORITO - } id; - enum - { - PLATFORM_FLAGS_NONE = 0, - PLATFORM_FLAGS_DECOMPRESSORS = 2, - PLATFORM_FLAGS_MODULES_BEFORE_KERNEL = 4, - } flags; - unsigned total_module_size; - unsigned decompressor_compressed_size; - unsigned decompressor_uncompressed_size; - unsigned decompressor_uncompressed_addr; - unsigned link_align; - grub_uint16_t elf_target; - unsigned section_align; - signed vaddr_offset; - grub_uint64_t link_addr; - unsigned mod_gap, mod_align; - grub_compression_t default_compression; - grub_uint16_t pe_target; -}; - #define EFI32_HEADER_SIZE ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE \ + GRUB_PE32_SIGNATURE_SIZE \ + sizeof (struct grub_pe32_coff_header) \ @@ -603,119 +572,6 @@ static const struct grub_install_image_target_desc image_targets[] = }, }; -#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x))) -#define grub_host_to_target32(x) (grub_host_to_target32_real (image_target, (x))) -#define grub_target_to_host64(x) (grub_target_to_host64_real (image_target, (x))) -#define grub_host_to_target64(x) (grub_host_to_target64_real (image_target, (x))) -#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (image_target, (x))) -#define grub_target_to_host16(x) (grub_target_to_host16_real (image_target, (x))) -#define grub_host_to_target16(x) (grub_host_to_target16_real (image_target, (x))) - -static inline grub_uint32_t -grub_target_to_host32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu32 (in); - else - return grub_le_to_cpu32 (in); -} - -static inline grub_uint64_t -grub_target_to_host64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu64 (in); - else - return grub_le_to_cpu64 (in); -} - -static inline grub_uint64_t -grub_host_to_target64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be64 (in); - else - return grub_cpu_to_le64 (in); -} - -static inline grub_uint32_t -grub_host_to_target32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be32 (in); - else - return grub_cpu_to_le32 (in); -} - -static inline grub_uint16_t -grub_target_to_host16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu16 (in); - else - return grub_le_to_cpu16 (in); -} - -static inline grub_uint16_t -grub_host_to_target16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be16 (in); - else - return grub_cpu_to_le16 (in); -} - -static inline grub_uint64_t -grub_host_to_target_addr_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) -{ - if (image_target->voidp_sizeof == 8) - return grub_host_to_target64_real (image_target, in); - else - return grub_host_to_target32_real (image_target, in); -} - -static inline grub_uint64_t -grub_target_to_host_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) -{ - if (image_target->voidp_sizeof == 8) - return grub_target_to_host64_real (image_target, in); - else - return grub_target_to_host32_real (image_target, in); -} - -#define GRUB_IEEE1275_NOTE_NAME "PowerPC" -#define GRUB_IEEE1275_NOTE_TYPE 0x1275 - -/* These structures are defined according to the CHRP binding to IEEE1275, - "Client Program Format" section. */ - -struct grub_ieee1275_note_desc -{ - grub_uint32_t real_mode; - grub_uint32_t real_base; - grub_uint32_t real_size; - grub_uint32_t virt_base; - grub_uint32_t virt_size; - grub_uint32_t load_base; -}; - -struct grub_ieee1275_note -{ - Elf32_Nhdr header; - char name[ALIGN_UP(sizeof (GRUB_IEEE1275_NOTE_NAME), 4)]; - struct grub_ieee1275_note_desc descriptor; -}; - -#define GRUB_XEN_NOTE_NAME "Xen" - -#define grub_target_to_host(val) grub_target_to_host_real(image_target, (val)) - #include static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return xmalloc(size); } @@ -830,111 +686,6 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char *core_size = kernel_size; } -struct fixup_block_list -{ - struct fixup_block_list *next; - int state; - struct grub_pe32_fixup_block b; -}; - -/* - * R_ARM_THM_CALL/THM_JUMP24 - * - * Relocate Thumb (T32) instruction set relative branches: - * B.W, BL and BLX - */ -static grub_err_t -grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - offset = grub_arm_thm_call_get_offset (target); - - grub_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); - - offset += sym_addr; - - grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", - target, sym_addr, offset); - - /* Keep traditional (pre-Thumb2) limits on blx. In any case if the kernel - is bigger than 2M (currently under 150K) then we probably have a problem - somewhere else. */ - if (offset < -0x200000 || offset >= 0x200000) - return grub_error (GRUB_ERR_BAD_MODULE, - "THM_CALL Relocation out of range."); - - grub_dprintf ("dl", " relative destination = %p", - (char *) target + offset); - - return grub_arm_thm_call_set_offset (target, offset); -} - -/* - * R_ARM_THM_JUMP19 - * - * Relocate conditional Thumb (T32) B.W - */ -static grub_err_t -grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - if (!(sym_addr & 1)) - return grub_error (GRUB_ERR_BAD_MODULE, - "Relocation targeting wrong execution state"); - - offset = grub_arm_thm_jump19_get_offset (target); - - /* Adjust and re-truncate offset */ - offset += sym_addr; - - if (!grub_arm_thm_jump19_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, - "THM_JUMP19 Relocation out of range."); - - grub_arm_thm_jump19_set_offset (target, offset); - - return GRUB_ERR_NONE; -} - -/* - * R_ARM_JUMP24 - * - * Relocate ARM (A32) B - */ -static grub_err_t -grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - if (sym_addr & 1) - return grub_error (GRUB_ERR_BAD_MODULE, - "Relocation targeting wrong execution state"); - - offset = grub_arm_jump24_get_offset (target); - offset += sym_addr; - - if (!grub_arm_jump24_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, - "JUMP24 Relocation out of range."); - - - grub_arm_jump24_set_offset (target, offset); - - return GRUB_ERR_NONE; -} - -#pragma GCC diagnostic ignored "-Wcast-align" - -#define MKIMAGE_ELF32 1 -#include "grub-mkimagexx.c" -#undef MKIMAGE_ELF32 - -#define MKIMAGE_ELF64 1 -#include "grub-mkimagexx.c" -#undef MKIMAGE_ELF64 - const struct grub_install_image_target_desc * grub_install_get_image_target (const char *arg) { @@ -1063,13 +814,13 @@ grub_install_generate_image (const char *dir, const char *prefix, (unsigned long long) total_module_size); if (image_target->voidp_sizeof == 4) - kernel_img = load_image32 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); + kernel_img = grub_mkimage_load_image32 (kernel_path, &exec_size, &kernel_size, &bss_size, + total_module_size, &start_address, &rel_section, + &reloc_size, &align, image_target); else - kernel_img = load_image64 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); + kernel_img = grub_mkimage_load_image64 (kernel_path, &exec_size, &kernel_size, &bss_size, + total_module_size, &start_address, &rel_section, + &reloc_size, &align, image_target); if (image_target->id == IMAGE_XEN && align < 4096) align = 4096; @@ -1890,11 +1641,11 @@ grub_install_generate_image (const char *dir, const char *prefix, else target_addr = image_target->link_addr; if (image_target->voidp_sizeof == 4) - generate_elf32 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + grub_mkimage_generate_elf32 (image_target, note, &core_img, &core_size, + target_addr, align, kernel_size, bss_size); else - generate_elf64 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + grub_mkimage_generate_elf64 (image_target, note, &core_img, &core_size, + target_addr, align, kernel_size, bss_size); } break; } From dd3969e7ec3a09bb4625aef5a852d4ffcf04b639 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 18 Feb 2016 20:54:37 +0100 Subject: [PATCH 145/207] mkimagexx: Split PE and generic part for relocations. As a preparation for U-Boot relocations, split emitting PE-relocations from parsing source ELF-relocations. --- util/grub-mkimagexx.c | 415 ++++++++++++++++++++++-------------------- 1 file changed, 219 insertions(+), 196 deletions(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 03874be57..a39803a06 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -1095,9 +1095,9 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, /* Add a PE32's fixup entry for a relocation. Return the resulting address after having written to the file OUT. */ static Elf_Addr -SUFFIX (add_fixup_entry) (struct fixup_block_list **cblock, grub_uint16_t type, - Elf_Addr addr, int flush, Elf_Addr current_address, - const struct grub_install_image_target_desc *image_target) +add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, + Elf_Addr addr, int flush, Elf_Addr current_address, + const struct grub_install_image_target_desc *image_target) { struct grub_pe32_fixup_block *b; @@ -1187,22 +1187,222 @@ SUFFIX (add_fixup_entry) (struct fixup_block_list **cblock, grub_uint16_t type, return current_address; } +struct translate_context +{ + struct fixup_block_list *lst, *lst0; + Elf_Addr current_address; +}; + +static void +translate_reloc_start (struct translate_context *ctx) +{ + ctx->lst = ctx->lst0 = xmalloc (sizeof (*ctx->lst) + 2 * 0x1000); + memset (ctx->lst, 0, sizeof (*ctx->lst) + 2 * 0x1000); + ctx->current_address = 0; +} + +static void +translate_relocation (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + /* Necessary to relocate only absolute addresses. */ + switch (image_target->elf_target) + { + case EM_386: + if (ELF_R_TYPE (info) == R_386_32) + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_HIGHLOW, + addr, 0, ctx->current_address, + image_target); + } + break; + case EM_X86_64: + if ((ELF_R_TYPE (info) == R_X86_64_32) || + (ELF_R_TYPE (info) == R_X86_64_32S)) + { + grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); + } + else if (ELF_R_TYPE (info) == R_X86_64_64) + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, + 0, ctx->current_address, + image_target); + } + break; + case EM_IA_64: + switch (ELF_R_TYPE (info)) + { + case R_IA64_PCREL64LSB: + case R_IA64_LDXMOV: + case R_IA64_PCREL21B: + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF22: + case R_IA64_GPREL22: + case R_IA64_SEGREL64LSB: + break; + + case R_IA64_FPTR64LSB: + case R_IA64_DIR64LSB: +#if 1 + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, + 0, ctx->current_address, + image_target); + } +#endif + break; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + case EM_AARCH64: + switch (ELF_R_TYPE (info)) + { + case R_AARCH64_ABS64: + { + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, 0, ctx->current_address, + image_target); + } + break; + /* Relative relocations do not require fixup entries. */ + case R_AARCH64_CALL26: + case R_AARCH64_JUMP26: + break; + /* Page-relative relocations do not require fixup entries. */ + case R_AARCH64_ADR_PREL_PG_HI21: + /* We page-align the whole kernel, so no need + for fixup entries. + */ + case R_AARCH64_ADD_ABS_LO12_NC: + case R_AARCH64_LDST64_ABS_LO12_NC: + break; + + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + break; +#if defined(MKIMAGE_ELF32) + case EM_ARM: + switch (ELF_R_TYPE (info)) + { + case R_ARM_V4BX: + /* Relative relocations do not require fixup entries. */ + case R_ARM_JUMP24: + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_CALL: + { + grub_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) ctx->current_address); + } + break; + /* Create fixup entry for PE/COFF loader */ + case R_ARM_ABS32: + { + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_HIGHLOW, + addr, 0, ctx->current_address, + image_target); + } + break; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; +#endif /* defined(MKIMAGE_ELF32) */ + default: + grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + } +} + +static Elf_Addr +finish_reloc_translation (struct translate_context *ctx, void **out, + const struct grub_install_image_target_desc *image_target) +{ + ctx->current_address = add_fixup_entry (&ctx->lst, 0, 0, 1, ctx->current_address, image_target); + + { + grub_uint8_t *ptr; + ptr = *out = xmalloc (ctx->current_address); + for (ctx->lst = ctx->lst0; ctx->lst; ctx->lst = ctx->lst->next) + if (ctx->lst->state) + { + memcpy (ptr, &ctx->lst->b, grub_target_to_host32 (ctx->lst->b.block_size)); + ptr += grub_target_to_host32 (ctx->lst->b.block_size); + } + assert ((ctx->current_address + (grub_uint8_t *) *out) == ptr); + } + + for (ctx->lst = ctx->lst0; ctx->lst; ) + { + struct fixup_block_list *next; + next = ctx->lst->next; + free (ctx->lst); + ctx->lst = next; + } + + return ctx->current_address; +} + +static void +translate_reloc_jumpers (struct translate_context *ctx, + Elf_Addr jumpers, grub_size_t njumpers, + const struct grub_install_image_target_desc *image_target) +{ + unsigned i; + for (i = 0; i < njumpers; i++) + ctx->current_address = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + jumpers + 8 * i, + 0, ctx->current_address, + image_target); +} + /* Make a .reloc section. */ static Elf_Addr -SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, - Elf_Addr *section_addresses, Elf_Shdr *sections, - Elf_Half section_entsize, Elf_Half num_sections, - const char *strtab, - Elf_Addr jumpers, grub_size_t njumpers, - const struct grub_install_image_target_desc *image_target) +make_reloc_section (Elf_Ehdr *e, void **out, + Elf_Addr *section_addresses, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, + const char *strtab, + Elf_Addr jumpers, grub_size_t njumpers, + const struct grub_install_image_target_desc *image_target) { unsigned i; Elf_Shdr *s; - struct fixup_block_list *lst, *lst0; - Elf_Addr current_address = 0; + struct translate_context ctx; - lst = lst0 = xmalloc (sizeof (*lst) + 2 * 0x1000); - memset (lst, 0, sizeof (*lst) + 2 * 0x1000); + translate_reloc_start (&ctx); for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -1231,199 +1431,22 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, { Elf_Addr info; Elf_Addr offset; + Elf_Addr addr; offset = grub_target_to_host (r->r_offset); info = grub_target_to_host (r->r_info); - /* Necessary to relocate only absolute addresses. */ - switch (image_target->elf_target) - { - case EM_386: - if (ELF_R_TYPE (info) == R_386_32) - { - Elf_Addr addr; + addr = section_address + offset; - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_HIGHLOW, - addr, 0, current_address, - image_target); - } - break; - case EM_X86_64: - if ((ELF_R_TYPE (info) == R_X86_64_32) || - (ELF_R_TYPE (info) == R_X86_64_32S)) - { - grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); - } - else if (ELF_R_TYPE (info) == R_X86_64_64) - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, - 0, current_address, - image_target); - } - break; - case EM_IA_64: - switch (ELF_R_TYPE (info)) - { - case R_IA64_PCREL64LSB: - case R_IA64_LDXMOV: - case R_IA64_PCREL21B: - case R_IA64_LTOFF_FPTR22: - case R_IA64_LTOFF22X: - case R_IA64_LTOFF22: - case R_IA64_GPREL22: - case R_IA64_SEGREL64LSB: - break; - - case R_IA64_FPTR64LSB: - case R_IA64_DIR64LSB: -#if 1 - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, - 0, current_address, - image_target); - } -#endif - break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; - case EM_AARCH64: - switch (ELF_R_TYPE (info)) - { - case R_AARCH64_ABS64: - { - Elf_Addr addr; - - addr = section_address + offset; - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, 0, current_address, - image_target); - } - break; - /* Relative relocations do not require fixup entries. */ - case R_AARCH64_CALL26: - case R_AARCH64_JUMP26: - break; - /* Page-relative relocations do not require fixup entries. */ - case R_AARCH64_ADR_PREL_PG_HI21: - /* We page-align the whole kernel, so no need - for fixup entries. - */ - case R_AARCH64_ADD_ABS_LO12_NC: - case R_AARCH64_LDST64_ABS_LO12_NC: - break; - - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; - break; -#if defined(MKIMAGE_ELF32) - case EM_ARM: - switch (ELF_R_TYPE (info)) - { - case R_ARM_V4BX: - /* Relative relocations do not require fixup entries. */ - case R_ARM_JUMP24: - case R_ARM_THM_CALL: - case R_ARM_THM_JUMP19: - case R_ARM_THM_JUMP24: - case R_ARM_CALL: - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) current_address); - } - break; - /* Create fixup entry for PE/COFF loader */ - case R_ARM_ABS32: - { - Elf_Addr addr; - - addr = section_address + offset; - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_HIGHLOW, - addr, 0, current_address, - image_target); - } - break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; -#endif /* defined(MKIMAGE_ELF32) */ - default: - grub_util_error ("unknown machine type 0x%x", image_target->elf_target); - } + translate_relocation (&ctx, addr, info, image_target); } } if (image_target->elf_target == EM_IA_64) - for (i = 0; i < njumpers; i++) - current_address = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - jumpers + 8 * i, - 0, current_address, - image_target); + translate_reloc_jumpers (&ctx, jumpers, njumpers, + image_target); - current_address = SUFFIX (add_fixup_entry) (&lst, 0, 0, 1, current_address, image_target); - - { - grub_uint8_t *ptr; - ptr = *out = xmalloc (current_address); - for (lst = lst0; lst; lst = lst->next) - if (lst->state) - { - memcpy (ptr, &lst->b, grub_target_to_host32 (lst->b.block_size)); - ptr += grub_target_to_host32 (lst->b.block_size); - } - assert ((current_address + (grub_uint8_t *) *out) == ptr); - } - - for (lst = lst0; lst; ) - { - struct fixup_block_list *next; - next = lst->next; - free (lst); - lst = next; - } - - return current_address; + return finish_reloc_translation (&ctx, out, image_target); } /* Determine if this section is a text section. Return false if this From 73a9c742fe15ab62b3a828f6600556b142f71f93 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 19 Feb 2016 01:49:53 +0100 Subject: [PATCH 146/207] Encapsulate image layout into a separate structure. Currently we pass around a lot of pointer. Instead put all relevant data into one structure. --- include/grub/util/mkimage.h | 32 ++++++---- util/grub-mkimagexx.c | 116 ++++++++++++++++++------------------ util/mkimage.c | 112 +++++++++++++++++----------------- 3 files changed, 133 insertions(+), 127 deletions(-) diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h index 564adbce7..8169939a7 100644 --- a/include/grub/util/mkimage.h +++ b/include/grub/util/mkimage.h @@ -19,20 +19,32 @@ #ifndef GRUB_UTIL_MKIMAGE_HEADER #define GRUB_UTIL_MKIMAGE_HEADER 1 +struct grub_mkimage_layout +{ + size_t exec_size; + size_t kernel_size; + size_t bss_size; + grub_uint64_t start_address; + void *reloc_section; + size_t reloc_size; + size_t align; + grub_size_t ia64jmp_off; + grub_size_t tramp_off; + grub_size_t ia64_got_off; + grub_size_t got_size; + unsigned ia64jmpnum; +}; + /* Private header. Use only in mkimage-related sources. */ char * -grub_mkimage_load_image32 (const char *kernel_path, size_t *exec_size, - size_t *kernel_sz, size_t *bss_size, - size_t total_module_size, grub_uint64_t *start, - void **reloc_section, size_t *reloc_size, - size_t *align, +grub_mkimage_load_image32 (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target); char * -grub_mkimage_load_image64 (const char *kernel_path, size_t *exec_size, - size_t *kernel_sz, size_t *bss_size, - size_t total_module_size, grub_uint64_t *start, - void **reloc_section, size_t *reloc_size, - size_t *align, +grub_mkimage_load_image64 (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target); void grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index a39803a06..74f86f5df 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -1346,22 +1346,23 @@ translate_relocation (struct translate_context *ctx, } } -static Elf_Addr -finish_reloc_translation (struct translate_context *ctx, void **out, +static void +finish_reloc_translation (struct translate_context *ctx, + struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target) { ctx->current_address = add_fixup_entry (&ctx->lst, 0, 0, 1, ctx->current_address, image_target); { grub_uint8_t *ptr; - ptr = *out = xmalloc (ctx->current_address); + layout->reloc_section = ptr = xmalloc (ctx->current_address); for (ctx->lst = ctx->lst0; ctx->lst; ctx->lst = ctx->lst->next) if (ctx->lst->state) { memcpy (ptr, &ctx->lst->b, grub_target_to_host32 (ctx->lst->b.block_size)); ptr += grub_target_to_host32 (ctx->lst->b.block_size); } - assert ((ctx->current_address + (grub_uint8_t *) *out) == ptr); + assert ((ctx->current_address + (grub_uint8_t *) layout->reloc_section) == ptr); } for (ctx->lst = ctx->lst0; ctx->lst; ) @@ -1372,7 +1373,7 @@ finish_reloc_translation (struct translate_context *ctx, void **out, ctx->lst = next; } - return ctx->current_address; + layout->reloc_size = ctx->current_address; } static void @@ -1390,8 +1391,8 @@ translate_reloc_jumpers (struct translate_context *ctx, } /* Make a .reloc section. */ -static Elf_Addr -make_reloc_section (Elf_Ehdr *e, void **out, +static void +make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, Elf_Addr *section_addresses, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, @@ -1446,7 +1447,7 @@ make_reloc_section (Elf_Ehdr *e, void **out, translate_reloc_jumpers (&ctx, jumpers, njumpers, image_target); - return finish_reloc_translation (&ctx, out, image_target); + finish_reloc_translation (&ctx, layout, image_target); } /* Determine if this section is a text section. Return false if this @@ -1498,8 +1499,7 @@ static Elf_Addr * SUFFIX (locate_sections) (const char *kernel_path, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, - size_t *exec_size, size_t *kernel_sz, - size_t *all_align, + struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target) { int i; @@ -1507,10 +1507,10 @@ SUFFIX (locate_sections) (const char *kernel_path, Elf_Addr *section_addresses; Elf_Shdr *s; - *all_align = 1; + layout->align = 1; /* Page-aligning simplifies relocation handling. */ if (image_target->elf_target == EM_AARCH64) - *all_align = 4096; + layout->align = 4096; section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); @@ -1521,8 +1521,8 @@ SUFFIX (locate_sections) (const char *kernel_path, i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) - && grub_host_to_target32 (s->sh_addralign) > *all_align) - *all_align = grub_host_to_target32 (s->sh_addralign); + && grub_host_to_target32 (s->sh_addralign) > layout->align) + layout->align = grub_host_to_target32 (s->sh_addralign); /* .text */ @@ -1562,7 +1562,7 @@ SUFFIX (locate_sections) (const char *kernel_path, current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - *exec_size = current_address; + layout->exec_size = current_address; /* .data */ for (i = 0, s = sections; @@ -1590,16 +1590,14 @@ SUFFIX (locate_sections) (const char *kernel_path, current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - *kernel_sz = current_address; + layout->kernel_size = current_address; return section_addresses; } char * -SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, - size_t *kernel_sz, size_t *bss_size, - size_t total_module_size, grub_uint64_t *start, - void **reloc_section, size_t *reloc_size, - size_t *align, +SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target) { char *kernel_img, *out_img; @@ -1614,12 +1612,11 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, Elf_Off section_offset; Elf_Half section_entsize; grub_size_t kernel_size; - grub_size_t ia64jmp_off = 0, tramp_off = 0, ia64_got_off = 0; - unsigned ia64jmpnum = 0; Elf_Shdr *symtab_section = 0; - grub_size_t got = 0; - *start = 0; + grub_memset (layout, 0, sizeof (*layout)); + + layout->start_address = 0; kernel_size = grub_util_get_image_size (kernel_path); kernel_img = xmalloc (kernel_size); @@ -1646,7 +1643,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, section_addresses = SUFFIX (locate_sections) (kernel_path, sections, section_entsize, num_sections, strtab, - exec_size, kernel_sz, align, + layout, image_target); section_vaddresses = xmalloc (sizeof (*section_addresses) * num_sections); @@ -1656,7 +1653,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, if (image_target->id != IMAGE_EFI) { - Elf_Addr current_address = *kernel_sz; + Elf_Addr current_address = layout->kernel_size; for (i = 0, s = sections; i < num_sections; @@ -1686,15 +1683,15 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - *bss_size = current_address - *kernel_sz; + layout->bss_size = current_address - layout->kernel_size; } else - *bss_size = 0; + layout->bss_size = 0; if (image_target->id == IMAGE_SPARC64_AOUT || image_target->id == IMAGE_SPARC64_RAW || image_target->id == IMAGE_SPARC64_CDCORE) - *kernel_sz = ALIGN_UP (*kernel_sz, image_target->mod_align); + layout->kernel_size = ALIGN_UP (layout->kernel_size, image_target->mod_align); if (image_target->id == IMAGE_EFI) { @@ -1715,13 +1712,13 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, { grub_size_t tramp; - *kernel_sz = ALIGN_UP (*kernel_sz, 16); + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); tramp = arm_get_trampoline_size (e, sections, section_entsize, num_sections, image_target); - tramp_off = *kernel_sz; - *kernel_sz += ALIGN_UP (tramp, 16); + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); } #endif @@ -1730,61 +1727,62 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, size_t *exec_size, { grub_size_t tramp; - *kernel_sz = ALIGN_UP (*kernel_sz, 16); + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); - grub_ia64_dl_get_tramp_got_size (e, &tramp, &got); + grub_ia64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); - tramp_off = *kernel_sz; - *kernel_sz += ALIGN_UP (tramp, 16); + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); - ia64jmp_off = *kernel_sz; - ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, + layout->ia64jmp_off = layout->kernel_size; + layout->ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, image_target); - *kernel_sz += 16 * ia64jmpnum; + layout->kernel_size += 16 * layout->ia64jmpnum; - ia64_got_off = *kernel_sz; - *kernel_sz += ALIGN_UP (got, 16); + layout->ia64_got_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (layout->got_size, 16); } #endif } else { - *reloc_size = 0; - *reloc_section = NULL; + layout->reloc_size = 0; + layout->reloc_section = NULL; } - out_img = xmalloc (*kernel_sz + total_module_size); - memset (out_img, 0, *kernel_sz + total_module_size); + out_img = xmalloc (layout->kernel_size + total_module_size); + memset (out_img, 0, layout->kernel_size + total_module_size); if (image_target->id == IMAGE_EFI) { - *start = SUFFIX (relocate_symbols) (e, sections, symtab_section, + layout->start_address = SUFFIX (relocate_symbols) (e, sections, symtab_section, section_vaddresses, section_entsize, num_sections, - (char *) out_img + ia64jmp_off, - ia64jmp_off + (char *) out_img + layout->ia64jmp_off, + layout->ia64jmp_off + image_target->vaddr_offset, image_target); - if (*start == 0) + if (layout->start_address == 0) grub_util_error ("start symbol is not defined"); - SUFFIX (entry_point) = (Elf_Addr) *start; + SUFFIX (entry_point) = (Elf_Addr) layout->start_address; /* Resolve addresses in the virtual address space. */ SUFFIX (relocate_addresses) (e, sections, section_addresses, section_entsize, num_sections, strtab, - out_img, tramp_off, ia64_got_off, + out_img, layout->tramp_off, + layout->ia64_got_off, image_target); - *reloc_size = SUFFIX (make_reloc_section) (e, reloc_section, - section_vaddresses, sections, - section_entsize, num_sections, - strtab, ia64jmp_off - + image_target->vaddr_offset, - 2 * ia64jmpnum + (got / 8), - image_target); + make_reloc_section (e, layout, + section_vaddresses, sections, + section_entsize, num_sections, + strtab, layout->ia64jmp_off + + image_target->vaddr_offset, + 2 * layout->ia64jmpnum + (layout->got_size / 8), + image_target); } for (i = 0, s = sections; diff --git a/util/mkimage.c b/util/mkimage.c index 86bb78190..ab58d34c0 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -742,17 +742,14 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_compression_t comp) { char *kernel_img, *core_img; - size_t kernel_size, total_module_size, core_size, exec_size; + size_t total_module_size, core_size; size_t memdisk_size = 0, config_size = 0; size_t prefix_size = 0; char *kernel_path; size_t offset; struct grub_util_path_list *path_list, *p; - size_t bss_size; - grub_uint64_t start_address; - void *rel_section = 0; - size_t reloc_size = 0, align; size_t decompress_size = 0; + struct grub_mkimage_layout layout; if (comp == GRUB_COMPRESSION_AUTO) comp = image_target->default_compression; @@ -814,15 +811,13 @@ grub_install_generate_image (const char *dir, const char *prefix, (unsigned long long) total_module_size); if (image_target->voidp_sizeof == 4) - kernel_img = grub_mkimage_load_image32 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); + kernel_img = grub_mkimage_load_image32 (kernel_path, total_module_size, + &layout, image_target); else - kernel_img = grub_mkimage_load_image64 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); - if (image_target->id == IMAGE_XEN && align < 4096) - align = 4096; + kernel_img = grub_mkimage_load_image64 (kernel_path, total_module_size, + &layout, image_target); + if (image_target->id == IMAGE_XEN && layout.align < 4096) + layout.align = 4096; if ((image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) && (image_target->total_module_size != TARGET_NO_FIELD)) @@ -831,7 +826,7 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) { - memmove (kernel_img + total_module_size, kernel_img, kernel_size); + memmove (kernel_img + total_module_size, kernel_img, layout.kernel_size); memset (kernel_img, 0, total_module_size); } @@ -842,14 +837,14 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) modinfo = (struct grub_module_info64 *) kernel_img; else - modinfo = (struct grub_module_info64 *) (kernel_img + kernel_size); + modinfo = (struct grub_module_info64 *) (kernel_img + layout.kernel_size); modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info64)); modinfo->size = grub_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) offset = sizeof (struct grub_module_info64); else - offset = kernel_size + sizeof (struct grub_module_info64); + offset = layout.kernel_size + sizeof (struct grub_module_info64); } else { @@ -858,14 +853,14 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) modinfo = (struct grub_module_info32 *) kernel_img; else - modinfo = (struct grub_module_info32 *) (kernel_img + kernel_size); + modinfo = (struct grub_module_info32 *) (kernel_img + layout.kernel_size); modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info32)); modinfo->size = grub_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) offset = sizeof (struct grub_module_info32); else - offset = kernel_size + sizeof (struct grub_module_info32); + offset = layout.kernel_size + sizeof (struct grub_module_info32); } for (p = path_list; p; p = p->next) @@ -944,8 +939,8 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_util_info ("kernel_img=%p, kernel_size=0x%" GRUB_HOST_PRIxLONG_LONG, kernel_img, - (unsigned long long) kernel_size); - compress_kernel (image_target, kernel_img, kernel_size + total_module_size, + (unsigned long long) layout.kernel_size); + compress_kernel (image_target, kernel_img, layout.kernel_size + total_module_size, &core_img, &core_size, comp); free (kernel_img); @@ -997,7 +992,7 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->decompressor_uncompressed_size != TARGET_NO_FIELD) *((grub_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_size)) - = grub_host_to_target32 (kernel_size + total_module_size); + = grub_host_to_target32 (layout.kernel_size + total_module_size); if (image_target->decompressor_uncompressed_addr != TARGET_NO_FIELD) { @@ -1030,16 +1025,17 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_I386_PC_ELTORITO: if (GRUB_KERNEL_I386_PC_LINK_ADDR + core_size > 0x78000 || (core_size > (0xffff << GRUB_DISK_SECTOR_BITS)) - || (kernel_size + bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)) + || (layout.kernel_size + layout.bss_size + + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)) grub_util_error (_("core image is too big (0x%x > 0x%x)"), GRUB_KERNEL_I386_PC_LINK_ADDR + (unsigned) core_size, 0x78000); /* fallthrough */ case IMAGE_COREBOOT: case IMAGE_QEMU: - if (kernel_size + bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000) + if (layout.kernel_size + layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000) grub_util_error (_("kernel image is too big (0x%x > 0x%x)"), - (unsigned) kernel_size + (unsigned) bss_size + (unsigned) layout.kernel_size + (unsigned) layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR, 0x68000); break; @@ -1161,13 +1157,13 @@ grub_install_generate_image (const char *dir, const char *prefix, reloc_addr = ALIGN_UP (header_size + core_size, image_target->section_align); - pe_size = ALIGN_UP (reloc_addr + reloc_size, + pe_size = ALIGN_UP (reloc_addr + layout.reloc_size, image_target->section_align); - pe_img = xmalloc (reloc_addr + reloc_size); + pe_img = xmalloc (reloc_addr + layout.reloc_size); memset (pe_img, 0, header_size); memcpy ((char *) pe_img + header_size, core_img, core_size); memset ((char *) pe_img + header_size + core_size, 0, reloc_addr - (header_size + core_size)); - memcpy ((char *) pe_img + reloc_addr, rel_section, reloc_size); + memcpy ((char *) pe_img + reloc_addr, layout.reloc_section, layout.reloc_size); header = pe_img; /* The magic. */ @@ -1201,14 +1197,14 @@ grub_install_generate_image (const char *dir, const char *prefix, (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE + sizeof (struct grub_pe32_coff_header)); o->magic = grub_host_to_target16 (GRUB_PE32_PE32_MAGIC); - o->code_size = grub_host_to_target32 (exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - exec_size + o->code_size = grub_host_to_target32 (layout.exec_size); + o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (bss_size); - o->entry_addr = grub_cpu_to_le32 (start_address); + o->bss_size = grub_cpu_to_le32 (layout.bss_size); + o->entry_addr = grub_cpu_to_le32 (layout.start_address); o->code_base = grub_cpu_to_le32 (header_size); - o->data_base = grub_host_to_target32 (header_size + exec_size); + o->data_base = grub_host_to_target32 (header_size + layout.exec_size); o->image_base = 0; o->section_alignment = grub_host_to_target32 (image_target->section_align); @@ -1226,7 +1222,7 @@ grub_install_generate_image (const char *dir, const char *prefix, o->num_data_directories = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (reloc_size); + o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); sections = o + 1; } else @@ -1239,11 +1235,11 @@ grub_install_generate_image (const char *dir, const char *prefix, (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE + sizeof (struct grub_pe32_coff_header)); o->magic = grub_host_to_target16 (GRUB_PE32_PE64_MAGIC); - o->code_size = grub_host_to_target32 (exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - exec_size + o->code_size = grub_host_to_target32 (layout.exec_size); + o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (bss_size); - o->entry_addr = grub_cpu_to_le32 (start_address); + o->bss_size = grub_cpu_to_le32 (layout.bss_size); + o->entry_addr = grub_cpu_to_le32 (layout.start_address); o->code_base = grub_cpu_to_le32 (header_size); o->image_base = 0; o->section_alignment = grub_host_to_target32 (image_target->section_align); @@ -1262,15 +1258,15 @@ grub_install_generate_image (const char *dir, const char *prefix, = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (reloc_size); + o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); sections = o + 1; } /* The sections. */ text_section = sections; strcpy (text_section->name, ".text"); - text_section->virtual_size = grub_cpu_to_le32 (exec_size); + text_section->virtual_size = grub_cpu_to_le32 (layout.exec_size); text_section->virtual_address = grub_cpu_to_le32 (header_size); - text_section->raw_data_size = grub_cpu_to_le32 (exec_size); + text_section->raw_data_size = grub_cpu_to_le32 (layout.exec_size); text_section->raw_data_offset = grub_cpu_to_le32 (header_size); text_section->characteristics = grub_cpu_to_le32_compile_time ( GRUB_PE32_SCN_CNT_CODE @@ -1279,10 +1275,10 @@ grub_install_generate_image (const char *dir, const char *prefix, data_section = text_section + 1; strcpy (data_section->name, ".data"); - data_section->virtual_size = grub_cpu_to_le32 (kernel_size - exec_size); - data_section->virtual_address = grub_cpu_to_le32 (header_size + exec_size); - data_section->raw_data_size = grub_cpu_to_le32 (kernel_size - exec_size); - data_section->raw_data_offset = grub_cpu_to_le32 (header_size + exec_size); + data_section->virtual_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->virtual_address = grub_cpu_to_le32 (header_size + layout.exec_size); + data_section->raw_data_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.exec_size); data_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ @@ -1291,8 +1287,8 @@ grub_install_generate_image (const char *dir, const char *prefix, #if 0 bss_section = data_section + 1; strcpy (bss_section->name, ".bss"); - bss_section->virtual_size = grub_cpu_to_le32 (bss_size); - bss_section->virtual_address = grub_cpu_to_le32 (header_size + kernel_size); + bss_section->virtual_size = grub_cpu_to_le32 (layout.bss_size); + bss_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size); bss_section->raw_data_size = 0; bss_section->raw_data_offset = 0; bss_section->characteristics @@ -1305,10 +1301,10 @@ grub_install_generate_image (const char *dir, const char *prefix, mods_section = data_section + 1; strcpy (mods_section->name, "mods"); - mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - kernel_size - header_size); - mods_section->virtual_address = grub_cpu_to_le32 (header_size + kernel_size + bss_size); - mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - kernel_size - header_size); - mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + kernel_size); + mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size + layout.bss_size); + mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.kernel_size); mods_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ @@ -1316,9 +1312,9 @@ grub_install_generate_image (const char *dir, const char *prefix, reloc_section = mods_section + 1; strcpy (reloc_section->name, ".reloc"); - reloc_section->virtual_size = grub_cpu_to_le32 (reloc_size); - reloc_section->virtual_address = grub_cpu_to_le32 (reloc_addr + bss_size); - reloc_section->raw_data_size = grub_cpu_to_le32 (reloc_size); + reloc_section->virtual_size = grub_cpu_to_le32 (layout.reloc_size); + reloc_section->virtual_address = grub_cpu_to_le32 (reloc_addr + layout.bss_size); + reloc_section->raw_data_size = grub_cpu_to_le32 (layout.reloc_size); reloc_section->raw_data_offset = grub_cpu_to_le32 (reloc_addr); reloc_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA @@ -1589,7 +1585,7 @@ grub_install_generate_image (const char *dir, const char *prefix, target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr - + kernel_size + total_module_size, 32); + + layout.kernel_size + total_module_size, 32); ecoff_img = xmalloc (program_size + sizeof (*head) + sizeof (*section)); grub_memset (ecoff_img, 0, program_size + sizeof (*head) + sizeof (*section)); @@ -1636,16 +1632,16 @@ grub_install_generate_image (const char *dir, const char *prefix, target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr - + kernel_size + total_module_size, 32); + + layout.kernel_size + total_module_size, 32); } else target_addr = image_target->link_addr; if (image_target->voidp_sizeof == 4) grub_mkimage_generate_elf32 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + target_addr, layout.align, layout.kernel_size, layout.bss_size); else grub_mkimage_generate_elf64 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + target_addr, layout.align, layout.kernel_size, layout.bss_size); } break; } @@ -1653,7 +1649,7 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_util_write_image (core_img, core_size, out, outname); free (core_img); free (kernel_path); - free (rel_section); + free (layout.reloc_section); grub_util_free_path_list (path_list); } From df21fff50456c6db9f487af0a3383e9e365595af Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 18 Feb 2016 20:57:21 +0100 Subject: [PATCH 147/207] Provide __bss_start and _end symbols in grub-mkimage. For this ensure that all bss sections are merged. We need this to correctly prelink non-PE relocatable images. --- include/grub/util/mkimage.h | 2 + util/grub-mkimagexx.c | 137 +++++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 50 deletions(-) diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h index 8169939a7..25a49d5c3 100644 --- a/include/grub/util/mkimage.h +++ b/include/grub/util/mkimage.h @@ -33,6 +33,8 @@ struct grub_mkimage_layout grub_size_t ia64_got_off; grub_size_t got_size; unsigned ia64jmpnum; + Elf_Addr bss_start; + Elf_Addr end; }; /* Private header. Use only in mkimage-related sources. */ diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 74f86f5df..433322d85 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -490,6 +490,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Shdr *symtab_section, Elf_Addr *section_addresses, Elf_Half section_entsize, Elf_Half num_sections, void *jumpers, Elf_Addr jumpers_addr, + Elf_Addr bss_start, Elf_Addr end, const struct grub_install_image_target_desc *image_target) { Elf_Word symtab_size, sym_size, num_syms; @@ -528,16 +529,22 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, } else if (cur_index == STN_UNDEF) { - if (sym->st_name) + if (sym->st_name && grub_strcmp (name, "__bss_start")) + sym->st_value = bss_start; + else if (sym->st_name && grub_strcmp (name, "__end")) + sym->st_value = end; + else if (sym->st_name) grub_util_error ("undefined symbol %s", name); else continue; } else if (cur_index >= num_sections) grub_util_error ("section %d does not exist", cur_index); - - sym->st_value = (grub_target_to_host (sym->st_value) - + section_addresses[cur_index]); + else + { + sym->st_value = (grub_target_to_host (sym->st_value) + + section_addresses[cur_index]); + } if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) == STT_FUNC) @@ -1462,9 +1469,7 @@ SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_de == (SHF_EXECINSTR | SHF_ALLOC)); } -/* Determine if this section is a data section. This assumes that - BSS is also a data section, since the converter initializes BSS - when producing PE32 to avoid a bug in EFI implementations. */ +/* Determine if this section is a data section. */ static int SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { @@ -1472,7 +1477,16 @@ SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_de && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) - == SHF_ALLOC); + == SHF_ALLOC) && !(grub_target_to_host32 (s->sh_type) == SHT_NOBITS); +} + +static int +SUFFIX (is_bss_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) +{ + if (!is_relocatable (image_target)) + return 0; + return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) + == SHF_ALLOC) && (grub_target_to_host32 (s->sh_type) == SHT_NOBITS); } /* Return if the ELF header is valid. */ @@ -1492,6 +1506,32 @@ SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_i return 1; } +static Elf_Addr +SUFFIX (put_section) (Elf_Shdr *s, int i, + Elf_Addr current_address, + Elf_Addr *section_addresses, + const char *strtab, + const struct grub_install_image_target_desc *image_target) +{ + Elf_Word align = grub_host_to_target_addr (s->sh_addralign); + const char *name = strtab + grub_host_to_target32 (s->sh_name); + + if (align) + current_address = ALIGN_UP (current_address + image_target->vaddr_offset, + align) + - image_target->vaddr_offset; + + grub_util_info ("locating the section %s at 0x%" + GRUB_HOST_PRIxLONG_LONG, + name, (unsigned long long) current_address); + if (!is_relocatable (image_target)) + current_address = grub_host_to_target_addr (s->sh_addr) + - image_target->link_addr; + section_addresses[i] = current_address; + current_address += grub_host_to_target_addr (s->sh_size); + return current_address; +} + /* Locate section addresses by merging code sections and data sections into .text and .data, respectively. Return the array of section addresses. */ @@ -1531,32 +1571,22 @@ SUFFIX (locate_sections) (const char *kernel_path, i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_text_section) (s, image_target)) { - Elf_Word align = grub_host_to_target_addr (s->sh_addralign); - const char *name = strtab + grub_host_to_target32 (s->sh_name); - if (align) - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, - align) - image_target->vaddr_offset; - grub_util_info ("locating the section %s at 0x%" - GRUB_HOST_PRIxLONG_LONG, - name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) + current_address = SUFFIX (put_section) (s, i, + current_address, + section_addresses, + strtab, + image_target); + if (!is_relocatable (image_target) && + grub_host_to_target_addr (s->sh_addr) != image_target->link_addr) { - current_address = grub_host_to_target_addr (s->sh_addr) - - image_target->link_addr; - if (grub_host_to_target_addr (s->sh_addr) - != image_target->link_addr) - { - char *msg - = grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" - " instead of 0x%llx: ld.gold bug?"), - kernel_path, - (unsigned long long) grub_host_to_target_addr (s->sh_addr), - (unsigned long long) image_target->link_addr); - grub_util_error ("%s", msg); - } + char *msg + = grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" + " instead of 0x%llx: ld.gold bug?"), + kernel_path, + (unsigned long long) grub_host_to_target_addr (s->sh_addr), + (unsigned long long) image_target->link_addr); + grub_util_error ("%s", msg); } - section_addresses[i] = current_address; - current_address += grub_host_to_target_addr (s->sh_size); } current_address = ALIGN_UP (current_address + image_target->vaddr_offset, @@ -1569,27 +1599,31 @@ SUFFIX (locate_sections) (const char *kernel_path, i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_data_section) (s, image_target)) - { - Elf_Word align = grub_host_to_target_addr (s->sh_addralign); - const char *name = strtab + grub_host_to_target32 (s->sh_name); - - if (align) - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, - align) - - image_target->vaddr_offset; - - grub_util_info ("locating the section %s at 0x%" - GRUB_HOST_PRIxLONG_LONG, - name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) - current_address = grub_host_to_target_addr (s->sh_addr) - - image_target->link_addr; - section_addresses[i] = current_address; - current_address += grub_host_to_target_addr (s->sh_size); - } + current_address = SUFFIX (put_section) (s, i, + current_address, + section_addresses, + strtab, + image_target); current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; + + layout->bss_start = current_address; + + /* .bss */ + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if (SUFFIX (is_bss_section) (s, image_target)) + current_address = SUFFIX (put_section) (s, i, + current_address, + section_addresses, + strtab, + image_target); + + current_address = ALIGN_UP (current_address + image_target->vaddr_offset, + image_target->section_align) - image_target->vaddr_offset; + layout->end = current_address; layout->kernel_size = current_address; return section_addresses; } @@ -1789,8 +1823,11 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_data_section) (s, image_target) + || SUFFIX (is_bss_section) (s, image_target) || SUFFIX (is_text_section) (s, image_target)) { + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. */ if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) memset (out_img + section_addresses[i], 0, grub_host_to_target_addr (s->sh_size)); From 5bcb7d394c26d212cebf59c9b70a42a11f90d2bc Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 18 Feb 2016 20:58:38 +0100 Subject: [PATCH 148/207] Allow _start == 0 with relocatable images --- util/grub-mkimagexx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 433322d85..fff811266 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -495,7 +495,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, { Elf_Word symtab_size, sym_size, num_syms; Elf_Off symtab_offset; - Elf_Addr start_address = 0; + Elf_Addr start_address = (Elf_Addr) -1; Elf_Sym *sym; Elf_Word i; Elf_Shdr *strtab_section; @@ -560,7 +560,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, (unsigned long long) sym->st_value, (unsigned long long) section_addresses[cur_index]); - if (! start_address) + if (start_address == (Elf_Addr)-1) if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0) start_address = sym->st_value; } @@ -1797,7 +1797,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, layout->ia64jmp_off + image_target->vaddr_offset, image_target); - if (layout->start_address == 0) + if (layout->start_address == (Elf_Addr) -1) grub_util_error ("start symbol is not defined"); SUFFIX (entry_point) = (Elf_Addr) layout->start_address; From 86ef66d977274051a9174437e97f923d9e97d9e8 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 19 Feb 2016 00:43:36 +0100 Subject: [PATCH 149/207] arm-uboot: Make self-relocatable to allow loading at any address --- grub-core/Makefile.core.def | 2 +- grub-core/kern/arm/uboot/startup.S | 60 +++++- include/grub/arm/uboot/kernel.h | 2 +- include/grub/offsets.h | 2 +- include/grub/util/mkimage.h | 5 +- util/grub-mkimagexx.c | 313 +++++++++++++++++++++++------ util/mkimage.c | 8 +- 7 files changed, 305 insertions(+), 87 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 887450110..58b4208b0 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -90,7 +90,7 @@ kernel = { i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)'; emu_cflags = '$(CFLAGS_GNULIB)'; emu_cppflags = '$(CPPFLAGS_GNULIB)'; - arm_uboot_ldflags = '-Wl,-Ttext=0x08000000'; + arm_uboot_ldflags = '-Wl,-r,-d'; arm_uboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version'; i386_pc_startup = kern/i386/pc/startup.S; diff --git a/grub-core/kern/arm/uboot/startup.S b/grub-core/kern/arm/uboot/startup.S index 0c4a5f670..5efaae16e 100644 --- a/grub-core/kern/arm/uboot/startup.S +++ b/grub-core/kern/arm/uboot/startup.S @@ -55,10 +55,6 @@ FUNCTION(_start) VARIABLE(grub_total_module_size) .long 0 -VARIABLE(grub_uboot_machine_type) - .long 0 -VARIABLE(grub_uboot_boot_data) - .long 0 VARIABLE(grub_modbase) .long 0 bss_start_ptr: @@ -66,29 +62,66 @@ bss_start_ptr: end_ptr: .long EXT_C(_end) + @ Memory map at start: + @ * text+data + @ * list relocations + @ * modules + @ Before we enter C, we need to apply the relocations + @ and get following map: + @ * text+data + @ * BSS (cleared) + @ * stack + @ * modules + @ + @ To make things easier we ensure + @ that BSS+stack is larger than list of relocations + @ by increasing stack if necessarry. + @ This allows us to always unconditionally copy backwards + @ Currently list of relocations is ~5K and stack is set + @ to be at least 256K + FUNCTION(codestart) @ Store context: Machine ID, atags/dtb, ... @ U-Boot API signature is stored on the U-Boot heap @ Stack pointer used as start address for signature probing mov r12, sp adr sp, entry_state - push {r4-r12,lr} @ store U-Boot context (sp in r12) + push {r1-r12,lr} @ store U-Boot context (sp in r12) - str r1, EXT_C(grub_uboot_machine_type) - str r2, EXT_C(grub_uboot_boot_data) - - @ Modules have been stored as a blob in BSS, - @ they need to be manually relocated to _end + adr r1, _start ldr r0, bss_start_ptr @ src + add r0, r0, r1 + + add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + mvn r2, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + and r0, r0, r2 +1: + ldr r3, [r0], #4 @load next offset + @ both -2 and -1 are treated the same as we have only one type of relocs + @ -2 means "end of this type of relocs" and -1 means "end of all relocs" + add r2, r3, #2 + cmp r2, #1 + bls reloc_done + @ Adjust next offset + ldr r2, [r3, r1] + add r2, r2, r1 + str r2, [r3, r1] + b 1b + +reloc_done: + + @ Modules have been stored as a blob + @ they need to be manually relocated to _end add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) mvn r1, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - and r0, r0, r1 + and r0, r0, r1 @ src = aligned end of relocations ldr r1, end_ptr @ dst = End of BSS ldr r2, grub_total_module_size @ blob size add r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE and r1, r1, #~0x7 @ Ensure 8-byte alignment + sub sp, r1, #8 add r1, r1, #1024 @@ -157,6 +190,11 @@ FUNCTION(grub_uboot_return) .align 3 @ U-boot context stack space entry_state_end: +VARIABLE(grub_uboot_machine_type) + .long 0 @ r1 +VARIABLE(grub_uboot_boot_data) + .long 0 @ r2 + .long 0 @ r3 .long 0 @ r4 .long 0 @ r5 .long 0 @ r6 diff --git a/include/grub/arm/uboot/kernel.h b/include/grub/arm/uboot/kernel.h index 06e543324..ce0b149cc 100644 --- a/include/grub/arm/uboot/kernel.h +++ b/include/grub/arm/uboot/kernel.h @@ -26,7 +26,7 @@ #endif /* ! ASM_FILE */ -#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000 +#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE #define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (16 * 1024 * 1024) #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/offsets.h b/include/grub/offsets.h index 85e7401ae..c88c86d4d 100644 --- a/include/grub/offsets.h +++ b/include/grub/offsets.h @@ -54,6 +54,7 @@ /* The offset of GRUB_TOTAL_MODULE_SIZE. */ #define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8 +#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000 #define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12 @@ -120,7 +121,6 @@ #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 -#define GRUB_KERNEL_ARM_UBOOT_LINK_ADDR 0x08000000 /* Minimal gap between _end and the start of the modules. It's a hack for PowerMac to prevent "CLAIM failed" error. The real fix is to diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h index 25a49d5c3..2a4894213 100644 --- a/include/grub/util/mkimage.h +++ b/include/grub/util/mkimage.h @@ -33,8 +33,8 @@ struct grub_mkimage_layout grub_size_t ia64_got_off; grub_size_t got_size; unsigned ia64jmpnum; - Elf_Addr bss_start; - Elf_Addr end; + grub_uint32_t bss_start; + grub_uint32_t end; }; /* Private header. Use only in mkimage-related sources. */ @@ -83,6 +83,7 @@ struct grub_install_image_target_desc unsigned decompressor_compressed_size; unsigned decompressor_uncompressed_size; unsigned decompressor_uncompressed_addr; + unsigned reloc_table_offset; unsigned link_align; grub_uint16_t elf_target; unsigned section_align; diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index fff811266..353a9407a 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -86,6 +86,12 @@ struct fixup_block_list #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) +static int +is_relocatable (const struct grub_install_image_target_desc *image_target) +{ + return image_target->id == IMAGE_EFI || image_target->id == IMAGE_UBOOT; +} + #ifdef MKIMAGE_ELF32 /* @@ -529,9 +535,9 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, } else if (cur_index == STN_UNDEF) { - if (sym->st_name && grub_strcmp (name, "__bss_start")) + if (sym->st_name && grub_strcmp (name, "__bss_start") == 0) sym->st_value = bss_start; - else if (sym->st_name && grub_strcmp (name, "__end")) + else if (sym->st_name && grub_strcmp (name, "_end") == 0) sym->st_value = end; else if (sym->st_name) grub_util_error ("undefined symbol %s", name); @@ -1008,7 +1014,8 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, grub_util_info (" ABS32:\toffset=%d\t(0x%08x)", (int) sym_addr, (int) sym_addr); /* Data will be naturally aligned */ - sym_addr += 0x400; + if (image_target->id == IMAGE_EFI) + sym_addr += 0x400; *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr); } break; @@ -1194,25 +1201,45 @@ add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, return current_address; } +struct raw_reloc +{ + struct raw_reloc *next; + grub_uint32_t offset; + enum raw_reloc_type { + RAW_RELOC_NONE = -1, + RAW_RELOC_32 = 0, + RAW_RELOC_MAX = 1, + } type; +}; + struct translate_context { + /* PE */ struct fixup_block_list *lst, *lst0; Elf_Addr current_address; + + /* Raw */ + struct raw_reloc *raw_relocs; }; static void -translate_reloc_start (struct translate_context *ctx) +translate_reloc_start (struct translate_context *ctx, + const struct grub_install_image_target_desc *image_target) { - ctx->lst = ctx->lst0 = xmalloc (sizeof (*ctx->lst) + 2 * 0x1000); - memset (ctx->lst, 0, sizeof (*ctx->lst) + 2 * 0x1000); - ctx->current_address = 0; + grub_memset (ctx, 0, sizeof (*ctx)); + if (image_target->id == IMAGE_EFI) + { + ctx->lst = ctx->lst0 = xmalloc (sizeof (*ctx->lst) + 2 * 0x1000); + memset (ctx->lst, 0, sizeof (*ctx->lst) + 2 * 0x1000); + ctx->current_address = 0; + } } static void -translate_relocation (struct translate_context *ctx, - Elf_Addr addr, - Elf_Addr info, - const struct grub_install_image_target_desc *image_target) +translate_relocation_pe (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) { /* Necessary to relocate only absolute addresses. */ switch (image_target->elf_target) @@ -1353,10 +1380,68 @@ translate_relocation (struct translate_context *ctx, } } +static enum raw_reloc_type +classify_raw_reloc (Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + /* Necessary to relocate only absolute addresses. */ + switch (image_target->elf_target) + { + case EM_ARM: + switch (ELF_R_TYPE (info)) + { + case R_ARM_V4BX: + case R_ARM_JUMP24: + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_CALL: + return RAW_RELOC_NONE; + case R_ARM_ABS32: + return RAW_RELOC_32; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + default: + grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + } +} + static void -finish_reloc_translation (struct translate_context *ctx, - struct grub_mkimage_layout *layout, +translate_relocation_raw (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, const struct grub_install_image_target_desc *image_target) +{ + enum raw_reloc_type class = classify_raw_reloc (info, image_target); + struct raw_reloc *rel; + if (class == RAW_RELOC_NONE) + return; + rel = xmalloc (sizeof (*rel)); + rel->next = ctx->raw_relocs; + rel->type = class; + rel->offset = addr; + ctx->raw_relocs = rel; +} + +static void +translate_relocation (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + if (image_target->id == IMAGE_EFI) + translate_relocation_pe (ctx, addr, info, image_target); + else + translate_relocation_raw (ctx, addr, info, image_target); +} + +static void +finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) { ctx->current_address = add_fixup_entry (&ctx->lst, 0, 0, 1, ctx->current_address, image_target); @@ -1381,14 +1466,90 @@ finish_reloc_translation (struct translate_context *ctx, } layout->reloc_size = ctx->current_address; + if (image_target->elf_target == EM_ARM && layout->reloc_size > GRUB_KERNEL_ARM_STACK_SIZE) + grub_util_error ("Reloc section (%d) is bigger than stack size (%d). " + "This breaks assembly assumptions. Please increase stack size", + (int) layout->reloc_size, + (int) GRUB_KERNEL_ARM_STACK_SIZE); } +/* + Layout: + + + + + ... + + + each relocation starts with 32-bit offset. Rest depends on relocation. + mkimage stops when it sees first unknown type or end marker. + This allows images to be created with mismatched mkimage and + kernel as long as no relocations are present in kernel that mkimage + isn't aware of (in which case mkimage aborts). + This also allows simple assembly to do the relocs. +*/ + +#define RAW_SEPARATOR 0xfffffffe +#define RAW_END_MARKER 0xffffffff + +static void +finish_reloc_translation_raw (struct translate_context *ctx, struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) +{ + size_t count = 0, sz; + enum raw_reloc_type highest = RAW_RELOC_NONE; + enum raw_reloc_type curtype; + struct raw_reloc *cur; + grub_uint32_t *p; + if (!ctx->raw_relocs) + { + layout->reloc_section = p = xmalloc (sizeof (grub_uint32_t)); + p[0] = RAW_END_MARKER; + layout->reloc_size = sizeof (grub_uint32_t); + return; + } + for (cur = ctx->raw_relocs; cur; cur = cur->next) + { + count++; + if (cur->type > highest) + highest = cur->type; + } + /* highest separators, count relocations and one end marker. */ + sz = (highest + count + 1) * sizeof (grub_uint32_t); + layout->reloc_section = p = xmalloc (sz); + for (curtype = 0; curtype <= highest; curtype++) + { + /* Support for special cases would go here. */ + for (cur = ctx->raw_relocs; cur; cur = cur->next) + if (cur->type == curtype) + { + *p++ = cur->offset; + } + *p++ = RAW_SEPARATOR; + } + *--p = RAW_END_MARKER; + layout->reloc_size = sz; +} + +static void +finish_reloc_translation (struct translate_context *ctx, struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) +{ + if (image_target->id == IMAGE_EFI) + finish_reloc_translation_pe (ctx, layout, image_target); + else + finish_reloc_translation_raw (ctx, layout, image_target); +} + + static void translate_reloc_jumpers (struct translate_context *ctx, Elf_Addr jumpers, grub_size_t njumpers, const struct grub_install_image_target_desc *image_target) { unsigned i; + assert (image_target->id == IMAGE_EFI); for (i = 0; i < njumpers; i++) ctx->current_address = add_fixup_entry (&ctx->lst, GRUB_PE32_REL_BASED_DIR64, @@ -1403,14 +1564,13 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, Elf_Addr *section_addresses, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, - Elf_Addr jumpers, grub_size_t njumpers, const struct grub_install_image_target_desc *image_target) { unsigned i; Elf_Shdr *s; struct translate_context ctx; - translate_reloc_start (&ctx); + translate_reloc_start (&ctx, image_target); for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -1451,7 +1611,10 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, } if (image_target->elf_target == EM_IA_64) - translate_reloc_jumpers (&ctx, jumpers, njumpers, + translate_reloc_jumpers (&ctx, + layout->ia64jmp_off + + image_target->vaddr_offset, + 2 * layout->ia64jmpnum + (layout->got_size / 8), image_target); finish_reloc_translation (&ctx, layout, image_target); @@ -1462,7 +1625,7 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, static int SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { - if (image_target->id != IMAGE_EFI + 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)) @@ -1473,7 +1636,7 @@ SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_de static int SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { - if (image_target->id != IMAGE_EFI + 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)) @@ -1536,14 +1699,13 @@ SUFFIX (put_section) (Elf_Shdr *s, int i, into .text and .data, respectively. Return the array of section addresses. */ static Elf_Addr * -SUFFIX (locate_sections) (const char *kernel_path, +SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target) { int i; - Elf_Addr current_address; Elf_Addr *section_addresses; Elf_Shdr *s; @@ -1555,7 +1717,7 @@ SUFFIX (locate_sections) (const char *kernel_path, section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); - current_address = 0; + layout->kernel_size = 0; for (i = 0, s = sections; i < num_sections; @@ -1571,8 +1733,8 @@ SUFFIX (locate_sections) (const char *kernel_path, i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_text_section) (s, image_target)) { - current_address = SUFFIX (put_section) (s, i, - current_address, + layout->kernel_size = SUFFIX (put_section) (s, i, + layout->kernel_size, section_addresses, strtab, image_target); @@ -1589,42 +1751,63 @@ SUFFIX (locate_sections) (const char *kernel_path, } } - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, + layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - layout->exec_size = current_address; + layout->exec_size = layout->kernel_size; /* .data */ for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_data_section) (s, image_target)) - current_address = SUFFIX (put_section) (s, i, - current_address, + layout->kernel_size = SUFFIX (put_section) (s, i, + layout->kernel_size, section_addresses, strtab, image_target); - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, - image_target->section_align) - image_target->vaddr_offset; +#ifdef MKIMAGE_ELF32 + if (image_target->elf_target == EM_ARM) + { + grub_size_t tramp; + layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset, + image_target->section_align) - image_target->vaddr_offset; - layout->bss_start = current_address; + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); + + tramp = arm_get_trampoline_size (e, sections, section_entsize, + num_sections, image_target); + + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); + } +#endif + + layout->bss_start = layout->kernel_size; + layout->end = layout->kernel_size; /* .bss */ for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_bss_section) (s, image_target)) - current_address = SUFFIX (put_section) (s, i, - current_address, - section_addresses, - strtab, - image_target); + layout->end = SUFFIX (put_section) (s, i, + layout->end, + section_addresses, + strtab, + image_target); - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, + layout->end = ALIGN_UP (layout->end + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - layout->end = current_address; - layout->kernel_size = current_address; + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. + Platforms other than EFI and U-boot shouldn't have .bss in + their binaries as we build with -Wl,-Ttext. + */ + if (image_target->id != IMAGE_UBOOT) + layout->kernel_size = layout->end; + return section_addresses; } @@ -1674,7 +1857,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + grub_host_to_target16 (e->e_shstrndx) * section_entsize); strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); - section_addresses = SUFFIX (locate_sections) (kernel_path, + section_addresses = SUFFIX (locate_sections) (e, kernel_path, sections, section_entsize, num_sections, strtab, layout, @@ -1685,7 +1868,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, for (i = 0; i < num_sections; i++) section_vaddresses[i] = section_addresses[i] + image_target->vaddr_offset; - if (image_target->id != IMAGE_EFI) + if (!is_relocatable (image_target)) { Elf_Addr current_address = layout->kernel_size; @@ -1706,7 +1889,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, grub_util_info ("locating the section %s at 0x%" GRUB_HOST_PRIxLONG_LONG, name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) + if (!is_relocatable (image_target)) current_address = grub_host_to_target_addr (s->sh_addr) - image_target->link_addr; @@ -1724,10 +1907,11 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, if (image_target->id == IMAGE_SPARC64_AOUT || image_target->id == IMAGE_SPARC64_RAW + || image_target->id == IMAGE_UBOOT || image_target->id == IMAGE_SPARC64_CDCORE) layout->kernel_size = ALIGN_UP (layout->kernel_size, image_target->mod_align); - if (image_target->id == IMAGE_EFI) + if (is_relocatable (image_target)) { symtab_section = NULL; for (i = 0, s = sections; @@ -1740,22 +1924,6 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, } if (! symtab_section) grub_util_error ("%s", _("no symbol table")); - -#ifdef MKIMAGE_ELF32 - if (image_target->elf_target == EM_ARM) - { - grub_size_t tramp; - - layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); - - tramp = arm_get_trampoline_size (e, sections, section_entsize, - num_sections, image_target); - - layout->tramp_off = layout->kernel_size; - layout->kernel_size += ALIGN_UP (tramp, 16); - } -#endif - #ifdef MKIMAGE_ELF64 if (image_target->elf_target == EM_IA_64) { @@ -1770,14 +1938,13 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, layout->ia64jmp_off = layout->kernel_size; layout->ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, - image_target); + image_target); layout->kernel_size += 16 * layout->ia64jmpnum; layout->ia64_got_off = layout->kernel_size; layout->kernel_size += ALIGN_UP (layout->got_size, 16); } #endif - } else { @@ -1788,7 +1955,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, out_img = xmalloc (layout->kernel_size + total_module_size); memset (out_img, 0, layout->kernel_size + total_module_size); - if (image_target->id == IMAGE_EFI) + if (is_relocatable (image_target)) { layout->start_address = SUFFIX (relocate_symbols) (e, sections, symtab_section, section_vaddresses, section_entsize, @@ -1796,6 +1963,8 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, (char *) out_img + layout->ia64jmp_off, layout->ia64jmp_off + image_target->vaddr_offset, + layout->bss_start, + layout->end, image_target); if (layout->start_address == (Elf_Addr) -1) grub_util_error ("start symbol is not defined"); @@ -1813,21 +1982,31 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path, make_reloc_section (e, layout, section_vaddresses, sections, section_entsize, num_sections, - strtab, layout->ia64jmp_off - + image_target->vaddr_offset, - 2 * layout->ia64jmpnum + (layout->got_size / 8), + strtab, image_target); + if (image_target->id != IMAGE_EFI) + { + out_img = xrealloc (out_img, layout->kernel_size + total_module_size + + ALIGN_UP (layout->reloc_size, image_target->mod_align)); + memcpy (out_img + layout->kernel_size, layout->reloc_section, layout->reloc_size); + memset (out_img + layout->kernel_size + layout->reloc_size, 0, + total_module_size + ALIGN_UP (layout->reloc_size, image_target->mod_align) - layout->reloc_size); + layout->kernel_size += ALIGN_UP (layout->reloc_size, image_target->mod_align); + } } for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_data_section) (s, image_target) - || SUFFIX (is_bss_section) (s, image_target) + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. + Platforms other than EFI and U-boot shouldn't have .bss in + their binaries as we build with -Wl,-Ttext. + */ + || (SUFFIX (is_bss_section) (s, image_target) && (image_target->id != IMAGE_UBOOT)) || SUFFIX (is_text_section) (s, image_target)) { - /* Explicitly initialize BSS - when producing PE32 to avoid a bug in EFI implementations. */ if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) memset (out_img + section_addresses[i], 0, grub_host_to_target_addr (s->sh_size)); diff --git a/util/mkimage.c b/util/mkimage.c index ab58d34c0..9ad4cfe42 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -88,6 +88,7 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, + .reloc_table_offset = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, .link_addr = GRUB_KERNEL_I386_COREBOOT_LINK_ADDR, @@ -527,7 +528,6 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_ARM_UBOOT_LINK_ADDR, .elf_target = EM_ARM, .mod_gap = GRUB_KERNEL_ARM_UBOOT_MOD_GAP, .mod_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, @@ -1522,9 +1522,9 @@ grub_install_generate_image (const char *dir, const char *prefix, hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC); hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); hdr->ih_size = grub_cpu_to_be32 (core_size); - hdr->ih_load = grub_cpu_to_be32 (image_target->link_addr); - hdr->ih_ep = grub_cpu_to_be32 (image_target->link_addr); - hdr->ih_type = GRUB_UBOOT_IH_TYPE_KERNEL; + hdr->ih_load = 0; + hdr->ih_ep = 0; + hdr->ih_type = GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD; hdr->ih_os = GRUB_UBOOT_IH_OS_LINUX; hdr->ih_arch = GRUB_UBOOT_IH_ARCH_ARM; hdr->ih_comp = GRUB_UBOOT_IH_COMP_NONE; From 0f076d75d04d76ab83e8472715eec71da0cb55ff Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 23 Feb 2016 12:06:48 +0100 Subject: [PATCH 150/207] ehci: Fix memory coherence This is a no-op on x86 but necessarry on ARM and may be necessarry on MIPS. --- grub-core/bus/usb/ehci.c | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c index ae1efb214..5f4297bb2 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -29,6 +29,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -337,6 +338,21 @@ struct grub_ehci static struct grub_ehci *ehci; +static void +sync_all_caches (struct grub_ehci *e) +{ + if (!e) + return; + if (e->td_virt) + grub_arch_sync_dma_caches (e->td_virt, sizeof (struct grub_ehci_td) * + GRUB_EHCI_N_TD); + if (e->qh_virt) + grub_arch_sync_dma_caches (e->qh_virt, sizeof (struct grub_ehci_qh) * + GRUB_EHCI_N_QH); + if (e->framelist_virt) + grub_arch_sync_dma_caches (e->framelist_virt, 4096); +} + /* EHCC registers access functions */ static inline grub_uint32_t grub_ehci_ehcc_read32 (struct grub_ehci *e, grub_uint32_t addr) @@ -437,6 +453,8 @@ grub_ehci_reset (struct grub_ehci *e) { grub_uint64_t maxtime; + sync_all_caches (e); + grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, GRUB_EHCI_CMD_HC_RESET | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); @@ -840,6 +858,8 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, e->next = ehci; ehci = e; + sync_all_caches (e); + grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: OK at all\n"); grub_dprintf ("ehci", @@ -1020,6 +1040,7 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer) /* Found proper existing (and linked) QH, do setup of QH */ grub_dprintf ("ehci", "find_qh: found, QH=%p\n", qh_iter); grub_ehci_setup_qh (qh_iter, transfer); + sync_all_caches (e); return qh_iter; } @@ -1291,6 +1312,8 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, struct grub_ehci_transfer_controller_data *cdata; grub_uint32_t status; + sync_all_caches (e); + /* Check if EHCI is running and AL is enabled */ status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); if ((status & GRUB_EHCI_ST_HC_HALTED) != 0) @@ -1399,6 +1422,8 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, * i.e. reset token */ cdata->qh_virt->td_overlay.token = grub_cpu_to_le32_compile_time (0); + sync_all_caches (e); + /* Finito */ transfer->controller_data = cdata; @@ -1447,6 +1472,8 @@ grub_ehci_parse_notrun (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + /* Additionally, do something with EHCI to make it running (what?) */ /* Try enable EHCI and AL */ grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, @@ -1482,6 +1509,8 @@ grub_ehci_parse_halt (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + /* Evaluation of error code - currently we don't have GRUB USB error * codes for some EHCI states, GRUB_USB_ERR_DATA is used for them. * Order of evaluation is critical, specially bubble/stall. */ @@ -1515,6 +1544,8 @@ grub_ehci_parse_success (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + return GRUB_USB_ERR_NONE; } @@ -1528,6 +1559,8 @@ grub_ehci_check_transfer (grub_usb_controller_t dev, transfer->controller_data; grub_uint32_t token, token_ftd; + sync_all_caches (e); + grub_dprintf ("ehci", "check_transfer: EHCI STATUS=%08x, cdata=%p, qh=%p\n", grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS), @@ -1594,6 +1627,9 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, int i; grub_uint64_t maxtime; grub_uint32_t qh_phys; + + sync_all_caches (e); + grub_uint32_t interrupt = cdata->qh_virt->ep_cap & GRUB_EHCI_SMASK_MASK; @@ -1613,6 +1649,7 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); grub_dprintf ("ehci", "cancel_transfer: end - EHCI not running\n"); return GRUB_USB_ERR_NONE; } @@ -1635,6 +1672,8 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, /* Unlink QH from AL */ e->qh_virt[i].qh_hptr = cdata->qh_virt->qh_hptr; + sync_all_caches (e); + /* If this is an interrupt transfer, we just wait for the periodic * schedule to advance a few times and then assume that the EHCI * controller has read the updated QH. */ @@ -1689,6 +1728,8 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, grub_dprintf ("ehci", "cancel_transfer: end\n"); + sync_all_caches (e); + return GRUB_USB_ERR_NONE; } From ca028db3d47387bbbd24b40f085751ca98a09183 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 23 Feb 2016 12:07:01 +0100 Subject: [PATCH 151/207] usbtrans: Fix memory coherence and use-after-free. --- grub-core/bus/usb/usbtrans.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c index ee8680853..9266e4931 100644 --- a/grub-core/bus/usb/usbtrans.c +++ b/grub-core/bus/usb/usbtrans.c @@ -24,6 +24,7 @@ #include #include #include +#include static inline unsigned int @@ -101,6 +102,8 @@ grub_usb_control_msg (grub_usb_device_t dev, data_addr = grub_dma_get_phys (data_chunk); grub_memcpy ((char *) data, data_in, size); + grub_arch_sync_dma_caches (data, size); + grub_dprintf ("usb", "control: reqtype=0x%02x req=0x%02x val=0x%02x idx=0x%02x size=%lu\n", reqtype, request, value, index, (unsigned long)size); @@ -161,6 +164,8 @@ grub_usb_control_msg (grub_usb_device_t dev, setupdata->value = value; setupdata->index = index; setupdata->length = size; + grub_arch_sync_dma_caches (setupdata, sizeof (*setupdata)); + transfer->transactions[0].size = sizeof (*setupdata); transfer->transactions[0].pid = GRUB_USB_TRANSFER_TYPE_SETUP; transfer->transactions[0].data = setupdata_addr; @@ -202,11 +207,13 @@ grub_usb_control_msg (grub_usb_device_t dev, grub_free (transfer->transactions); grub_free (transfer); - grub_dma_free (data_chunk); grub_dma_free (setupdata_chunk); + grub_arch_sync_dma_caches (data, size0); grub_memcpy (data_in, (char *) data, size0); + grub_dma_free (data_chunk); + return err; } @@ -236,7 +243,10 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, data = grub_dma_get_virt (data_chunk); data_addr = grub_dma_get_phys (data_chunk); if (type == GRUB_USB_TRANSFER_TYPE_OUT) - grub_memcpy ((char *) data, data_in, size); + { + grub_memcpy ((char *) data, data_in, size); + grub_arch_sync_dma_caches (data, size); + } /* Create a transfer. */ transfer = grub_malloc (sizeof (struct grub_usb_transfer)); @@ -306,9 +316,13 @@ grub_usb_bulk_finish_readwrite (grub_usb_transfer_t transfer) dev->toggle[transfer->endpoint] = toggle; if (transfer->dir == GRUB_USB_TRANSFER_TYPE_IN) - grub_memcpy (transfer->data, (void *) - grub_dma_get_virt (transfer->data_chunk), - transfer->size + 1); + { + grub_arch_sync_dma_caches (grub_dma_get_virt (transfer->data_chunk), + transfer->size + 1); + grub_memcpy (transfer->data, (void *) + grub_dma_get_virt (transfer->data_chunk), + transfer->size + 1); + } grub_free (transfer->transactions); grub_dma_free (transfer->data_chunk); From 51f375d688529b7c1819ba40188ee52b9333887c Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Sat, 27 Feb 2016 13:44:59 +0100 Subject: [PATCH 152/207] efidisk: Respect block_io_protocol buffer alignment Returned from the OpenProtocol operation, the grub_efi_block_io_media structure contains the io_align field, specifying the minimum alignment required for buffers used in any data transfers with the device. Make grub_efidisk_readwrite() allocate a temporary buffer, aligned to this boundary, if the buffer passed to it does not already meet the requirements. Also sanity check the io_align field in grub_efidisk_open() for power-of-two-ness and bail if invalid. --- grub-core/disk/efi/efidisk.c | 48 ++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index 75bb4a9ca..3b79f7bbc 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -493,8 +493,15 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) m = d->block_io->media; /* FIXME: Probably it is better to store the block size in the disk, and total sectors should be replaced with total blocks. */ - grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x\n", - m, (unsigned long long) m->last_block, m->block_size); + grub_dprintf ("efidisk", + "m = %p, last block = %llx, block size = %x, io align = %x\n", + m, (unsigned long long) m->last_block, m->block_size, + m->io_align); + + /* Ensure required buffer alignment is a power of two (or is zero). */ + if (m->io_align & (m->io_align - 1)) + return grub_error (GRUB_ERR_IO, "invalid buffer alignment %d", m->io_align); + disk->total_sectors = m->last_block + 1; /* Don't increase this value due to bug in some EFI. */ disk->max_agglomerate = 0xa0000 >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS); @@ -524,15 +531,42 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector, { struct grub_efidisk_data *d; grub_efi_block_io_t *bio; + grub_efi_status_t status; + grub_size_t io_align, num_bytes; + char *aligned_buf; d = disk->data; bio = d->block_io; - return efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio, - bio->media->media_id, - (grub_efi_uint64_t) sector, - (grub_efi_uintn_t) size << disk->log_sector_size, - buf); + /* Set alignment to 1 if 0 specified */ + io_align = bio->media->io_align ? bio->media->io_align : 1; + num_bytes = size << disk->log_sector_size; + + if ((grub_addr_t) buf & (io_align - 1)) + { + aligned_buf = grub_memalign (io_align, num_bytes); + if (! aligned_buf) + return GRUB_EFI_OUT_OF_RESOURCES; + if (wr) + grub_memcpy (aligned_buf, buf, num_bytes); + } + else + { + aligned_buf = buf; + } + + status = efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio, + bio->media->media_id, (grub_efi_uint64_t) sector, + (grub_efi_uintn_t) num_bytes, aligned_buf); + + if ((grub_addr_t) buf & (io_align - 1)) + { + if (!wr) + grub_memcpy (buf, aligned_buf, num_bytes); + grub_free (aligned_buf); + } + + return status; } static grub_err_t From 102e435d818e3f9e1718326c3fe55e8459e924f3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 28 Feb 2016 03:07:27 +0100 Subject: [PATCH 153/207] grub_arch_sync_dma_caches: Accept volatile address --- include/grub/cache.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/grub/cache.h b/include/grub/cache.h index a9b3f529c..fc669dfd1 100644 --- a/include/grub/cache.h +++ b/include/grub/cache.h @@ -35,10 +35,11 @@ void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); #ifndef GRUB_MACHINE_EMU #ifdef _mips -void EXPORT_FUNC(grub_arch_sync_dma_caches) (void *address, grub_size_t len); +void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, + grub_size_t len); #else static inline void -grub_arch_sync_dma_caches (void *address __attribute__ ((unused)), +grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { } From 8207874e5d0d05159fd8c531c87f0f6e4653b8a6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 28 Feb 2016 03:07:41 +0100 Subject: [PATCH 154/207] Release 2.02~beta3 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 26d2f33c7..a85b134ec 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are dnl used for the target type. See INSTALL for full list of variables. -AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org]) +AC_INIT([GRUB],[2.02~beta3],[bug-grub@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) From d017ea8ede3f76aaf6b6c9dabe3e96af0eebd395 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 28 Feb 2016 21:52:08 +0300 Subject: [PATCH 155/207] NEWS update --- NEWS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS b/NEWS index c9a975219..572eadb3e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ New in 2.02: * ZFS features support. * ZFS LZ4 support. * XFS V5 format support. + * LVM RAID1 support. * New/improved terminal and video support: * Monochrome text (matching `hercules' in GRUB Legacy). @@ -49,6 +50,7 @@ New in 2.02: * Improve TFTP robustness. * Parse `nd' disk names in GRUB Legacy configuration files. * Issue separate DNS queries for IPv4 and IPv6. + * Support IPv6 Router Advertisement to configure default router. * Coreboot improvements: * CBFS support both in on-disk images (loopback) and flash. @@ -96,6 +98,8 @@ New in 2.02: EFI Stall. If everything fails, use hardcoded frequency 800MHz. * Support Hyper-V Gen2 platforms which lack PIT for TSC calibration. * Map UEFI Persistent Memory to E820 persistent memory. + * New Xen loader on ARM64. + * Respect alignment requirement for block device IO buffers on EFI. * Security: * Add optional facility to enforce that all files read by the core image @@ -134,6 +138,11 @@ New in 2.02: menu entry immediately. * New `file' command and grub-file utility to check file types. * New syslinux configuration file parser. + * Set menu entry class to primary OS name returned by os-prober to display + OS specific icon. + * On Linux x86 detect EFI word size in grub-install and automatically select + correct platform (x86_64-efi or i386-efi) to install. Requires Linux kernel + 4.0 or higher. * Build system: * Remove all uses of nested functions; GRUB no longer requires an @@ -160,6 +169,8 @@ New in 2.02: * emu libusb support removed (was broken and unmaintained). * powerpc64le compile support. * Use fixed timestamp when generating GRUB image for reproducible builds. + * Verify at build time that modules contain only supported relocations and their + structure matches what boot-time module loader expects. * Revision control moved to git. From 082bc9f77b200eb48a5f1147163dea9c9d02d44c Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 5 Mar 2016 17:30:48 -0500 Subject: [PATCH 156/207] 10_linux: Fix grouping of tests for GRUB_DEVICE Commit 7290bb562 causes GRUB_DISABLE_LINUX_UUID to be ignored due to mixing of || and && operators. Add some parens to help with that. --- util/grub.d/10_linux.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 5a78513ae..de9044c7f 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -47,7 +47,7 @@ esac # and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} From 9545a8fd04ca33bcecc1907fec4d2354b02992ba Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 6 Mar 2016 08:54:19 +0300 Subject: [PATCH 157/207] 20_linux_xen: fix test for GRUB_DEVICE Same fix as in 082bc9f. --- util/grub.d/20_linux_xen.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 46045db1a..c48af948d 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -47,7 +47,7 @@ esac # and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} From 7f2a856faec951b7ab816880bd26e1e10b17a596 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 10 Mar 2016 21:16:10 +0100 Subject: [PATCH 158/207] multiboot2: Remove useless GRUB_PACKED Reported by: Daniel Kiper --- include/multiboot2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/multiboot2.h b/include/multiboot2.h index 9d4862759..8b8c1568a 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -176,7 +176,7 @@ struct multiboot_mmap_entry #define MULTIBOOT_MEMORY_BADRAM 5 multiboot_uint32_t type; multiboot_uint32_t zero; -} GRUB_PACKED; +}; typedef struct multiboot_mmap_entry multiboot_memory_map_t; struct multiboot_tag From 15aee573d2312ebf4aab53d07d3d30eccf1484f9 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 11 Mar 2016 10:26:51 +0100 Subject: [PATCH 159/207] xen_file: Fix invalid payload size --- grub-core/loader/i386/xen_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c index 583621890..37f9ad8ac 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -55,11 +55,11 @@ grub_xen_file (grub_file_t file) grub_dprintf ("xen", "found bzimage payload 0x%llx-0x%llx\n", (unsigned long long) (lh.setup_sects + 1) * 512 + lh.payload_offset, - (unsigned long long) lh.payload_length - 4); + (unsigned long long) lh.payload_length); off_file = grub_file_offset_open (file, (lh.setup_sects + 1) * 512 + lh.payload_offset, - lh.payload_length - 4); + lh.payload_length); if (!off_file) goto fail; From 3c3e96d0443e8de64ff29a6563fb69c8a37dd15a Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Fri, 29 Jan 2016 14:49:24 -0500 Subject: [PATCH 160/207] Failed config now returns exit code (#1252311) Grub would notify the user if the new config was invalid, however, it did not exit properly with exit code 1. Added the proper exit code. Resolves: rhbz#1252311 --- util/grub-mkconfig.in | 1 + 1 file changed, 1 insertion(+) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 203b07696..f8496d28b 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -273,6 +273,7 @@ Ensure that there are no errors in /etc/default/grub and /etc/grub.d/* files or please file a bug report with %s file attached." "${grub_cfg}.new" >&2 echo >&2 + exit 1 else # none of the children aborted with error, install the new grub.cfg mv -f ${grub_cfg}.new ${grub_cfg} From ee83919e938e7987c2753b3003a2074e92edf671 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 13 Mar 2016 08:11:58 +0300 Subject: [PATCH 161/207] Makefile.util.def: add $LIBINTL to grub-macbless flags Fixes compilation on OpenBSD 5.9. Reported by Jiri B --- Makefile.util.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.util.def b/Makefile.util.def index ed9b4c697..f9caccb97 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -416,7 +416,7 @@ program = { ldadd = libgrubgcry.a; ldadd = libgrubkern.a; ldadd = grub-core/gnulib/libgnu.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; data = { From 76eac44af37358fb14f437a7878119e6d34e8d7f Mon Sep 17 00:00:00 2001 From: Aaron Luft Date: Mon, 14 Mar 2016 16:48:33 -0400 Subject: [PATCH 162/207] Remove the variable oldname which is attempting to free stack space. Historically this variable hold previous value of filename that had to be freed if allocated previously. Currently this branch is entered only if filename was not allocated previously so it became redundant. It did not cause real problems because grub_free was not called, but code is confusing and causes compilation error in some cases. --- grub-core/fs/iso9660.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c index 67a67cf40..c9c8374bf 100644 --- a/grub-core/fs/iso9660.c +++ b/grub-core/fs/iso9660.c @@ -750,19 +750,15 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (dir->data->joliet && !ctx.filename) { - char *oldname, *semicolon; + char *semicolon; - oldname = name; ctx.filename = grub_iso9660_convert_string - ((grub_uint8_t *) oldname, dirent.namelen >> 1); + ((grub_uint8_t *) name, dirent.namelen >> 1); semicolon = grub_strrchr (ctx.filename, ';'); if (semicolon) *semicolon = '\0'; - if (ctx.filename_alloc) - grub_free (oldname); - ctx.filename_alloc = 1; } From 5b8ddf6e03bbc780d6902b1d9c1e3aa6361c9cc3 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 19 Mar 2016 09:39:30 +0300 Subject: [PATCH 163/207] bootp: fix memory leak in grub_cmd_dhcpopt --- grub-core/net/bootp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index a088244b4..09c6f7606 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -368,6 +368,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (grub_strcmp (args[3], "string") == 0) { + grub_err_t err = GRUB_ERR_NONE; char *val = grub_malloc (taglength + 1); if (!val) return grub_errno; @@ -376,8 +377,9 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (args[0][0] == '-' && args[0][1] == 0) grub_printf ("%s\n", val); else - return grub_env_set (args[0], val); - return GRUB_ERR_NONE; + err = grub_env_set (args[0], val); + grub_free (val); + return err; } if (grub_strcmp (args[3], "number") == 0) @@ -399,6 +401,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (grub_strcmp (args[3], "hex") == 0) { + grub_err_t err = GRUB_ERR_NONE; char *val = grub_malloc (2 * taglength + 1); int i; if (!val) @@ -412,8 +415,9 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (args[0][0] == '-' && args[0][1] == 0) grub_printf ("%s\n", val); else - return grub_env_set (args[0], val); - return GRUB_ERR_NONE; + err = grub_env_set (args[0], val); + grub_free (val); + return err; } return grub_error (GRUB_ERR_BAD_ARGUMENT, From 6714d7ecffe58021760e4d1ebfa9cc3473f7fb24 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 20 Mar 2016 10:32:33 +0300 Subject: [PATCH 164/207] bootp: check that interface is not NULL in configure_by_dhcp_ack grub_net_add_addr may fail with OOM and we use returned interface later without any checks. --- grub-core/net/bootp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 09c6f7606..189551a48 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -157,6 +157,9 @@ grub_net_configure_by_dhcp_ack (const char *name, hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); + if (!inter) + return 0; + #if 0 /* This is likely based on misunderstanding. gateway_ip refers to address of BOOTP relay and should not be used after BOOTP transaction From f4d35d49e32c29183b3492da18ea480d91716efe Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 22 Mar 2016 20:12:22 +0300 Subject: [PATCH 165/207] configure: set -fno-pie together with -fno-PIE OpenBSD 5.9 apparently defaults to -fpie. We use -fno-PIE when appropriate already, but that is not enough - it does not turn off -fpie. Actually check for -fPIE is not precise enough. __PIE__ is set for both -fpie and -fPIE but with different values. As far as I can tell, both options were introduced at the same time, so both should always be supported. This fixes compilation on OpenBSD 5.9 which otherwise created insanely big lzma_decompress.img. Reported, suggested and tested by: Jiri B --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a85b134ec..57e17138e 100644 --- a/configure.ac +++ b/configure.ac @@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS" # Position independent executable. grub_CHECK_PIE [# Need that, because some distributions ship compilers that include -# `-fPIE' in the default specs. +# `-fPIE' or '-fpie' in the default specs. if [ x"$pie_possible" = xyes ]; then - TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" + TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie" fi] CFLAGS="$TARGET_CFLAGS" From abf9beb7d667d3604774753cf698c439c6fbc736 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Wed, 6 Apr 2016 18:19:14 +0800 Subject: [PATCH 166/207] http: fix superfluous null line in range request header At least the apache sever is very unhappy with that extra null line and will take more than ten seconds in responding to each range request, which slows down a lot the entire http file transfer process or even time out. --- grub-core/net/http.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c index 4684f8b33..a7c5101a1 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -381,9 +381,8 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) ptr = nb->tail; grub_snprintf ((char *) ptr, sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX-" - "\r\n" "\r\n"), - "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n\r\n", + "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n", offset); grub_netbuff_put (nb, grub_strlen ((char *) ptr)); } From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Tue, 19 Apr 2016 14:27:22 -0400 Subject: [PATCH 167/207] build: Use AC_HEADER_MAJOR to find device macros Depending on the OS/libc, device macros are defined in different headers. This change ensures we include the right one. sys/types.h - BSD sys/mkdev.h - Sun sys/sysmacros.h - glibc (Linux) glibc currently pulls sys/sysmacros.h into sys/types.h, but this may change in a future release. https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html --- configure.ac | 3 ++- grub-core/osdep/devmapper/getroot.c | 6 ++++++ grub-core/osdep/devmapper/hostdisk.c | 5 +++++ grub-core/osdep/linux/getroot.c | 6 ++++++ grub-core/osdep/unix/getroot.c | 4 +++- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 57e17138e..9ddfc5323 100644 --- a/configure.ac +++ b/configure.ac @@ -388,7 +388,8 @@ fi # Check for functions and headers. AC_CHECK_FUNCS(posix_memalign memalign getextmntent) -AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h) +AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) +AC_HEADER_MAJOR AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default #include diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index 05eda500a..72e558275 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -40,6 +40,12 @@ #include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif + #include #include diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c index 19c1101fd..a697bcb4d 100644 --- a/grub-core/osdep/devmapper/hostdisk.c +++ b/grub-core/osdep/devmapper/hostdisk.c @@ -24,6 +24,11 @@ #include #include +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #ifdef HAVE_DEVICE_MAPPER # include diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 10480b646..09e7e6e6d 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -35,6 +35,12 @@ #include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif + #include #include /* ioctl */ #include diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index 1079a919d..4bf37b027 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -51,8 +51,10 @@ #endif #include -#if defined(HAVE_SYS_MKDEV_H) +#if defined(MAJOR_IN_MKDEV) #include +#elif defined(MAJOR_IN_SYSMACROS) +#include #endif #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) From 13f7ead3a17a5c2681b95c4bb4f40d8eb8648880 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 30 Apr 2016 09:10:12 +0300 Subject: [PATCH 168/207] http: reset EOF indication in http_seek Otherwise next read will stop polling too early due to stale EOF indicator, returning incomplete data to caller. --- grub-core/net/http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/net/http.c b/grub-core/net/http.c index a7c5101a1..5aa4ad3be 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -449,6 +449,7 @@ http_seek (struct grub_file *file, grub_off_t off) } file->device->net->stall = 0; + file->device->net->eof = 0; file->device->net->offset = off; data = grub_zalloc (sizeof (*data)); From e045af148a580203e47e47276e387fc3958391a5 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 30 Apr 2016 09:15:36 +0300 Subject: [PATCH 169/207] net: reset net->stall in grub_net_seek_real If we open new connection, we need to reset stall indication, otherwise nothing will ever be polled (low level code rely on this field being zero when establishing connection). --- grub-core/net/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 942459527..26a1fc3fc 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1672,6 +1672,7 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset) file->device->net->packs.last = NULL; file->device->net->offset = 0; file->device->net->eof = 0; + file->device->net->stall = 0; err = file->device->net->protocol->open (file, file->device->net->name); if (err) return err; From b524fa27f56381bb0efa4944e36f50265113aee5 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 3 May 2016 19:23:31 +0300 Subject: [PATCH 170/207] net: translate pxe prefix to tftp when checking for self-load Commit ba218c1 missed legacy pxe and pxe: prefixes which are translated to tftp, so comparison failed. --- grub-core/net/net.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 26a1fc3fc..10773fc34 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1346,6 +1346,15 @@ grub_net_open_real (const char *name) continue; } + if (grub_strncmp (prefdev, "pxe", sizeof ("pxe") - 1) == 0 && + (!prefdev[sizeof ("pxe") - 1] || (prefdev[sizeof("pxe") - 1] == ':'))) + { + grub_free (prefdev); + prefdev = grub_strdup ("tftp"); + if (!prefdev) + continue; + } + comma = grub_strchr (prefdev, ','); if (comma) *comma = '\0'; From 58590cb2ef48c6e85a8afeda01c385efc8c693bc Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 26 Jul 2016 20:29:26 +0300 Subject: [PATCH 171/207] xfs: accept filesystem with meta_uuid XFS V5 stores UUID in metadata and compares them with superblock UUID. To allow changing of user-visible UUID it stores original value in new superblock field (meta_uuid) and sets incompatible flag to indicate that new field must be used to verify metadata. Our driver currently does not check metadata UUID so simply accept such filesystem. Reported-By: Marcos Mello Reviewd by Jan Kara --- grub-core/fs/xfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index ca9c0c37a..9f66dd6e4 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -76,8 +76,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); /* incompat feature flags */ #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ +#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ +#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ + +/* We do not currently verify metadata UUID so it is safe to read such filesystem */ #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ - (XFS_SB_FEAT_INCOMPAT_FTYPE) + (XFS_SB_FEAT_INCOMPAT_FTYPE | \ + XFS_SB_FEAT_INCOMPAT_META_UUID) struct grub_xfs_sblock { From 52408aa94604466bdd80f48fa8d68378a1ffab31 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 26 Jul 2016 20:38:58 +0300 Subject: [PATCH 172/207] dns: fix buffer overflow for data->addresses in recv_hook We may get more than one response before exiting out of loop in grub_net_dns_lookup, but buffer was allocated for the first response only, so storing answers from subsequent replies wrote past allocated size. We never really use more than the very first address during lookup so there is little point in collecting all of them. Just quit early if we already have some reply. Code needs serious redesign to actually collect multiple answers and select the best fit according to requested type (IPv4 or IPv6). Reported and tested by Michael Chang --- grub-core/net/dns.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index 89741dd7d..5d9afe093 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -238,6 +238,15 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), char *redirect_save = NULL; grub_uint32_t ttl_all = ~0U; + /* Code apparently assumed that only one packet is received as response. + We may get multiple responses due to network condition, so check here + and quit early. */ + if (*data->addresses) + { + grub_netbuff_free (nb); + return GRUB_ERR_NONE; + } + head = (struct dns_header *) nb->data; ptr = (grub_uint8_t *) (head + 1); if (ptr >= nb->tail) From c831d2073b9beda9dd94b74dd62d0f56c6168334 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 27 Jul 2016 08:33:12 +0300 Subject: [PATCH 173/207] at_keyboard: fix numpad "0" and "." mapping Reported for set 1 by fgndevelop . Apparently set 2 was reversed too. --- grub-core/term/at_keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c index c234e92f2..b4ea9ff7e 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -88,7 +88,7 @@ static const grub_uint8_t set1_mapping[128] = /* 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, + /* 0x52 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x54 */ 0, 0, /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, @@ -193,7 +193,7 @@ static const grub_uint8_t set2_mapping[256] = /* 0x6a */ GRUB_KEYBOARD_KEY_JP_YEN, GRUB_KEYBOARD_KEY_NUM4, /* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, GRUB_KEYBOARD_KEY_KPCOMMA, /* 0x6e */ 0, 0, - /* 0x70 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUM0, + /* 0x70 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5, /* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8, /* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK, From 4e0f8f66e321cf1051c0e01f6fbcc6fc35a807b6 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 13 Aug 2016 10:51:34 +0200 Subject: [PATCH 174/207] Add missing va_end() to xasprintf() in grub-emu. --- grub-core/kern/emu/misc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index d361feb00..76661337f 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -127,6 +127,7 @@ xasprintf (const char *fmt, ...) va_start (ap, fmt); result = grub_xvasprintf (fmt, ap); + va_end (ap); if (!result) grub_util_error ("%s", _("out of memory")); From a0bf403f66dbaca4edd8e667bfc397dd91c8d71c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 28 Sep 2016 20:31:04 +0300 Subject: [PATCH 175/207] asm-tests/i386-pc: Check that movl is 5 bytes. LLVM 3.9 now emits short form of jump instructions, but it is still using 32 bit addresses for some movl instructions. Fortunately it was caught early: clang ... boot/i386/pc/boot.S clang -cc1as: fatal error: error in backend: invalid .org offset '440' (at offset '441') Add additional check to catch it during configure run and force -no-integrated-as. Closes: 49200 More details in https://lists.gnu.org/archive/html/grub-devel/2015-02/msg00099.html https://llvm.org/bugs/show_bug.cgi?id=22662 --- asm-tests/i386-pc.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/asm-tests/i386-pc.S b/asm-tests/i386-pc.S index f6f9a88be..d037744f9 100644 --- a/asm-tests/i386-pc.S +++ b/asm-tests/i386-pc.S @@ -1,12 +1,16 @@ /* on x86 old clang doesn't support .code16 newer clang supports it but creates 6-byte jumps instead of 3-byte ones - which makes us go over boot sector size. */ + which makes us go over boot sector size. + Starting with 3.9 clang emits 3-byte jumps but still creates 8-bytes movl + instead of 5-bytes, so code overflows into data. */ .code16 jmp far .org 4 jmp nearer .org 6 + movl nearer, %ebx + .org 11 .space 100 nearer: .space 200 From e563928ba42ad400abd8d329a879a632abddcd0c Mon Sep 17 00:00:00 2001 From: Sakar Arora Date: Tue, 20 Sep 2016 01:01:17 +0530 Subject: [PATCH 176/207] net/ip: Fix limit_time calculation in freeing old fragments limit_time underflows when current time is less than 90000ms. This causes packet fragments received during this time, i.e., till 90000ms pass since timer init, to be rejected. Hence, set it to 0 if its less than 90000. Signed-off-by: Sakar Arora --- grub-core/net/ip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c index 8c56baaf7..aba4f8908 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -363,7 +363,9 @@ static void free_old_fragments (void) { struct reassemble *rsm, **prev; - grub_uint64_t limit_time = grub_get_time_ms () - 90000; + grub_uint64_t limit_time = grub_get_time_ms (); + + limit_time = (limit_time > 90000) ? limit_time - 90000 : 0; for (prev = &reassembles, rsm = *prev; rsm; rsm = *prev) if (rsm->last_time < limit_time) From 9862b241212b25ee23f60f5bcc4277d2289eaaf9 Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Fri, 17 Jul 2015 19:43:42 +0200 Subject: [PATCH 177/207] i386/relocator: Add grub_relocator64_efi relocator Add grub_relocator64_efi relocator. It will be used on EFI 64-bit platforms when multiboot2 compatible image requests MULTIBOOT_TAG_TYPE_EFI_BS. Relocator will set lower parts of %rax and %rbx accordingly to multiboot2 specification. On the other hand processor mode, just before jumping into loaded image, will be set accordingly to Unified Extensible Firmware Interface Specification, Version 2.4 Errata B, section 2.3.4, x64 Platforms, boot services. This way loaded image will be able to use EFI boot services without any issues. Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Vladimir Serbinenko --- grub-core/Makefile.core.def | 1 + grub-core/lib/i386/relocator64.S | 11 ++++ grub-core/lib/x86_64/efi/relocator.c | 80 ++++++++++++++++++++++++++++ grub-core/loader/multiboot.c | 51 ++++++++++++++++-- grub-core/loader/multiboot_mbi2.c | 19 +++++-- include/grub/i386/multiboot.h | 11 ++++ include/grub/i386/relocator.h | 21 ++++++++ include/multiboot2.h | 1 + 8 files changed, 186 insertions(+), 9 deletions(-) create mode 100644 grub-core/lib/x86_64/efi/relocator.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 58b4208b0..21ad0dd7c 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1531,6 +1531,7 @@ module = { i386_xen = lib/i386/xen/relocator.S; x86_64_xen = lib/x86_64/xen/relocator.S; xen = lib/i386/relocator_common_c.c; + x86_64_efi = lib/x86_64/efi/relocator.c; extra_dist = lib/i386/relocator_common.S; extra_dist = kern/powerpc/cache_flush.S; diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S index e4648d818..75725cf75 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -73,6 +73,14 @@ VARIABLE(grub_relocator64_rsp) movq %rax, %rsp + /* + * Here is grub_relocator64_efi_start() entry point. + * Following code is shared between grub_relocator64_efi_start() + * and grub_relocator64_start(). + * + * Think twice before changing anything below!!! + */ +VARIABLE(grub_relocator64_efi_start) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 @@ -120,6 +128,9 @@ LOCAL(jump_addr): VARIABLE(grub_relocator64_rip) .quad 0 + /* Here grub_relocator64_efi_start() ends. Ufff... */ +VARIABLE(grub_relocator64_efi_end) + #ifndef __x86_64__ .p2align 4 LOCAL(gdt): diff --git a/grub-core/lib/x86_64/efi/relocator.c b/grub-core/lib/x86_64/efi/relocator.c new file mode 100644 index 000000000..3caef7a40 --- /dev/null +++ b/grub-core/lib/x86_64/efi/relocator.c @@ -0,0 +1,80 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * Copyright (C) 2016 Oracle and/or its affiliates. All rights reserved. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +#include +#include + +#include +#include + +extern grub_uint64_t grub_relocator64_rax; +extern grub_uint64_t grub_relocator64_rbx; +extern grub_uint64_t grub_relocator64_rcx; +extern grub_uint64_t grub_relocator64_rdx; +extern grub_uint64_t grub_relocator64_rip; +extern grub_uint64_t grub_relocator64_rsi; + +extern grub_uint8_t grub_relocator64_efi_start; +extern grub_uint8_t grub_relocator64_efi_end; + +#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) + +grub_err_t +grub_relocator64_efi_boot (struct grub_relocator *rel, + struct grub_relocator64_efi_state state) +{ + grub_err_t err; + void *relst; + grub_relocator_chunk_t ch; + + /* + * 64-bit relocator code may live above 4 GiB quite well. + * However, I do not want ask for problems. Just in case. + */ + err = grub_relocator_alloc_chunk_align (rel, &ch, 0, + 0x100000000 - RELOCATOR_SIZEOF (64_efi), + RELOCATOR_SIZEOF (64_efi), 16, + GRUB_RELOCATOR_PREFERENCE_NONE, 1); + if (err) + return err; + + /* Do not touch %rsp! It points to EFI created stack. */ + grub_relocator64_rax = state.rax; + grub_relocator64_rbx = state.rbx; + grub_relocator64_rcx = state.rcx; + grub_relocator64_rdx = state.rdx; + grub_relocator64_rip = state.rip; + grub_relocator64_rsi = state.rsi; + + grub_memmove (get_virtual_current_address (ch), &grub_relocator64_efi_start, + RELOCATOR_SIZEOF (64_efi)); + + err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + &relst, NULL); + if (err) + return err; + + ((void (*) (void)) relst) (); + + /* Not reached. */ + return GRUB_ERR_NONE; +} diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c index 73aa0aa12..18038fd31 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c @@ -118,6 +118,48 @@ grub_multiboot_set_video_mode (void) return err; } +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +#define grub_relocator_efi_boot grub_relocator64_efi_boot +#define grub_relocator_efi_state grub_relocator64_efi_state +#endif +#endif + +#ifdef grub_relocator_efi_boot +static void +efi_boot (struct grub_relocator *rel, + grub_uint32_t target) +{ + struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; + + state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip; + state_efi.MULTIBOOT_EFI_MBI_REGISTER = target; + + grub_relocator_efi_boot (rel, state_efi); +} +#else +#define grub_efi_is_finished 1 +static void +efi_boot (struct grub_relocator *rel __attribute__ ((unused)), + grub_uint32_t target __attribute__ ((unused))) +{ +} +#endif + +#if defined (__i386__) || defined (__x86_64__) +static void +normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +{ + grub_relocator32_boot (rel, state, 0); +} +#else +static void +normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +{ + grub_relocator32_boot (rel, state); +} +#endif + static grub_err_t grub_multiboot_boot (void) { @@ -131,11 +173,10 @@ grub_multiboot_boot (void) if (err) return err; -#if defined (__i386__) || defined (__x86_64__) - grub_relocator32_boot (grub_multiboot_relocator, state, 0); -#else - grub_relocator32_boot (grub_multiboot_relocator, state); -#endif + if (grub_efi_is_finished) + normal_boot (grub_multiboot_relocator, state); + else + efi_boot (grub_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER); /* Not reached. */ return GRUB_ERR_NONE; diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index f147d674d..a3dca9011 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -107,8 +107,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) grub_err_t err; struct multiboot_header_tag *tag; struct multiboot_header_tag_address *addr_tag = NULL; - int entry_specified = 0; - grub_addr_t entry = 0; + int entry_specified = 0, efi_entry_specified = 0; + grub_addr_t entry = 0, efi_entry = 0; grub_uint32_t console_required = 0; struct multiboot_header_tag_framebuffer *fbtag = NULL; int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; @@ -192,6 +192,13 @@ grub_multiboot_load (grub_file_t file, const char *filename) entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr; break; + case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64: +#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) + efi_entry_specified = 1; + efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr; +#endif + break; + case MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS: if (!(((struct multiboot_header_tag_console_flags *) tag)->console_flags & MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED)) @@ -211,7 +218,9 @@ grub_multiboot_load (grub_file_t file, const char *filename) break; case MULTIBOOT_HEADER_TAG_EFI_BS: +#ifdef GRUB_MACHINE_EFI keep_bs = 1; +#endif break; default: @@ -224,7 +233,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) break; } - if (addr_tag && !entry_specified) + if (addr_tag && !entry_specified && !(keep_bs && efi_entry_specified)) { grub_free (buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, @@ -287,7 +296,9 @@ grub_multiboot_load (grub_file_t file, const char *filename) } } - if (entry_specified) + if (keep_bs && efi_entry_specified) + grub_multiboot_payload_eip = efi_entry; + else if (entry_specified) grub_multiboot_payload_eip = entry; if (fbtag) diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h index a1b94883d..807a1de27 100644 --- a/include/grub/i386/multiboot.h +++ b/include/grub/i386/multiboot.h @@ -30,6 +30,17 @@ #define MULTIBOOT_MBI_REGISTER ebx #define MULTIBOOT_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_I386 +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +#define MULTIBOOT_EFI_INITIAL_STATE { .rax = MULTIBOOT_BOOTLOADER_MAGIC, \ + .rcx = 0, \ + .rdx = 0, \ + } +#define MULTIBOOT_EFI_ENTRY_REGISTER rip +#define MULTIBOOT_EFI_MBI_REGISTER rbx +#endif +#endif + #define MULTIBOOT_ELF32_MACHINE EM_386 #define MULTIBOOT_ELF64_MACHINE EM_X86_64 diff --git a/include/grub/i386/relocator.h b/include/grub/i386/relocator.h index 5f89a7ec8..2a56c3b54 100644 --- a/include/grub/i386/relocator.h +++ b/include/grub/i386/relocator.h @@ -65,6 +65,20 @@ struct grub_relocator64_state grub_addr_t cr3; }; +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +struct grub_relocator64_efi_state +{ + grub_uint64_t rax; + grub_uint64_t rbx; + grub_uint64_t rcx; + grub_uint64_t rdx; + grub_uint64_t rip; + grub_uint64_t rsi; +}; +#endif +#endif + grub_err_t grub_relocator16_boot (struct grub_relocator *rel, struct grub_relocator16_state state); @@ -76,4 +90,11 @@ grub_err_t grub_relocator64_boot (struct grub_relocator *rel, struct grub_relocator64_state state, grub_addr_t min_addr, grub_addr_t max_addr); +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +grub_err_t grub_relocator64_efi_boot (struct grub_relocator *rel, + struct grub_relocator64_efi_state state); +#endif +#endif + #endif /* ! GRUB_RELOCATOR_CPU_HEADER */ diff --git a/include/multiboot2.h b/include/multiboot2.h index 8b8c1568a..46e7b7182 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -69,6 +69,7 @@ #define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5 #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6 #define MULTIBOOT_HEADER_TAG_EFI_BS 7 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4 From ba89c19f4995e01e3b84c6680f12f14bf0f6a38b Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Thu, 20 Nov 2014 00:09:54 +0100 Subject: [PATCH 178/207] multiboot2: Add tags used to pass ImageHandle to loaded image Add tags used to pass ImageHandle to loaded image if requested. It is used by at least ExitBootServices() function. Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Vladimir Serbinenko --- grub-core/loader/multiboot_mbi2.c | 42 +++++++++++++++++++++++++------ include/multiboot2.h | 16 ++++++++++++ 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index a3dca9011..6c044024e 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -172,6 +172,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) case MULTIBOOT_TAG_TYPE_NETWORK: case MULTIBOOT_TAG_TYPE_EFI_MMAP: case MULTIBOOT_TAG_TYPE_EFI_BS: + case MULTIBOOT_TAG_TYPE_EFI32_IH: + case MULTIBOOT_TAG_TYPE_EFI64_IH: break; default: @@ -407,13 +409,15 @@ grub_multiboot_get_mbi_size (void) + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry)), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN) - + ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN) - + ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) + sizeof (struct grub_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN) + acpiv2_size () + net_size () #ifdef GRUB_MACHINE_EFI + + ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi32_ih), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi64_ih), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_efi_mmap) + efi_mmap_size, MULTIBOOT_TAG_ALIGN) #endif @@ -907,11 +911,35 @@ grub_multiboot_make_mbi (grub_uint32_t *target) if (keep_bs) { - struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig; - tag->type = MULTIBOOT_TAG_TYPE_EFI_BS; - tag->size = sizeof (struct multiboot_tag); - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + { + struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI_BS; + tag->size = sizeof (struct multiboot_tag); + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } + +#ifdef __i386__ + { + struct multiboot_tag_efi32_ih *tag = (struct multiboot_tag_efi32_ih *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI32_IH; + tag->size = sizeof (struct multiboot_tag_efi32_ih); + tag->pointer = (grub_addr_t) grub_efi_image_handle; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } +#endif + +#ifdef __x86_64__ + { + struct multiboot_tag_efi64_ih *tag = (struct multiboot_tag_efi64_ih *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI64_IH; + tag->size = sizeof (struct multiboot_tag_efi64_ih); + tag->pointer = (grub_addr_t) grub_efi_image_handle; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } +#endif } #endif diff --git a/include/multiboot2.h b/include/multiboot2.h index 46e7b7182..f5bebe1e3 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -60,6 +60,8 @@ #define MULTIBOOT_TAG_TYPE_NETWORK 16 #define MULTIBOOT_TAG_TYPE_EFI_MMAP 17 #define MULTIBOOT_TAG_TYPE_EFI_BS 18 +#define MULTIBOOT_TAG_TYPE_EFI32_IH 19 +#define MULTIBOOT_TAG_TYPE_EFI64_IH 20 #define MULTIBOOT_HEADER_TAG_END 0 #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1 @@ -371,6 +373,20 @@ struct multiboot_tag_efi_mmap multiboot_uint8_t efi_mmap[0]; }; +struct multiboot_tag_efi32_ih +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint32_t pointer; +}; + +struct multiboot_tag_efi64_ih +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint64_t pointer; +}; + #endif /* ! ASM_FILE */ #endif /* ! MULTIBOOT_HEADER */ From f2b6c20a258b328ae8717cd5624d7b039328bcc0 Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Sat, 18 Jul 2015 00:09:31 +0200 Subject: [PATCH 179/207] multiboot2: Do not pass memory maps to image if EFI boot services are enabled If image requested EFI boot services then skip multiboot2 memory maps. Main reason for not providing maps is because they will likely be invalid. We do a few allocations after filling them, e.g. for relocator needs. Usually we do not care as we would have finished boot services. If we keep boot services then it is easier/safer to not provide maps. However, if image needs memory maps and they are not provided by bootloader then it should get itself just before ExitBootServices() call. Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Vladimir Serbinenko --- grub-core/loader/multiboot_mbi2.c | 71 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index 6c044024e..ad1553ba7 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -390,7 +390,7 @@ static grub_size_t grub_multiboot_get_mbi_size (void) { #ifdef GRUB_MACHINE_EFI - if (!efi_mmap_size) + if (!keep_bs && !efi_mmap_size) find_efi_mmap_size (); #endif return 2 * sizeof (grub_uint32_t) + sizeof (struct multiboot_tag) @@ -755,12 +755,13 @@ grub_multiboot_make_mbi (grub_uint32_t *target) } } - { - struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig; - grub_fill_multiboot_mmap (tag); - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); - } + if (!keep_bs) + { + struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig; + grub_fill_multiboot_mmap (tag); + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } { struct multiboot_tag_elf_sections *tag @@ -776,18 +777,19 @@ grub_multiboot_make_mbi (grub_uint32_t *target) / sizeof (grub_properly_aligned_t); } - { - struct multiboot_tag_basic_meminfo *tag - = (struct multiboot_tag_basic_meminfo *) ptrorig; - tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO; - tag->size = sizeof (struct multiboot_tag_basic_meminfo); + if (!keep_bs) + { + struct multiboot_tag_basic_meminfo *tag + = (struct multiboot_tag_basic_meminfo *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO; + tag->size = sizeof (struct multiboot_tag_basic_meminfo); - /* Convert from bytes to kilobytes. */ - tag->mem_lower = grub_mmap_get_lower () / 1024; - tag->mem_upper = grub_mmap_get_upper () / 1024; - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); - } + /* Convert from bytes to kilobytes. */ + tag->mem_lower = grub_mmap_get_lower () / 1024; + tag->mem_upper = grub_mmap_get_upper () / 1024; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } { struct grub_net_network_level_interface *net; @@ -886,27 +888,24 @@ grub_multiboot_make_mbi (grub_uint32_t *target) grub_efi_uintn_t efi_desc_size; grub_efi_uint32_t efi_desc_version; - tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP; - tag->size = sizeof (*tag) + efi_mmap_size; - if (!keep_bs) - err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, - &efi_desc_size, &efi_desc_version); - else { - if (grub_efi_get_memory_map (&efi_mmap_size, (void *) tag->efi_mmap, - NULL, - &efi_desc_size, &efi_desc_version) <= 0) - err = grub_error (GRUB_ERR_IO, "couldn't retrieve memory map"); - } - if (err) - return err; - tag->descr_size = efi_desc_size; - tag->descr_vers = efi_desc_version; - tag->size = sizeof (*tag) + efi_mmap_size; + tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP; + tag->size = sizeof (*tag) + efi_mmap_size; - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, + &efi_desc_size, &efi_desc_version); + + if (err) + return err; + + tag->descr_size = efi_desc_size; + tag->descr_vers = efi_desc_version; + tag->size = sizeof (*tag) + efi_mmap_size; + + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } } if (keep_bs) From a620876e3b32e4ea0c9a7b3541fcb9a4dd4fb9eb Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Fri, 17 Jul 2015 21:02:09 +0200 Subject: [PATCH 180/207] multiboot2: Add support for relocatable images Currently multiboot2 protocol loads image exactly at address specified in ELF or multiboot2 header. This solution works quite well on legacy BIOS platforms. It is possible because memory regions are placed at predictable addresses (though I was not able to find any spec which says that it is strong requirement, so, it looks that it is just a goodwill of hardware designers). However, EFI platforms are more volatile. Even if required memory regions live at specific addresses then they are sometimes simply not free (e.g. used by boot/runtime services on Dell PowerEdge R820 and OVMF). This means that you are not able to just set up final image destination on build time. You have to provide method to relocate image contents to real load address which is usually different than load address specified in ELF and multiboot2 headers. This patch provides all needed machinery to do self relocation in image code. First of all GRUB2 reads min_addr (min. load addr), max_addr (max. load addr), align (required image alignment), preference (it says which memory regions are preferred by image, e.g. none, low, high) from multiboot_header_tag_relocatable header tag contained in binary (at this stage load addresses from multiboot2 and/or ELF headers are ignored). Later loader tries to fulfill request (not only that one) and if it succeeds then it informs image about real load address via multiboot_tag_load_base_addr tag. At this stage GRUB2 role is finished. Starting from now executable must cope with relocations itself using whole static and dynamic knowledge provided by boot loader. This patch does not provide functionality which could do relocations using ELF relocation data. However, I was asked by Konrad Rzeszutek Wilk and Vladimir 'phcoder' Serbinenko to investigate that thing. It looks that relevant machinery could be added to existing code (including this patch) without huge effort. Additionally, ELF relocation could live in parallel with self relocation provided by this patch. However, during research I realized that first of all we should establish the details how ELF relocatable image should look like and how it should be build. At least to build proper test/example files. So, this patch just provides support for self relocatable images. If ELF file with relocs is loaded then GRUB2 complains loudly and ignores it. Support for such files will be added later. This patch was tested with Xen image which uses that functionality. However, this Xen feature is still under development and new patchset will be released in about 2-3 weeks. Signed-off-by: Daniel Kiper Reviewed-by: Vladimir Serbinenko --- grub-core/loader/i386/multiboot_mbi.c | 13 ++- grub-core/loader/multiboot.c | 11 +-- grub-core/loader/multiboot_elfxx.c | 129 ++++++++++++++++---------- grub-core/loader/multiboot_mbi2.c | 122 ++++++++++++++++++++---- include/grub/multiboot.h | 22 ++++- include/multiboot2.h | 24 +++++ 6 files changed, 243 insertions(+), 78 deletions(-) diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c index f60b70234..fd7b41b0c 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -70,9 +70,18 @@ load_kernel (grub_file_t file, const char *filename, char *buffer, struct multiboot_header *header) { grub_err_t err; + mbi_load_data_t mld; + + mld.file = file; + mld.filename = filename; + mld.buffer = buffer; + mld.mbi_ver = 1; + mld.relocatable = 0; + mld.avoid_efi_boot_services = 0; + if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE) { - err = grub_multiboot_load_elf (file, filename, buffer); + err = grub_multiboot_load_elf (&mld); if (err == GRUB_ERR_NONE) { return GRUB_ERR_NONE; } @@ -121,7 +130,7 @@ load_kernel (grub_file_t file, const char *filename, return GRUB_ERR_NONE; } - return grub_multiboot_load_elf (file, filename, buffer); + return grub_multiboot_load_elf (&mld); } static struct multiboot_header * diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c index 18038fd31..bd9d5b3e6 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c @@ -207,13 +207,12 @@ static grub_uint64_t highest_load; /* Load ELF32 or ELF64. */ grub_err_t -grub_multiboot_load_elf (grub_file_t file, const char *filename, - void *buffer) +grub_multiboot_load_elf (mbi_load_data_t *mld) { - if (grub_multiboot_is_elf32 (buffer)) - return grub_multiboot_load_elf32 (file, filename, buffer); - else if (grub_multiboot_is_elf64 (buffer)) - return grub_multiboot_load_elf64 (file, filename, buffer); + if (grub_multiboot_is_elf32 (mld->buffer)) + return grub_multiboot_load_elf32 (mld); + else if (grub_multiboot_is_elf64 (mld->buffer)) + return grub_multiboot_load_elf64 (mld); return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); } diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c index e3a39b609..5e649ed25 100644 --- a/grub-core/loader/multiboot_elfxx.c +++ b/grub-core/loader/multiboot_elfxx.c @@ -51,11 +51,15 @@ CONCAT(grub_multiboot_is_elf, XX) (void *buffer) } static grub_err_t -CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, void *buffer) +CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) { - Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; + Elf_Ehdr *ehdr = (Elf_Ehdr *) mld->buffer; char *phdr_base; + grub_err_t err; + grub_relocator_chunk_t ch; + grub_uint32_t load_offset, load_size; int i; + void *source; if (ehdr->e_ident[EI_MAG0] != ELFMAG0 || ehdr->e_ident[EI_MAG1] != ELFMAG1 @@ -75,54 +79,86 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - phdr_base = (char *) buffer + ehdr->e_phoff; + phdr_base = (char *) mld->buffer + ehdr->e_phoff; #define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + mld->link_base_addr = ~0; + + /* Calculate lowest and highest load address. */ + for (i = 0; i < ehdr->e_phnum; i++) + if (phdr(i)->p_type == PT_LOAD) + { + mld->link_base_addr = grub_min (mld->link_base_addr, phdr(i)->p_paddr); + highest_load = grub_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz); + } + +#ifdef MULTIBOOT_LOAD_ELF64 + if (highest_load >= 0x100000000) + return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border"); +#endif + + load_size = highest_load - mld->link_base_addr; + + if (mld->relocatable) + { + if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size) + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + mld->min_addr, mld->max_addr - load_size, + load_size, mld->align ? mld->align : 1, + mld->preference, mld->avoid_efi_boot_services); + } + else + err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch, + mld->link_base_addr, load_size); + + if (err) + { + grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); + return err; + } + + mld->load_base_addr = get_physical_target_address (ch); + source = get_virtual_current_address (ch); + + grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + "load_size=0x%x, relocatable=%d\n", mld->link_base_addr, + mld->load_base_addr, load_size, mld->relocatable); + + if (mld->relocatable) + grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + (long) mld->align, mld->preference, mld->avoid_efi_boot_services); + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { if (phdr(i)->p_type == PT_LOAD) { - grub_err_t err; - void *source; - - if (phdr(i)->p_paddr + phdr(i)->p_memsz > highest_load) - highest_load = phdr(i)->p_paddr + phdr(i)->p_memsz; grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr); - { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, - &ch, phdr(i)->p_paddr, - phdr(i)->p_memsz); - if (err) - { - grub_dprintf ("multiboot_loader", "Error loading phdr %d\n", i); - return err; - } - source = get_virtual_current_address (ch); - } + load_offset = phdr(i)->p_paddr - mld->link_base_addr; if (phdr(i)->p_filesz != 0) { - if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) + if (grub_file_seek (mld->file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, source, phdr(i)->p_filesz) + if (grub_file_read (mld->file, (grub_uint8_t *) source + load_offset, phdr(i)->p_filesz) != (grub_ssize_t) phdr(i)->p_filesz) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } } if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset ((grub_uint8_t *) source + phdr(i)->p_filesz, 0, + grub_memset ((grub_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0, phdr(i)->p_memsz - phdr(i)->p_filesz); } } @@ -168,18 +204,18 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi if (!shdr) return grub_errno; - if (grub_file_seek (file, ehdr->e_shoff) == (grub_off_t) -1) + if (grub_file_seek (mld->file, ehdr->e_shoff) == (grub_off_t) -1) { grub_free (shdr); return grub_errno; } - if (grub_file_read (file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) + if (grub_file_read (mld->file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) != (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } @@ -189,7 +225,9 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi Elf_Shdr *sh = (Elf_Shdr *) shdrptr; void *src; grub_addr_t target; - grub_err_t err; + + if (mld->mbi_ver >= 2 && (sh->sh_type == SHT_REL || sh->sh_type == SHT_RELA)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet"); /* This section is a loaded section, so we don't care. */ @@ -200,33 +238,28 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi if (sh->sh_size == 0) continue; - { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, - &ch, 0, - (0xffffffff - sh->sh_size) - + 1, sh->sh_size, - sh->sh_addralign, - GRUB_RELOCATOR_PREFERENCE_NONE, - 0); - if (err) - { - grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); - return err; - } - src = get_virtual_current_address (ch); - target = get_physical_target_address (ch); - } + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0, + (0xffffffff - sh->sh_size) + 1, + sh->sh_size, sh->sh_addralign, + GRUB_RELOCATOR_PREFERENCE_NONE, + mld->avoid_efi_boot_services); + if (err) + { + grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); + return err; + } + src = get_virtual_current_address (ch); + target = get_physical_target_address (ch); - if (grub_file_seek (file, sh->sh_offset) == (grub_off_t) -1) + if (grub_file_seek (mld->file, sh->sh_offset) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, src, sh->sh_size) + if (grub_file_read (mld->file, src, sh->sh_size) != (grub_ssize_t) sh->sh_size) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } sh->sh_addr = target; diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index ad1553ba7..b0679a9f6 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -68,6 +68,7 @@ static grub_size_t elf_sec_num, elf_sec_entsize; static unsigned elf_sec_shstrndx; static void *elf_sections; static int keep_bs = 0; +static grub_uint32_t load_base_addr; void grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, @@ -101,36 +102,40 @@ find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) grub_err_t grub_multiboot_load (grub_file_t file, const char *filename) { - grub_properly_aligned_t *buffer; grub_ssize_t len; struct multiboot_header *header; grub_err_t err; struct multiboot_header_tag *tag; struct multiboot_header_tag_address *addr_tag = NULL; + struct multiboot_header_tag_relocatable *rel_tag; int entry_specified = 0, efi_entry_specified = 0; grub_addr_t entry = 0, efi_entry = 0; grub_uint32_t console_required = 0; struct multiboot_header_tag_framebuffer *fbtag = NULL; int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; + mbi_load_data_t mld; - buffer = grub_malloc (MULTIBOOT_SEARCH); - if (!buffer) + mld.mbi_ver = 2; + mld.relocatable = 0; + + mld.buffer = grub_malloc (MULTIBOOT_SEARCH); + if (!mld.buffer) return grub_errno; - len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); + len = grub_file_read (file, mld.buffer, MULTIBOOT_SEARCH); if (len < 32) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); } COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); - header = find_header (buffer, len); + header = find_header (mld.buffer, len); if (header == 0) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found"); } @@ -174,10 +179,11 @@ grub_multiboot_load (grub_file_t file, const char *filename) case MULTIBOOT_TAG_TYPE_EFI_BS: case MULTIBOOT_TAG_TYPE_EFI32_IH: case MULTIBOOT_TAG_TYPE_EFI64_IH: + case MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR: break; default: - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "unsupported information tag: 0x%x", request_tag->requests[i]); @@ -215,6 +221,27 @@ grub_multiboot_load (grub_file_t file, const char *filename) accepted_consoles |= GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER; break; + case MULTIBOOT_HEADER_TAG_RELOCATABLE: + mld.relocatable = 1; + rel_tag = (struct multiboot_header_tag_relocatable *) tag; + mld.min_addr = rel_tag->min_addr; + mld.max_addr = rel_tag->max_addr; + mld.align = rel_tag->align; + switch (rel_tag->preference) + { + case MULTIBOOT_LOAD_PREFERENCE_LOW: + mld.preference = GRUB_RELOCATOR_PREFERENCE_LOW; + break; + + case MULTIBOOT_LOAD_PREFERENCE_HIGH: + mld.preference = GRUB_RELOCATOR_PREFERENCE_HIGH; + break; + + default: + mld.preference = GRUB_RELOCATOR_PREFERENCE_NONE; + } + break; + /* GRUB always page-aligns modules. */ case MULTIBOOT_HEADER_TAG_MODULE_ALIGN: break; @@ -228,7 +255,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) default: if (! (tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL)) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "unsupported tag: 0x%x", tag->type); } @@ -237,7 +264,7 @@ grub_multiboot_load (grub_file_t file, const char *filename) if (addr_tag && !entry_specified && !(keep_bs && efi_entry_specified)) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "load address tag without entry address tag"); } @@ -246,8 +273,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) { grub_uint64_t load_addr = (addr_tag->load_addr + 1) ? addr_tag->load_addr : (addr_tag->header_addr - - ((char *) header - (char *) buffer)); - int offset = ((char *) header - (char *) buffer - + - ((char *) header - (char *) mld.buffer)); + int offset = ((char *) header - (char *) mld.buffer - (addr_tag->header_addr - load_addr)); int load_size = ((addr_tag->load_end_addr == 0) ? file->size - offset : addr_tag->load_end_addr - addr_tag->load_addr); @@ -260,27 +287,50 @@ grub_multiboot_load (grub_file_t file, const char *filename) else code_size = load_size; - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, - &ch, load_addr, - code_size); + if (mld.relocatable) + { + if (code_size > mld.max_addr || mld.min_addr > mld.max_addr - code_size) + { + grub_free (mld.buffer); + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + } + + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + mld.min_addr, mld.max_addr - code_size, + code_size, mld.align ? mld.align : 1, + mld.preference, keep_bs); + } + else + err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, + &ch, load_addr, code_size); if (err) { grub_dprintf ("multiboot_loader", "Error loading aout kludge\n"); - grub_free (buffer); + grub_free (mld.buffer); return err; } + mld.link_base_addr = load_addr; + mld.load_base_addr = get_physical_target_address (ch); source = get_virtual_current_address (ch); + grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + "load_size=0x%lx, relocatable=%d\n", mld.link_base_addr, + mld.load_base_addr, (long) code_size, mld.relocatable); + + if (mld.relocatable) + grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + (long) mld.align, mld.preference, keep_bs); + if ((grub_file_seek (file, offset)) == (grub_off_t) -1) { - grub_free (buffer); + grub_free (mld.buffer); return grub_errno; } grub_file_read (file, source, load_size); if (grub_errno) { - grub_free (buffer); + grub_free (mld.buffer); return grub_errno; } @@ -290,19 +340,41 @@ grub_multiboot_load (grub_file_t file, const char *filename) } else { - err = grub_multiboot_load_elf (file, filename, buffer); + mld.file = file; + mld.filename = filename; + mld.avoid_efi_boot_services = keep_bs; + err = grub_multiboot_load_elf (&mld); if (err) { - grub_free (buffer); + grub_free (mld.buffer); return err; } } + load_base_addr = mld.load_base_addr; + if (keep_bs && efi_entry_specified) grub_multiboot_payload_eip = efi_entry; else if (entry_specified) grub_multiboot_payload_eip = entry; + if (mld.relocatable) + { + /* + * Both branches are mathematically equivalent. However, it looks + * that real life (C?) is more complicated. I am trying to avoid + * wrap around here if mld.load_base_addr < mld.link_base_addr. + * If you look at C operator precedence then everything should work. + * However, I am not 100% sure that a given compiler will not + * optimize/break this stuff. So, maybe we should use signed + * 64-bit int here. + */ + if (mld.load_base_addr >= mld.link_base_addr) + grub_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr; + else + grub_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr; + } + if (fbtag) err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, accepted_consoles, @@ -411,6 +483,7 @@ grub_multiboot_get_mbi_size (void) + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) + sizeof (struct grub_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_load_base_addr), MULTIBOOT_TAG_ALIGN) + acpiv2_size () + net_size () #ifdef GRUB_MACHINE_EFI @@ -693,6 +766,15 @@ grub_multiboot_make_mbi (grub_uint32_t *target) % sizeof (grub_properly_aligned_t) == 0); ptrorig += (2 * sizeof (grub_uint32_t)) / sizeof (grub_properly_aligned_t); + { + struct multiboot_tag_load_base_addr *tag = (struct multiboot_tag_load_base_addr *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR; + tag->size = sizeof (struct multiboot_tag_load_base_addr); + tag->load_base_addr = load_base_addr; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } + { struct multiboot_tag_string *tag = (struct multiboot_tag_string *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_CMDLINE; diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h index e13c0843b..c96492bb5 100644 --- a/include/grub/multiboot.h +++ b/include/grub/multiboot.h @@ -91,10 +91,28 @@ grub_multiboot_set_console (int console_type, int accepted_consoles, int console_required); grub_err_t grub_multiboot_load (grub_file_t file, const char *filename); + +struct mbi_load_data +{ + grub_file_t file; + const char *filename; + void *buffer; + unsigned int mbi_ver; + int relocatable; + grub_uint32_t min_addr; + grub_uint32_t max_addr; + grub_size_t align; + grub_uint32_t preference; + grub_uint32_t link_base_addr; + grub_uint32_t load_base_addr; + int avoid_efi_boot_services; +}; +typedef struct mbi_load_data mbi_load_data_t; + /* Load ELF32 or ELF64. */ grub_err_t -grub_multiboot_load_elf (grub_file_t file, const char *filename, - void *buffer); +grub_multiboot_load_elf (mbi_load_data_t *mld); + extern grub_size_t grub_multiboot_pure_size; extern grub_size_t grub_multiboot_alloc_mbi; extern grub_uint32_t grub_multiboot_payload_eip; diff --git a/include/multiboot2.h b/include/multiboot2.h index f5bebe1e3..5a3db5a7c 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -62,6 +62,7 @@ #define MULTIBOOT_TAG_TYPE_EFI_BS 18 #define MULTIBOOT_TAG_TYPE_EFI32_IH 19 #define MULTIBOOT_TAG_TYPE_EFI64_IH 20 +#define MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR 21 #define MULTIBOOT_HEADER_TAG_END 0 #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1 @@ -72,11 +73,16 @@ #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6 #define MULTIBOOT_HEADER_TAG_EFI_BS 7 #define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 +#define MULTIBOOT_HEADER_TAG_RELOCATABLE 10 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4 #define MULTIBOOT_HEADER_TAG_OPTIONAL 1 +#define MULTIBOOT_LOAD_PREFERENCE_NONE 0 +#define MULTIBOOT_LOAD_PREFERENCE_LOW 1 +#define MULTIBOOT_LOAD_PREFERENCE_HIGH 2 + #define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1 #define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2 @@ -161,6 +167,17 @@ struct multiboot_header_tag_module_align multiboot_uint32_t size; }; +struct multiboot_header_tag_relocatable +{ + multiboot_uint16_t type; + multiboot_uint16_t flags; + multiboot_uint32_t size; + multiboot_uint32_t min_addr; + multiboot_uint32_t max_addr; + multiboot_uint32_t align; + multiboot_uint32_t preference; +}; + struct multiboot_color { multiboot_uint8_t red; @@ -387,6 +404,13 @@ struct multiboot_tag_efi64_ih multiboot_uint64_t pointer; }; +struct multiboot_tag_load_base_addr +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint32_t load_base_addr; +}; + #endif /* ! ASM_FILE */ #endif /* ! MULTIBOOT_HEADER */ From 4231927e449feeb8b1b39470a9b2288f2f773f25 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:06 +0100 Subject: [PATCH 181/207] xen: make xen loader callable multiple times The loader for xen paravirtualized environment isn't callable multiple times as it won't free any memory in case of failure. Call grub_relocator_unload() as other modules do it before allocating a new relocator or when unloading the module. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index c4d9689f7..179e89cb9 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -316,11 +316,23 @@ grub_xen_boot (void) xen_inf.virt_base); } +static void +grub_xen_reset (void) +{ + grub_memset (&next_start, 0, sizeof (next_start)); + xen_module_info_page = NULL; + n_modules = 0; + + grub_relocator_unload (relocator); + relocator = NULL; + loaded = 0; +} + static grub_err_t grub_xen_unload (void) { + grub_xen_reset (); grub_dl_unref (my_mod); - loaded = 0; return GRUB_ERR_NONE; } @@ -403,10 +415,7 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), grub_loader_unset (); - grub_memset (&next_start, 0, sizeof (next_start)); - - xen_module_info_page = NULL; - n_modules = 0; + grub_xen_reset (); grub_create_loader_cmdline (argc - 1, argv + 1, (char *) next_start.cmd_line, @@ -503,16 +512,18 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), goto fail; fail: + /* grub_errno might be clobbered by further calls, save the error reason. */ + err = grub_errno; if (elf) grub_elf_close (elf); else if (file) grub_file_close (file); - if (grub_errno != GRUB_ERR_NONE) - loaded = 0; + if (err != GRUB_ERR_NONE) + grub_xen_reset (); - return grub_errno; + return err; } static grub_err_t From c69d1858f1187b7d78cae33f213a946ec2e50e8b Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:07 +0100 Subject: [PATCH 182/207] xen: avoid memleaks on error When loading a Xen pv-kernel avoid memory leaks in case of errors. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 2 +- grub-core/loader/i386/xen_fileXX.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index 179e89cb9..f45f70f1d 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -563,7 +563,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), { err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size); if (err) - return err; + goto fail; if (grub_initrd_load (&initrd_ctx, argv, get_virtual_current_address (ch))) diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c index 1ba5649e2..36b40e4b0 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -26,6 +26,8 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, char *buf; char *ptr; int has_paddr = 0; + + grub_errno = GRUB_ERR_NONE; if (grub_file_seek (elf->file, off) == (grub_off_t) -1) return grub_errno; buf = grub_malloc (sz); @@ -35,7 +37,8 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, if (grub_file_read (elf->file, buf, sz) != (grub_ssize_t) sz) { if (grub_errno) - return grub_errno; + goto out; + grub_free (buf); return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), elf->file->name); } @@ -123,14 +126,14 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, { xi->virt_base = grub_strtoull (ptr + sizeof ("VIRT_BASE=") - 1, &ptr, 16); if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "VIRT_ENTRY=", sizeof ("VIRT_ENTRY=") - 1) == 0) { xi->entry_point = grub_strtoull (ptr + sizeof ("VIRT_ENTRY=") - 1, &ptr, 16); if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "HYPERCALL_PAGE=", sizeof ("HYPERCALL_PAGE=") - 1) == 0) @@ -138,7 +141,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->hypercall_page = grub_strtoull (ptr + sizeof ("HYPERCALL_PAGE=") - 1, &ptr, 16); xi->has_hypercall_page = 1; if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "ELF_PADDR_OFFSET=", sizeof ("ELF_PADDR_OFFSET=") - 1) == 0) @@ -146,7 +149,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->paddr_offset = grub_strtoull (ptr + sizeof ("ELF_PADDR_OFFSET=") - 1, &ptr, 16); has_paddr = 1; if (grub_errno) - return grub_errno; + goto out; continue; } } @@ -154,7 +157,11 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->hypercall_page = (xi->hypercall_page << 12) + xi->virt_base; if (!has_paddr) xi->paddr_offset = xi->virt_base; - return GRUB_ERR_NONE; + +out: + grub_free (buf); + + return grub_errno; } #pragma GCC diagnostic ignored "-Wcast-align" From 6ae55ce1038425ca8811365725e939b47a99b33a Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:08 +0100 Subject: [PATCH 183/207] xen: reduce number of global variables in xen loader The loader for xen paravirtualized environment is using lots of global variables. Reduce the number by making them either local or by putting them into a single state structure. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 259 +++++++++++++++++++----------------- 1 file changed, 138 insertions(+), 121 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index f45f70f1d..691c22e8a 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -42,16 +42,20 @@ GRUB_MOD_LICENSE ("GPLv3+"); -static struct grub_relocator *relocator = NULL; -static grub_uint64_t max_addr; +struct xen_loader_state { + struct grub_relocator *relocator; + struct start_info next_start; + struct grub_xen_file_info xen_inf; + grub_uint64_t max_addr; + struct xen_multiboot_mod_list *module_info_page; + grub_uint64_t modules_target_start; + grub_size_t n_modules; + int loaded; +}; + +static struct xen_loader_state xen_state; + static grub_dl_t my_mod; -static int loaded = 0; -static struct start_info next_start; -static void *kern_chunk_src; -static struct grub_xen_file_info xen_inf; -static struct xen_multiboot_mod_list *xen_module_info_page; -static grub_uint64_t modules_target_start; -static grub_size_t n_modules; #define PAGE_SIZE 4096 #define MAX_MODULES (PAGE_SIZE / sizeof (struct xen_multiboot_mod_list)) @@ -225,50 +229,55 @@ grub_xen_boot (void) if (grub_xen_n_allocated_shared_pages) return grub_error (GRUB_ERR_BUG, "active grants"); - state.mfn_list = max_addr; - next_start.mfn_list = max_addr + xen_inf.virt_base; - next_start.first_p2m_pfn = max_addr >> PAGE_SHIFT; /* Is this right? */ + state.mfn_list = xen_state.max_addr; + xen_state.next_start.mfn_list = + xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.next_start.first_p2m_pfn = xen_state.max_addr >> PAGE_SHIFT; pgtsize = sizeof (grub_xen_mfn_t) * grub_xen_start_page_addr->nr_pages; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, pgtsize); - next_start.nr_p2m_frames = (pgtsize + PAGE_SIZE - 1) >> PAGE_SHIFT; + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, pgtsize); + xen_state.next_start.nr_p2m_frames = (pgtsize + PAGE_SIZE - 1) >> PAGE_SHIFT; if (err) return err; new_mfn_list = get_virtual_current_address (ch); grub_memcpy (new_mfn_list, (void *) grub_xen_start_page_addr->mfn_list, pgtsize); - max_addr = ALIGN_UP (max_addr + pgtsize, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + pgtsize, PAGE_SIZE); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, sizeof (next_start)); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, + sizeof (xen_state.next_start)); if (err) return err; - state.start_info = max_addr + xen_inf.virt_base; + state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; nst = get_virtual_current_address (ch); - max_addr = ALIGN_UP (max_addr + sizeof (next_start), PAGE_SIZE); + xen_state.max_addr = + ALIGN_UP (xen_state.max_addr + sizeof (xen_state.next_start), PAGE_SIZE); - next_start.nr_pages = grub_xen_start_page_addr->nr_pages; - grub_memcpy (next_start.magic, grub_xen_start_page_addr->magic, - sizeof (next_start.magic)); - next_start.store_mfn = grub_xen_start_page_addr->store_mfn; - next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; - next_start.console.domU = grub_xen_start_page_addr->console.domU; - next_start.shared_info = grub_xen_start_page_addr->shared_info; + xen_state.next_start.nr_pages = grub_xen_start_page_addr->nr_pages; + grub_memcpy (xen_state.next_start.magic, grub_xen_start_page_addr->magic, + sizeof (xen_state.next_start.magic)); + xen_state.next_start.store_mfn = grub_xen_start_page_addr->store_mfn; + xen_state.next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; + xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; + xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; - err = set_mfns (new_mfn_list, max_addr >> PAGE_SHIFT); + err = set_mfns (new_mfn_list, xen_state.max_addr >> PAGE_SHIFT); if (err) return err; - max_addr += 2 * PAGE_SIZE; + xen_state.max_addr += 2 * PAGE_SIZE; - next_start.pt_base = max_addr + xen_inf.virt_base; - state.paging_start = max_addr >> PAGE_SHIFT; + xen_state.next_start.pt_base = + xen_state.max_addr + xen_state.xen_inf.virt_base; + state.paging_start = xen_state.max_addr >> PAGE_SHIFT; - nr_info_pages = max_addr >> PAGE_SHIFT; + nr_info_pages = xen_state.max_addr >> PAGE_SHIFT; nr_pages = nr_info_pages; while (1) { nr_pages = ALIGN_UP (nr_pages, (ALIGN_SIZE >> PAGE_SHIFT)); - nr_pt_pages = get_pgtable_size (nr_pages, xen_inf.virt_base); + nr_pt_pages = get_pgtable_size (nr_pages, xen_state.xen_inf.virt_base); nr_need_pages = nr_info_pages + nr_pt_pages + ((ADDITIONAL_SIZE + STACK_SIZE) >> PAGE_SHIFT); @@ -278,27 +287,28 @@ grub_xen_boot (void) } grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", - (unsigned long long) xen_inf.virt_base, + (unsigned long long) xen_state.xen_inf.virt_base, (unsigned long long) page2offset (nr_pages)); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, page2offset (nr_pt_pages)); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, + page2offset (nr_pt_pages)); if (err) return err; generate_page_table (get_virtual_current_address (ch), - max_addr >> PAGE_SHIFT, nr_pages, - xen_inf.virt_base, new_mfn_list); + xen_state.max_addr >> PAGE_SHIFT, nr_pages, + xen_state.xen_inf.virt_base, new_mfn_list); - max_addr += page2offset (nr_pt_pages); - state.stack = max_addr + STACK_SIZE + xen_inf.virt_base; - state.entry_point = xen_inf.entry_point; + xen_state.max_addr += page2offset (nr_pt_pages); + state.stack = xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; + state.entry_point = xen_state.xen_inf.entry_point; - next_start.nr_p2m_frames += nr_pt_pages; - next_start.nr_pt_frames = nr_pt_pages; + xen_state.next_start.nr_p2m_frames += nr_pt_pages; + xen_state.next_start.nr_pt_frames = nr_pt_pages; state.paging_size = nr_pt_pages; - *nst = next_start; + *nst = xen_state.next_start; grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); @@ -308,24 +318,20 @@ grub_xen_boot (void) for (i = 0; i < ARRAY_SIZE (grub_xen_shared_info->evtchn_pending); i++) grub_xen_shared_info->evtchn_pending[i] = 0; - return grub_relocator_xen_boot (relocator, state, nr_pages, - xen_inf.virt_base < + return grub_relocator_xen_boot (xen_state.relocator, state, nr_pages, + xen_state.xen_inf.virt_base < PAGE_SIZE ? page2offset (nr_pages) : 0, nr_pages - 1, page2offset (nr_pages - 1) + - xen_inf.virt_base); + xen_state.xen_inf.virt_base); } static void grub_xen_reset (void) { - grub_memset (&next_start, 0, sizeof (next_start)); - xen_module_info_page = NULL; - n_modules = 0; + grub_relocator_unload (xen_state.relocator); - grub_relocator_unload (relocator); - relocator = NULL; - loaded = 0; + grub_memset (&xen_state, 0, sizeof (xen_state)); } static grub_err_t @@ -409,17 +415,22 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), grub_file_t file; grub_elf_t elf; grub_err_t err; + void *kern_chunk_src; + grub_relocator_chunk_t ch; + grub_addr_t kern_start; + grub_addr_t kern_end; if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + /* Call grub_loader_unset early to avoid it being called by grub_loader_set */ grub_loader_unset (); grub_xen_reset (); grub_create_loader_cmdline (argc - 1, argv + 1, - (char *) next_start.cmd_line, - sizeof (next_start.cmd_line) - 1); + (char *) xen_state.next_start.cmd_line, + sizeof (xen_state.next_start.cmd_line) - 1); file = grub_file_open (argv[0]); if (!file) @@ -429,85 +440,82 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), if (!elf) goto fail; - err = grub_xen_get_info (elf, &xen_inf); + err = grub_xen_get_info (elf, &xen_state.xen_inf); if (err) goto fail; #ifdef __x86_64__ - if (xen_inf.arch != GRUB_XEN_FILE_X86_64) + if (xen_state.xen_inf.arch != GRUB_XEN_FILE_X86_64) #else - if (xen_inf.arch != GRUB_XEN_FILE_I386_PAE - && xen_inf.arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE + && xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE_BIMODE) #endif { grub_error (GRUB_ERR_BAD_OS, "incompatible architecture: %d", - xen_inf.arch); + xen_state.xen_inf.arch); goto fail; } - if (xen_inf.virt_base & (PAGE_SIZE - 1)) + if (xen_state.xen_inf.virt_base & (PAGE_SIZE - 1)) { grub_error (GRUB_ERR_BAD_OS, "unaligned virt_base"); goto fail; } grub_dprintf ("xen", "virt_base = %llx, entry = %llx\n", - (unsigned long long) xen_inf.virt_base, - (unsigned long long) xen_inf.entry_point); + (unsigned long long) xen_state.xen_inf.virt_base, + (unsigned long long) xen_state.xen_inf.entry_point); - relocator = grub_relocator_new (); - if (!relocator) + xen_state.relocator = grub_relocator_new (); + if (!xen_state.relocator) goto fail; - grub_relocator_chunk_t ch; - grub_addr_t kern_start = xen_inf.kern_start - xen_inf.paddr_offset; - grub_addr_t kern_end = xen_inf.kern_end - xen_inf.paddr_offset; + kern_start = xen_state.xen_inf.kern_start - xen_state.xen_inf.paddr_offset; + kern_end = xen_state.xen_inf.kern_end - xen_state.xen_inf.paddr_offset; - if (xen_inf.has_hypercall_page) + if (xen_state.xen_inf.has_hypercall_page) { grub_dprintf ("xen", "hypercall page at 0x%llx\n", - (unsigned long long) xen_inf.hypercall_page); - if (xen_inf.hypercall_page - xen_inf.virt_base < kern_start) - kern_start = xen_inf.hypercall_page - xen_inf.virt_base; - - if (xen_inf.hypercall_page - xen_inf.virt_base + PAGE_SIZE > kern_end) - kern_end = xen_inf.hypercall_page - xen_inf.virt_base + PAGE_SIZE; + (unsigned long long) xen_state.xen_inf.hypercall_page); + kern_start = grub_min (kern_start, xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base); + kern_end = grub_max (kern_end, xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base + PAGE_SIZE); } - max_addr = ALIGN_UP (kern_end, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (kern_end, PAGE_SIZE); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, kern_start, + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, kern_start, kern_end - kern_start); if (err) goto fail; kern_chunk_src = get_virtual_current_address (ch); grub_dprintf ("xen", "paddr_offset = 0x%llx\n", - (unsigned long long) xen_inf.paddr_offset); + (unsigned long long) xen_state.xen_inf.paddr_offset); grub_dprintf ("xen", "kern_start = 0x%llx, kern_end = 0x%llx\n", - (unsigned long long) xen_inf.kern_start, - (unsigned long long) xen_inf.kern_end); + (unsigned long long) xen_state.xen_inf.kern_start, + (unsigned long long) xen_state.xen_inf.kern_end); err = grub_elfXX_load (elf, argv[0], (grub_uint8_t *) kern_chunk_src - kern_start - - xen_inf.paddr_offset, 0, 0, 0); + - xen_state.xen_inf.paddr_offset, 0, 0, 0); - if (xen_inf.has_hypercall_page) + if (xen_state.xen_inf.has_hypercall_page) { unsigned i; for (i = 0; i < PAGE_SIZE / HYPERCALL_INTERFACE_SIZE; i++) set_hypercall_interface ((grub_uint8_t *) kern_chunk_src + i * HYPERCALL_INTERFACE_SIZE + - xen_inf.hypercall_page - xen_inf.virt_base - - kern_start, i); + xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base - kern_start, i); } if (err) goto fail; grub_dl_ref (my_mod); - loaded = 1; + xen_state.loaded = 1; grub_loader_set (grub_xen_boot, grub_xen_unload, 0); - loaded = 1; goto fail; @@ -541,14 +549,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - if (!loaded) + if (!xen_state.loaded) { grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (next_start.mod_start || next_start.mod_len) + if (xen_state.next_start.mod_start || xen_state.next_start.mod_len) { grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); goto fail; @@ -561,7 +569,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), if (size) { - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, size); if (err) goto fail; @@ -570,13 +579,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - next_start.mod_start = max_addr + xen_inf.virt_base; - next_start.mod_len = size; + xen_state.next_start.mod_start = + xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.next_start.mod_len = size; - max_addr = ALIGN_UP (max_addr + size, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); grub_dprintf ("xen", "Initrd, addr=0x%x, size=0x%x\n", - (unsigned) next_start.mod_start, (unsigned) size); + (unsigned) xen_state.next_start.mod_start, (unsigned) size); fail: grub_initrd_close (&initrd_ctx); @@ -608,45 +618,48 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); - if (!loaded) + if (!xen_state.loaded) { return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); } - if ((next_start.mod_start || next_start.mod_len) && !xen_module_info_page) + if ((xen_state.next_start.mod_start || xen_state.next_start.mod_len) && + !xen_state.module_info_page) { return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); } /* Leave one space for terminator. */ - if (n_modules >= MAX_MODULES - 1) + if (xen_state.n_modules >= MAX_MODULES - 1) { return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many modules"); } - if (!xen_module_info_page) + if (!xen_state.module_info_page) { - n_modules = 0; - max_addr = ALIGN_UP (max_addr, PAGE_SIZE); - modules_target_start = max_addr; - next_start.mod_start = max_addr + xen_inf.virt_base; - next_start.flags |= SIF_MULTIBOOT_MOD; + xen_state.n_modules = 0; + xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); + xen_state.modules_target_start = xen_state.max_addr; + xen_state.next_start.mod_start = + xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.next_start.flags |= SIF_MULTIBOOT_MOD; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, MAX_MODULES + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, MAX_MODULES * - sizeof (xen_module_info_page + sizeof (xen_state.module_info_page [0])); if (err) return err; - xen_module_info_page = get_virtual_current_address (ch); - grub_memset (xen_module_info_page, 0, MAX_MODULES - * sizeof (xen_module_info_page[0])); - max_addr += MAX_MODULES * sizeof (xen_module_info_page[0]); + xen_state.module_info_page = get_virtual_current_address (ch); + grub_memset (xen_state.module_info_page, 0, MAX_MODULES + * sizeof (xen_state.module_info_page[0])); + xen_state.max_addr += + MAX_MODULES * sizeof (xen_state.module_info_page[0]); } - max_addr = ALIGN_UP (max_addr, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); if (nounzip) grub_file_filter_disable_compression (); @@ -657,20 +670,22 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), cmdline_len = grub_loader_cmdline_size (argc - 1, argv + 1); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, cmdline_len); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, cmdline_len); if (err) goto fail; grub_create_loader_cmdline (argc - 1, argv + 1, get_virtual_current_address (ch), cmdline_len); - xen_module_info_page[n_modules].cmdline = max_addr - modules_target_start; - max_addr = ALIGN_UP (max_addr + cmdline_len, PAGE_SIZE); + xen_state.module_info_page[xen_state.n_modules].cmdline = + xen_state.max_addr - xen_state.modules_target_start; + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + cmdline_len, PAGE_SIZE); if (size) { - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, size); if (err) goto fail; if (grub_file_read (file, get_virtual_current_address (ch), size) @@ -682,15 +697,17 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), goto fail; } } - next_start.mod_len = max_addr + size - modules_target_start; - xen_module_info_page[n_modules].mod_start = max_addr - modules_target_start; - xen_module_info_page[n_modules].mod_end = - max_addr + size - modules_target_start; + xen_state.next_start.mod_len = + xen_state.max_addr + size - xen_state.modules_target_start; + xen_state.module_info_page[xen_state.n_modules].mod_start = + xen_state.max_addr - xen_state.modules_target_start; + xen_state.module_info_page[xen_state.n_modules].mod_end = + xen_state.max_addr + size - xen_state.modules_target_start; - n_modules++; + xen_state.n_modules++; grub_dprintf ("xen", "module, addr=0x%x, size=0x%x\n", - (unsigned) max_addr, (unsigned) size); - max_addr = ALIGN_UP (max_addr + size, PAGE_SIZE); + (unsigned) xen_state.max_addr, (unsigned) size); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: From 7e5fcb0b346063e1c5af2353b82e74cf299b8b67 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:09 +0100 Subject: [PATCH 184/207] xen: add elfnote.h to avoid using numbers instead of constants Various features and parameters of a pv-kernel are specified via elf notes in the kernel image. Those notes are part of the interface between the Xen hypervisor and the kernel. Instead of using num,bers in the code when interpreting the elf notes make use of the header supplied by Xen for that purpose. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen_fileXX.c | 19 +- include/xen/elfnote.h | 281 +++++++++++++++++++++++++++++ 2 files changed, 291 insertions(+), 9 deletions(-) create mode 100644 include/xen/elfnote.h diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c index 36b40e4b0..03215cab2 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -18,6 +18,7 @@ #include #include +#include static grub_err_t parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, @@ -203,35 +204,35 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, xi->has_note = 1; switch (nh->n_type) { - case 1: + case XEN_ELFNOTE_ENTRY: xi->entry_point = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 2: + case XEN_ELFNOTE_HYPERCALL_PAGE: xi->hypercall_page = grub_le_to_cpu_addr (*(Elf_Addr *) desc); xi->has_hypercall_page = 1; break; - case 3: + case XEN_ELFNOTE_VIRT_BASE: xi->virt_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 4: + case XEN_ELFNOTE_PADDR_OFFSET: xi->paddr_offset = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 5: + case XEN_ELFNOTE_XEN_VERSION: grub_dprintf ("xen", "xenversion = `%s'\n", (char *) desc); break; - case 6: + case XEN_ELFNOTE_GUEST_OS: grub_dprintf ("xen", "name = `%s'\n", (char *) desc); break; - case 7: + case XEN_ELFNOTE_GUEST_VERSION: grub_dprintf ("xen", "version = `%s'\n", (char *) desc); break; - case 8: + case XEN_ELFNOTE_LOADER: if (descsz < 7 || grub_memcmp (desc, "generic", descsz == 7 ? 7 : 8) != 0) return grub_error (GRUB_ERR_BAD_OS, "invalid loader"); break; /* PAE */ - case 9: + case XEN_ELFNOTE_PAE_MODE: grub_dprintf ("xen", "pae = `%s', %d, %d\n", (char *) desc, xi->arch, descsz); if (xi->arch != GRUB_XEN_FILE_I386 diff --git a/include/xen/elfnote.h b/include/xen/elfnote.h new file mode 100644 index 000000000..71cd4ec52 --- /dev/null +++ b/include/xen/elfnote.h @@ -0,0 +1,281 @@ +/****************************************************************************** + * elfnote.h + * + * Definitions used for the Xen ELF notes. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Copyright (c) 2006, Ian Campbell, XenSource Ltd. + */ + +#ifndef __XEN_PUBLIC_ELFNOTE_H__ +#define __XEN_PUBLIC_ELFNOTE_H__ + +/* + * `incontents 200 elfnotes ELF notes + * + * The notes should live in a PT_NOTE segment and have "Xen" in the + * name field. + * + * Numeric types are either 4 or 8 bytes depending on the content of + * the desc field. + * + * LEGACY indicated the fields in the legacy __xen_guest string which + * this a note type replaces. + * + * String values (for non-legacy) are NULL terminated ASCII, also known + * as ASCIZ type. + */ + +/* + * NAME=VALUE pair (string). + */ +#define XEN_ELFNOTE_INFO 0 + +/* + * The virtual address of the entry point (numeric). + * + * LEGACY: VIRT_ENTRY + */ +#define XEN_ELFNOTE_ENTRY 1 + +/* The virtual address of the hypercall transfer page (numeric). + * + * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page + * number not a virtual address) + */ +#define XEN_ELFNOTE_HYPERCALL_PAGE 2 + +/* The virtual address where the kernel image should be mapped (numeric). + * + * Defaults to 0. + * + * LEGACY: VIRT_BASE + */ +#define XEN_ELFNOTE_VIRT_BASE 3 + +/* + * The offset of the ELF paddr field from the actual required + * pseudo-physical address (numeric). + * + * This is used to maintain backwards compatibility with older kernels + * which wrote __PAGE_OFFSET into that field. This field defaults to 0 + * if not present. + * + * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE) + */ +#define XEN_ELFNOTE_PADDR_OFFSET 4 + +/* + * The version of Xen that we work with (string). + * + * LEGACY: XEN_VER + */ +#define XEN_ELFNOTE_XEN_VERSION 5 + +/* + * The name of the guest operating system (string). + * + * LEGACY: GUEST_OS + */ +#define XEN_ELFNOTE_GUEST_OS 6 + +/* + * The version of the guest operating system (string). + * + * LEGACY: GUEST_VER + */ +#define XEN_ELFNOTE_GUEST_VERSION 7 + +/* + * The loader type (string). + * + * LEGACY: LOADER + */ +#define XEN_ELFNOTE_LOADER 8 + +/* + * The kernel supports PAE (x86/32 only, string = "yes", "no" or + * "bimodal"). + * + * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting + * may be given as "yes,bimodal" which will cause older Xen to treat + * this kernel as PAE. + * + * LEGACY: PAE (n.b. The legacy interface included a provision to + * indicate 'extended-cr3' support allowing L3 page tables to be + * placed above 4G. It is assumed that any kernel new enough to use + * these ELF notes will include this and therefore "yes" here is + * equivalent to "yes[entended-cr3]" in the __xen_guest interface. + */ +#define XEN_ELFNOTE_PAE_MODE 9 + +/* + * The features supported/required by this kernel (string). + * + * The string must consist of a list of feature names (as given in + * features.h, without the "XENFEAT_" prefix) separated by '|' + * characters. If a feature is required for the kernel to function + * then the feature name must be preceded by a '!' character. + * + * LEGACY: FEATURES + */ +#define XEN_ELFNOTE_FEATURES 10 + +/* + * The kernel requires the symbol table to be loaded (string = "yes" or "no") + * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence + * of this string as a boolean flag rather than requiring "yes" or + * "no". + */ +#define XEN_ELFNOTE_BSD_SYMTAB 11 + +/* + * The lowest address the hypervisor hole can begin at (numeric). + * + * This must not be set higher than HYPERVISOR_VIRT_START. Its presence + * also indicates to the hypervisor that the kernel can deal with the + * hole starting at a higher address. + */ +#define XEN_ELFNOTE_HV_START_LOW 12 + +/* + * List of maddr_t-sized mask/value pairs describing how to recognize + * (non-present) L1 page table entries carrying valid MFNs (numeric). + */ +#define XEN_ELFNOTE_L1_MFN_VALID 13 + +/* + * Whether or not the guest supports cooperative suspend cancellation. + * This is a numeric value. + * + * Default is 0 + */ +#define XEN_ELFNOTE_SUSPEND_CANCEL 14 + +/* + * The (non-default) location the initial phys-to-machine map should be + * placed at by the hypervisor (Dom0) or the tools (DomU). + * The kernel must be prepared for this mapping to be established using + * large pages, despite such otherwise not being available to guests. + * The kernel must also be able to handle the page table pages used for + * this mapping not being accessible through the initial mapping. + * (Only x86-64 supports this at present.) + */ +#define XEN_ELFNOTE_INIT_P2M 15 + +/* + * Whether or not the guest can deal with being passed an initrd not + * mapped through its initial page tables. + */ +#define XEN_ELFNOTE_MOD_START_PFN 16 + +/* + * The features supported by this kernel (numeric). + * + * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a + * kernel to specify support for features that older hypervisors don't + * know about. The set of features 4.2 and newer hypervisors will + * consider supported by the kernel is the combination of the sets + * specified through this and the string note. + * + * LEGACY: FEATURES + */ +#define XEN_ELFNOTE_SUPPORTED_FEATURES 17 + +/* + * Physical entry point into the kernel. + * + * 32bit entry point into the kernel. When requested to launch the + * guest kernel in a HVM container, Xen will use this entry point to + * launch the guest in 32bit protected mode with paging disabled. + * Ignored otherwise. + */ +#define XEN_ELFNOTE_PHYS32_ENTRY 18 + +/* + * The number of the highest elfnote defined. + */ +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY + +/* + * System information exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO + * note in case of a system crash. This note will contain various + * information about the system, see xen/include/xen/elfcore.h. + */ +#define XEN_ELFNOTE_CRASH_INFO 0x1000001 + +/* + * System registers exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS + * note per cpu in case of a system crash. This note is architecture + * specific and will contain registers not saved in the "CORE" note. + * See xen/include/xen/elfcore.h for more information. + */ +#define XEN_ELFNOTE_CRASH_REGS 0x1000002 + + +/* + * xen dump-core none note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE + * in its dump file to indicate that the file is xen dump-core + * file. This note doesn't have any other information. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000 + +/* + * xen dump-core header note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER + * in its dump file. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001 + +/* + * xen dump-core xen version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION + * in its dump file. It contains the xen version obtained via the + * XENVER hypercall. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002 + +/* + * xen dump-core format version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION + * in its dump file. It contains a format version identifier. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003 + +#endif /* __XEN_PUBLIC_ELFNOTE_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ From 72c28509fa60289391b9a865507635a6d261c6b3 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:10 +0100 Subject: [PATCH 185/207] xen: synchronize xen header Get actual version of include/xen/xen.h from the Xen repository in order to be able to use constants defined there. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- include/xen/arch-x86/xen-x86_32.h | 22 +++--- include/xen/arch-x86/xen-x86_64.h | 8 +- include/xen/xen.h | 125 ++++++++++++++++++++++-------- 3 files changed, 105 insertions(+), 50 deletions(-) diff --git a/include/xen/arch-x86/xen-x86_32.h b/include/xen/arch-x86/xen-x86_32.h index 15041911e..7eca6cd41 100644 --- a/include/xen/arch-x86/xen-x86_32.h +++ b/include/xen/arch-x86/xen-x86_32.h @@ -58,34 +58,31 @@ #define __HYPERVISOR_VIRT_START_PAE 0xF5800000 #define __MACH2PHYS_VIRT_START_PAE 0xF5800000 #define __MACH2PHYS_VIRT_END_PAE 0xF6800000 -#define HYPERVISOR_VIRT_START_PAE \ - mk_unsigned_long(__HYPERVISOR_VIRT_START_PAE) -#define MACH2PHYS_VIRT_START_PAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_START_PAE) -#define MACH2PHYS_VIRT_END_PAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_END_PAE) +#define HYPERVISOR_VIRT_START_PAE xen_mk_ulong(__HYPERVISOR_VIRT_START_PAE) +#define MACH2PHYS_VIRT_START_PAE xen_mk_ulong(__MACH2PHYS_VIRT_START_PAE) +#define MACH2PHYS_VIRT_END_PAE xen_mk_ulong(__MACH2PHYS_VIRT_END_PAE) /* Non-PAE bounds are obsolete. */ #define __HYPERVISOR_VIRT_START_NONPAE 0xFC000000 #define __MACH2PHYS_VIRT_START_NONPAE 0xFC000000 #define __MACH2PHYS_VIRT_END_NONPAE 0xFC400000 #define HYPERVISOR_VIRT_START_NONPAE \ - mk_unsigned_long(__HYPERVISOR_VIRT_START_NONPAE) + xen_mk_ulong(__HYPERVISOR_VIRT_START_NONPAE) #define MACH2PHYS_VIRT_START_NONPAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_START_NONPAE) + xen_mk_ulong(__MACH2PHYS_VIRT_START_NONPAE) #define MACH2PHYS_VIRT_END_NONPAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_END_NONPAE) + xen_mk_ulong(__MACH2PHYS_VIRT_END_NONPAE) #define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_PAE #define __MACH2PHYS_VIRT_START __MACH2PHYS_VIRT_START_PAE #define __MACH2PHYS_VIRT_END __MACH2PHYS_VIRT_END_PAE #ifndef HYPERVISOR_VIRT_START -#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) +#define HYPERVISOR_VIRT_START xen_mk_ulong(__HYPERVISOR_VIRT_START) #endif -#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) -#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) +#define MACH2PHYS_VIRT_START xen_mk_ulong(__MACH2PHYS_VIRT_START) +#define MACH2PHYS_VIRT_END xen_mk_ulong(__MACH2PHYS_VIRT_END) #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>2) #ifndef machine_to_phys_mapping #define machine_to_phys_mapping ((unsigned long *)MACH2PHYS_VIRT_START) @@ -104,6 +101,7 @@ do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0; \ (hnd).p = val; \ } while ( 0 ) +#define int64_aligned_t int64_t __attribute__((aligned(8))) #define uint64_aligned_t uint64_t __attribute__((aligned(8))) #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name) diff --git a/include/xen/arch-x86/xen-x86_64.h b/include/xen/arch-x86/xen-x86_64.h index 1c4e1590f..5e18613bd 100644 --- a/include/xen/arch-x86/xen-x86_64.h +++ b/include/xen/arch-x86/xen-x86_64.h @@ -76,12 +76,12 @@ #define __MACH2PHYS_VIRT_END 0xFFFF804000000000 #ifndef HYPERVISOR_VIRT_START -#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) -#define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END) +#define HYPERVISOR_VIRT_START xen_mk_ulong(__HYPERVISOR_VIRT_START) +#define HYPERVISOR_VIRT_END xen_mk_ulong(__HYPERVISOR_VIRT_END) #endif -#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) -#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) +#define MACH2PHYS_VIRT_START xen_mk_ulong(__MACH2PHYS_VIRT_START) +#define MACH2PHYS_VIRT_END xen_mk_ulong(__MACH2PHYS_VIRT_END) #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3) #ifndef machine_to_phys_mapping #define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START) diff --git a/include/xen/xen.h b/include/xen/xen.h index a6a20926a..6c9e42b2b 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -52,6 +52,19 @@ DEFINE_XEN_GUEST_HANDLE(void); DEFINE_XEN_GUEST_HANDLE(uint64_t); DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); + +/* Turn a plain number into a C unsigned (long) constant. */ +#define __xen_mk_uint(x) x ## U +#define __xen_mk_ulong(x) x ## UL +#define xen_mk_uint(x) __xen_mk_uint(x) +#define xen_mk_ulong(x) __xen_mk_ulong(x) + +#else + +/* In assembly code we cannot use C numeric constant suffixes. */ +#define xen_mk_uint(x) x +#define xen_mk_ulong(x) x + #endif /* @@ -101,6 +114,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); #define __HYPERVISOR_kexec_op 37 #define __HYPERVISOR_tmem_op 38 #define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */ +#define __HYPERVISOR_xenpmu_op 40 /* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48 @@ -160,6 +174,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); #define VIRQ_MEM_EVENT 10 /* G. (DOM0) A memory event has occured */ #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient */ #define VIRQ_ENOMEM 12 /* G. (DOM0) Low on heap memory */ +#define VIRQ_XENPMU 13 /* V. PMC interrupt */ /* Architecture-specific VIRQ definitions. */ #define VIRQ_ARCH_0 16 @@ -449,13 +464,13 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */ /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */ /* ` enum uvm_flags { */ -#define UVMF_NONE (0UL<<0) /* No flushing at all. */ -#define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */ -#define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */ -#define UVMF_FLUSHTYPE_MASK (3UL<<0) -#define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */ -#define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */ -#define UVMF_ALL (1UL<<2) /* Flush all TLBs. */ +#define UVMF_NONE (xen_mk_ulong(0)<<0) /* No flushing at all. */ +#define UVMF_TLB_FLUSH (xen_mk_ulong(1)<<0) /* Flush entire TLB(s). */ +#define UVMF_INVLPG (xen_mk_ulong(2)<<0) /* Flush only one entry. */ +#define UVMF_FLUSHTYPE_MASK (xen_mk_ulong(3)<<0) +#define UVMF_MULTI (xen_mk_ulong(0)<<2) /* Flush subset of TLBs. */ +#define UVMF_LOCAL (xen_mk_ulong(0)<<2) /* Flush local TLB. */ +#define UVMF_ALL (xen_mk_ulong(1)<<2) /* Flush all TLBs. */ /* ` } */ /* @@ -486,17 +501,27 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* x86/PAE guests: support PDPTs above 4GB. */ #define VMASST_TYPE_pae_extended_cr3 3 +/* + * x86/64 guests: strictly hide M2P from user mode. + * This allows the guest to control respective hypervisor behavior: + * - when not set, L4 tables get created with the respective slot blank, + * and whenever the L4 table gets used as a kernel one the missing + * mapping gets inserted, + * - when set, L4 tables get created with the respective slot initialized + * as before, and whenever the L4 table gets used as a user one the + * mapping gets zapped. + */ +#define VMASST_TYPE_m2p_strict 32 + +#if __XEN_INTERFACE_VERSION__ < 0x00040600 #define MAX_VMASST_TYPE 3 - -#ifndef __ASSEMBLY__ - -typedef uint16_t domid_t; +#endif /* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */ -#define DOMID_FIRST_RESERVED (0x7FF0U) +#define DOMID_FIRST_RESERVED xen_mk_uint(0x7FF0) /* DOMID_SELF is used in certain contexts to refer to oneself. */ -#define DOMID_SELF (0x7FF0U) +#define DOMID_SELF xen_mk_uint(0x7FF0) /* * DOMID_IO is used to restrict page-table updates to mapping I/O memory. @@ -507,7 +532,7 @@ typedef uint16_t domid_t; * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can * be specified by any calling domain. */ -#define DOMID_IO (0x7FF1U) +#define DOMID_IO xen_mk_uint(0x7FF1) /* * DOMID_XEN is used to allow privileged domains to map restricted parts of @@ -515,17 +540,21 @@ typedef uint16_t domid_t; * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if * the caller is privileged. */ -#define DOMID_XEN (0x7FF2U) +#define DOMID_XEN xen_mk_uint(0x7FF2) /* * DOMID_COW is used as the owner of sharable pages */ -#define DOMID_COW (0x7FF3U) +#define DOMID_COW xen_mk_uint(0x7FF3) /* DOMID_INVALID is used to identify pages with unknown owner. */ -#define DOMID_INVALID (0x7FF4U) +#define DOMID_INVALID xen_mk_uint(0x7FF4) /* Idle domain. */ -#define DOMID_IDLE (0x7FFFU) +#define DOMID_IDLE xen_mk_uint(0x7FFF) + +#ifndef __ASSEMBLY__ + +typedef uint16_t domid_t; /* * Send an array of these to HYPERVISOR_mmu_update(). @@ -682,6 +711,12 @@ struct shared_info { uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */ uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */ uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */ +#if !defined(__i386__) + uint32_t wc_sec_hi; +# define xen_wc_sec_hi wc_sec_hi +#elif !defined(__XEN__) && !defined(__XEN_TOOLS__) +# define xen_wc_sec_hi arch.wc_sec_hi +#endif struct arch_shared_info arch; @@ -698,24 +733,27 @@ typedef struct shared_info shared_info_t; * 3. This the order of bootstrap elements in the initial virtual region: * a. relocated kernel image * b. initial ram disk [mod_start, mod_len] + * (may be omitted) * c. list of allocated page frames [mfn_list, nr_pages] * (unless relocated due to XEN_ELFNOTE_INIT_P2M) * d. start_info_t structure [register ESI (x86)] - * e. bootstrap page tables [pt_base and CR3 (x86)] - * f. bootstrap stack [register ESP (x86)] + * in case of dom0 this page contains the console info, too + * e. unless dom0: xenstore ring page + * f. unless dom0: console ring page + * g. bootstrap page tables [pt_base and CR3 (x86)] + * h. bootstrap stack [register ESP (x86)] * 4. Bootstrap elements are packed together, but each is 4kB-aligned. - * 5. The initial ram disk may be omitted. - * 6. The list of page frames forms a contiguous 'pseudo-physical' memory + * 5. The list of page frames forms a contiguous 'pseudo-physical' memory * layout for the domain. In particular, the bootstrap virtual-memory * region is a 1:1 mapping to the first section of the pseudo-physical map. - * 7. All bootstrap elements are mapped read-writable for the guest OS. The + * 6. All bootstrap elements are mapped read-writable for the guest OS. The * only exception is the bootstrap page table, which is mapped read-only. - * 8. There is guaranteed to be at least 512kB padding after the final + * 7. There is guaranteed to be at least 512kB padding after the final * bootstrap element. If necessary, the bootstrap virtual region is * extended by an extra 4MB to ensure this. * * Note: Prior to 25833:bb85bbccb1c9. ("x86/32-on-64 adjust Dom0 initial page - * table layout") a bug caused the pt_base (3.e above) and cr3 to not point + * table layout") a bug caused the pt_base (3.g above) and cr3 to not point * to the start of the guest page tables (it was offset by two pages). * This only manifested itself on 32-on-64 dom0 kernels and not 32-on-64 domU * or 64-bit kernels of any colour. The page tables for a 32-on-64 dom0 got @@ -759,6 +797,29 @@ struct start_info { }; typedef struct start_info start_info_t; +/* + * Start of day structure passed to PVH guests in %ebx. + * + * NOTE: nothing will be loaded at physical address 0, so + * a 0 value in any of the address fields should be treated + * as not present. + */ +struct hvm_start_info { +#define HVM_START_MAGIC_VALUE 0x336ec578 + uint32_t magic; /* Contains the magic value 0x336ec578 */ + /* ("xEn3" with the 0x80 bit of the "E" set).*/ + uint32_t flags; /* SIF_xxx flags. */ + uint32_t cmdline_paddr; /* Physical address of the command line. */ + uint32_t nr_modules; /* Number of modules passed to the kernel. */ + uint32_t modlist_paddr; /* Physical address of an array of */ + /* hvm_modlist_entry. */ +}; + +struct hvm_modlist_entry { + uint32_t paddr; /* Physical address of the module. */ + uint32_t size; /* Size of the module in bytes. */ +}; + /* New console union for dom0 introduced in 0x00030203. */ #if __XEN_INTERFACE_VERSION__ < 0x00030203 #define console_mfn console.domU.mfn @@ -771,6 +832,8 @@ typedef struct start_info start_info_t; #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ #define SIF_MULTIBOOT_MOD (1<<2) /* Is mod_start a multiboot module? */ #define SIF_MOD_START_PFN (1<<3) /* Is mod_start a PFN? */ +#define SIF_VIRT_P2M_4TOOLS (1<<4) /* Do Xen tools understand a virt. mapped */ + /* P->M making the 3 level tree obsolete? */ #define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */ /* @@ -851,25 +914,19 @@ typedef struct dom0_vga_console_info { typedef uint8_t xen_domain_handle_t[16]; -/* Turn a plain number into a C unsigned long constant. */ -#define __mk_unsigned_long(x) x ## UL -#define mk_unsigned_long(x) __mk_unsigned_long(x) - __DEFINE_XEN_GUEST_HANDLE(uint8, uint8_t); __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); -#else /* __ASSEMBLY__ */ - -/* In assembly code we cannot use C numeric constant suffixes. */ -#define mk_unsigned_long(x) x - #endif /* !__ASSEMBLY__ */ /* Default definitions for macros used by domctl/sysctl. */ #if defined(__XEN__) || defined(__XEN_TOOLS__) +#ifndef int64_aligned_t +#define int64_aligned_t int64_t +#endif #ifndef uint64_aligned_t #define uint64_aligned_t uint64_t #endif From c221ea06b5ed13b51dda8e32d620a7ca2d555a8f Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:11 +0100 Subject: [PATCH 186/207] xen: factor out p2m list allocation into separate function Do the p2m list allocation of the to be loaded kernel in a separate function. This will allow doing the p2m list allocation at different times of the boot preparations depending on the features the kernel is supporting. While at this remove superfluous setting of first_p2m_pfn and nr_p2m_frames as those are needed only in case of the p2m list not being mapped by the initial kernel mapping. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 87 +++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index 691c22e8a..a2fd1f60a 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -44,8 +44,10 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct xen_loader_state { struct grub_relocator *relocator; + struct grub_relocator_xen_state state; struct start_info next_start; struct grub_xen_file_info xen_inf; + grub_xen_mfn_t *virt_mfn_list; grub_uint64_t max_addr; struct xen_multiboot_mod_list *module_info_page; grub_uint64_t modules_target_start; @@ -170,7 +172,7 @@ generate_page_table (grub_uint64_t *where, grub_uint64_t paging_start, } static grub_err_t -set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) +set_mfns (grub_xen_mfn_t pfn) { grub_xen_mfn_t i, t; grub_xen_mfn_t cn_pfn = -1, st_pfn = -1; @@ -179,32 +181,34 @@ set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) for (i = 0; i < grub_xen_start_page_addr->nr_pages; i++) { - if (new_mfn_list[i] == grub_xen_start_page_addr->console.domU.mfn) + if (xen_state.virt_mfn_list[i] == + grub_xen_start_page_addr->console.domU.mfn) cn_pfn = i; - if (new_mfn_list[i] == grub_xen_start_page_addr->store_mfn) + if (xen_state.virt_mfn_list[i] == grub_xen_start_page_addr->store_mfn) st_pfn = i; } if (cn_pfn == (grub_xen_mfn_t)-1) return grub_error (GRUB_ERR_BUG, "no console"); if (st_pfn == (grub_xen_mfn_t)-1) return grub_error (GRUB_ERR_BUG, "no store"); - t = new_mfn_list[pfn]; - new_mfn_list[pfn] = new_mfn_list[cn_pfn]; - new_mfn_list[cn_pfn] = t; - t = new_mfn_list[pfn + 1]; - new_mfn_list[pfn + 1] = new_mfn_list[st_pfn]; - new_mfn_list[st_pfn] = t; + t = xen_state.virt_mfn_list[pfn]; + xen_state.virt_mfn_list[pfn] = xen_state.virt_mfn_list[cn_pfn]; + xen_state.virt_mfn_list[cn_pfn] = t; + t = xen_state.virt_mfn_list[pfn + 1]; + xen_state.virt_mfn_list[pfn + 1] = xen_state.virt_mfn_list[st_pfn]; + xen_state.virt_mfn_list[st_pfn] = t; - m2p_updates[0].ptr = page2offset (new_mfn_list[pfn]) | MMU_MACHPHYS_UPDATE; + m2p_updates[0].ptr = + page2offset (xen_state.virt_mfn_list[pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[0].val = pfn; m2p_updates[1].ptr = - page2offset (new_mfn_list[pfn + 1]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[pfn + 1]) | MMU_MACHPHYS_UPDATE; m2p_updates[1].val = pfn + 1; m2p_updates[2].ptr = - page2offset (new_mfn_list[cn_pfn]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[cn_pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[2].val = cn_pfn; m2p_updates[3].ptr = - page2offset (new_mfn_list[st_pfn]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[st_pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[3].val = st_pfn; grub_xen_mmu_update (m2p_updates, 4, NULL, DOMID_SELF); @@ -212,44 +216,53 @@ set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) return GRUB_ERR_NONE; } +static grub_err_t +grub_xen_p2m_alloc (void) +{ + grub_relocator_chunk_t ch; + grub_size_t p2msize; + grub_err_t err; + + xen_state.state.mfn_list = xen_state.max_addr; + xen_state.next_start.mfn_list = + xen_state.max_addr + xen_state.xen_inf.virt_base; + p2msize = sizeof (grub_xen_mfn_t) * grub_xen_start_page_addr->nr_pages; + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, p2msize); + if (err) + return err; + xen_state.virt_mfn_list = get_virtual_current_address (ch); + grub_memcpy (xen_state.virt_mfn_list, + (void *) grub_xen_start_page_addr->mfn_list, p2msize); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + p2msize, PAGE_SIZE); + + return GRUB_ERR_NONE; +} + static grub_err_t grub_xen_boot (void) { - struct grub_relocator_xen_state state; grub_relocator_chunk_t ch; grub_err_t err; - grub_size_t pgtsize; struct start_info *nst; grub_uint64_t nr_info_pages; grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; struct gnttab_set_version gnttab_setver; - grub_xen_mfn_t *new_mfn_list; grub_size_t i; if (grub_xen_n_allocated_shared_pages) return grub_error (GRUB_ERR_BUG, "active grants"); - state.mfn_list = xen_state.max_addr; - xen_state.next_start.mfn_list = - xen_state.max_addr + xen_state.xen_inf.virt_base; - xen_state.next_start.first_p2m_pfn = xen_state.max_addr >> PAGE_SHIFT; - pgtsize = sizeof (grub_xen_mfn_t) * grub_xen_start_page_addr->nr_pages; - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, - xen_state.max_addr, pgtsize); - xen_state.next_start.nr_p2m_frames = (pgtsize + PAGE_SIZE - 1) >> PAGE_SHIFT; + err = grub_xen_p2m_alloc (); if (err) return err; - new_mfn_list = get_virtual_current_address (ch); - grub_memcpy (new_mfn_list, - (void *) grub_xen_start_page_addr->mfn_list, pgtsize); - xen_state.max_addr = ALIGN_UP (xen_state.max_addr + pgtsize, PAGE_SIZE); err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, sizeof (xen_state.next_start)); if (err) return err; - state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; nst = get_virtual_current_address (ch); xen_state.max_addr = ALIGN_UP (xen_state.max_addr + sizeof (xen_state.next_start), PAGE_SIZE); @@ -262,14 +275,14 @@ grub_xen_boot (void) xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; - err = set_mfns (new_mfn_list, xen_state.max_addr >> PAGE_SHIFT); + err = set_mfns (xen_state.max_addr >> PAGE_SHIFT); if (err) return err; xen_state.max_addr += 2 * PAGE_SIZE; xen_state.next_start.pt_base = xen_state.max_addr + xen_state.xen_inf.virt_base; - state.paging_start = xen_state.max_addr >> PAGE_SHIFT; + xen_state.state.paging_start = xen_state.max_addr >> PAGE_SHIFT; nr_info_pages = xen_state.max_addr >> PAGE_SHIFT; nr_pages = nr_info_pages; @@ -298,15 +311,15 @@ grub_xen_boot (void) generate_page_table (get_virtual_current_address (ch), xen_state.max_addr >> PAGE_SHIFT, nr_pages, - xen_state.xen_inf.virt_base, new_mfn_list); + xen_state.xen_inf.virt_base, xen_state.virt_mfn_list); xen_state.max_addr += page2offset (nr_pt_pages); - state.stack = xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; - state.entry_point = xen_state.xen_inf.entry_point; + xen_state.state.stack = + xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; + xen_state.state.entry_point = xen_state.xen_inf.entry_point; - xen_state.next_start.nr_p2m_frames += nr_pt_pages; xen_state.next_start.nr_pt_frames = nr_pt_pages; - state.paging_size = nr_pt_pages; + xen_state.state.paging_size = nr_pt_pages; *nst = xen_state.next_start; @@ -318,7 +331,7 @@ grub_xen_boot (void) for (i = 0; i < ARRAY_SIZE (grub_xen_shared_info->evtchn_pending); i++) grub_xen_shared_info->evtchn_pending[i] = 0; - return grub_relocator_xen_boot (xen_state.relocator, state, nr_pages, + return grub_relocator_xen_boot (xen_state.relocator, xen_state.state, nr_pages, xen_state.xen_inf.virt_base < PAGE_SIZE ? page2offset (nr_pages) : 0, nr_pages - 1, From 1fbb2b4b390dd33b808b119eaac35a38105b114a Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:12 +0100 Subject: [PATCH 187/207] xen: factor out allocation of special pages into separate function Do the allocation of special pages (start info, console and xenbus ring buffers) in a separate function. This will allow to do the allocation at different times of the boot preparations depending on the features the kernel is supporting. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 60 +++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index a2fd1f60a..a80c0f8b2 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -48,6 +48,8 @@ struct xen_loader_state { struct start_info next_start; struct grub_xen_file_info xen_inf; grub_xen_mfn_t *virt_mfn_list; + struct start_info *virt_start_info; + grub_xen_mfn_t console_pfn; grub_uint64_t max_addr; struct xen_multiboot_mod_list *module_info_page; grub_uint64_t modules_target_start; @@ -239,12 +241,40 @@ grub_xen_p2m_alloc (void) return GRUB_ERR_NONE; } +static grub_err_t +grub_xen_special_alloc (void) +{ + grub_relocator_chunk_t ch; + grub_err_t err; + + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, + sizeof (xen_state.next_start)); + if (err) + return err; + xen_state.state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.virt_start_info = get_virtual_current_address (ch); + xen_state.max_addr = + ALIGN_UP (xen_state.max_addr + sizeof (xen_state.next_start), PAGE_SIZE); + xen_state.console_pfn = xen_state.max_addr >> PAGE_SHIFT; + xen_state.max_addr += 2 * PAGE_SIZE; + + xen_state.next_start.nr_pages = grub_xen_start_page_addr->nr_pages; + grub_memcpy (xen_state.next_start.magic, grub_xen_start_page_addr->magic, + sizeof (xen_state.next_start.magic)); + xen_state.next_start.store_mfn = grub_xen_start_page_addr->store_mfn; + xen_state.next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; + xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; + xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; + + return GRUB_ERR_NONE; +} + static grub_err_t grub_xen_boot (void) { grub_relocator_chunk_t ch; grub_err_t err; - struct start_info *nst; grub_uint64_t nr_info_pages; grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; struct gnttab_set_version gnttab_setver; @@ -256,29 +286,9 @@ grub_xen_boot (void) err = grub_xen_p2m_alloc (); if (err) return err; - - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, - xen_state.max_addr, - sizeof (xen_state.next_start)); + err = grub_xen_special_alloc (); if (err) return err; - xen_state.state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; - nst = get_virtual_current_address (ch); - xen_state.max_addr = - ALIGN_UP (xen_state.max_addr + sizeof (xen_state.next_start), PAGE_SIZE); - - xen_state.next_start.nr_pages = grub_xen_start_page_addr->nr_pages; - grub_memcpy (xen_state.next_start.magic, grub_xen_start_page_addr->magic, - sizeof (xen_state.next_start.magic)); - xen_state.next_start.store_mfn = grub_xen_start_page_addr->store_mfn; - xen_state.next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; - xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; - xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; - - err = set_mfns (xen_state.max_addr >> PAGE_SHIFT); - if (err) - return err; - xen_state.max_addr += 2 * PAGE_SIZE; xen_state.next_start.pt_base = xen_state.max_addr + xen_state.xen_inf.virt_base; @@ -309,6 +319,10 @@ grub_xen_boot (void) if (err) return err; + err = set_mfns (xen_state.console_pfn); + if (err) + return err; + generate_page_table (get_virtual_current_address (ch), xen_state.max_addr >> PAGE_SHIFT, nr_pages, xen_state.xen_inf.virt_base, xen_state.virt_mfn_list); @@ -321,7 +335,7 @@ grub_xen_boot (void) xen_state.next_start.nr_pt_frames = nr_pt_pages; xen_state.state.paging_size = nr_pt_pages; - *nst = xen_state.next_start; + *xen_state.virt_start_info = xen_state.next_start; grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); From d73976fdffe067262b0f7ca69010be13e4c9f638 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:13 +0100 Subject: [PATCH 188/207] xen: factor out allocation of page tables into separate function Do the allocation of page tables in a separate function. This will allow to do the allocation at different times of the boot preparations depending on the features the kernel is supporting. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 85 +++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index a80c0f8b2..2e127637a 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -51,6 +51,9 @@ struct xen_loader_state { struct start_info *virt_start_info; grub_xen_mfn_t console_pfn; grub_uint64_t max_addr; + grub_uint64_t *virt_pgtable; + grub_uint64_t pgtbl_start; + grub_uint64_t pgtbl_end; struct xen_multiboot_mod_list *module_info_page; grub_uint64_t modules_target_start; grub_size_t n_modules; @@ -110,17 +113,17 @@ get_pgtable_size (grub_uint64_t total_pages, grub_uint64_t virt_base) static void generate_page_table (grub_uint64_t *where, grub_uint64_t paging_start, - grub_uint64_t total_pages, grub_uint64_t virt_base, - grub_xen_mfn_t *mfn_list) + grub_uint64_t paging_end, grub_uint64_t total_pages, + grub_uint64_t virt_base, grub_xen_mfn_t *mfn_list) { if (!virt_base) - total_pages++; + paging_end++; grub_uint64_t lx[NUMBER_OF_LEVELS], lxs[NUMBER_OF_LEVELS]; grub_uint64_t nlx, nls, sz = 0; int l; - nlx = total_pages; + nlx = paging_end; nls = virt_base >> PAGE_SHIFT; for (l = 0; l < NUMBER_OF_LEVELS; l++) { @@ -164,7 +167,7 @@ generate_page_table (grub_uint64_t *where, grub_uint64_t paging_start, if (pr) pg += POINTERS_PER_PAGE; - for (j = 0; j < total_pages; j++) + for (j = 0; j < paging_end; j++) { if (j >= paging_start && j < lp) pg[j + lxs[0]] = page2offset (mfn_list[j]) | 5; @@ -271,24 +274,12 @@ grub_xen_special_alloc (void) } static grub_err_t -grub_xen_boot (void) +grub_xen_pt_alloc (void) { grub_relocator_chunk_t ch; grub_err_t err; grub_uint64_t nr_info_pages; grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; - struct gnttab_set_version gnttab_setver; - grub_size_t i; - - if (grub_xen_n_allocated_shared_pages) - return grub_error (GRUB_ERR_BUG, "active grants"); - - err = grub_xen_p2m_alloc (); - if (err) - return err; - err = grub_xen_special_alloc (); - if (err) - return err; xen_state.next_start.pt_base = xen_state.max_addr + xen_state.xen_inf.virt_base; @@ -309,32 +300,62 @@ grub_xen_boot (void) nr_pages = nr_need_pages; } - grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", - (unsigned long long) xen_state.xen_inf.virt_base, - (unsigned long long) page2offset (nr_pages)); - err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, page2offset (nr_pt_pages)); if (err) return err; + xen_state.virt_pgtable = get_virtual_current_address (ch); + xen_state.pgtbl_start = xen_state.max_addr >> PAGE_SHIFT; + xen_state.max_addr += page2offset (nr_pt_pages); + xen_state.state.stack = + xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; + xen_state.state.paging_size = nr_pt_pages; + xen_state.next_start.nr_pt_frames = nr_pt_pages; + xen_state.max_addr = page2offset (nr_pages); + xen_state.pgtbl_end = nr_pages; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_xen_boot (void) +{ + grub_err_t err; + grub_uint64_t nr_pages; + struct gnttab_set_version gnttab_setver; + grub_size_t i; + + if (grub_xen_n_allocated_shared_pages) + return grub_error (GRUB_ERR_BUG, "active grants"); + + err = grub_xen_p2m_alloc (); + if (err) + return err; + err = grub_xen_special_alloc (); + if (err) + return err; + err = grub_xen_pt_alloc (); + if (err) + return err; + err = set_mfns (xen_state.console_pfn); if (err) return err; - generate_page_table (get_virtual_current_address (ch), - xen_state.max_addr >> PAGE_SHIFT, nr_pages, + nr_pages = xen_state.max_addr >> PAGE_SHIFT; + + grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", + (unsigned long long) xen_state.xen_inf.virt_base, + (unsigned long long) page2offset (nr_pages)); + + generate_page_table (xen_state.virt_pgtable, xen_state.pgtbl_start, + xen_state.pgtbl_end, nr_pages, xen_state.xen_inf.virt_base, xen_state.virt_mfn_list); - xen_state.max_addr += page2offset (nr_pt_pages); - xen_state.state.stack = - xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; xen_state.state.entry_point = xen_state.xen_inf.entry_point; - xen_state.next_start.nr_pt_frames = nr_pt_pages; - xen_state.state.paging_size = nr_pt_pages; - *xen_state.virt_start_info = xen_state.next_start; grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); @@ -348,8 +369,8 @@ grub_xen_boot (void) return grub_relocator_xen_boot (xen_state.relocator, xen_state.state, nr_pages, xen_state.xen_inf.virt_base < PAGE_SIZE ? page2offset (nr_pages) : 0, - nr_pages - 1, - page2offset (nr_pages - 1) + + xen_state.pgtbl_end - 1, + page2offset (xen_state.pgtbl_end - 1) + xen_state.xen_inf.virt_base); } From 5500cefccd6341d6bdaa800211582f2be8a85a26 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:14 +0100 Subject: [PATCH 189/207] xen: add capability to load initrd outside of initial mapping Modern pvops linux kernels support an initrd not covered by the initial mapping. This capability is flagged by an elf-note. In case the elf-note is set by the kernel don't place the initrd into the initial mapping. This will allow to load larger initrds and/or support domains with larger memory, as the initial mapping is limited to 2GB and it is containing the p2m list. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 60 ++++++++++++++++++++++++------ grub-core/loader/i386/xen_fileXX.c | 3 ++ include/grub/xen_file.h | 1 + 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index 2e127637a..9639ca159 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -228,6 +228,9 @@ grub_xen_p2m_alloc (void) grub_size_t p2msize; grub_err_t err; + if (xen_state.virt_mfn_list) + return GRUB_ERR_NONE; + xen_state.state.mfn_list = xen_state.max_addr; xen_state.next_start.mfn_list = xen_state.max_addr + xen_state.xen_inf.virt_base; @@ -250,6 +253,9 @@ grub_xen_special_alloc (void) grub_relocator_chunk_t ch; grub_err_t err; + if (xen_state.virt_start_info) + return GRUB_ERR_NONE; + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, sizeof (xen_state.next_start)); @@ -281,6 +287,9 @@ grub_xen_pt_alloc (void) grub_uint64_t nr_info_pages; grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; + if (xen_state.virt_pgtable) + return GRUB_ERR_NONE; + xen_state.next_start.pt_base = xen_state.max_addr + xen_state.xen_inf.virt_base; xen_state.state.paging_start = xen_state.max_addr >> PAGE_SHIFT; @@ -319,6 +328,25 @@ grub_xen_pt_alloc (void) return GRUB_ERR_NONE; } +/* Allocate all not yet allocated areas mapped by initial page tables. */ +static grub_err_t +grub_xen_alloc_boot_data (void) +{ + grub_err_t err; + + err = grub_xen_p2m_alloc (); + if (err) + return err; + err = grub_xen_special_alloc (); + if (err) + return err; + err = grub_xen_pt_alloc (); + if (err) + return err; + + return GRUB_ERR_NONE; +} + static grub_err_t grub_xen_boot (void) { @@ -330,13 +358,7 @@ grub_xen_boot (void) if (grub_xen_n_allocated_shared_pages) return grub_error (GRUB_ERR_BUG, "active grants"); - err = grub_xen_p2m_alloc (); - if (err) - return err; - err = grub_xen_special_alloc (); - if (err) - return err; - err = grub_xen_pt_alloc (); + err = grub_xen_alloc_boot_data (); if (err) return err; @@ -610,6 +632,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } + if (xen_state.xen_inf.unmapped_initrd) + { + err = grub_xen_alloc_boot_data (); + if (err) + goto fail; + } + if (grub_initrd_init (argc, argv, &initrd_ctx)) goto fail; @@ -627,14 +656,22 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - xen_state.next_start.mod_start = - xen_state.max_addr + xen_state.xen_inf.virt_base; xen_state.next_start.mod_len = size; - xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); + if (xen_state.xen_inf.unmapped_initrd) + { + xen_state.next_start.flags |= SIF_MOD_START_PFN; + xen_state.next_start.mod_start = xen_state.max_addr >> PAGE_SHIFT; + } + else + xen_state.next_start.mod_start = + xen_state.max_addr + xen_state.xen_inf.virt_base; grub_dprintf ("xen", "Initrd, addr=0x%x, size=0x%x\n", - (unsigned) xen_state.next_start.mod_start, (unsigned) size); + (unsigned) (xen_state.max_addr + xen_state.xen_inf.virt_base), + (unsigned) size); + + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: grub_initrd_close (&initrd_ctx); @@ -686,6 +723,7 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), if (!xen_state.module_info_page) { + xen_state.xen_inf.unmapped_initrd = 0; xen_state.n_modules = 0; xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); xen_state.modules_target_start = xen_state.max_addr; diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c index 03215cab2..8751174cf 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -261,6 +261,9 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, descsz == 2 ? 2 : 3) == 0) xi->arch = GRUB_XEN_FILE_I386; break; + case XEN_ELFNOTE_MOD_START_PFN: + xi->unmapped_initrd = !!grub_le_to_cpu32(*(grub_uint32_t *) desc); + break; default: grub_dprintf ("xen", "unknown note type %d\n", nh->n_type); break; diff --git a/include/grub/xen_file.h b/include/grub/xen_file.h index 4b2ccba78..ed749fafe 100644 --- a/include/grub/xen_file.h +++ b/include/grub/xen_file.h @@ -36,6 +36,7 @@ struct grub_xen_file_info int has_note; int has_xen_guest; int extended_cr3; + int unmapped_initrd; enum { GRUB_XEN_FILE_I386 = 1, From b67a95ecad9fd815ac39a5cbade93358975aa0f1 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:15 +0100 Subject: [PATCH 190/207] xen: modify page table construction Modify the page table construction to allow multiple virtual regions to be mapped. This is done as preparation for removing the p2m list from the initial kernel mapping in order to support huge pv domains. This allows a cleaner approach for mapping the relocator page by using this capability. The interface to the assembler level of the relocator has to be changed in order to be able to process multiple page table areas. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/lib/i386/xen/relocator.S | 87 ++++--- grub-core/lib/x86_64/xen/relocator.S | 134 +++++------ grub-core/lib/xen/relocator.c | 28 ++- grub-core/loader/i386/xen.c | 329 ++++++++++++++++++--------- include/grub/i386/memory.h | 7 + include/grub/xen/relocator.h | 6 +- 6 files changed, 358 insertions(+), 233 deletions(-) diff --git a/grub-core/lib/i386/xen/relocator.S b/grub-core/lib/i386/xen/relocator.S index 694a54c85..f1c729e8c 100644 --- a/grub-core/lib/i386/xen/relocator.S +++ b/grub-core/lib/i386/xen/relocator.S @@ -16,6 +16,8 @@ * along with GRUB. If not, see . */ +#include +#include #include #include @@ -23,78 +25,86 @@ VARIABLE(grub_relocator_xen_remap_start) LOCAL(base): - /* mov imm32, %ebx */ + /* Remap the remapper to it's new address. */ + /* mov imm32, %ebx - %ebx: new virtual address of remapper */ .byte 0xbb VARIABLE(grub_relocator_xen_remapper_virt) .long 0 - /* mov imm32, %ecx */ + /* mov imm32, %ecx - %ecx: low part of page table entry */ .byte 0xb9 VARIABLE(grub_relocator_xen_remapper_map) .long 0 - /* mov imm32, %edx */ + /* mov imm32, %edx - %edx: high part of page table entry */ .byte 0xba VARIABLE(grub_relocator_xen_remapper_map_high) .long 0 - movl %ebx, %ebp + movl %ebx, %ebp /* %ebx is clobbered by hypercall */ - movl $2, %esi + movl $UVMF_INVLPG, %esi /* esi: flags (inv. single entry) */ movl $__HYPERVISOR_update_va_mapping, %eax int $0x82 movl %ebp, %ebx addl $(LOCAL(cont) - LOCAL(base)), %ebx - jmp *%ebx + jmp *%ebx /* Continue with new virtual address */ LOCAL(cont): - xorl %eax, %eax - movl %eax, %ebp + /* Modify mappings of new page tables to be read-only. */ + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE(grub_relocator_xen_paging_areas_addr) + .long 0 + movl %eax, %ebx 1: + movl 0(%ebx), %ebp /* Get start pfn of the current area */ + movl GRUB_TARGET_SIZEOF_LONG(%ebx), %ecx /* Get # of pg tables */ + testl %ecx, %ecx /* 0 -> last area reached */ + jz 3f + addl $(2 * GRUB_TARGET_SIZEOF_LONG), %ebx + movl %ebx, %esp /* Save current area pointer */ +2: + movl %ecx, %edi /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_mfn_list) .long 0 - movl %eax, %edi - movl %ebp, %eax - movl 0(%edi, %eax, 4), %ecx - - /* mov imm32, %ebx */ - .byte 0xbb -VARIABLE(grub_relocator_xen_paging_start) - .long 0 - shll $12, %eax - addl %eax, %ebx + movl 0(%eax, %ebp, 4), %ecx /* mfn */ + movl %ebp, %ebx + shll $PAGE_SHIFT, %ebx /* virtual address (1:1 mapping) */ movl %ecx, %edx - shll $12, %ecx - shrl $20, %edx - orl $5, %ecx - movl $2, %esi + shll $PAGE_SHIFT, %ecx /* prepare pte low part */ + shrl $(32 - PAGE_SHIFT), %edx /* pte high part */ + orl $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %ecx /* pte low */ + movl $UVMF_INVLPG, %esi movl $__HYPERVISOR_update_va_mapping, %eax - int $0x82 + int $0x82 /* parameters: eax, ebx, ecx, edx, esi */ - incl %ebp - /* mov imm32, %ecx */ - .byte 0xb9 -VARIABLE(grub_relocator_xen_paging_size) - .long 0 - cmpl %ebp, %ecx + incl %ebp /* next pfn */ + movl %edi, %ecx - ja 1b + loop 2b + mov %esp, %ebx /* restore area poniter */ + jmp 1b + +3: + /* Switch page tables: pin new L3 pt, load cr3, unpin old L3. */ /* mov imm32, %ebx */ .byte 0xbb VARIABLE(grub_relocator_xen_mmu_op_addr) .long 0 - movl $3, %ecx - movl $0, %edx - movl $0x7FF0, %esi + movl $3, %ecx /* 3 mmu ops */ + movl $0, %edx /* pdone (not used) */ + movl $DOMID_SELF, %esi movl $__HYPERVISOR_mmuext_op, %eax int $0x82 + /* Continue in virtual kernel mapping. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_remap_continue) @@ -102,6 +112,9 @@ VARIABLE(grub_relocator_xen_remap_continue) jmp *%eax +VARIABLE(grub_relocator_xen_paging_areas) + .long 0, 0, 0, 0, 0, 0, 0, 0 + VARIABLE(grub_relocator_xen_mmu_op) .space 256 @@ -109,6 +122,7 @@ VARIABLE(grub_relocator_xen_remap_end) VARIABLE(grub_relocator_xen_start) + /* Unmap old remapper area. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_remapper_virt2) @@ -116,14 +130,14 @@ VARIABLE(grub_relocator_xen_remapper_virt2) movl %eax, %edi - xorl %ecx, %ecx + xorl %ecx, %ecx /* Invalid pte */ xorl %edx, %edx - movl $2, %esi + movl $UVMF_INVLPG, %esi movl $__HYPERVISOR_update_va_mapping, %eax int $0x82 - + /* Prepare registers for starting kernel. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_stack) @@ -145,6 +159,7 @@ VARIABLE(grub_relocator_xen_start_info) VARIABLE(grub_relocator_xen_entry_point) .long 0 + /* Now start the new kernel. */ jmp *%eax VARIABLE(grub_relocator_xen_end) diff --git a/grub-core/lib/x86_64/xen/relocator.S b/grub-core/lib/x86_64/xen/relocator.S index 92e9e72a9..f5364ed0f 100644 --- a/grub-core/lib/x86_64/xen/relocator.S +++ b/grub-core/lib/x86_64/xen/relocator.S @@ -16,95 +16,85 @@ * along with GRUB. If not, see . */ +#include +#include #include #include +/* Macro to load an imm64 value stored by the C-part into %rax: */ +#define MOV_IMM64_RAX(var) .byte 0x48, 0xb8; VARIABLE(var); .quad 0 + .p2align 4 /* force 16-byte alignment */ VARIABLE(grub_relocator_xen_remap_start) LOCAL(base): - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_virt) - .quad 0 + /* Remap the remapper to it's new address. */ + MOV_IMM64_RAX(grub_relocator_xen_remapper_virt) - movq %rax, %rdi - movq %rax, %rbx + movq %rax, %rdi /* %rdi: new virtual address of remapper */ + movq %rax, %rbx /* Remember new virtual address */ - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_map) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_remapper_map) - movq %rax, %rsi + movq %rax, %rsi /* %rsi: page table entry */ - movq $2, %rdx + movq $UVMF_INVLPG, %rdx /* %rdx: flags (inv. single entry) */ movq $__HYPERVISOR_update_va_mapping, %rax - syscall + syscall /* Do the remap operation */ addq $(LOCAL(cont) - LOCAL(base)), %rbx - jmp *%rbx + jmp *%rbx /* Continue with new virtual address */ LOCAL(cont): - - /* mov imm64, %rcx */ - .byte 0x48 - .byte 0xb9 -VARIABLE(grub_relocator_xen_paging_size) - .quad 0 + /* Modify mappings of new page tables to be read-only. */ + MOV_IMM64_RAX(grub_relocator_xen_mfn_list) - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_paging_start) - .quad 0 + movq %rax, %rbx /* %rbx is the base of the p2m list */ + leaq EXT_C(grub_relocator_xen_paging_areas) (%rip), %r8 - movq %rax, %r12 - - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_mfn_list) - .quad 0 - - movq %rax, %rsi 1: + movq 0(%r8), %r12 /* Get start pfn of the current area */ + movq GRUB_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */ + testq %rcx, %rcx /* 0 -> last area reached */ + jz 3f +2: movq %r12, %rdi - movq %rsi, %rbx - movq 0(%rsi), %rsi - shlq $12, %rsi - orq $5, %rsi - movq $2, %rdx - movq %rcx, %r9 + shlq $PAGE_SHIFT, %rdi /* virtual address (1:1 mapping) */ + movq (%rbx, %r12, 8), %rsi /* mfn */ + shlq $PAGE_SHIFT, %rsi + orq $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %rsi /* Build pte */ + movq $UVMF_INVLPG, %rdx + movq %rcx, %r9 /* %rcx clobbered by hypercall */ movq $__HYPERVISOR_update_va_mapping, %rax syscall movq %r9, %rcx - addq $8, %rbx - addq $4096, %r12 - movq %rbx, %rsi + incq %r12 /* next pfn */ - loop 1b + loop 2b - leaq LOCAL(mmu_op) (%rip), %rdi - movq $3, %rsi - movq $0, %rdx - movq $0x7FF0, %r10 + addq $(2 * GRUB_TARGET_SIZEOF_LONG), %r8 /* next pg table area */ + jmp 1b + +3: + /* Switch page tables: pin new L4 pt, load cr3, unpin old L4. */ + leaq EXT_C(grub_relocator_xen_mmu_op) (%rip), %rdi + movq $3, %rsi /* 3 mmu ops */ + movq $0, %rdx /* pdone (not used) */ + movq $DOMID_SELF, %r10 movq $__HYPERVISOR_mmuext_op, %rax syscall - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remap_continue) - .quad 0 + /* Continue in virtual kernel mapping. */ + MOV_IMM64_RAX(grub_relocator_xen_remap_continue) jmp *%rax -LOCAL(mmu_op): +VARIABLE(grub_relocator_xen_paging_areas) + /* array of start, size pairs, size 0 is end marker */ + .quad 0, 0, 0, 0, 0, 0, 0, 0 + VARIABLE(grub_relocator_xen_mmu_op) .space 256 @@ -112,46 +102,32 @@ VARIABLE(grub_relocator_xen_remap_end) VARIABLE(grub_relocator_xen_start) - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_virt2) - .quad 0 + /* Unmap old remapper area. */ + MOV_IMM64_RAX(grub_relocator_xen_remapper_virt2) movq %rax, %rdi - xorq %rax, %rax + xorq %rax, %rax /* Invalid pte */ movq %rax, %rsi - movq $2, %rdx + movq $UVMF_INVLPG, %rdx movq $__HYPERVISOR_update_va_mapping, %rax syscall - - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_stack) - .quad 0 + /* Prepare registers for starting kernel. */ + MOV_IMM64_RAX(grub_relocator_xen_stack) movq %rax, %rsp - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_start_info) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_start_info) movq %rax, %rsi cld - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_entry_point) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_entry_point) + /* Now start the new kernel. */ jmp *%rax VARIABLE(grub_relocator_xen_end) diff --git a/grub-core/lib/xen/relocator.c b/grub-core/lib/xen/relocator.c index 8f427d341..4d0cbcadb 100644 --- a/grub-core/lib/xen/relocator.c +++ b/grub-core/lib/xen/relocator.c @@ -29,6 +29,11 @@ typedef grub_addr_t grub_xen_reg_t; +struct grub_relocator_xen_paging_area { + grub_xen_reg_t start; + grub_xen_reg_t size; +} GRUB_PACKED; + extern grub_uint8_t grub_relocator_xen_start; extern grub_uint8_t grub_relocator_xen_end; extern grub_uint8_t grub_relocator_xen_remap_start; @@ -36,15 +41,16 @@ extern grub_uint8_t grub_relocator_xen_remap_end; extern grub_xen_reg_t grub_relocator_xen_stack; extern grub_xen_reg_t grub_relocator_xen_start_info; extern grub_xen_reg_t grub_relocator_xen_entry_point; -extern grub_xen_reg_t grub_relocator_xen_paging_start; -extern grub_xen_reg_t grub_relocator_xen_paging_size; extern grub_xen_reg_t grub_relocator_xen_remapper_virt; extern grub_xen_reg_t grub_relocator_xen_remapper_virt2; extern grub_xen_reg_t grub_relocator_xen_remapper_map; extern grub_xen_reg_t grub_relocator_xen_mfn_list; +extern struct grub_relocator_xen_paging_area + grub_relocator_xen_paging_areas[XEN_MAX_MAPPINGS]; extern grub_xen_reg_t grub_relocator_xen_remap_continue; #ifdef __i386__ extern grub_xen_reg_t grub_relocator_xen_mmu_op_addr; +extern grub_xen_reg_t grub_relocator_xen_paging_areas_addr; extern grub_xen_reg_t grub_relocator_xen_remapper_map_high; #endif extern mmuext_op_t grub_relocator_xen_mmu_op[3]; @@ -61,6 +67,7 @@ grub_relocator_xen_boot (struct grub_relocator *rel, { grub_err_t err; void *relst; + int i; grub_relocator_chunk_t ch, ch_tramp; grub_xen_mfn_t *mfn_list = (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; @@ -77,8 +84,11 @@ grub_relocator_xen_boot (struct grub_relocator *rel, grub_relocator_xen_stack = state.stack; grub_relocator_xen_start_info = state.start_info; grub_relocator_xen_entry_point = state.entry_point; - grub_relocator_xen_paging_start = state.paging_start << 12; - grub_relocator_xen_paging_size = state.paging_size; + for (i = 0; i < XEN_MAX_MAPPINGS; i++) + { + grub_relocator_xen_paging_areas[i].start = state.paging_start[i]; + grub_relocator_xen_paging_areas[i].size = state.paging_size[i]; + } grub_relocator_xen_remapper_virt = remapper_virt; grub_relocator_xen_remapper_virt2 = remapper_virt; grub_relocator_xen_remap_continue = trampoline_virt; @@ -88,10 +98,12 @@ grub_relocator_xen_boot (struct grub_relocator *rel, grub_relocator_xen_remapper_map_high = (mfn_list[remapper_pfn] >> 20); grub_relocator_xen_mmu_op_addr = (char *) &grub_relocator_xen_mmu_op - (char *) &grub_relocator_xen_remap_start + remapper_virt; + grub_relocator_xen_paging_areas_addr = + (char *) &grub_relocator_xen_paging_areas + - (char *) &grub_relocator_xen_remap_start + remapper_virt; #endif - grub_relocator_xen_mfn_list = state.mfn_list - + state.paging_start * sizeof (grub_addr_t); + grub_relocator_xen_mfn_list = state.mfn_list; grub_memset (grub_relocator_xen_mmu_op, 0, sizeof (grub_relocator_xen_mmu_op)); @@ -100,9 +112,9 @@ grub_relocator_xen_boot (struct grub_relocator *rel, #else grub_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L4_TABLE; #endif - grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start]; + grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start[0]]; grub_relocator_xen_mmu_op[1].cmd = MMUEXT_NEW_BASEPTR; - grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start]; + grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start[0]]; grub_relocator_xen_mmu_op[2].cmd = MMUEXT_UNPIN_TABLE; grub_relocator_xen_mmu_op[2].arg1.mfn = mfn_list[grub_xen_start_page_addr->pt_base >> 12]; diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index 9639ca159..a98badf44 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -39,9 +39,34 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); +#ifdef __x86_64__ +#define NUMBER_OF_LEVELS 4 +#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER) +#define VIRT_MASK 0x0000ffffffffffffULL +#else +#define NUMBER_OF_LEVELS 3 +#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW) +#define VIRT_MASK 0x00000000ffffffffULL +#define HYPERVISOR_PUD_ADDRESS 0xc0000000ULL +#endif + +struct grub_xen_mapping_lvl { + grub_uint64_t virt_start; + grub_uint64_t virt_end; + grub_uint64_t pfn_start; + grub_uint64_t n_pt_pages; +}; + +struct grub_xen_mapping { + grub_uint64_t *where; + struct grub_xen_mapping_lvl area; + struct grub_xen_mapping_lvl lvls[NUMBER_OF_LEVELS]; +}; + struct xen_loader_state { struct grub_relocator *relocator; struct grub_relocator_xen_state state; @@ -51,12 +76,13 @@ struct xen_loader_state { struct start_info *virt_start_info; grub_xen_mfn_t console_pfn; grub_uint64_t max_addr; - grub_uint64_t *virt_pgtable; - grub_uint64_t pgtbl_start; grub_uint64_t pgtbl_end; struct xen_multiboot_mod_list *module_info_page; grub_uint64_t modules_target_start; grub_size_t n_modules; + struct grub_xen_mapping *map_reloc; + struct grub_xen_mapping mappings[XEN_MAX_MAPPINGS]; + int n_mappings; int loaded; }; @@ -64,9 +90,8 @@ static struct xen_loader_state xen_state; static grub_dl_t my_mod; -#define PAGE_SIZE 4096 +#define PAGE_SIZE (1UL << PAGE_SHIFT) #define MAX_MODULES (PAGE_SIZE / sizeof (struct xen_multiboot_mod_list)) -#define PAGE_SHIFT 12 #define STACK_SIZE 1048576 #define ADDITIONAL_SIZE (1 << 19) #define ALIGN_SIZE (1 << 22) @@ -79,100 +104,163 @@ page2offset (grub_uint64_t page) return page << PAGE_SHIFT; } -#ifdef __x86_64__ -#define NUMBER_OF_LEVELS 4 -#define INTERMEDIATE_OR 7 -#else -#define NUMBER_OF_LEVELS 3 -#define INTERMEDIATE_OR 3 +static grub_err_t +get_pgtable_size (grub_uint64_t from, grub_uint64_t to, grub_uint64_t pfn) +{ + struct grub_xen_mapping *map, *map_cmp; + grub_uint64_t mask, bits; + int i, m; + + if (xen_state.n_mappings == XEN_MAX_MAPPINGS) + return grub_error (GRUB_ERR_BUG, "too many mapped areas"); + + grub_dprintf ("xen", "get_pgtable_size %d from=%llx, to=%llx, pfn=%llx\n", + xen_state.n_mappings, (unsigned long long) from, + (unsigned long long) to, (unsigned long long) pfn); + + map = xen_state.mappings + xen_state.n_mappings; + grub_memset (map, 0, sizeof (*map)); + + map->area.virt_start = from & VIRT_MASK; + map->area.virt_end = (to - 1) & VIRT_MASK; + map->area.n_pt_pages = 0; + + for (i = NUMBER_OF_LEVELS - 1; i >= 0; i--) + { + map->lvls[i].pfn_start = pfn + map->area.n_pt_pages; + if (i == NUMBER_OF_LEVELS - 1) + { + if (xen_state.n_mappings == 0) + { + map->lvls[i].virt_start = 0; + map->lvls[i].virt_end = VIRT_MASK; + map->lvls[i].n_pt_pages = 1; + map->area.n_pt_pages++; + } + continue; + } + + bits = PAGE_SHIFT + (i + 1) * LOG_POINTERS_PER_PAGE; + mask = (1ULL << bits) - 1; + map->lvls[i].virt_start = map->area.virt_start & ~mask; + map->lvls[i].virt_end = map->area.virt_end | mask; +#ifdef __i386__ + /* PAE wants last root directory present. */ + if (i == 1 && to <= HYPERVISOR_PUD_ADDRESS && xen_state.n_mappings == 0) + map->lvls[i].virt_end = VIRT_MASK; #endif + for (m = 0; m < xen_state.n_mappings; m++) + { + map_cmp = xen_state.mappings + m; + if (map_cmp->lvls[i].virt_start == map_cmp->lvls[i].virt_end) + continue; + if (map->lvls[i].virt_start >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_end <= map_cmp->lvls[i].virt_end) + { + map->lvls[i].virt_start = 0; + map->lvls[i].virt_end = 0; + break; + } + if (map->lvls[i].virt_start >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_start <= map_cmp->lvls[i].virt_end) + map->lvls[i].virt_start = map_cmp->lvls[i].virt_end + 1; + if (map->lvls[i].virt_end >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_end <= map_cmp->lvls[i].virt_end) + map->lvls[i].virt_end = map_cmp->lvls[i].virt_start - 1; + } + if (map->lvls[i].virt_start < map->lvls[i].virt_end) + map->lvls[i].n_pt_pages = + ((map->lvls[i].virt_end - map->lvls[i].virt_start) >> bits) + 1; + map->area.n_pt_pages += map->lvls[i].n_pt_pages; + grub_dprintf ("xen", "get_pgtable_size level %d: virt %llx-%llx %d pts\n", + i, (unsigned long long) map->lvls[i].virt_start, + (unsigned long long) map->lvls[i].virt_end, + (int) map->lvls[i].n_pt_pages); + } + + grub_dprintf ("xen", "get_pgtable_size return: %d page tables\n", + (int) map->area.n_pt_pages); + + xen_state.state.paging_start[xen_state.n_mappings] = pfn; + xen_state.state.paging_size[xen_state.n_mappings] = map->area.n_pt_pages; + + return GRUB_ERR_NONE; +} + +static grub_uint64_t * +get_pg_table_virt (int mapping, int level) +{ + grub_uint64_t pfn; + struct grub_xen_mapping *map; + + map = xen_state.mappings + mapping; + pfn = map->lvls[level].pfn_start - map->lvls[NUMBER_OF_LEVELS - 1].pfn_start; + return map->where + pfn * POINTERS_PER_PAGE; +} static grub_uint64_t -get_pgtable_size (grub_uint64_t total_pages, grub_uint64_t virt_base) +get_pg_table_prot (int level, grub_uint64_t pfn) { - if (!virt_base) - total_pages++; - grub_uint64_t ret = 0; - grub_uint64_t ll = total_pages; - int i; - for (i = 0; i < NUMBER_OF_LEVELS; i++) + int m; + grub_uint64_t pfn_s, pfn_e; + + if (level > 0) + return INTERMEDIATE_OR; + for (m = 0; m < xen_state.n_mappings; m++) { - ll = (ll + POINTERS_PER_PAGE - 1) >> LOG_POINTERS_PER_PAGE; - /* PAE wants all 4 root directories present. */ -#ifdef __i386__ - if (i == 1) - ll = 4; -#endif - ret += ll; + pfn_s = xen_state.mappings[m].lvls[NUMBER_OF_LEVELS - 1].pfn_start; + pfn_e = xen_state.mappings[m].area.n_pt_pages + pfn_s; + if (pfn >= pfn_s && pfn < pfn_e) + return GRUB_PAGE_PRESENT | GRUB_PAGE_USER; } - for (i = 1; i < NUMBER_OF_LEVELS; i++) - if (virt_base >> (PAGE_SHIFT + i * LOG_POINTERS_PER_PAGE)) - ret++; - return ret; + return GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER; } static void -generate_page_table (grub_uint64_t *where, grub_uint64_t paging_start, - grub_uint64_t paging_end, grub_uint64_t total_pages, - grub_uint64_t virt_base, grub_xen_mfn_t *mfn_list) +generate_page_table (grub_xen_mfn_t *mfn_list) { - if (!virt_base) - paging_end++; + int l, m1, m2; + long p, p_s, p_e; + grub_uint64_t start, end, pfn; + grub_uint64_t *pg; + struct grub_xen_mapping_lvl *lvl; - grub_uint64_t lx[NUMBER_OF_LEVELS], lxs[NUMBER_OF_LEVELS]; - grub_uint64_t nlx, nls, sz = 0; - int l; + for (m1 = 0; m1 < xen_state.n_mappings; m1++) + grub_memset (xen_state.mappings[m1].where, 0, + xen_state.mappings[m1].area.n_pt_pages * PAGE_SIZE); - nlx = paging_end; - nls = virt_base >> PAGE_SHIFT; - for (l = 0; l < NUMBER_OF_LEVELS; l++) + for (l = NUMBER_OF_LEVELS - 1; l >= 0; l--) { - nlx = (nlx + POINTERS_PER_PAGE - 1) >> LOG_POINTERS_PER_PAGE; - /* PAE wants all 4 root directories present. */ -#ifdef __i386__ - if (l == 1) - nlx = 4; -#endif - lx[l] = nlx; - sz += lx[l]; - lxs[l] = nls & (POINTERS_PER_PAGE - 1); - if (nls && l != 0) - sz++; - nls >>= LOG_POINTERS_PER_PAGE; - } - - grub_uint64_t lp; - grub_uint64_t j; - grub_uint64_t *pg = (grub_uint64_t *) where; - int pr = 0; - - grub_memset (pg, 0, sz * PAGE_SIZE); - - lp = paging_start + lx[NUMBER_OF_LEVELS - 1]; - for (l = NUMBER_OF_LEVELS - 1; l >= 1; l--) - { - if (lxs[l] || pr) - pg[0] = page2offset (mfn_list[lp++]) | INTERMEDIATE_OR; - if (pr) - pg += POINTERS_PER_PAGE; - for (j = 0; j < lx[l - 1]; j++) - pg[j + lxs[l]] = page2offset (mfn_list[lp++]) | INTERMEDIATE_OR; - pg += lx[l] * POINTERS_PER_PAGE; - if (lxs[l]) - pr = 1; - } - - if (lxs[0] || pr) - pg[0] = page2offset (mfn_list[total_pages]) | 5; - if (pr) - pg += POINTERS_PER_PAGE; - - for (j = 0; j < paging_end; j++) - { - if (j >= paging_start && j < lp) - pg[j + lxs[0]] = page2offset (mfn_list[j]) | 5; - else - pg[j + lxs[0]] = page2offset (mfn_list[j]) | 7; + for (m1 = 0; m1 < xen_state.n_mappings; m1++) + { + start = xen_state.mappings[m1].lvls[l].virt_start; + end = xen_state.mappings[m1].lvls[l].virt_end; + pg = get_pg_table_virt(m1, l); + for (m2 = 0; m2 < xen_state.n_mappings; m2++) + { + lvl = (l > 0) ? xen_state.mappings[m2].lvls + l - 1 + : &xen_state.mappings[m2].area; + if (l > 0 && lvl->n_pt_pages == 0) + continue; + if (lvl->virt_start >= end || lvl->virt_end <= start) + continue; + p_s = (grub_max (start, lvl->virt_start) - start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); + p_e = (grub_min (end, lvl->virt_end) - start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); + pfn = ((grub_max (start, lvl->virt_start) - lvl->virt_start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE)) + lvl->pfn_start; + grub_dprintf ("xen", "write page table entries level %d pg %p " + "mapping %d/%d index %lx-%lx pfn %llx\n", + l, pg, m1, m2, p_s, p_e, (unsigned long long) pfn); + for (p = p_s; p <= p_e; p++) + { + pg[p] = page2offset (mfn_list[pfn]) | + get_pg_table_prot (l, pfn); + pfn++; + } + } + } } } @@ -285,45 +373,71 @@ grub_xen_pt_alloc (void) grub_relocator_chunk_t ch; grub_err_t err; grub_uint64_t nr_info_pages; - grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; + grub_uint64_t nr_need_pages; + grub_uint64_t try_virt_end; + struct grub_xen_mapping *map; - if (xen_state.virt_pgtable) + if (xen_state.pgtbl_end) return GRUB_ERR_NONE; + map = xen_state.mappings + xen_state.n_mappings; + xen_state.map_reloc = map + 1; + xen_state.next_start.pt_base = xen_state.max_addr + xen_state.xen_inf.virt_base; - xen_state.state.paging_start = xen_state.max_addr >> PAGE_SHIFT; - nr_info_pages = xen_state.max_addr >> PAGE_SHIFT; - nr_pages = nr_info_pages; + nr_need_pages = nr_info_pages; while (1) { - nr_pages = ALIGN_UP (nr_pages, (ALIGN_SIZE >> PAGE_SHIFT)); - nr_pt_pages = get_pgtable_size (nr_pages, xen_state.xen_inf.virt_base); - nr_need_pages = - nr_info_pages + nr_pt_pages + - ((ADDITIONAL_SIZE + STACK_SIZE) >> PAGE_SHIFT); - if (nr_pages >= nr_need_pages) + try_virt_end = ALIGN_UP (xen_state.xen_inf.virt_base + + page2offset (nr_need_pages) + + ADDITIONAL_SIZE + STACK_SIZE, ALIGN_SIZE); + if (!xen_state.xen_inf.virt_base) + try_virt_end += PAGE_SIZE; + + err = get_pgtable_size (xen_state.xen_inf.virt_base, try_virt_end, + nr_info_pages); + if (err) + return err; + xen_state.n_mappings++; + + /* Map the relocator page either at virtual 0 or after end of area. */ + nr_need_pages = nr_info_pages + map->area.n_pt_pages; + if (xen_state.xen_inf.virt_base) + err = get_pgtable_size (0, PAGE_SIZE, nr_need_pages); + else + err = get_pgtable_size (try_virt_end - PAGE_SIZE, try_virt_end, + nr_need_pages); + if (err) + return err; + nr_need_pages += xen_state.map_reloc->area.n_pt_pages; + + if (xen_state.xen_inf.virt_base + page2offset (nr_need_pages) <= + try_virt_end) break; - nr_pages = nr_need_pages; + + xen_state.n_mappings--; } + xen_state.n_mappings++; + nr_need_pages = map->area.n_pt_pages + xen_state.map_reloc->area.n_pt_pages; err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, xen_state.max_addr, - page2offset (nr_pt_pages)); + page2offset (nr_need_pages)); if (err) return err; - xen_state.virt_pgtable = get_virtual_current_address (ch); - xen_state.pgtbl_start = xen_state.max_addr >> PAGE_SHIFT; - xen_state.max_addr += page2offset (nr_pt_pages); + map->where = get_virtual_current_address (ch); + map->area.pfn_start = 0; + xen_state.max_addr += page2offset (nr_need_pages); xen_state.state.stack = xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; - xen_state.state.paging_size = nr_pt_pages; - xen_state.next_start.nr_pt_frames = nr_pt_pages; - xen_state.max_addr = page2offset (nr_pages); - xen_state.pgtbl_end = nr_pages; + xen_state.next_start.nr_pt_frames = nr_need_pages; + xen_state.max_addr = try_virt_end - xen_state.xen_inf.virt_base; + xen_state.pgtbl_end = xen_state.max_addr >> PAGE_SHIFT; + xen_state.map_reloc->where = (grub_uint64_t *) ((char *) map->where + + page2offset (map->area.n_pt_pages)); return GRUB_ERR_NONE; } @@ -372,9 +486,8 @@ grub_xen_boot (void) (unsigned long long) xen_state.xen_inf.virt_base, (unsigned long long) page2offset (nr_pages)); - generate_page_table (xen_state.virt_pgtable, xen_state.pgtbl_start, - xen_state.pgtbl_end, nr_pages, - xen_state.xen_inf.virt_base, xen_state.virt_mfn_list); + xen_state.map_reloc->area.pfn_start = nr_pages; + generate_page_table (xen_state.virt_mfn_list); xen_state.state.entry_point = xen_state.xen_inf.entry_point; diff --git a/include/grub/i386/memory.h b/include/grub/i386/memory.h index c9b13288f..8bb6e1cbb 100644 --- a/include/grub/i386/memory.h +++ b/include/grub/i386/memory.h @@ -20,6 +20,8 @@ #ifndef GRUB_MEMORY_CPU_HEADER #define GRUB_MEMORY_CPU_HEADER 1 +#define PAGE_SHIFT 12 + /* The flag for protected mode. */ #define GRUB_MEMORY_CPU_CR0_PE_ON 0x1 #define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020 @@ -31,6 +33,11 @@ #define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ #define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START +/* Some PTE definitions. */ +#define GRUB_PAGE_PRESENT 0x00000001 +#define GRUB_PAGE_RW 0x00000002 +#define GRUB_PAGE_USER 0x00000004 + #ifndef ASM_FILE #define GRUB_MMAP_MALLOC_LOW 1 diff --git a/include/grub/xen/relocator.h b/include/grub/xen/relocator.h index ae45dce21..35a0ad9c7 100644 --- a/include/grub/xen/relocator.h +++ b/include/grub/xen/relocator.h @@ -23,11 +23,13 @@ #include #include +#define XEN_MAX_MAPPINGS 3 + struct grub_relocator_xen_state { grub_addr_t start_info; - grub_addr_t paging_start; - grub_addr_t paging_size; + grub_addr_t paging_start[XEN_MAX_MAPPINGS]; + grub_addr_t paging_size[XEN_MAX_MAPPINGS]; grub_addr_t mfn_list; grub_addr_t stack; grub_addr_t entry_point; From 0de3eeb6232db319812335ec02ea4cfb15aa2fef Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 3 Mar 2016 10:38:16 +0100 Subject: [PATCH 191/207] xen: add capability to load p2m list outside of kernel mapping Modern pvops linux kernels support a p2m list not covered by the kernel mapping. This capability is flagged by an elf-note specifying the virtual address the kernel is expecting the p2m list to be mapped to. In case the elf-note is set by the kernel don't place the p2m list into the kernel mapping, but map it to the given address. This will allow to support domains with larger memory, as the kernel mapping is limited to 2GB and a domain with huge memory in the TB range will have a p2m list larger than this. Signed-off-by: Juergen Gross Reviewed-by: Daniel Kiper --- grub-core/loader/i386/xen.c | 53 +++++++++++++++++++++++++----- grub-core/loader/i386/xen_fileXX.c | 4 +++ include/grub/xen_file.h | 2 ++ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index a98badf44..51d1ddd37 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -313,24 +313,50 @@ static grub_err_t grub_xen_p2m_alloc (void) { grub_relocator_chunk_t ch; - grub_size_t p2msize; + grub_size_t p2msize, p2malloc; grub_err_t err; + struct grub_xen_mapping *map; if (xen_state.virt_mfn_list) return GRUB_ERR_NONE; + map = xen_state.mappings + xen_state.n_mappings; + p2msize = ALIGN_UP (sizeof (grub_xen_mfn_t) * + grub_xen_start_page_addr->nr_pages, PAGE_SIZE); + if (xen_state.xen_inf.has_p2m_base) + { + err = get_pgtable_size (xen_state.xen_inf.p2m_base, + xen_state.xen_inf.p2m_base + p2msize, + (xen_state.max_addr + p2msize) >> PAGE_SHIFT); + if (err) + return err; + + map->area.pfn_start = xen_state.max_addr >> PAGE_SHIFT; + p2malloc = p2msize + page2offset (map->area.n_pt_pages); + xen_state.n_mappings++; + xen_state.next_start.mfn_list = xen_state.xen_inf.p2m_base; + xen_state.next_start.first_p2m_pfn = map->area.pfn_start; + xen_state.next_start.nr_p2m_frames = p2malloc >> PAGE_SHIFT; + } + else + { + xen_state.next_start.mfn_list = + xen_state.max_addr + xen_state.xen_inf.virt_base; + p2malloc = p2msize; + } + xen_state.state.mfn_list = xen_state.max_addr; - xen_state.next_start.mfn_list = - xen_state.max_addr + xen_state.xen_inf.virt_base; - p2msize = sizeof (grub_xen_mfn_t) * grub_xen_start_page_addr->nr_pages; err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, - xen_state.max_addr, p2msize); + xen_state.max_addr, p2malloc); if (err) return err; xen_state.virt_mfn_list = get_virtual_current_address (ch); + if (xen_state.xen_inf.has_p2m_base) + map->where = (grub_uint64_t *) xen_state.virt_mfn_list + + p2msize / sizeof (grub_uint64_t); grub_memcpy (xen_state.virt_mfn_list, (void *) grub_xen_start_page_addr->mfn_list, p2msize); - xen_state.max_addr = ALIGN_UP (xen_state.max_addr + p2msize, PAGE_SIZE); + xen_state.max_addr += p2malloc; return GRUB_ERR_NONE; } @@ -448,9 +474,12 @@ grub_xen_alloc_boot_data (void) { grub_err_t err; - err = grub_xen_p2m_alloc (); - if (err) - return err; + if (!xen_state.xen_inf.has_p2m_base) + { + err = grub_xen_p2m_alloc (); + if (err) + return err; + } err = grub_xen_special_alloc (); if (err) return err; @@ -475,6 +504,12 @@ grub_xen_boot (void) err = grub_xen_alloc_boot_data (); if (err) return err; + if (xen_state.xen_inf.has_p2m_base) + { + err = grub_xen_p2m_alloc (); + if (err) + return err; + } err = set_mfns (xen_state.console_pfn); if (err) diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c index 8751174cf..fb66e66fe 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -261,6 +261,10 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, descsz == 2 ? 2 : 3) == 0) xi->arch = GRUB_XEN_FILE_I386; break; + case XEN_ELFNOTE_INIT_P2M: + xi->p2m_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->has_p2m_base = 1; + break; case XEN_ELFNOTE_MOD_START_PFN: xi->unmapped_initrd = !!grub_le_to_cpu32(*(grub_uint32_t *) desc); break; diff --git a/include/grub/xen_file.h b/include/grub/xen_file.h index ed749fafe..658799952 100644 --- a/include/grub/xen_file.h +++ b/include/grub/xen_file.h @@ -32,9 +32,11 @@ struct grub_xen_file_info grub_uint64_t entry_point; grub_uint64_t hypercall_page; grub_uint64_t paddr_offset; + grub_uint64_t p2m_base; int has_hypercall_page; int has_note; int has_xen_guest; + int has_p2m_base; int extended_cr3; int unmapped_initrd; enum From 5f311e86d296fd8a7a16faa01bc87b26c1e5aa86 Mon Sep 17 00:00:00 2001 From: Corey Hickey Date: Fri, 4 Nov 2016 21:58:14 -0700 Subject: [PATCH 192/207] fix detection of non-LUKS CRYPT grub_util_get_dm_abstraction() does a string comparison of insufficient length. When using a UUID such as "CRYPT-PLAIN-sda6_crypt", the function returns GRUB_DEV_ABSTRACTION_LUKS. This results in the error: ./grub-probe: error: disk `cryptouuid/sda6_crypt' not found. This appears to be a copy/paste error introduced in: a10e7a5a8918bea6e2632055129fa9b516fe965a The bug was (apparently) latent until revealed by: 3bca85b4184f74995a7cc2791e432173fde26d34 Signed-off-by: Corey Hickey --- grub-core/osdep/devmapper/getroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index 72e558275..a13a39c96 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -143,7 +143,7 @@ grub_util_get_dm_abstraction (const char *os_dev) grub_free (uuid); return GRUB_DEV_ABSTRACTION_LVM; } - if (strncmp (uuid, "CRYPT-LUKS1-", 4) == 0) + if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0) { grub_free (uuid); return GRUB_DEV_ABSTRACTION_LUKS; From fbca3741052f4ee28a522cf0d778869623a8437d Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 29 Feb 2016 00:22:23 +0100 Subject: [PATCH 193/207] arm64: Move firmware fdt search into global function Searching for a device tree that EFI passes to us via configuration tables is nothing architecture specific. Move it into generic code. Signed-off-by: Alexander Graf Reviewed-by: Daniel Kiper --- grub-core/kern/efi/init.c | 22 ++++++++++++++++++++++ grub-core/loader/arm64/fdt.c | 24 +----------------------- include/grub/efi/efi.h | 2 ++ 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index e9c85de12..fb90ecd98 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -72,6 +72,28 @@ grub_machine_get_bootlocation (char **device, char **path) } } +void * +grub_efi_get_firmware_fdt (void) +{ + grub_efi_configuration_table_t *tables; + grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + void *firmware_fdt = NULL; + unsigned int i; + + /* Look for FDT in UEFI config tables. */ + tables = grub_efi_system_table->configuration_table; + + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) + { + firmware_fdt = tables[i].vendor_table; + grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); + break; + } + + return firmware_fdt; +} + void grub_efi_fini (void) { diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/arm64/fdt.c index 5202c14e0..db49cf649 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/arm64/fdt.c @@ -28,28 +28,6 @@ static void *loaded_fdt; static void *fdt; -static void * -get_firmware_fdt (void) -{ - grub_efi_configuration_table_t *tables; - grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; - void *firmware_fdt = NULL; - unsigned int i; - - /* Look for FDT in UEFI config tables. */ - tables = grub_efi_system_table->configuration_table; - - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) - { - firmware_fdt = tables[i].vendor_table; - grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); - break; - } - - return firmware_fdt; -} - void * grub_fdt_load (grub_size_t additional_size) { @@ -65,7 +43,7 @@ grub_fdt_load (grub_size_t additional_size) if (loaded_fdt) raw_fdt = loaded_fdt; else - raw_fdt = get_firmware_fdt(); + raw_fdt = grub_efi_get_firmware_fdt(); size = raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 0e6fd86b0..2acf85ec1 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -81,6 +81,8 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, char **device, char **path); +void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); + grub_addr_t grub_efi_modules_addr (void); void grub_efi_mm_init (void); From e1b099fb69643afb5b215e8d74fc2175a9e4c7d3 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 29 Feb 2016 00:22:24 +0100 Subject: [PATCH 194/207] arm efi: Use fdt from firmware when available If EFI is nice enough to pass us an FDT using configuration tables on 32bit ARM, we should really try and make use of it. Signed-off-by: Alexander Graf Reviewed-by: Daniel Kiper --- include/grub/arm/linux.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h index 059dbba42..a66caad13 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -40,11 +40,7 @@ # define LINUX_PHYS_OFFSET (0x00008000) # define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) # define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) -static inline grub_addr_t -grub_arm_firmware_get_boot_data (void) -{ - return 0; -} +# define grub_arm_firmware_get_boot_data (grub_addr_t)grub_efi_get_firmware_fdt static inline grub_uint32_t grub_arm_firmware_get_machine_type (void) { From 28511b0da900876151c71b66885b89615c68cfa4 Mon Sep 17 00:00:00 2001 From: Joonas Lahtinen Date: Thu, 10 Nov 2016 15:45:38 +0200 Subject: [PATCH 195/207] .gitignore: Add grub-core/build-grub-module-verifier Signed-off-by: Joonas Lahtinen --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 18ab8e812..eca17bec9 100644 --- a/.gitignore +++ b/.gitignore @@ -246,3 +246,4 @@ build-aux/test-driver /garbage-gen /garbage-gen.exe /grub-fs-tester +grub-core/build-grub-module-verifier From 0d663b50b9abf830fd10de384606a0632a605b77 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 11 Oct 2016 22:19:02 +0200 Subject: [PATCH 196/207] grub-mknetdir: Add support for ARM64 EFI --- util/grub-mknetdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c index 3813e8bc0..82073d5cc 100644 --- a/util/grub-mknetdir.c +++ b/util/grub-mknetdir.c @@ -106,7 +106,8 @@ static const struct [GRUB_INSTALL_PLATFORM_I386_EFI] = { "i386-efi", "efinet", ".efi" }, [GRUB_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64-efi", "efinet", ".efi" }, [GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" } + [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" }, + [GRUB_INSTALL_PLATFORM_ARM64_EFI] = { "arm64-efi", "efinet", ".efi" } }; static void From 0af7539bd297fb03da8166ba0c0c143cd2143fd2 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Wed, 9 Nov 2016 23:26:43 +0200 Subject: [PATCH 197/207] configure.ac: don't require build time grub-mkfont on powerpc-ieee1275 Don't require build time grub-mkfont on powerpc-ieee1275. Signed-off-by: Aaro Koskinen --- configure.ac | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 9ddfc5323..3d2551035 100644 --- a/configure.ac +++ b/configure.ac @@ -1555,11 +1555,11 @@ if test x"$grub_build_mkfont_excuse" = x ; then else enable_build_grub_mkfont=no fi -if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then +if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then if test x"$grub_build_mkfont_excuse" = x ; then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont]) else - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont ($grub_build_mkfont_excuse)]) fi fi @@ -1629,11 +1629,11 @@ if test x"$enable_build_grub_mkfont" = xno ; then FONT_SOURCE= fi -if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then +if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then if test x"$grub_build_mkfont_excuse" = x ; then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont]) else - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) fi fi From f8c3af3b613f9b1d5123f1ccad565950f82f6959 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 22 Nov 2016 20:42:23 +0300 Subject: [PATCH 198/207] bootp: export next server IP as environment variable Network boot autoconfiguration sets default server to next server IP (siaddr) from BOOTP/DHCP reply, but manual configuration using net_bootp exports only server name. Unfortunately semantic of server name is not clearly defined. BOOTP RFC 951 defines it only for client request, and DHCP RFC 1541 only mentions it, without any implied usage. It looks like this field is mostly empty in server replies. Export next server IP as net__next_server variable. This allows grub configuration script to set $root/$prefix based on information obtained by net_bootp. Reported and tested by: Nikunj A Dadhania Cc: nikunj@linux.vnet.ibm.com v2: change variable name to net__next_server as discussed on the list --- docs/grub.texi | 11 +++++++++++ grub-core/net/bootp.c | 24 ++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 82f6fa459..b9ddb9b8a 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -2446,6 +2446,10 @@ The boot file name provided by DHCP. Read-only. The name of the DHCP server responsible for these boot parameters. Read-only. +@item net_@var{}_next_server +The IP address of the next (usually, TFTP) server provided by DHCP. +Read-only. + @item net_default_interface Initially set to name of network interface that was used to load grub. Read-write, although setting it affects only interpretation of @@ -3062,6 +3066,7 @@ These variables have special meaning to GRUB. * net_@var{}_hostname:: * net_@var{}_ip:: * net_@var{}_mac:: +* net_@var{}_next_server:: * net_@var{}_rootpath:: * net_default_interface:: * net_default_ip:: @@ -3422,6 +3427,12 @@ The default is the value of @samp{color_normal} (@pxref{color_normal}). @xref{Network}. +@node net_@var{}_next_server +@subsection net_@var{}_next_server + +@xref{Network}. + + @node net_@var{}_rootpath @subsection net_@var{}_rootpath diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 189551a48..9e2fdb795 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -142,6 +142,7 @@ grub_net_configure_by_dhcp_ack (const char *name, grub_net_link_level_address_t hwaddr; struct grub_net_network_level_interface *inter; int mask = -1; + char server_ip[sizeof ("xxx.xxx.xxx.xxx")]; addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; addr.ipv4 = bp->your_ip; @@ -192,15 +193,22 @@ grub_net_configure_by_dhcp_ack (const char *name, if (size > OFFSET_OF (boot_file, bp)) grub_env_set_net_property (name, "boot_file", bp->boot_file, sizeof (bp->boot_file)); + if (bp->server_ip) + { + grub_snprintf (server_ip, sizeof (server_ip), "%d.%d.%d.%d", + ((grub_uint8_t *) &bp->server_ip)[0], + ((grub_uint8_t *) &bp->server_ip)[1], + ((grub_uint8_t *) &bp->server_ip)[2], + ((grub_uint8_t *) &bp->server_ip)[3]); + grub_env_set_net_property (name, "next_server", server_ip, sizeof (server_ip)); + grub_print_error (); + } + if (is_def) grub_net_default_server = 0; if (is_def && !grub_net_default_server && bp->server_ip) { - grub_net_default_server = grub_xasprintf ("%d.%d.%d.%d", - ((grub_uint8_t *) &bp->server_ip)[0], - ((grub_uint8_t *) &bp->server_ip)[1], - ((grub_uint8_t *) &bp->server_ip)[2], - ((grub_uint8_t *) &bp->server_ip)[3]); + grub_net_default_server = grub_strdup (server_ip); grub_print_error (); } @@ -212,11 +220,7 @@ grub_net_configure_by_dhcp_ack (const char *name, if (device && !*device && bp->server_ip) { - *device = grub_xasprintf ("tftp,%d.%d.%d.%d", - ((grub_uint8_t *) &bp->server_ip)[0], - ((grub_uint8_t *) &bp->server_ip)[1], - ((grub_uint8_t *) &bp->server_ip)[2], - ((grub_uint8_t *) &bp->server_ip)[3]); + *device = grub_xasprintf ("tftp,%s", server_ip); grub_print_error (); } if (size > OFFSET_OF (server_name, bp) From c9a8d037a85fe439027e4dc294169e9d18757fcc Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 22 Nov 2016 20:51:54 +0300 Subject: [PATCH 199/207] NEWS updates --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 572eadb3e..2ebd54e78 100644 --- a/NEWS +++ b/NEWS @@ -51,6 +51,8 @@ New in 2.02: * Parse `nd' disk names in GRUB Legacy configuration files. * Issue separate DNS queries for IPv4 and IPv6. * Support IPv6 Router Advertisement to configure default router. + * New variable net__next_server containing next server + from BOOTP reply. * Coreboot improvements: * CBFS support both in on-disk images (loopback) and flash. @@ -171,6 +173,7 @@ New in 2.02: * Use fixed timestamp when generating GRUB image for reproducible builds. * Verify at build time that modules contain only supported relocations and their structure matches what boot-time module loader expects. + * Do not require fonts on powerpc-ieee1275. * Revision control moved to git. From 0d2345774dddfb94d753a97db802d19494e31a82 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 21 Nov 2016 16:23:02 +0100 Subject: [PATCH 200/207] efi: Move fdt helper into own file We only support FDT files with EFI on arm and arm64 systems, not on x86. So move the helper that finds a prepopulated FDT UUID into its own file and only build it for architectures where it also gets called. Signed-off-by: Alexander Graf Reviewed-by: Daniel Kiper --- grub-core/Makefile.core.def | 2 ++ grub-core/kern/efi/fdt.c | 43 +++++++++++++++++++++++++++++++++++++ grub-core/kern/efi/init.c | 22 ------------------- include/grub/efi/efi.h | 2 ++ 4 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 grub-core/kern/efi/fdt.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 21ad0dd7c..2dfa22a92 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -212,8 +212,10 @@ kernel = { arm_efi = kern/arm/efi/init.c; arm_efi = kern/arm/efi/misc.c; + arm_efi = kern/efi/fdt.c; arm64_efi = kern/arm64/efi/init.c; + arm64_efi = kern/efi/fdt.c; i386_pc = kern/i386/pc/init.c; i386_pc = kern/i386/pc/mmap.c; diff --git a/grub-core/kern/efi/fdt.c b/grub-core/kern/efi/fdt.c new file mode 100644 index 000000000..30100c61c --- /dev/null +++ b/grub-core/kern/efi/fdt.c @@ -0,0 +1,43 @@ +/* fdt.c - EFI Flattened Device Tree interaction */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +void * +grub_efi_get_firmware_fdt (void) +{ + grub_efi_configuration_table_t *tables; + grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + void *firmware_fdt = NULL; + unsigned int i; + + /* Look for FDT in UEFI config tables. */ + tables = grub_efi_system_table->configuration_table; + + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) + { + firmware_fdt = tables[i].vendor_table; + grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); + break; + } + + return firmware_fdt; +} diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index fb90ecd98..e9c85de12 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -72,28 +72,6 @@ grub_machine_get_bootlocation (char **device, char **path) } } -void * -grub_efi_get_firmware_fdt (void) -{ - grub_efi_configuration_table_t *tables; - grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; - void *firmware_fdt = NULL; - unsigned int i; - - /* Look for FDT in UEFI config tables. */ - tables = grub_efi_system_table->configuration_table; - - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) - { - firmware_fdt = tables[i].vendor_table; - grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); - break; - } - - return firmware_fdt; -} - void grub_efi_fini (void) { diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 2acf85ec1..e9c601f34 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -81,7 +81,9 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, char **device, char **path); +#if defined(__arm__) || defined(__aarch64__) void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); +#endif grub_addr_t grub_efi_modules_addr (void); From 7b4c54c4ad6a1c92228e1f05047bf820b3a6d36d Mon Sep 17 00:00:00 2001 From: Stanislav Kholmanskikh Date: Mon, 12 Dec 2016 18:03:38 +0300 Subject: [PATCH 201/207] ofnet: move the allocation of the transmit buffer into a function In the current code search_net_devices() uses the "alloc-mem" command from the IEEE1275 User Interface for allocation of the transmit buffer for the case when GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN is set. I don't have hardware where this flag is set to verify if this workaround is still needed. However, further changes to ofnet will require to execute this workaround one more time. Therefore, to avoid possible duplication of code I'm moving this piece of code into a function. Signed-off-by: Stanislav Kholmanskikh Reviewed-by: Daniel Kiper --- grub-core/net/drivers/ieee1275/ofnet.c | 69 ++++++++++++++++---------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index 6bd3b922e..cec0ccc3c 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -294,6 +294,48 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, } } +/* Allocate memory with alloc-mem */ +static void * +grub_ieee1275_alloc_mem (grub_size_t len) +{ + struct alloc_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t len; + grub_ieee1275_cell_t catch; + grub_ieee1275_cell_t result; + } + args; + + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + { + grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + return NULL; + } + + INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2); + args.len = len; + args.method = (grub_ieee1275_cell_t) "alloc-mem"; + + if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("alloc-mem failed")); + return NULL; + } + else + return (void *)args.result; +} + +static void * +ofnet_alloc_netbuf (grub_size_t len) +{ + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + return grub_ieee1275_alloc_mem (len); + else + return grub_zalloc (len); +} + static int search_net_devices (struct grub_ieee1275_devalias *alias) { @@ -410,32 +452,7 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) - { - struct alloc_args - { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t catch; - grub_ieee1275_cell_t result; - } - args; - INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2); - args.len = card->txbufsize; - args.method = (grub_ieee1275_cell_t) "alloc-mem"; - - if (IEEE1275_CALL_ENTRY_FN (&args) == -1 - || args.catch) - { - card->txbuf = 0; - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); - } - else - card->txbuf = (void *) args.result; - } - else - card->txbuf = grub_zalloc (card->txbufsize); + card->txbuf = ofnet_alloc_netbuf (card->txbufsize); if (!card->txbuf) { grub_free (ofdata->path); From 130234bc782e1b36a6c55fcac31ff3208cc8807b Mon Sep 17 00:00:00 2001 From: Stanislav Kholmanskikh Date: Mon, 12 Dec 2016 18:03:39 +0300 Subject: [PATCH 202/207] ofnet: implement the receive buffer get_card_packet() from ofnet.c allocates a netbuff based on the device's MTU: nb = grub_netbuff_alloc (dev->mtu + 64 + 2); In the case when the MTU is large, and the received packet is relatively small, this leads to allocation of significantly more memory, than it's required. An example could be transmission of TFTP packets with 0x400 blksize via a network card with 0x10000 MTU. This patch implements a per-card receive buffer in a way similar to efinet.c, and makes get_card_packet() allocate a netbuff of the received data size. Signed-off-by: Stanislav Kholmanskikh Reviewed-by: Daniel Kiper --- grub-core/net/drivers/ieee1275/ofnet.c | 90 +++++++++++++++++++++----- 1 file changed, 75 insertions(+), 15 deletions(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index cec0ccc3c..a78d164db 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -85,24 +85,30 @@ get_card_packet (struct grub_net_card *dev) grub_uint64_t start_time; struct grub_net_buff *nb; - nb = grub_netbuff_alloc (dev->mtu + 64 + 2); + start_time = grub_get_time_ms (); + do + rc = grub_ieee1275_read (data->handle, dev->rcvbuf, dev->rcvbufsize, &actual); + while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); + + if (actual <= 0) + return NULL; + + nb = grub_netbuff_alloc (actual + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ grub_netbuff_reserve (nb, 2); - start_time = grub_get_time_ms (); - do - rc = grub_ieee1275_read (data->handle, nb->data, dev->mtu + 64, &actual); - while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); - if (actual > 0) + grub_memcpy (nb->data, dev->rcvbuf, actual); + + if (grub_netbuff_put (nb, actual)) { - grub_netbuff_put (nb, actual); - return nb; + grub_netbuff_free (nb); + return NULL; } - grub_netbuff_free (nb); - return NULL; + + return nb; } static struct grub_net_card_driver ofdriver = @@ -327,6 +333,40 @@ grub_ieee1275_alloc_mem (grub_size_t len) return (void *)args.result; } +/* Free memory allocated by alloc-mem */ +static grub_err_t +grub_ieee1275_free_mem (void *addr, grub_size_t len) +{ + struct free_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t len; + grub_ieee1275_cell_t addr; + grub_ieee1275_cell_t catch; + } + args; + + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + { + grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + return grub_errno; + } + + INIT_IEEE1275_COMMON (&args.common, "interpret", 3, 1); + args.addr = (grub_ieee1275_cell_t)addr; + args.len = len; + args.method = (grub_ieee1275_cell_t) "free-mem"; + + if (IEEE1275_CALL_ENTRY_FN(&args) == -1 || args.catch) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("free-mem failed")); + return grub_errno; + } + + return GRUB_ERR_NONE; +} + static void * ofnet_alloc_netbuf (grub_size_t len) { @@ -336,6 +376,15 @@ ofnet_alloc_netbuf (grub_size_t len) return grub_zalloc (len); } +static void +ofnet_free_netbuf (void *addr, grub_size_t len) +{ + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + grub_ieee1275_free_mem (addr, len); + else + grub_free (addr); +} + static int search_net_devices (struct grub_ieee1275_devalias *alias) { @@ -451,15 +500,19 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->default_address = lla; card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; + card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256; card->txbuf = ofnet_alloc_netbuf (card->txbufsize); if (!card->txbuf) + goto fail_netbuf; + + card->rcvbuf = ofnet_alloc_netbuf (card->rcvbufsize); + if (!card->rcvbuf) { - grub_free (ofdata->path); - grub_free (ofdata); - grub_free (card); - grub_print_error (); - return 0; + grub_error_push (); + ofnet_free_netbuf (card->txbuf, card->txbufsize); + grub_error_pop (); + goto fail_netbuf; } card->driver = NULL; card->data = ofdata; @@ -472,6 +525,13 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->driver = &ofdriver; grub_net_card_register (card); return 0; + +fail_netbuf: + grub_free (ofdata->path); + grub_free (ofdata); + grub_free (card); + grub_print_error (); + return 0; } static void From a3e9da054d00260f274cfd9d1b9611c32ecd437c Mon Sep 17 00:00:00 2001 From: Magnus Granberg Date: Wed, 14 Dec 2016 20:44:41 +0300 Subject: [PATCH 203/207] configure: add check for -no-pie if the compiler default to -fPIE When Grub is compile with gcc 6.1 that have --enable-defult-pie set. It fail with. -ffreestanding -m32 -Wl,-melf_i386 -Wl,--build-id=none -nostdlib -Wl,-N -Wl,-r,-d - o trig.module trig_module-trigtables.o grep 'MARKER' gcry_whirlpool.marker.new > gcry_whirlpool.marker; rm -f gcry_whirlpool.marker.new /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and - shared may not be used together collect2: error: ld returned 1 exit status Makefile:26993: recipe for target 'trig.module' failed Check that compiler supports -no-pie and add it to linker flags. --- acinclude.m4 | 18 ++++++++++++++++++ configure.ac | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 526f97a3a..7884c1bb5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -390,6 +390,24 @@ else [fi] ]) +dnl Check if the Linker supports `-no-pie'. +AC_DEFUN([grub_CHECK_NO_PIE], +[AC_MSG_CHECKING([whether linker accepts -no-pie]) +AC_CACHE_VAL(grub_cv_cc_ld_no_pie, +[save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -no-pie" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_ld_no_pie=yes], + [grub_cv_cc_ld_no_pie=no]) +LDFLAGS="$save_LDFLAGS" +]) +AC_MSG_RESULT([$grub_cv_cc_ld_no_pie]) +nopie_possible=no +if test "x$grub_cv_cc_ld_no_pie" = xyes ; then + nopie_possible=yes +fi +]) + dnl Check if the C compiler supports `-fPIC'. AC_DEFUN([grub_CHECK_PIC],[ [# Position independent executable. diff --git a/configure.ac b/configure.ac index 3d2551035..dc56564d7 100644 --- a/configure.ac +++ b/configure.ac @@ -1185,13 +1185,18 @@ CFLAGS="$TARGET_CFLAGS" # Position independent executable. grub_CHECK_PIE +grub_CHECK_NO_PIE [# Need that, because some distributions ship compilers that include -# `-fPIE' or '-fpie' in the default specs. +# `-fPIE' or '-fpie' and '-pie' in the default specs. if [ x"$pie_possible" = xyes ]; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie" +fi +if [ x"$nopie_possible" = xyes ] && [ x"$pie_possible" = xyes ]; then + TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie" fi] CFLAGS="$TARGET_CFLAGS" +LDFLAGS="$TARGET_LDFLAGS" # Position independent executable. grub_CHECK_PIC From ce95549cc54b5d6f494608a7c390dba3aab4fba7 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 15 Dec 2016 16:07:00 +0300 Subject: [PATCH 204/207] efi: properly terminate filepath with NULL in chainloader EFI File Path Media Device Path is defined as NULL terminated string; but chainloader built file paths without final NULL. This caused error with Secure Boot and Linux Foundation PreLoader on Acer with InsydeH20 BIOS. Apparently firmware failed verification with EFI_INVALID_PARAMETER which is considered fatal error by PreLoader. Reported and tested by Giovanni Santini --- grub-core/loader/efi/chainloader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c index 522a716e3..adc856366 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -122,6 +122,8 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, if (*p == '/') *p = '\\'; + /* File Path is NULL terminated */ + fp->path_name[size++] = '\0'; fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp); } @@ -156,8 +158,10 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) d = GRUB_EFI_NEXT_DEVICE_PATH (d); } + /* File Path is NULL terminated. Allocate space for 2 extra characters */ + /* FIXME why we split path in two components? */ file_path = grub_malloc (size - + ((grub_strlen (dir_start) + 1) + + ((grub_strlen (dir_start) + 2) * GRUB_MAX_UTF16_PER_UTF8 * sizeof (grub_efi_char16_t)) + sizeof (grub_efi_file_path_device_path_t) * 2); From 562c406763d6c078ccf9fad1058e6d618b2456da Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Mon, 19 Dec 2016 17:09:04 +0800 Subject: [PATCH 205/207] Fix fwpath in efi netboot The path returned by grub_efi_net_config has already been stripped for the directory part extracted from cached bootp packet. We should just return the result to avoild it be stripped again. It fixed the problem that grub.efi as NBP image always looking for grub.cfg and platform directory in upper folder rather than current one it gets loaded while $prefix is empty. The behavior is inconsistent with other architecture and how we would expect empty $prefix going to be in general. The only exception to the general rule of empty $prefix is that when loaded from platform directory itself, the platform part is stripped thus upper folder is used for looking up files. It meets the case for how grub-mknetdir lay out the files under tftp root directory, but also hide away this issue to be identified as it appears to be just works. Also fix possible memory leak by moving grub_efi_get_filename() call after grub_efi_net_config(). --- grub-core/kern/efi/init.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index e9c85de12..2c31847bf 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -59,10 +59,13 @@ grub_machine_get_bootlocation (char **device, char **path) if (!image) return; *device = grub_efidisk_get_device_name (image->device_handle); - *path = grub_efi_get_filename (image->file_path); if (!*device && grub_efi_net_config) - grub_efi_net_config (image->device_handle, device, path); + { + grub_efi_net_config (image->device_handle, device, path); + return; + } + *path = grub_efi_get_filename (image->file_path); if (*path) { /* Get the directory. */ From 07662af7aed55bcec448bc2a6610de1f0cb62100 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 22 Dec 2016 22:48:25 +0300 Subject: [PATCH 206/207] configure: fix check for sys/sysmacros.h under glibc 2.25+ glibc 2.25 still includes sys/sysmacros.h in sys/types.h but also emits deprecation warning. So test for sys/types.h succeeds in configure but later compilation fails because we use -Werror by default. While this is fixed in current autoconf GIT, we really cannot force everyone to use bleeding edge (that is not even released right now). So run test under -Werror as well to force proper detection. This should have no impact on autoconf 2.70+ as AC_HEADER_MAJOR in this version simply checks for header existence. Reported and tested by Khem Raj --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index dc56564d7..4e980c5fe 100644 --- a/configure.ac +++ b/configure.ac @@ -389,7 +389,14 @@ fi # Check for functions and headers. AC_CHECK_FUNCS(posix_memalign memalign getextmntent) AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) + +# glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation +# warning which causes compilation failure later with -Werror. So use -Werror here +# as well to force proper sys/sysmacros.h detection. +SAVED_CFLAGS="$CFLAGS" +CFLAGS="$HOST_CFLAGS -Werror" AC_HEADER_MAJOR +CFLAGS="$SAVED_CFLAGS" AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default #include From 972765fe8245cdf44d465329f33b5aa9ac6c2f47 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 8 Jan 2017 15:52:49 +0300 Subject: [PATCH 207/207] linux: fix "vga=XX deprecated" warning for text mode Arguments were in reverse order which resulted in text is deprecated. Use set gfxpayload=vga=0 before linux command instead. --- grub-core/loader/i386/linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index fddcc461d..b15b8cca5 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -915,8 +915,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " - "linux command instead.\n"), "text", - argv[i]); + "linux command instead.\n"), + argv[i], "text"); break; case 1: @@ -925,8 +925,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " - "linux command instead.\n"), "text", - argv[i]); + "linux command instead.\n"), + argv[i], "text"); break; default: /* Ignore invalid values. */