grub2: updated to version 2.04, added python dependency

This commit is contained in:
Matt Housh 2019-07-22 15:30:41 -05:00
parent 76bd41c685
commit a724e47a23
6 changed files with 23 additions and 203 deletions

View File

@ -164,8 +164,11 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/ext2.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/extcmd.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/extcmd.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/f2fs.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/f2fs.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/fat.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/fat.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/fdt.lst (EMPTY)
-rw-r--r-- root/root usr/lib/grub/i386-pc/file.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/file.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/font.mod
@ -417,6 +420,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/pci.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/pcidump.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/pcidump.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/pgp.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/pgp.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/plan9.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/plan9.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/play.mod
@ -443,6 +448,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/raid6rec.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/random.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/random.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/rdmsr.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/rdmsr.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/read.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/read.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/reboot.mod
@ -489,6 +496,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/spkmodem.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/squash4.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/squash4.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/strtoull_test.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/strtoull_test.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/syslinuxcfg.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/syslinuxcfg.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/tar.mod
@ -548,8 +557,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/usbtest.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/vbe.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/vbe.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/verify.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/verify.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/verifiers.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/verifiers.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/vga.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/vga.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/vga_text.mod
@ -571,6 +580,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/videotest.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/videotest_checksum.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/videotest_checksum.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/wrmsr.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/wrmsr.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/xfs.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/xfs.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/xnu.mod
@ -587,6 +598,8 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
-rwxr-xr-x root/root usr/lib/grub/i386-pc/zfscrypt.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/zfsinfo.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/zfsinfo.module
-rw-r--r-- root/root usr/lib/grub/i386-pc/zstd.mod
-rwxr-xr-x root/root usr/lib/grub/i386-pc/zstd.module
drwxr-xr-x root/root usr/sbin/
-rwxr-xr-x root/root usr/sbin/grub-bios-setup
-rwxr-xr-x root/root usr/sbin/grub-install

View File

@ -1,12 +1,9 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/SxVGmwlROxvKK8Weep13PAOcxjJ/LJtyxrqfQPaNUwU89QdXIiJwXFGK1DPUL67RLh73dFF0hp3ohXfkTBUdwc=
SHA256 (Pkgfile) = 262004c478d147dc0ef0fdbe95a4a5a23032a8d6c93b635d915b6931bc90fa2d
SHA256 (.footprint) = b592950a75c1fb931e49e42b9f2b27c5eb2e23d5c4a2c24d27a80d1ccdcac054
SHA256 (grub-2.02.tar.xz) = 810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
RWSE3ohX2g5d/TieVcrzVU0C0JYwvSfyNeSn+XON0zkdKDKr+jDpmuFzp7yyuwgODvSqZC4qOxRgHroTymgYoNylh5dKebec8Ao=
SHA256 (Pkgfile) = d7b8f6268150f52f17332f30f0acc99c5f1b9ea6b6c6caf77af4bd847650220a
SHA256 (.footprint) = 54ddb5b7e4049418dcd6c1ca674945c6abc793f65644c602860122d2d377b361
SHA256 (grub-2.04.tar.xz) = e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
SHA256 (unifont-9.0.06.pcf.gz) = 6d23e82ea3fd3d79849d675c0c30129b62a3973a83b4cdc05f9994efef773b86
SHA256 (grub2-00_header.diff) = e4b30c60aa0fa37d48cad2c4e5a53278f1cd5f4ae2df075f55f7be5fa931f8a7
SHA256 (grub2-10_linux.diff) = 5621b312a199647909a09e94e710bb4fca1a2be687d61e2ce7a3cf529f09d1ef
SHA256 (grub.cfg.sample) = c2e72228c1dd150f727e8d611d6f14956080ce078651b03eb14fcf65b0917dda
SHA256 (grub2-intel-ucode.diff) = c20d9f0d207e30c930815bee5b833757da771535ea13436dd94274360f601f0f
SHA256 (grub2-relocation.patch) = 51562fa1016c54567dbf42a86c0cfc902372ab579bbee17879a81aff09b76b99
SHA256 (grub2-xfs.patch) = fcd5a626d4af33665d041ce42df813f1f198d8230ea186481b155a5b676f3b87

View File

