Compare commits

..

170 Commits

Author SHA1 Message Date
Vladimir Serbinenko
3ffd8219c5 wip fs-tester 2017-01-27 18:48:27 +00:00
Vladimir Serbinenko
79fc008935 Don't use -mlong-calls on arm.
We don't really need it and it's flaky and creates
bogus symbols with clang.
2017-01-27 18:48:25 +00:00
Vladimir Serbinenko
bf9c561670 configure: Disable movw/movt with clang.
Those relocations are not compatible with PE and also
not compatible with custom uboot relocator.
Disable them.
2017-01-27 18:48:23 +00:00
Vladimir Serbinenko
afa9dda37e grub-fs-tester: Delete directory once we're done. 2017-01-27 18:00:40 +00:00
Vladimir Serbinenko
cde63a3bb0 grub-fs-tester: Accomodate for slower systems.
fstime can be more different with xz squashfs.
Allow difference up to 3 seconds.
This code is ugly now but rewriting it now is not on the
table.
2017-01-27 17:58:15 +00:00
Vladimir Serbinenko
bf0e59cebf grub-fs-tester: Accomodate for testing in proot containers.
proot creates hidden files with .proot prefix and name
derived from real file name. So decrease file name length
and path depth. For some reason depth 85 also results in
undeleteable directory, so use 84 instead of 85.
2017-01-27 17:46:47 +00:00
Andrei Borzenkov
a2932fbe8a osdep/linux: handle autofs entries in /proc/self/mountinfo
These entries have placeholder for device name and so are useless for our
purpose. grub failed with something like

