1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[grub] update GRUB 2.04 core.img for Ubuntu 20.10 support

* GRUB have cherry-picked patches from the "BootHole" vulnerability fix at
  https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00034.html and
  have applied them to their 2.04 GRUB loader.
* This results in breakage with "error: symbol 'grub_calloc' not found" when
  using the release GRUB 2.04 version of core.img.
* Therefore, we too cherry-picked some patches to apply on top of GRUB 2.04
  release to make our core.img compatible with Ubuntu 20.10.
* Closes #1616
* Also increase the maximum write stride for ms-sys to 64 KB (required to
  write the GRUB 2.05 bootloader which is larger than 32 KB) and update hash DB.
This commit is contained in:
Pete Batard 2020-09-16 13:59:06 +01:00
parent 1bb2b3b126
commit e987272287
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
6 changed files with 22 additions and 14 deletions

View file

@ -1,7 +1,7 @@
This directory contains the Grub4DOS boot records that are used by Rufus
* grldr.mbr was taken from the official 2019.07.15 release from
http://grub4dos.chenall.net/downloads/grub4dos-0.4.6a-2019-07-15/
* grldr.mbr was taken from the official 2020.08.09 release from
http://grub4dos.chenall.net/downloads/grub4dos-0.4.6a-2020-08-09/
* Note that, for convenience reasons, the first 512 bytes from this grldr.mbr are
*not* the ones that Rufus processes when writing the actual MBR (first 512 bytes).

Binary file not shown.

View file

