Vladimir Serbinenko [Tue, 9 May 2017 06:47:34 +0000 (08:47 +0200)]
arm_coreboot: Add Chromebook keyboard driver.
Vladimir Serbinenko [Tue, 9 May 2017 06:42:14 +0000 (08:42 +0200)]
rk3288_spi: Add SPI driver
Vladimir Serbinenko [Tue, 9 May 2017 06:40:29 +0000 (08:40 +0200)]
fdtbus: Add ability to send/receive messages on parent busses.
Vladimir Serbinenko [Tue, 9 May 2017 06:39:40 +0000 (08:39 +0200)]
Fix bug on FDT nodes with compatible property
Vladimir Serbinenko [Mon, 8 May 2017 20:14:28 +0000 (22:14 +0200)]
arm_coreboot: Support EHCI.
Vladimir Serbinenko [Mon, 8 May 2017 20:10:26 +0000 (22:10 +0200)]
ehci: Split core code from PCI part.
On ARM often EHCI is present without PCI and just declared in device
tree. So splitcore from PCI part.
Vladimir Serbinenko [Mon, 8 May 2017 20:06:04 +0000 (22:06 +0200)]
arm_coreboot: Support DMA.
This is needed to support USB and some other busses.
Vladimir Serbinenko [Mon, 8 May 2017 20:00:06 +0000 (22:00 +0200)]
arm_coreboot: Support loading linux images.
Vladimir Serbinenko [Mon, 8 May 2017 19:59:48 +0000 (21:59 +0200)]
arm_coreboot: Support grub-mkstandalone.
Vladimir Serbinenko [Mon, 8 May 2017 19:42:37 +0000 (21:42 +0200)]
arm_coreboot: Support keyboard for vexpress.
Vladimir Serbinenko [Mon, 8 May 2017 19:41:22 +0000 (21:41 +0200)]
at_keyboard: Split protocol from controller code.
On vexpress controller is different but protocol is the same, so reuse the
code.
Vladimir Serbinenko [Mon, 8 May 2017 19:29:48 +0000 (21:29 +0200)]
arm-coreboot: Export FDT routines.
We need to use them from modules as well.
Vladimir Serbinenko [Mon, 8 May 2017 19:26:36 +0000 (21:26 +0200)]
arm-coreboot: Support for vexpress timer.
Vladimir Serbinenko [Mon, 8 May 2017 19:19:59 +0000 (21:19 +0200)]
Add support for device-tree-based drivers.
Vladimir Serbinenko [Mon, 8 May 2017 18:53:28 +0000 (20:53 +0200)]
arm-coreboot: Start new port.
Vladimir Serbinenko [Mon, 8 May 2017 17:37:29 +0000 (19:37 +0200)]
Rename uboot/datetime to dummy/datetime.
It's just a stub and is not UBoot-specific.
Vladimir Serbinenko [Mon, 8 May 2017 17:31:55 +0000 (19:31 +0200)]
Rename uboot/halt.c to dummy/halt.c.
It's not U-Boot specific and it's a stub.
Vladimir Serbinenko [Mon, 8 May 2017 17:06:22 +0000 (19:06 +0200)]
coreboot: Split parts that are platform-independent.
We currently assume that coreboot is always i386, it's no longer the case,
so split i386-coreboot parts from generic coreboot code.
Vladimir Serbinenko [Mon, 8 May 2017 15:47:57 +0000 (17:47 +0200)]
Refactor arm-uboot code to make it genereic.
arm-coreboot startup code can be very similar to arm-uboot but current code has
U-Boot specific references. So split U-Boot part from generic part.
Vladimir Serbinenko [Mon, 8 May 2017 15:32:15 +0000 (17:32 +0200)]
mkimage: Pass layout to mkimage_generate_elfXX rather than some fields.
This allows easier extension of this function without having too long of
arguments list.
Paulo Flabiano Smorigo [Mon, 23 Dec 2013 14:32:02 +0000 (12:32 -0200)]
Add Virtual LAN support.
This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows
multiple VLANs in a bridged network to share the same physical network link
but maintain isolation:
http://en.wikipedia.org/wiki/IEEE_802.1Q
* grub-core/net/ethernet.c: Add check, get, and set vlan tag id.
* grub-core/net/drivers/ieee1275/ofnet.c: Get vlan tag id from bootargs.
* grub-core/net/arp.c: Add check.
* grub-core/net/ip.c: Likewise.
* include/grub/net/arp.h: Add vlantag attribute.
* include/grub/net/ip.h: Likewise.
Vladimir Serbinenko [Wed, 10 Aug 2016 15:49:42 +0000 (17:49 +0200)]
strtoull: Fix behaviour on chars between '9' and 'a'.
Reported by: Aaron Miller <aaronmiller@fb.com>
Vladimir Serbinenko [Wed, 3 May 2017 10:58:15 +0000 (12:58 +0200)]
Add strtoull test.
Vladimir Serbinenko [Sun, 22 Jan 2017 17:22:34 +0000 (20:22 +0300)]
Fix shebang for termux.
Termux doesn't have a /bin/sh. So we needto use $SHELL.
Keep /bin/sh as much as possible.
Vladimir Serbinenko [Mon, 23 Jan 2017 11:52:48 +0000 (14:52 +0300)]
Add termux path to dict.
Vladimir Serbinenko [Mon, 23 Jan 2017 11:54:03 +0000 (14:54 +0300)]
po: Use @SHELL@ rather than /bin/sh.
/bin/sh might not exist.
Vladimir Serbinenko [Sun, 22 Jan 2017 21:55:30 +0000 (00:55 +0300)]
Use $(SHELL) rather than /bin/sh.
/bin/sh doesn't exist under termux.
Vladimir Serbinenko [Mon, 23 Jan 2017 17:21:05 +0000 (20:21 +0300)]
Support lseek64.
Android doesn't have 64-bit off_t, so use off64_t instead.
Vladimir Serbinenko [Mon, 23 Jan 2017 18:24:05 +0000 (21:24 +0300)]
Don't retrieve fstime when it's not useful.
Vladimir Serbinenko [Mon, 23 Jan 2017 11:31:36 +0000 (14:31 +0300)]
support busybox date.
Busybox date doesn't understand weekdays in -d input,
so strip them beforehand.
Vladimir Serbinenko [Mon, 23 Jan 2017 11:35:59 +0000 (14:35 +0300)]
fs-tester: make sh-compatible
Vladimir Serbinenko [Mon, 23 Jan 2017 00:47:13 +0000 (03:47 +0300)]
Remove bashisms from tests.
Those tests don't actually need bash. Just use common shebang.
Vladimir Serbinenko [Wed, 3 May 2017 09:55:52 +0000 (11:55 +0200)]
Bump version to 2.03
Vladimir Serbinenko [Tue, 25 Apr 2017 14:23:16 +0000 (16:23 +0200)]
Increase version to 2.02.
Vladimir Serbinenko [Wed, 12 Apr 2017 01:42:38 +0000 (01:42 +0000)]
Fix remaining cases of gcc 7 fallthrough warning.
They are all intended, so just add the relevant comment.
Andrei Borzenkov [Tue, 4 Apr 2017 16:37:47 +0000 (19:37 +0300)]
Add gnulib-fix-gcc7-fallthrough.diff
As long as the code is not upstream, add it as explicit patch for the
case of gnulib refresh.
Andrei Borzenkov [Tue, 4 Apr 2017 16:23:55 +0000 (19:23 +0300)]
i386, x86_64, ppc: fix switch fallthrough cases with GCC7
In util/getroot and efidisk slightly modify exitsing comment to mostly
retain it but still make GCC7 compliant with respect to fall through
annotation.
In grub-core/lib/xzembed/xz_dec_lzma2.c it adds same comments as
upstream.
In grub-core/tests/setjmp_tets.c declare functions as "noreturn" to
suppress GCC7 warning.
In grub-core/gnulib/regexec.c use new __attribute__, because existing
annotation is not recognized by GCC7 parser (which requires that comment
immediately precedes case statement).
Otherwise add FALLTHROUGH comment.
Closes: 50598
Andrei Borzenkov [Tue, 4 Apr 2017 16:22:32 +0000 (19:22 +0300)]
btrfs: avoid "used uninitialized" error with GCC7
sblock was local and so considered new variable on every loop
iteration.
Closes: 50597
Andrei Borzenkov [Sun, 2 Apr 2017 11:47:20 +0000 (14:47 +0300)]
acpi: add missing efi_call wrapper to acpi command
Fixed loading of ACPI tables on EFI (side effect was apparent memory
corruption ranging from unpredictable behavior to system reset).
Reported by Nando Eva <nando4eva@ymail.com>
Vladimir Serbinenko [Wed, 15 Mar 2017 08:20:29 +0000 (09:20 +0100)]
Increment version to GRUB 2.02~rc2.
Vladimir Serbinenko [Wed, 15 Mar 2017 08:20:14 +0000 (09:20 +0100)]
Use core2duo for bootcheck test on 64-bit EFI.
Obviously pentium2 can't run efi64.
Andrei Borzenkov [Tue, 14 Mar 2017 04:12:32 +0000 (04:12 +0000)]
efi: skip iPXE block device.
iPXE adds Simple File System Protocol to loaded image handle, as side
effect it also adds Block IO protocol (according to comments, to work
around some bugs in EDK2). GRUB assumes that every device with Block IO
is disk and skips network initialization entirely. But iPXE Block IO
implementation is just a stub which always fails for every operation
so cannot be used. Attempt to detect and skip such devices.
We are using media ID which iPXE sets to "iPXE" and block IO size in
hope that no real device would announce 1B block ...
Closes: 50518
phcoder [Sun, 5 Mar 2017 09:04:07 +0000 (10:04 +0100)]
xen: Fix wrong register in relocator.
This fixes chainloading of some GRUB variants.
Vladimir Serbinenko [Thu, 9 Feb 2017 01:22:24 +0000 (02:22 +0100)]
video_fb: Fix blue collor if using unoptimized blitter.
when unmapping the color what matters is the mode of source, not target.
Vladimir Serbinenko [Fri, 24 Feb 2017 21:23:09 +0000 (21:23 +0000)]
legacy_initrd: Strip any additional arguments to initrd.
Andrei Borzenkov [Sun, 26 Feb 2017 11:38:04 +0000 (14:38 +0300)]
grub-fs-tester: improve squash4 tests
1. Make sure files are not multiple of block size. This will ensure tail packing
for squash4 and may also trigger more codes paths in other filesystems.
2. Call mksquashfs with -always-use-fragments to force tail packing.
Andrei Borzenkov [Sat, 25 Feb 2017 05:39:38 +0000 (08:39 +0300)]
efi: strip off final NULL from File Path in grub_efi_get_filename
UEFI 2.6 9.3.6.4 File Path Media Device Path says that Path Name is
"A NULL-terminated Path string including directory and file names".
Strip final NULL from Path Name in each File Path node when constructing
full path. To be on safe side, strip all of them.
Fixes failure chainloading grub from grub, when loaded grub truncates
image path and does not find its grub.cfg.
https://bugzilla.opensuse.org/show_bug.cgi?id=
1026344
This was triggered by commit
ce95549cc54b5d6f494608a7c390dba3aab4fba7;
before it we built Path Name without trailing NULL, and apparently all
other bootloaders use single File Path node, thus not exposing this bug.
Andrei Borzenkov [Fri, 24 Feb 2017 16:10:43 +0000 (19:10 +0300)]
squash4: fix handling of fragments and sparse files
1. Do not assume block list and fragment are mutually exclusive. Squash
can pack file tail as fragment (unless -no-fragments is specified); so
check read offset and read either from block list or from fragments as
appropriate.
2. Support sparse files with zero blocks.
3. Fix fragment read - frag.offset is absolute fragment position,
not offset relative to ino.chunk.
Reported and tested by Carlo Caione <carlo@endlessm.com>
Vladimir Serbinenko [Wed, 22 Feb 2017 08:55:51 +0000 (09:55 +0100)]
Whitelist sparc64-ieee1275 as having no video modules.
ieee1275_fb is not built on sparc64 due to virtual address issues.
Andrei Borzenkov [Sun, 12 Feb 2017 06:23:34 +0000 (09:23 +0300)]
script: fix double free in lexer
yylex_destroy() already frees scanner.
Found by: Coverity scan.
CID: 176636
Vladimir Serbinenko [Mon, 6 Feb 2017 23:47:23 +0000 (00:47 +0100)]
xen: Fix parsing of XZ kernel.
In case of xz, the uncompressed size is appended to xz data which confuses
our xz decompressor. Trim it.
Vladimir Serbinenko [Mon, 6 Feb 2017 23:42:43 +0000 (00:42 +0100)]
xen: Fix handling of GRUB chainloading.
In case of GRUB we put remapper after domain pages and not at 0x0.
In this case we use max_addr to put remapper. Unfortunately we increment
max_addr as well in this case resulting in virt mapping mapping page
at old max_addr and trying to boot using new max_addr.
Closes 46014.
Vladimir Serbinenko [Fri, 3 Feb 2017 23:06:57 +0000 (00:06 +0100)]
linguas: Don't skip ko.po.
Translation project doesn't require copyright disclaimers. They're independant
from us. They're responsible for their copyright story.
Vladimir Serbinenko [Fri, 3 Feb 2017 19:17:48 +0000 (20:17 +0100)]
Fix truncated checksum.h.
Vladimir Serbinenko [Fri, 3 Feb 2017 12:41:13 +0000 (13:41 +0100)]
Regenerate checksums.h
Screenshots contain version, so we need new checksums.
Vladimir Serbinenko [Fri, 3 Feb 2017 11:34:21 +0000 (12:34 +0100)]
Release 2.02-rc1.
Vladimir Serbinenko [Fri, 3 Feb 2017 11:59:50 +0000 (12:59 +0100)]
Fix mingw compilation.
Daniel Kahn Gillmor [Fri, 3 Feb 2017 11:32:25 +0000 (12:32 +0100)]
documentation: Clarify documentation for special environment variable "default".
The current documentation for the special environment variable
"default" is confusing and unclear. This patch attempts to clean it
up.
In particular, the current documentation refers to the "number or
title", but then in the example it gives, the menu entries and
submenus all have numbers *in* their title; furthermore, there is no
example given about how to choose the number, or any indication about
whether counting is zero-indexed or 1-indexed.
Having a cleaner example and presenting all variants (numeric, title,
and id) should make it clearer to the user.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Vladimir Serbinenko [Thu, 2 Feb 2017 23:34:07 +0000 (00:34 +0100)]
Avoid causing kernel oops in nilfs2 test.
1024-byte and 2048-byte blocks don't really work with some kernels, skip
them as we don't want any oops'es.
Vladimir Serbinenko [Thu, 2 Feb 2017 23:30:29 +0000 (00:30 +0100)]
btrfs: Shorten label by one character.
mkfs.btrfs imposes a slightly lower limit than would be possible in btrfs.
Vladimir Serbinenko [Thu, 2 Feb 2017 22:32:38 +0000 (23:32 +0100)]
grub-fs-tester: Fix mkudffs invocation.
With current invocation order of arguments is wrong and path is hardcoded.
Vladimir Serbinenko [Thu, 2 Feb 2017 22:19:00 +0000 (23:19 +0100)]
grub-fs-tester: Fix fat test.
mkfs.vfat ignores -S when invoked on a disk, including loopback device,
so do an mkfs on underlying image.
Daniel Kiper [Thu, 2 Feb 2017 14:19:18 +0000 (15:19 +0100)]
i386/relocator: Align stack in grub_relocator64_efi relocator
Unified Extensible Firmware Interface Specification, Version 2.6,
section 2.3.4, x64 Platforms, boot services, says among others:
The stack must be 16-byte aligned. So, do it. Otherwise OS may
boot only by chance as it happens right now.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Vladimir Serbinenko [Thu, 2 Feb 2017 20:41:33 +0000 (21:41 +0100)]
i386-ieee1275: Add missing bootcheck target.
Vladimir Serbinenko [Thu, 2 Feb 2017 20:41:18 +0000 (21:41 +0100)]
bootcheck-linux-i386: Use -cpu pentium2.
Most modern kernels are compiled for i686, so use -cpu pentium2
to avoid spurious failures.
Vladimir Serbinenko [Thu, 2 Feb 2017 00:24:11 +0000 (01:24 +0100)]
Use -fPIC with arm64 with clang.
Currently it doesn't work either way but with -fPIC it should work once
clang bug is fixed.
Vladimir Serbinenko [Thu, 2 Feb 2017 00:11:52 +0000 (01:11 +0100)]
INSTALL: Fix mention of thumb-clang.
Vladimir Serbinenko [Wed, 1 Feb 2017 23:59:49 +0000 (00:59 +0100)]
Fix thumb compilation with clang.
According to EABI only STT_FUNC has convention of lowest bit indicating
execution mode. R_THM_{JUMP,CALL}* relocations are assumed to be pointing
to thumb mode unless they use STT_FUNC.
Vladimir Serbinenko [Wed, 1 Feb 2017 20:50:17 +0000 (21:50 +0100)]
Add missing strtoull_test.c
It was forgotten in my local directory.
Vladimir Serbinenko [Wed, 1 Feb 2017 20:46:19 +0000 (21:46 +0100)]
arm64: Add support for GOT and PCREL32 relocations.
Vladimir Serbinenko [Wed, 1 Feb 2017 20:21:17 +0000 (21:21 +0100)]
mkimage: Fix memory leak.
Vladimir Serbinenko [Wed, 1 Feb 2017 19:12:07 +0000 (20:12 +0100)]
arm/arm64: Fix improper use of start address.
It was used instead of loading address of current section or of entire buffer.
Vladimir Serbinenko [Wed, 1 Feb 2017 19:10:26 +0000 (20:10 +0100)]
ia64: Fix iterator for relocation entries.
Don't assume relocation entry size and use sh_entsize properly.
Vladimir Serbinenko [Wed, 1 Feb 2017 14:58:36 +0000 (15:58 +0100)]
arm: Fix trampoline generation.
We used the wrong pointer in this case. It worked only by accident.
Vladimir Serbinenko [Wed, 1 Feb 2017 14:57:08 +0000 (15:57 +0100)]
Fix bootcheck-related files compilation.
We need -static as otherwise linker will set interpreter field and ld.so
is not available on our initrd's.
Strip all sections we don't need on binary tests.
Vladimir Serbinenko [Tue, 31 Jan 2017 21:36:11 +0000 (22:36 +0100)]
Regenerate checksum.h.
Screenshots checked.
Using unifont from http://ftp.us.debian.org/debian/pool/main/u/unifont/xfonts-unifont_7.0.06-1_all.deb.
Vladimir Serbinenko [Tue, 31 Jan 2017 21:32:21 +0000 (22:32 +0100)]
grub-mkfont: Remove leftover debug statement.
Vladimir Serbinenko [Tue, 31 Jan 2017 18:29:31 +0000 (19:29 +0100)]
charset: Trim away RLM and LRM.
They are not visible but would otherwise end up as [LRM] or [RLM] squares
with some fonts.
Vladimir Serbinenko [Tue, 31 Jan 2017 17:49:37 +0000 (18:49 +0100)]
gfxterm: Fix clearing of cursor.
If ascent is bigger than height - 2, then we draw over character box but then
to clear cursor we only draw over character box. So trim ascent if necessarry.
Vladimir Serbinenko [Tue, 31 Jan 2017 11:39:01 +0000 (12:39 +0100)]
ia64: Add support for R_IA64_GPREL64I.
Recent GCC generates those relocations, so we need to support them.
Vladimir Serbinenko [Mon, 30 Jan 2017 18:52:58 +0000 (19:52 +0100)]
grub-module-verifier: Add mips to all_video whitelist.
On MIPS video is compiled-in. So all_video is empty. Whitelist it.
Vladimir Serbinenko [Mon, 30 Jan 2017 13:38:50 +0000 (14:38 +0100)]
Fix -nopie/-nopie check.
We don't use lgcc_s but missing lgcc_s or another library cause test to fail.
So use -nostdlib.
We need to use -Werror to avoid warning-generated case to be accepted.
Clang uses -nopie rather than -no-pie. Check both and use whichever one works.
Additionally android clang passes -pie to the linker even though it doesn't
define __PIE__. So if compilation without no-pie logic fails add -nopie/-no-pie
even if __PIE__ is not defined.
Vladimir Serbinenko [Mon, 30 Jan 2017 00:13:41 +0000 (00:13 +0000)]
grub-module-verifier: Ignore all_video emptiness on xen.
It's intentional that it's empty when no video modules
are available.
Vladimir Serbinenko [Sat, 28 Jan 2017 14:41:23 +0000 (14:41 +0000)]
Support arm clang 3.8 amd later.
clang 3.8 and later doesn't support -mllvm -use-arm-movt=0
whereas older clang doesn't know -mno-movt. So use
-mno-movt whenever possible and fallback to mllvm variant.
Carlo Caione [Fri, 27 Jan 2017 22:10:21 +0000 (22:10 +0000)]
exfat: Support files over 4GiB
file size in grub_fat_data was 32-bit on exfat.
Vladimir Serbinenko [Mon, 23 Jan 2017 20:32:25 +0000 (23:32 +0300)]
Ensure that grub_reboot doesn't return on emu.
Use grub_fatal if longjmp fails.
grub_reboot is marked as noreturn so return would cause
a crash.
Vladimir Serbinenko [Mon, 23 Jan 2017 18:25:25 +0000 (21:25 +0300)]
grub-shell: skip font copying when no font is available.
Vladimir Serbinenko [Mon, 23 Jan 2017 20:57:23 +0000 (23:57 +0300)]
Don't use -mlong-calls on arm.
We don't really need it and it's flaky and creates
bogus symbols with clang.
Vladimir Serbinenko [Sun, 22 Jan 2017 21:52:32 +0000 (00:52 +0300)]
configure: Disable movw/movt with clang.
Those relocations are not compatible with PE and also
not compatible with custom uboot relocator.
Disable them.
Vladimir Serbinenko [Fri, 27 Jan 2017 18:00:40 +0000 (18:00 +0000)]
grub-fs-tester: Delete directory once we're done.
Vladimir Serbinenko [Fri, 27 Jan 2017 17:58:15 +0000 (17:58 +0000)]
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.
Vladimir Serbinenko [Fri, 27 Jan 2017 17:46:47 +0000 (17:46 +0000)]
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.
Andrei Borzenkov [Tue, 24 Jan 2017 17:05:19 +0000 (20:05 +0300)]
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
Andrei Borzenkov [Sun, 8 Jan 2017 12:52:49 +0000 (15:52 +0300)]
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.
Andrei Borzenkov [Thu, 22 Dec 2016 19:48:25 +0000 (22:48 +0300)]
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>
Michael Chang [Mon, 19 Dec 2016 09:09:04 +0000 (17:09 +0800)]
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().
Andrei Borzenkov [Thu, 15 Dec 2016 13:07:00 +0000 (16:07 +0300)]
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>
Magnus Granberg [Wed, 14 Dec 2016 17:44:41 +0000 (20:44 +0300)]
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.
Stanislav Kholmanskikh [Mon, 12 Dec 2016 15:03:39 +0000 (18:03 +0300)]
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>
Stanislav Kholmanskikh [Mon, 12 Dec 2016 15:03:38 +0000 (18:03 +0300)]
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>