grub-install: error: failed to get canonical path of `systemd-1'.

When we see autofs entry, record it (to keep parent-child relationship) but
continue to look for real mount. If it is found, we process it as usual. If
only autofs entry exists, attempt to trigger mount by opening mount point
and retry. Mount point itself is then kept open to avoid timeout.

Recent systemd is by default using automount for /boot/efi so this should
become more popular problem on EFI systems.

Closes: 49942
2017-01-24 20:05:19 +03:00
Andrei Borzenkov
972765fe82 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.
2017-01-08 15:52:49 +03:00
Andrei Borzenkov
07662af7ae 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 <raj.khem@gmail.com>
2016-12-22 22:48:25 +03:00
Michael Chang
562c406763 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().
2016-12-22 22:37:32 +03:00
Andrei Borzenkov
ce95549cc5 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 <itachi.sama.amaterasu@gmail.com>
2016-12-15 16:07:00 +03:00
Magnus Granberg
a3e9da054d 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.
2016-12-14 20:44:41 +03:00
Stanislav Kholmanskikh
130234bc78 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 <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-12-14 14:13:34 +01:00
Stanislav Kholmanskikh
7b4c54c4ad 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 <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-12-14 14:13:34 +01:00
Alexander Graf
0d2345774d 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 <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-11-24 10:09:24 +01:00
Andrei Borzenkov
c9a8d037a8 NEWS updates 2016-11-22 20:51:54 +03:00
Andrei Borzenkov
f8c3af3b61 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_<interface>_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 <nikunj@linux.vnet.ibm.com>
Cc: nikunj@linux.vnet.ibm.com

v2: change variable name to net_<interface>_next_server as discussed on the list
2016-11-22 20:43:04 +03:00
Aaro Koskinen
0af7539bd2 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 <aaro.koskinen@iki.fi>
2016-11-22 20:41:34 +03:00
Dirk Mueller
0d663b50b9 grub-mknetdir: Add support for ARM64 EFI 2016-11-14 19:27:13 +03:00
Joonas Lahtinen
28511b0da9 .gitignore: Add grub-core/build-grub-module-verifier
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2016-11-12 12:07:31 +03:00
Alexander Graf
e1b099fb69 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 <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-11-10 13:21:00 +01:00
Alexander Graf
fbca374105 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 <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-11-10 13:20:56 +01:00
Corey Hickey
5f311e86d2 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:
a10e7a5a89

The bug was (apparently) latent until revealed by:
3bca85b418

Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
2016-11-05 15:28:50 +03:00
Juergen Gross
0de3eeb623 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
b67a95ecad 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
5500cefccd 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
d73976fdff 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
1fbb2b4b39 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
c221ea06b5 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
72c28509fa 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:22:06 +02:00
Juergen Gross
7e5fcb0b34 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:21:25 +02:00
Juergen Gross
6ae55ce103 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:17:15 +02:00
Juergen Gross
c69d1858f1 xen: avoid memleaks on error
When loading a Xen pv-kernel avoid memory leaks in case of errors.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:17:15 +02:00
Juergen Gross
4231927e44 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 <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-10-27 16:16:54 +02:00
Daniel Kiper
a620876e3b 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 <daniel.kiper@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2016-10-27 15:55:16 +02:00
Daniel Kiper
f2b6c20a25 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 <daniel.kiper@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2016-10-27 15:55:00 +02:00
Daniel Kiper
ba89c19f49 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 <daniel.kiper@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2016-10-27 15:54:46 +02:00
Daniel Kiper
9862b24121 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 <daniel.kiper@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2016-10-27 15:53:43 +02:00
Sakar Arora
e563928ba4 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 <Sakar.Arora@nxp.com>
2016-10-18 20:26:42 +03:00
Andrei Borzenkov
a0bf403f66 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
2016-09-28 20:31:04 +03:00
Pete Batard
4e0f8f66e3 Add missing va_end() to xasprintf() in grub-emu. 2016-08-13 16:36:01 +03:00
Andrei Borzenkov
c831d2073b at_keyboard: fix numpad "0" and "." mapping
Reported for set 1 by fgndevelop <fgndevelop@posteo.org>. Apparently
set 2 was reversed too.
2016-07-27 08:33:12 +03:00
Andrei Borzenkov
52408aa946 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 <mchang@suse.com>
2016-07-26 20:38:58 +03:00
Andrei Borzenkov
58590cb2ef 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 <marcosfrm@outlook.com>
Reviewd by Jan Kara <jack@suse.cz>
2016-07-26 20:29:26 +03:00
Andrei Borzenkov
b524fa27f5 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.
2016-05-03 19:23:31 +03:00
Andrei Borzenkov
e045af148a 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).
2016-04-30 09:15:36 +03:00
Stefan Fritsch
13f7ead3a1 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.
2016-04-30 09:13:34 +03:00
Mike Gilbert
7a5b301e3a 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
2016-04-24 08:12:42 +03:00
Michael Chang
abf9beb7d6 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.
2016-04-09 07:08:13 +03:00
Andrei Borzenkov
f4d35d49e3 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 <jirib@devio.us>
2016-03-22 20:12:22 +03:00
Andrei Borzenkov
6714d7ecff 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.
2016-03-20 10:32:33 +03:00
Andrei Borzenkov
5b8ddf6e03 bootp: fix memory leak in grub_cmd_dhcpopt 2016-03-19 09:39:30 +03:00
Aaron Luft
76eac44af3 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.
2016-03-15 22:04:38 +03:00
Andrei Borzenkov
ee83919e93 Makefile.util.def: add $LIBINTL to grub-macbless flags
Fixes compilation on OpenBSD 5.9.

Reported by Jiri B <jirib@devio.us>
2016-03-13 08:11:58 +03:00
Robert Marshall
3c3e96d044 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
2016-03-11 17:24:56 +01:00
Michael Chang
15aee573d2 xen_file: Fix invalid payload size 2016-03-11 10:26:51 +01:00
Vladimir Serbinenko
7f2a856fae multiboot2: Remove useless GRUB_PACKED
Reported by: Daniel Kiper
2016-03-10 21:16:10 +01:00
Andrei Borzenkov
9545a8fd04 20_linux_xen: fix test for GRUB_DEVICE
Same fix as in 082bc9f.
2016-03-06 08:54:19 +03:00
Mike Gilbert
082bc9f77b 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.
2016-03-06 08:51:07 +03:00
Andrei Borzenkov
d017ea8ede NEWS update 2016-02-28 21:52:08 +03:00
Vladimir Serbinenko
8207874e5d Release 2.02~beta3 2016-02-28 03:07:41 +01:00
Vladimir Serbinenko
102e435d81 grub_arch_sync_dma_caches: Accept volatile address 2016-02-28 03:07:27 +01:00
Leif Lindholm
51f375d688 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.
2016-02-27 13:44:59 +01:00
Vladimir Serbinenko
ca028db3d4 usbtrans: Fix memory coherence and use-after-free. 2016-02-27 13:40:52 +01:00
Vladimir Serbinenko
0f076d75d0 ehci: Fix memory coherence
This is a no-op on x86 but necessarry on ARM and may be necessarry on MIPS.
2016-02-27 13:40:52 +01:00
Vladimir Serbinenko
86ef66d977 arm-uboot: Make self-relocatable to allow loading at any address 2016-02-27 13:40:52 +01:00
Vladimir Serbinenko
5bcb7d394c Allow _start == 0 with relocatable images 2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
df21fff504 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.
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
73a9c742fe Encapsulate image layout into a separate structure.
Currently we pass around a lot of pointer. Instead put all relevant data
into one structure.
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
dd3969e7ec mkimagexx: Split PE and generic part for relocations.
As a preparation for U-Boot relocations, split emitting PE-relocations
from parsing source ELF-relocations.
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
36212460d3 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
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
2ebef43cf6 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.
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
8c26dace6f cat: Don't switch terminal mode when there is nothing to highlight.
This just pollutes serial console.
2016-02-27 13:35:36 +01:00
Vladimir Serbinenko
070e190305 Use console rather than serial_efi0 on arm64-efi in tests 2016-02-27 13:35:36 +01:00
Andrei Borzenkov
109189ce01 efidisk: fix misplaced parenthesis in b00e4c2 2016-02-27 15:16:48 +03:00
Andrei Borzenkov
b00e4c2bd9 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 <Andreas.Loew@gmx.net>
2016-02-26 21:44:37 +03:00
Vladimir Serbinenko
06a3b0b214 Regenerate checksums 2016-02-26 11:37:47 +01:00
Vladimir Serbinenko
5486a4e12b Makefile: Don't delete default_payload.elf if it doesn't exist. 2016-02-26 11:14:46 +01:00
Josef Bacik
eb9f401fc1 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 <jbacik@fb.com>
2016-02-25 22:38:52 +03:00
Vladimir Serbinenko
94c56a4c65 ieee1275: fix signed comparison 2016-02-24 18:37:22 +01:00
Andrei Borzenkov
1b782e902e search: actually skip floppy with --no-floppy
grub_device_iterate() ignores device when iterator returns 1, not 0.

Reported by Carlos E. R. <robin.listas@telefonica.net>
2016-02-23 23:17:24 +03:00
Andrei Borzenkov
15dfea842c multiboot2: zero reserved field in memory map
Documentation says, bootloader should set reserved field to zero.

Reported by Wink Saville <wink@saville.com>
2016-02-23 09:12:14 +03:00
Vladimir Serbinenko
054d1325e9 Improve EHCI logging
Add dprintf's on common error paths and remove some entries which are too
noisy.
2016-02-22 20:07:10 +01:00
Vladimir Serbinenko
0678b5d629 usb_keyboard: Remove useless include
This prevents non-PCI machines from having USB.
2016-02-22 20:05:54 +01:00
Vladimir Serbinenko
be4e9d20a5 Refresh before abort
This ensures that abort message is actually visible to the user.
2016-02-22 19:46:55 +01:00
Eric Snowberg
bc220962e3 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 <eric.snowberg@oracle.com>
2016-02-22 10:01:31 +03:00
Thomas Huth
625934ec0f 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 <thuth@redhat.com>
2016-02-22 09:59:27 +03:00
Vladimir Serbinenko
e3745f9087 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.
2016-02-17 18:19:18 +01:00
Vladimir Serbinenko
01d50c2539 default_payload.elf: Include password_pbkdf2.
Withoout this module we may end up in a system where no password is
accepted.
2016-02-17 18:11:51 +01:00
Vladimir Serbinenko
8d69065f52 default_payload.elf: Add modules from $(EXTRA_PAYLOAD_MODULES).
This allows coreboot building system to add extra modules depending
on user config.
2016-02-17 18:10:31 +01:00
Vladimir Serbinenko
59ec05bcf8 mm: Avoid integer overflow. 2016-02-17 18:09:44 +01:00
Vladimir Serbinenko
fabde8324d Remove -Wno-maybe-uninitialized as it may not be present. 2016-02-17 17:58:05 +01:00
Vladimir Serbinenko
5cae910665 Fix warnings when compiling with -O3 2016-02-17 17:56:41 +01:00
Vladimir Serbinenko
25492a0f04 Add wbinvd around bios call.
Via C3 has problems with cache coherency when transitioning between the modes,
so flush it around bios calls.
2016-02-14 08:34:10 +01:00
Eric Snowberg
080a20861c 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.
2016-02-12 23:16:03 +01:00
Andreas Freimuth
f96b34224e Add Thinkpad T410s button cmos address. 2016-02-12 19:19:11 +01:00
Vladimir Serbinenko
a2ab8c2172 TODO: Remove obsolete link 2016-02-12 17:51:52 +01:00
Toomas Soome
ce01054ec3 lz4: Fix pointer overflow 2016-02-12 17:26:32 +01:00
Vladimir Serbinenko
feef882f98 grub-shell: Update 32-bit OVMF binary name. 2016-02-12 16:08:04 +01:00
Daniel Kiper
eba6db6323 relocator: Fix integer underflow. 2016-02-12 16:07:57 +01:00
Vladimir Serbinenko
6e1ace590a Change -v to -V for version of shell utils. 2016-02-12 15:46:05 +01:00
Vladimir Serbinenko
7c35f65aac xnu: Add new kernel path to autoconfig. 2016-02-12 15:42:26 +01:00
Vladimir Serbinenko
4598cafa7d arm64: Use cpu timer for timekeeping. 2016-02-12 12:43:02 +01:00
Vladimir Serbinenko
6f4189ffc1 powerpc: Trim header in tests. 2016-02-12 12:42:04 +01:00
Vladimir Serbinenko
127cfea8be default_payload: Include syslinuxcfg, all filesystems and xnu. 2016-02-12 12:41:28 +01:00
Vladimir Serbinenko
22aa31bcc3 xnu: Supply random seed.
Now we're able to load kernels up to El Capitan.
2016-02-12 12:40:10 +01:00
Vladimir Serbinenko
e72de13b9e Add RNG module. 2016-02-12 12:39:38 +01:00
Vladimir Serbinenko
342d6edb97 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.
2016-02-12 12:34:54 +01:00
Vladimir Serbinenko
e5c9300191 printf: Fix and test %% behaviour in presence of subsequenbt args. 2016-02-12 12:33:41 +01:00
Vladimir Serbinenko
d9a3bfead8 Split pmtimer wait and tsc measurement from pmtimer tsc calibration. 2016-02-12 11:40:51 +01:00
Vladimir Serbinenko
1933d37371 Make grub_cpu_is_tsc_supported generally available. 2016-02-12 11:38:51 +01:00
Vladimir Serbinenko
b29638222e Make grub_acpi_find_fadt accessible generically 2016-02-12 11:35:48 +01:00
Vladimir Serbinenko
8ad190cac2 Make unaligned types public.
This simplifies code which has to handle those types.
2016-02-12 09:11:06 +01:00
Vladimir Serbinenko
281baeecd3 Fix emu compilation error on arm. 2016-02-12 09:10:08 +01:00
Vladimir Serbinenko
df4df4d887 xnu: Include relocated EFI in heap size. 2016-02-11 12:30:45 +01:00
Vladimir Serbinenko
2d425ffdd5 xnu: supply ramsize to the kernel.
Without this info recent kernels crash as they allocate no heap.
2016-02-11 11:58:28 +01:00
Andrei Borzenkov
67dba97e45 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.
2016-02-03 20:34:55 +03:00
Andrei Borzenkov
7290bb5623 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
2016-02-01 20:13:48 +03:00
Vladimir Serbinenko
ff84a9b868 Error out if mtools invocation fails. 2016-01-22 19:28:08 +01:00
Vladimir Serbinenko
605eecc985 arm64: Add support for relocations needed for linaro gcc 2016-01-22 19:09:37 +01:00
Vladimir Serbinenko
b6a03dfd32 efiemu: Fix compilation failure 2016-01-22 14:10:30 +01:00
Vladimir Serbinenko
5f2b285bf8 Document cpuid -p 2016-01-22 13:50:53 +01:00
Robert Elliott
ae3b83a4d4 efiemu: Handle persistent RAM and unknown possible future additions. 2016-01-22 13:32:30 +01:00
Vladimir Serbinenko
dab148891e Document expr1 expr2 syntax for test command 2016-01-22 13:27:36 +01:00
Michael Chang
64e2d139fe Restore terminal settings on grub-emu exit. 2016-01-22 11:05:32 +01:00
Vladimir Serbinenko
0edd750e50 xen_boot: Remove obsolete module type distinctions. 2016-01-22 10:18:47 +01:00
Vladimir Serbinenko
cc2ed41039 arm: Ignore qemu clock bug 2016-01-22 10:12:43 +01:00
Vladimir Serbinenko
7c6c2ad42c i386-ieee1275: Increase maximum heap size to accomodate highres graphi tests 2016-01-22 10:12:43 +01:00
Colin Watson
47e67d809c 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.
2016-01-20 15:56:55 +00:00
Colin Watson
92bbf25714 loader/bsd: Fix signed/unsigned comparison 2016-01-16 20:40:55 +00:00
Colin Watson
95440b41d3 ahci, ehci: Fix typos 2016-01-16 20:37:15 +00:00
Andrei Borzenkov
f826d914e2 grub-probe: fix memory leak
Found by: Coverity scan.
CID: 73783
2016-01-16 21:47:28 +03:00
Andrei Borzenkov
77002c65d3 tftp: fix memory leaks in open
If protocol open fails, file is immediately freed, so data was leaked.

Found by: Coverity scan.
CID: 96659
2016-01-16 21:27:57 +03:00
Andrei Borzenkov
d4561cd080 tcp: fix memory leaks
Found by: Coverity scan.
CID: 96639, 96647
2016-01-16 20:59:50 +03:00
Andrei Borzenkov
9b4256bf05 net: fix memory leaks
Found by: Coverity scan.
CID: 96638, 96648
2016-01-16 20:48:33 +03:00
Andrei Borzenkov
eefa3239c2 legacycfg: fix memory leaks and add NULL check
Memory leaks found by Coverity scan.
CID: 96642, 96645
2016-01-16 20:34:02 +03:00
Andrei Borzenkov
4f8fe948b9 loader: Unintended sign extension
CID: 96707, 96699, 96693, 96691, 96711, 96709, 96708, 96703, 96702,
96700, 96698, 96696, 96695, 96692, 96710, 96705
2016-01-15 19:18:05 +03:00
Andrei Borzenkov
b95e926788 script: fix memory leak
Found by: Coverity scan.
CID: 96637
2016-01-12 22:50:30 +03:00
Andrei Borzenkov
26533fe6bc normal: fix memory leak
Found by: Coverity scan.
CID: 96641, 96670, 96667
2016-01-12 22:40:03 +03:00
Andrei Borzenkov
29862fdc3a xnu: fix memory leak
Found by: Coverity scan.
CID: 96663
2016-01-12 21:52:51 +03:00
Andrei Borzenkov
9daf7aae8b truecrypt: fix memory leak
Found by: Coverity scan.
CID: 156611
2016-01-12 21:52:51 +03:00
Andrei Borzenkov
a4b1326f0d gfxmenu: fix memory leak
Found by: Coverity scan.
CID: 96657
2016-01-12 21:52:50 +03:00
Andrei Borzenkov
dbb0f9fa4f efiemu: fix memory leak
Found by: Coverity scan.
CID: 156610
2016-01-12 21:52:50 +03:00
Andrei Borzenkov
e9d71db53a efidisk: fix memory leak
Found by: Coverity scan.
CID: 96644
2016-01-12 21:52:50 +03:00
Andrei Borzenkov
6c35ce72ba verify: fix memory leak
Found by: Coverity scan.
CID: 96643
2016-01-12 21:52:42 +03:00
Andrei Borzenkov
f3c84fa798 password_pbkdf2: fix memory leak
Found by: Coverity scan.
CID: 96656
2016-01-12 20:53:26 +03:00
Andrei Borzenkov
5db2190f2c parttool: fix memory leak
Found by: Coverity scan.
CID: 96652
2016-01-12 20:41:44 +03:00
Andrei Borzenkov
1bff60e5aa nativedisk: fix memory leak
Based on Coverity scan.
CID: 96660

Extended to also cover other error return places.
2016-01-12 20:37:43 +03:00
Andrei Borzenkov
8fe17d91af acpi: fix memory leak
Found by: Coverity scan.
CID: 96673
2016-01-12 20:26:30 +03:00
Andrei Borzenkov
66768b99f1 grub-install: include ehci in list of native modules
This matches behavior of "nativedisk" command.

Reported and tested by Smith Henry <sh37092@gmail.com>
2016-01-10 16:08:06 +03:00
Andrei Borzenkov
962b69d950 grub-mkimage: remove redundant NULL check
Found by: Coverity scan.
CID: 73737
2016-01-10 11:51:34 +03:00
Andrei Borzenkov
528256932b 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
2016-01-10 11:33:13 +03:00
Andrei Borzenkov
269a522c7d 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
2016-01-10 10:41:04 +03:00
Andrei Borzenkov
5a5a3c6963 setup: fix NULL pointer dereference
Check return value of grub_guess_root_devices

Found by: Coverity scan.
CID: 73638, 73751
2016-01-09 21:25:22 +03:00
Andrei Borzenkov
670c43af27 mkimage: fix unintended sign extension
Found by: Coverity scan.
CID: 73691, 73717
2016-01-09 21:05:44 +03:00
Andrei Borzenkov
dc27d254f2 util/getroot: delete dead code
is_part cannot be non-zero at this point.

Found by: Coveruty scan.
CID: 73838
2016-01-09 20:54:54 +03:00
Andrei Borzenkov
31f6506c57 loader/multiboot: fix unintended sign extension
Found by: Coveruty scan.
CID: 73700, 73763
2016-01-09 19:58:51 +03:00
Andrei Borzenkov
9fecb0588e kern/elf: fix unintended sign extension
Found by: Coverity scan.
CID: 73729, 73735, 73758, 73760
2016-01-09 19:41:26 +03:00
Andrei Borzenkov
aafd205c92 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
2016-01-09 18:55:55 +03:00
Andrei Borzenkov
bd60f5a207 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
2016-01-09 18:15:27 +03:00
Andrei Borzenkov
725548a285 grub-mklayout: check subscript bounds
Found by: Coverity scan.
CID: 73686
2016-01-09 14:13:36 +03:00
Andrei Borzenkov
d5cc487d39 grub-probe: fix memory leak
Found by: Coverity scan.
CID: 73783
2016-01-09 13:55:28 +03:00
Andrei Borzenkov
fa2af21ec8 gfxmenu: fix memory leak
Found by: Coverity scan.
CID: 73766
2016-01-09 13:55:28 +03:00
Andrei Borzenkov
0e075ac385 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
2016-01-09 13:55:18 +03:00
Andrei Borzenkov
57e7f1b775 setup: fix memory leak
Found by: Coverity scan.
CID: 73680, 73715
2016-01-09 13:10:10 +03:00
Andrei Borzenkov
67d9ce82ac efiemu: check return value of grub_efiemu_write_value
Found by: Coverity scan.
CID: 73590
2016-01-09 11:36:42 +03:00
Andrei Borzenkov
12bf87466f efiemu: change code to avoid Coverity false positive
CID: 73623
2016-01-09 11:36:42 +03:00
Andrei Borzenkov
97c41e1216 efiemu: fix unintended sign extension
Found by: Coverity scan.
CID: 73883, 73637
2016-01-09 11:36:42 +03:00
Andrei Borzenkov
8ab2675ede hfs: fix memory leak
Found by: Coverity scan.
CID: 156531
2016-01-09 11:36:42 +03:00
Andrei Borzenkov
efc04d65c7 grub-module-verifier: fix unintended sign extension
Found by: Coverity scan.
CID: 156533, 156532
2016-01-09 11:36:42 +03:00
154 changed files with 4576 additions and 2093 deletions

1
.gitignore vendored
View File

@@ -246,3 +246,4 @@ build-aux/test-driver
/garbage-gen
/garbage-gen.exe
/grub-fs-tester
grub-core/build-grub-module-verifier

View File

@@ -409,8 +409,9 @@ BOOTCHECK_TIMEOUT=180
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
default_payload.elf: grub-mkstandalone grub-mkimage FORCE
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
endif

View File

@@ -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;
@@ -414,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 = {
@@ -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;

14
NEWS
View File

@@ -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,9 @@ 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.
* New variable net_<interface>_next_server containing next server
from BOOTP reply.
* Coreboot improvements:
* CBFS support both in on-disk images (loopback) and flash.
@@ -96,6 +100,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 +140,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 +171,9 @@ 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.
* Do not require fonts on powerpc-ieee1275.
* Revision control moved to git.

4
TODO
View File

@@ -7,7 +7,3 @@ glance. So write to <grub-devel@gnu.org> 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/

View File

@@ -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.

View File

@@ -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

View File

@@ -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])
@@ -388,7 +388,15 @@ 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)
# 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 <sys/param.h>
@@ -1144,14 +1152,15 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
fi
if test "x$target_cpu" = xarm; then
AC_CACHE_CHECK([whether option -mlong-calls works], grub_cv_cc_mlong_calls, [
CFLAGS="$TARGET_CFLAGS -mlong-calls -Werror"
AC_CACHE_CHECK([whether option -mllvm -arm-use-movt=0 works], grub_cv_cc_mllvm_arm_use_movt, [
CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_mlong_calls=yes],
[grub_cv_cc_mlong_calls=no])
[grub_cv_cc_mllvm_arm_use_movt=yes],
[grub_cv_cc_mllvm_arm_use_movt=no])
])
if test "x$grub_cv_cc_mlong_calls" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mlong-calls"
if test "x$grub_cv_cc_mllvm_arm_use_movt" = xyes; then
# A trick so that clang doesn't see it on link stage
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0"
fi
AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [
CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror"
@@ -1184,13 +1193,18 @@ CFLAGS="$TARGET_CFLAGS"
# Position independent executable.
grub_CHECK_PIE
grub_CHECK_NO_PIE
[# Need that, because some distributions ship compilers that include
# `-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"
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
@@ -1554,11 +1568,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
@@ -1628,11 +1642,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