@ -1,28 +1,21 @@
# Description: A Multiboot boot loader
# URL: http://www.gnu.org/software/grub/
# Maintainer: Matt Housh, jaeger at crux dot ninja
# Depends on: libdevmapper freetype
# Depends on: libdevmapper freetype python
name=grub2
version=2.02
release=3
version=2.04
release=1
source=(http://ftp.gnu.org/gnu/grub/grub-$version.tar.xz \
http://jaeger.morpheus.net/linux/crux/files/unifont-9.0.06.pcf.gz \
$name-00_header.diff $name-10_linux.diff grub.cfg.sample \
$name-intel-ucode.diff $name-relocation.patch $name-xfs.patch)
$name-00_header.diff $name-10_linux.diff grub.cfg.sample)
build() {
export CFLAGS="${CFLAGS} -Wno-error"
cd grub-$version
# fix for glibc 'gets' removal
sed -i -e '/gets is a/d' grub-core/gnulib/stdio.in.h
patch -i $SRC/$name-00_header.diff util/grub.d/00_header.in
patch -i $SRC/$name-10_linux.diff util/grub.d/10_linux.in
patch -i $SRC/$name-intel-ucode.diff util/grub.d/10_linux.in
patch -p1 -i $SRC/$name-relocation.patch
patch -p1 -i $SRC/$name-xfs.patch
./configure --prefix=/usr \
--sysconfdir=/etc \

View File

@ -1,58 +0,0 @@
diff -urN grub-2.02.orig/util/grub.d/10_linux.in grub-2.02/util/grub.d/10_linux.in
--- grub-2.02.orig/util/grub.d/10_linux.in 2017-04-24 04:15:50.000000000 -0500
+++ grub-2.02/util/grub.d/10_linux.in 2017-05-25 15:58:11.559658295 -0500
@@ -135,11 +135,27 @@
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
+ if test -n "${intel_ucode}" ; then
+ message="$(gettext_printf "Loading intel microcode and initial ramdisk ...")"
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$(echo "$message" | grub_quote)'
+ initrd ${rel_dirname}/${intel_ucode} ${rel_dirname}/${initrd}
+EOF
+ else
message="$(gettext_printf "Loading initial ramdisk ...")"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
initrd ${rel_dirname}/${initrd}
EOF
+ fi
+ else
+ if test -n "${intel_ucode}" ; then
+ message="$(gettext_printf "Loading intel microcode ...")"
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$(echo "$message" | grub_quote)'
+ initrd ${rel_dirname}/${intel_ucode}
+EOF
+ fi
fi
sed "s/^/$submenu_indentation/" << EOF
}
@@ -203,6 +219,15 @@
fi
done
+ intel_ucode=
+ for i in "early-ucode.cpio" "early-ucode.cpio.gz" \
+ "intel-ucode.img" "intel-ucode.img.gz"; do
+ if test -e "${dirname}/${i}" ; then
+ intel_ucode="$i"
+ break
+ fi
+ done
+
config=
for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${i}" ; then
@@ -216,6 +241,10 @@
initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
fi
+ if test -n "${intel_ucode}" ; then
+ gettext_printf "Found intel-ucode image: %s\n" "${dirname}/${intel_ucode}" >&2
+ fi
+
if test -n "${initrd}" ; then
gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
elif test -z "${initramfs}" ; then

View File

@ -1,65 +0,0 @@
commit 842c390469e2c2e10b5aa36700324cd3bde25875
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Feb 17 06:47:28 2018 -0800
x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a
x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as
R_X86_64_PC32.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c
index e49d0b6ff..18facf47f 100644
--- a/grub-core/efiemu/i386/loadcore64.c
+++ b/grub-core/efiemu/i386/loadcore64.c
@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
err = grub_efiemu_write_value (addr,
*addr32 + rel->r_addend
+ sym.off
diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
index 440690673..3a73e6e6c 100644
--- a/grub-core/kern/x86_64/dl.c
+++ b/grub-core/kern/x86_64/dl.c
@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
{
grub_int64_t value;
value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index a2bb05439..39d7efb91 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
break;
case R_X86_64_PC32:
+ case R_X86_64_PLT32:
{
grub_uint32_t *t32 = (grub_uint32_t *) target;
*t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
index 9179285a5..a79271f66 100644
--- a/util/grub-module-verifier.c
+++ b/util/grub-module-verifier.c
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = {
-1
}, (int[]){
R_X86_64_PC32,
+ R_X86_64_PLT32,
-1
}
},

View File

@ -1,60 +0,0 @@
From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001
From: Daniel Kiper <daniel.kiper@oracle.com>
Date: Tue, 29 May 2018 16:16:02 +0200
Subject: xfs: Accept filesystem with sparse inodes
The sparse inode metadata format became a mkfs.xfs default in
xfsprogs-4.16.0, and such filesystems are now rejected by grub as
containing an incompatible feature.
In essence, this feature allows xfs to allocate inodes into fragmented
freespace. (Without this feature, if xfs could not allocate contiguous
space for 64 new inodes, inode creation would fail.)
In practice, the disk format change is restricted to the inode btree,
which as far as I can tell is not used by grub. If all you're doing
today is parsing a directory, reading an inode number, and converting
that inode number to a disk location, then ignoring this feature
should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED
I did some brief testing of this patch by hacking up the regression
tests to completely fragment freespace on the test xfs filesystem, and
then write a large-ish number of inodes to consume any existing
contiguous 64-inode chunk. This way any files the grub tests add and
traverse would be in such a fragmented inode allocation. Tests passed,
but I'm not sure how to cleanly integrate that into the test harness.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Chris Murphy <lists@colorremedies.com>
---
grub-core/fs/xfs.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index c6031bd..3b00c74 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs/xfs.c
@@ -79,9 +79,18 @@ GRUB_MOD_LICENSE ("GPLv3+");
#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 */
+/*
+ * Directory entries with ftype are explicitly handled by GRUB code.
+ *
+ * We do not currently read the inode btrees, so it is safe to read filesystems
+ * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature.
+ *
+ * We do not currently verify metadata UUID, so it is safe to read filesystems
+ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
+ */
#define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
(XFS_SB_FEAT_INCOMPAT_FTYPE | \
+ XFS_SB_FEAT_INCOMPAT_SPINODES | \
XFS_SB_FEAT_INCOMPAT_META_UUID)
struct grub_xfs_sblock
--
cgit v1.0-41-gc330