~dannf/grub:tftp-and-img-base

Last commit made on 2020-11-09
Get this branch:
git clone -b tftp-and-img-base https://git.launchpad.net/~dannf/grub
Only dann frazier can upload to this branch. If you are dann frazier please log in for upload directions.

Branch merges

Branch information

Name:
tftp-and-img-base
Repository:
lp:~dannf/grub

Recent commits

d9e8e94... by dann frazier

merge patched-ubuntu into ubuntu

633e57c... by Javier Martinez Canillas <email address hidden>

tftp: Roll-over block counter to prevent data packets timeouts

Commit 781b3e5efc3 (tftp: Do not use priority queue) caused a regression
when fetching files over TFTP whose size is bigger than 65535 * block size.

  grub> linux /images/pxeboot/vmlinuz
  grub> echo $?
  0
  grub> initrd /images/pxeboot/initrd.img
  error: timeout reading '/images/pxeboot/initrd.img'.
  grub> echo $?
  28

It is caused by the block number counter being a 16-bit field, which leads
to a maximum file size of ((1 << 16) - 1) * block size. Because GRUB sets
the block size to 1024 octets (by using the TFTP Blocksize Option from RFC
2348 [0]), the maximum file size that can be transferred is 67107840 bytes.

The TFTP PROTOCOL (REVISION 2) RFC 1350 [1] does not mention what a client
should do when a file size is bigger than the maximum, but most TFTP hosts
support the block number counter to be rolled over. That is, acking a data
packet with a block number of 0 is taken as if the 65356th block was acked.

It was working before because the block counter roll-over was happening due
an overflow. But that got fixed by the mentioned commit, which led to the
regression when attempting to fetch files larger than the maximum size.

To allow TFTP file transfers of unlimited size again, re-introduce a block
counter roll-over so the data packets are acked preventing the timeouts.

[0]: https://tools.ietf.org/html/rfc2348
[1]: https://tools.ietf.org/html/rfc1350

Fixes: 781b3e5efc3 (tftp: Do not use priority queue)

Suggested-by: Peter Jones <email address hidden>
Signed-off-by: Javier Martinez Canillas <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1900773
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=a6838bbc6726ad624bd2b94991f690b8e9d23c69
Last-Updated: 2020-11-09
Patch-Name: tftp-rollover-block-counter.patch

97097f6... by Javier Martinez Canillas <email address hidden>

efi: Set image base address before jumping to the PE/COFF entry point

Upstream GRUB uses the EFI LoadImage() and StartImage() to boot the Linux
kernel. But our custom EFI loader that supports Secure Boot instead uses
the EFI handover protocol (for x86) or jumping directly to the PE/COFF
entry point (for aarch64).

This is done to allow the bootloader to verify the images using the shim
lock protocol to avoid booting untrusted binaries.

Since the bootloader loads the kernel from the boot media instead of using
LoadImage(), it is responsible to set the Loaded Image base address before
booting the kernel.

Otherwise the kernel EFI stub will complain that it was not set correctly
and print the following warning message:

EFI stub: ERROR: FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value

Resolves: rhbz#1825411

Signed-off-by: Javier Martinez Canillas <email address hidden>
[ dannf: Offset adjustment to apply to Ubuntu's GRUB ]

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1900774
Origin: https://github.com/rhboot/grub2/commit/1d5ef08216edec4d31d0e10cfdb30b5ebfef7a45
Last-Updated: 2020-11-09
Patch-Name: ubuntu-linuxefi-arm64-set-base-addr.patch

13b8f84... by Dimitri John Ledkov

releasing package grub2 version 2.04-1ubuntu35

5649e23... by Dimitri John Ledkov

Do not finalize params twice on arm64. LP: #1897819

0511ec4... by Dimitri John Ledkov

merge patched-ubuntu into ubuntu

26335cb... by Dimitri John Ledkov

configure.ac: one more dejavu font search path

Debian/Ubuntu ship dejavu font in a subdir of truetype.

Patch-Name: ubuntu-dejavu-font-path.patch

f38282a... by Julian Andres Klode

Cherry-pick back parts of "Load arm with SB enabled."

These parts got lost in our 2.04 rebase, let's add them back.

Pick (grub_efi_physical_address_t)(grub_efi_uintn_t) cast from
fedora-34 instead, it seems to cause compilation error on armhf
to not do the (grub_efi_uintn_t) cast first.

Bug-Ubuntu: https://bugs.launchpad.net/1862279
Origin: vendor, https://github.com/rhboot/grub2/commit/2786ab864cf00c15123320671f653e9a36ba12b4
Patch-Name: ubuntu-linuxefi-arm64.patch

e07b23a... by Dimitri John Ledkov

postinst.in, grub-multi-install: fix logic of skipping installing onto any device, if one chose to not install bootloader on any device. LP: #1896608

6757868... by Dimitri John Ledkov

releasing package grub2 version 2.04-1ubuntu34