View File

@@ -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{<interface>}_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
@@ -2538,6 +2542,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
@@ -3060,6 +3066,7 @@ These variables have special meaning to GRUB.
* net_@var{<interface>}_hostname::
* net_@var{<interface>}_ip::
* net_@var{<interface>}_mac::
* net_@var{<interface>}_next_server::
* net_@var{<interface>}_rootpath::
* net_default_interface::
* net_default_ip::
@@ -3420,6 +3427,12 @@ The default is the value of @samp{color_normal} (@pxref{color_normal}).
@xref{Network}.
@node net_@var{<interface>}_next_server
@subsection net_@var{<interface>}_next_server
@xref{Network}.
@node net_@var{<interface>}_rootpath
@subsection net_@var{<interface>}_rootpath
@@ -4073,12 +4086,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
@@ -5042,6 +5058,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

View File

@@ -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

View File

@@ -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;
@@ -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/arm/efi/init.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;
@@ -1531,6 +1533,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;
@@ -1685,7 +1688,32 @@ 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;
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 = {

View File

@@ -29,6 +29,7 @@
#include <grub/loader.h>
#include <grub/cs5536.h>
#include <grub/disk.h>
#include <grub/cache.h>
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;
}
@@ -1121,7 +1142,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))
@@ -1289,16 +1310,28 @@ 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;
sync_all_caches (e);
/* 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 +1343,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 +1353,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 +1380,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;
}
@@ -1386,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;
@@ -1434,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,
@@ -1469,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. */
@@ -1502,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;
}
@@ -1515,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),
@@ -1581,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;
@@ -1600,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;
}
@@ -1622,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. */
@@ -1676,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;
}
@@ -1777,11 +1831,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)
{

View File

@@ -24,6 +24,7 @@
#include <grub/usb.h>
#include <grub/usbtrans.h>
#include <grub/time.h>
#include <grub/cache.h>
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);