@ -1,10 +1,16 @@
This directory contains the Grub 2.0 boot records that are used by Rufus
* boot.img and core.img were compiled from
https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz, on a Debian 9.9 x64 system.
This was done following the guide from:
https://pete.akeo.ie/2014/05/compiling-and-installing-grub2-for.html.
--enable-boot-time was also added during ./configure for Manjaro Linux compatibility.
* boot.img and core.img were created from:
https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz
with the following two extra patches applied:
- https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00016.html
- https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00017.html
on a Debian 10.x x64 system using the commands:
./autogen.sh
./configure --disable-nls --enable-boot-time
make -j6
cd grub-core
../grub-mkimage -v -O i386-pc -d. -p\(hd0,msdos1\)/boot/grub biosdisk part_msdos fat ntfs exfat -o core.img
* boot.img has been modified to nop the jump @ 0x66 as per grub2's setup.c comments:
/* If DEST_DRIVE is a hard disk, enable the workaround, which is

View file

@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* DB of the hash values we know for downloadable content (GRUB, Syslinux, etc.)
* Copyright © 2016-2019 Pete Batard <pete@akeo.ie>
* Copyright © 2016-2020 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,6 +85,7 @@ static uint8_t sha256db[] = {
0xa6, 0x82, 0x43, 0xa0, 0xf2, 0xe5, 0x90, 0xb8, 0x14, 0x02, 0xd6, 0xfa, 0x62, 0xd4, 0xfd, 0x30, 0x94, 0x8c, 0x00, 0x3d, 0xa1, 0x2b, 0xfe, 0xeb, 0x69, 0xba, 0x20, 0x34, 0x17, 0x27, 0x09, 0x4c, // syslinux-6.03/pre14/ldlinux.sys
0xa9, 0x4a, 0x99, 0xe6, 0xde, 0x68, 0x81, 0x44, 0x49, 0x2b, 0x38, 0xdb, 0xee, 0x09, 0xde, 0x07, 0x30, 0xe3, 0x2e, 0x1c, 0xfd, 0x0a, 0xb2, 0x54, 0x99, 0x22, 0xff, 0xa8, 0x04, 0x01, 0xad, 0x49, // syslinux-6.03/pre2/ldlinux.bss
0xa9, 0x95, 0x68, 0x57, 0x9c, 0xd2, 0x51, 0xaf, 0xf1, 0x34, 0xfc, 0xaa, 0xa8, 0x09, 0x91, 0x60, 0x5e, 0x8f, 0xb1, 0x19, 0x74, 0x51, 0xf7, 0x51, 0xaa, 0x4d, 0x6c, 0x84, 0xbf, 0x65, 0xf4, 0xe3, // syslinux-6.03/pre15/ldlinux.sys
0xb1, 0x97, 0x91, 0x33, 0xa4, 0x5e, 0x29, 0x4f, 0x54, 0xee, 0xd0, 0xbd, 0x92, 0xb7, 0xf2, 0xb9, 0xa3, 0xd2, 0x26, 0x45, 0xae, 0x28, 0x20, 0x0e, 0x4a, 0xd8, 0xfd, 0x98, 0xaf, 0x24, 0x1a, 0x07, // grub-2.05/core.img
0xb2, 0xf0, 0xde, 0x2e, 0x01, 0xa7, 0xe3, 0x4d, 0x96, 0xa9, 0x76, 0x36, 0x43, 0x05, 0xd3, 0x9f, 0xf8, 0x49, 0xd5, 0x0a, 0xd1, 0x3a, 0xd1, 0xf8, 0xa8, 0xb4, 0x41, 0x1d, 0x1d, 0x53, 0x4e, 0x88, // syslinux-5.10/ldlinux.bss
0xb3, 0xa8, 0xf2, 0x12, 0x89, 0x1c, 0xd2, 0x6e, 0x1a, 0xb4, 0x4a, 0xa8, 0x59, 0x8f, 0x6e, 0x64, 0xc6, 0x83, 0x19, 0x8d, 0x43, 0x00, 0x27, 0x54, 0xec, 0xbd, 0x8a, 0x78, 0xf2, 0xd0, 0xc0, 0x0b, // syslinux-6.03/pre8/ldlinux.sys
0xb3, 0xdc, 0x31, 0x79, 0xf6, 0x2b, 0x20, 0x51, 0xc9, 0x43, 0xe5, 0x2e, 0xeb, 0xf2, 0x29, 0x8a, 0xa4, 0x7e, 0x7c, 0x0a, 0x97, 0x78, 0xe8, 0x62, 0x77, 0xa7, 0x48, 0x2a, 0x27, 0x0a, 0x7a, 0x8e, // syslinux-6.01/ldlinux.bss
@ -94,6 +95,7 @@ static uint8_t sha256db[] = {
0xc3, 0x3b, 0x31, 0x5f, 0xec, 0xe4, 0xad, 0xc4, 0xc3, 0xb2, 0x75, 0x13, 0x22, 0x84, 0x66, 0xe4, 0x44, 0x99, 0xcd, 0xa7, 0xfd, 0x63, 0x97, 0xc5, 0xab, 0xe0, 0xf8, 0xce, 0x4f, 0xe3, 0x45, 0x39, // syslinux-5.10/ldlinux.c32
0xcc, 0x40, 0xba, 0x03, 0x49, 0x78, 0x2c, 0xb4, 0xc9, 0x02, 0x1e, 0x54, 0xdc, 0xc0, 0xa4, 0x54, 0x0c, 0x3a, 0x8b, 0x96, 0x08, 0x8b, 0x3a, 0x56, 0x48, 0x67, 0x19, 0x26, 0xef, 0x44, 0xd2, 0xf0, // syslinux-6.04/ldlinux.bss
0xcd, 0x08, 0xf4, 0x81, 0xfb, 0x0c, 0xda, 0x19, 0xe1, 0x78, 0x6d, 0x43, 0x8d, 0x5c, 0x13, 0x93, 0xf7, 0xbf, 0xf3, 0x81, 0x31, 0x44, 0x4a, 0x0a, 0x5e, 0x54, 0xc1, 0x04, 0xed, 0x1d, 0x4d, 0xad, // syslinux-6.03/pre10/ldlinux.bss
0xce, 0x4c, 0xb0, 0x9b, 0x45, 0x03, 0xfe, 0x97, 0xca, 0xc3, 0x25, 0x6e, 0xd4, 0x29, 0xfa, 0x4e, 0xc5, 0x0d, 0x96, 0x7b, 0x4e, 0x08, 0x11, 0xa8, 0x98, 0x0d, 0x95, 0x51, 0x3f, 0x7d, 0x53, 0xe1, // grub-2.04/core.img
0xd0, 0x15, 0x48, 0xaf, 0x46, 0xf6, 0x4f, 0xed, 0x16, 0x69, 0xa5, 0x6e, 0x69, 0x31, 0x56, 0xb5, 0xde, 0x39, 0xd6, 0xbf, 0xa8, 0x6e, 0x9e, 0x07, 0x13, 0x1d, 0x70, 0x06, 0x3c, 0x56, 0x3d, 0xd0, // grub4dos/grldr.mbr
0xd2, 0xc6, 0x93, 0x8d, 0xae, 0x5a, 0xd7, 0x16, 0x0e, 0x9e, 0x6c, 0x61, 0xef, 0x46, 0xb7, 0xfd, 0x14, 0x6e, 0x30, 0xc0, 0x3f, 0xdc, 0x8f, 0x5c, 0x6d, 0xbd, 0xeb, 0x86, 0x22, 0xc8, 0xa7, 0xbd, // syslinux-5.00/ldlinux.bss
0xd3, 0x47, 0x2c, 0x02, 0x26, 0x3a, 0xcf, 0x9c, 0xd1, 0xda, 0x5d, 0xb5, 0x1e, 0x26, 0x3c, 0x54, 0x84, 0xba, 0xd1, 0x3e, 0xa6, 0x86, 0x18, 0xc4, 0x03, 0xd9, 0xcb, 0x01, 0xca, 0x07, 0x0a, 0xee, // syslinux-6.04/ldlinux.c32

View file

@ -4,7 +4,7 @@
#include <stdint.h>
/* Max valid value of uiLen for contains_data */
#define MAX_DATA_LEN 32768
#define MAX_DATA_LEN 65536
/* We hijack the FILE structure for our own needs */
typedef struct {

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.12.1703"
CAPTION "Rufus 3.12.1704"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,12,1703,0
PRODUCTVERSION 3,12,1703,0
FILEVERSION 3,12,1704,0
PRODUCTVERSION 3,12,1704,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.12.1703"
VALUE "FileVersion", "3.12.1704"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.12.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.12.1703"
VALUE "ProductVersion", "3.12.1704"
END
END
BLOCK "VarFileInfo"