View File

@@ -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;

View File

@@ -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 ();

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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]);

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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]);

View File

@@ -85,6 +85,12 @@ make_devices (void)
{
/* Uggh. */
grub_free (handles);
while (devices)
{
d = devices->next;
grub_free (devices);
devices = d;
}
return 0;
}
@@ -487,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);
@@ -518,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
@@ -541,7 +581,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,
@@ -562,7 +604,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);

View File

@@ -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;
}
@@ -343,7 +346,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);

View File

@@ -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");

View File

@@ -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_PERSISTENT:
case GRUB_MEMORY_PERSISTENT_LEGACY:
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_PERSISTENT, 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;

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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
{
@@ -775,7 +780,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);

View File

@@ -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);

View File

@@ -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)) {

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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"),

View File

@@ -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;
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <grub/env.h>
#include <grub/kernel.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/time.h>
#include <grub/efi/efi.h>
#include <grub/loader.h>
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 ();
}

View File

@@ -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;
@@ -605,7 +611,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;

43
grub-core/kern/efi/fdt.c Normal file
View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <grub/efi/efi.h>
#include <grub/mm.h>
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;
}

View File

@@ -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. */

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -65,6 +65,12 @@ grub_reboot (void)
longjmp (main_env, 1);
}
void
grub_exit (void)
{
grub_reboot ();
}
void
grub_machine_init (void)
{
@@ -195,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);
@@ -226,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;

View File

@@ -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"));
@@ -134,11 +135,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)

View File

@@ -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)
{

View File

@@ -24,129 +24,35 @@
#include <grub/time.h>
#include <grub/misc.h>
#include <grub/i386/tsc.h>
#include <grub/i386/pmtimer.h>
#include <grub/acpi.h>
#include <grub/cpu/io.h>
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)
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)
@@ -158,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;
}

View File

@@ -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 < 0 || (grub_size_t) 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))
{

View File

@@ -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;
}
@@ -1099,6 +1106,8 @@ grub_fatal (const char *fmt, ...)
grub_vprintf (_(fmt), ap);
va_end (ap);
grub_refresh ();
grub_abort ();
}

View File

@@ -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 <adress space size> - 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;

View File

@@ -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);

103
grub-core/lib/i386/random.c Normal file
View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <grub/random.h>
#include <grub/i386/io.h>
#include <grub/i386/tsc.h>
#include <grub/i386/pmtimer.h>
#include <grub/acpi.h>
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);
}

View File

@@ -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):

View File

@@ -16,6 +16,8 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/i386/memory.h>
#include <grub/i386/types.h>
#include <grub/symbol.h>
#include <grub/xen.h>
@@ -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)

View File

@@ -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,

120
grub-core/lib/random.c Normal file
View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <grub/random.h>
#include <grub/dl.h>
#include <grub/lib/hexdump.h>
#include <grub/command.h>
#include <grub/mm.h>
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);
}

View File

@@ -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;
}
}
}
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <grub/mm.h>
#include <grub/misc.h>
#include <grub/types.h>
#include <grub/err.h>
#include <grub/i386/relocator.h>
#include <grub/relocator_private.h>
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;
}

View File

@@ -16,95 +16,85 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/x86_64/memory.h>
#include <grub/x86_64/types.h>
#include <grub/symbol.h>
#include <grub/xen.h>
/* 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)

View File

@@ -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];

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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");

View File

@@ -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_ssize_t) ((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;

View File

@@ -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. */

View File

@@ -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 *

View File

@@ -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);

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -18,6 +18,7 @@
#include <grub/xen_file.h>
#include <grub/misc.h>
#include <xen/elfnote.h>
static grub_err_t
parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
@@ -26,6 +27,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 +38,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 +127,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 +142,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 +150,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 +158,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"
@@ -196,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
@@ -253,6 +261,13 @@ 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;
default:
grub_dprintf ("xen", "unknown note type %d\n", nh->n_type);
break;

View File

@@ -35,6 +35,7 @@
#include <grub/i18n.h>
#include <grub/bitmap_scale.h>
#include <grub/cpu/io.h>
#include <grub/random.h>
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
@@ -338,7 +339,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;
}
@@ -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? */
@@ -897,6 +918,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 +1016,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;
@@ -1080,7 +1124,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

View File

@@ -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;
@@ -166,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"));
}

View File

@@ -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
@@ -72,57 +76,89 @@ 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;
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);
}
}
@@ -164,22 +200,22 @@ 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;
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, 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;

View File

@@ -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;
int entry_specified = 0;
grub_addr_t entry = 0;
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");
}
@@ -172,10 +177,13 @@ 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:
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]);
@@ -192,6 +200,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))
@@ -206,27 +221,50 @@ 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;
case MULTIBOOT_HEADER_TAG_EFI_BS:
#ifdef GRUB_MACHINE_EFI
keep_bs = 1;
#endif
break;
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);
}
break;
}
if (addr_tag && !entry_specified)
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");
}
@@ -235,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);
@@ -249,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;
}
@@ -279,17 +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;
}
}
if (entry_specified)
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,
@@ -377,7 +462,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)
@@ -396,13 +481,16 @@ 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)
+ ALIGN_UP (sizeof (struct multiboot_tag_load_base_addr), 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
@@ -420,6 +508,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;
@@ -677,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;
@@ -739,12 +837,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
@@ -760,18 +859,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;
@@ -870,36 +970,57 @@ 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)
{
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

View File

@@ -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);

View File

@@ -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;
@@ -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;
@@ -157,6 +158,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
@@ -189,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 ();
}
@@ -209,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)
@@ -368,6 +375,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 +384,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 +408,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 +422,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,

View File

@@ -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)

View File

@@ -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 =
@@ -151,7 +157,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 +227,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;
}
@@ -294,6 +300,91 @@ 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;
}
/* 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)
{
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN))
return grub_ieee1275_alloc_mem (len);
else
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)
{
@@ -409,40 +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;
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)
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;
@@ -455,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

View File

@@ -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));
}
@@ -450,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));

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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;
@@ -299,12 +284,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 +296,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)
{
@@ -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
{
@@ -1322,20 +1310,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;
}
}
@@ -1365,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';
@@ -1428,7 +1418,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)
@@ -1688,6 +1681,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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}
@@ -476,7 +480,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 +1272,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 +1282,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;
}

View File

@@ -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)

View File

@@ -40,6 +40,12 @@
#include <limits.h>
#endif
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#include <libdevmapper.h>
#include <grub/types.h>
@@ -137,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;

View File

@@ -24,6 +24,11 @@
#include <errno.h>
#include <limits.h>
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#ifdef HAVE_DEVICE_MAPPER
# include <libdevmapper.h>

View File

@@ -35,6 +35,12 @@
#include <limits.h>
#endif
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#include <grub/types.h>
#include <sys/ioctl.h> /* ioctl */
#include <sys/mount.h>
@@ -374,24 +380,30 @@ get_btrfs_fs_prefix (const char *mount_path)
char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
{
FILE *fp;
FILE *fp = NULL;
char *buf = NULL;
size_t len = 0;
grub_size_t entry_len = 0, entry_max = 4;
grub_size_t entry_len, entry_max = 4;
struct mountinfo_entry *entries;
struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" };
int i;
int retry = 0;
int dir_fd = -1;
char **ret = NULL;
if (! *dir)
dir = "/";
if (relroot)
*relroot = NULL;
entries = xmalloc (entry_max * sizeof (*entries));
again:
fp = grub_util_fopen ("/proc/self/mountinfo", "r");
if (! fp)
return NULL; /* fall through to other methods */
goto out; /* fall through to other methods */
entries = xmalloc (entry_max * sizeof (*entries));
entry_len = 0;
/* First, build a list of relevant visible mounts. */
while (getline (&buf, &len, fp) > 0)
@@ -478,7 +490,6 @@ grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
/* Now scan visible mounts for the ones we're interested in. */
for (i = entry_len - 1; i >= 0; i--)
{
char **ret = NULL;
char *fs_prefix = NULL;
if (!*entries[i].device)
continue;
@@ -509,6 +520,23 @@ grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
ret = grub_find_root_devices_from_btrfs (dir);
fs_prefix = get_btrfs_fs_prefix (entries[i].enc_path);
}
else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0)
{
/* If the best match is automounted, try to trigger mount. We cannot
simply return here because stat() on automounted directory does not
trigger mount and returns bogus (pseudo)device number instead.
We keep mountpoint open until end of scan to prevent timeout. */
int flags = O_RDONLY|O_DIRECTORY;
fclose (fp);
#ifdef O_LARGEFILE
flags |= O_LARGEFILE;
#endif
dir_fd = open (entries[i].enc_path, flags);
retry = 1;
goto again;
}
if (!ret)
{
ret = xmalloc (2 * sizeof (ret[0]));
@@ -538,16 +566,17 @@ grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
}
if (fs_prefix != entries[i].enc_root)
free (fs_prefix);
free (buf);
free (entries);
fclose (fp);
return ret;
break;
}
out:
free (buf);
free (entries);
fclose (fp);
return NULL;
if (fp)
fclose (fp);
if (dir_fd != -1)
close (dir_fd);
return ret;
}
static char *

View File

@@ -51,8 +51,10 @@
#endif
#include <sys/types.h>
#if defined(HAVE_SYS_MKDEV_H)
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)

View File

@@ -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 */
}
}

View File

@@ -30,7 +30,6 @@
#include "grub_script.tab.h"
#pragma GCC diagnostic ignored "-Wunreachable-code"
#pragma GCC diagnostic ignored "-Wmissing-declarations"
%}

View File

@@ -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
}

View File

@@ -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,

View File

@@ -19,7 +19,6 @@
#include <grub/term.h>
#include <grub/time.h>
#include <grub/cpu/io.h>
#include <grub/misc.h>
#include <grub/term.h>
#include <grub/usb.h>

View File

@@ -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 },

Some files were not shown because too many files have changed in this diff Show More