mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
sys-boot/grub: Sync with Gentoo
It's from Gentoo commit 97daf89c0e60fa163c04990d17635cdebd83e579.
This commit is contained in:
parent
abb6bdb682
commit
9b12fecc00
@ -1,2 +1,8 @@
|
||||
DIST dejavu-sans-ttf-2.37.zip 417746 SHA256 5c6e497a2f36552cb5ffb112c413a6af39c0f3c47653662b90b4fa6499822fd7 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae WHIRLPOOL 6f19280e76ea3efe265db09236e94bdd00268c5d8742c191100b8eb19faa532289fb03d838e33aa3c501d8a3243db248648af8929d5d5dba1bfd2ea2c10358cd
|
||||
DIST unifont-9.0.06.pcf.gz 1360354 SHA256 6d23e82ea3fd3d79849d675c0c30129b62a3973a83b4cdc05f9994efef773b86 SHA512 dd0a1afa72f5204c62055d83f22750c74af38ffafdb8eda8e1f1cf7292e572a14969b8a9a6a2cb336d5bed4ab633f6b5a962c59117a590e4238788959cb82774 WHIRLPOOL 3153fe2a254cffa5aac6c5915468262bf60f993ce5a2aa47885ccef2a6714e205724b01fd9d26d499b9efbc5213e3cea0037c91f17fb2ae780ee289cab0de69b
|
||||
DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae
|
||||
DIST grub-2.06-backports-r2.tar.xz 40416 BLAKE2B d9b4a8274a24aa35023eef7450bc4311045d0872250b1d11b1714b9daa32f7862fe1444b5b86db8b885a9f7b3af2459a5b2f87f0beaf4326a982fd96ec51d602 SHA512 99cf40b3d3d10cf6ba928ccc571c3a8baab217f650267fa7de4ba4ce807a895ff9414156647cc4dcb34bfbe48747a0c486bf60fee1c188a2dc89f26c2db3840f
|
||||
DIST grub-2.06.tar.xz 6581924 BLAKE2B 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417 SHA512 4f11c648f3078567e53fc0c74d5026fdc6da4be27d188975e79d9a4df817ade0fe5ad2ddd694238a07edc45adfa02943d83c57767dd51548102b375e529e8efe
|
||||
DIST grub-2.06.tar.xz.sig 566 BLAKE2B 2ff18fb40d9cce36cac110ba9996f88236dbaa261d19e777a6d23a0e9754a9fc8bc45a01896f4838c88bb44edff0172a97611202cb3ffd5653a3cbdfc102ae16 SHA512 797683dafade76b5981bd02f079d7dcecb36f5d07eca652181fd69f3df821931f84cc0d8771bfb80506ef41fbd96edfb202b6698af1fec3c8228dd320a05fa84
|
||||
DIST grub-2.12~rc1.tar.xz 6589460 BLAKE2B edfad62a01970026ca4ad088056da6225ef1319a08e8a95418b24cc8102be7fe45bb1412797aab13f8c1f4f690cf2fa9e5b4725f6769013ce76aa81c43952557 SHA512 6f1fbce004b6dccf58e203bf6a6eeb771bac5ecc54b503265e56a97e9adce0221677bb3e64328144ec921f327a099f0345e7a9952be41cd8808f7635cded52cb
|
||||
DIST grub-2.12~rc1.tar.xz.sig 566 BLAKE2B 4b0563623498d06f512d29d9a84a4f8386e7d5adf257d0f2ea8f3301e5112b7ad669741d78519dfa35d16e7f1695b0c74740d679f07e41774ecc8910c3f6bc5c SHA512 b8b3c818679b50810e2d9e597a01c34b05fbc1218a88bdf35aaec798ce29b376c7aa696c50233d416306a480f6ee602dfcbe7eaf481c503f3c203a7b8e8db7a2
|
||||
DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0
|
||||
DIST unifont-15.0.06.pcf.gz 1358322 BLAKE2B 81811e3de390ca35d1a2dc1f1dee73464e97f44907ba522c218ba9c5e39ca3c9d767552780a257a97c156eb623c17786d9c0d2b67786d61df5ca33a1e10db7ca SHA512 0a28a406629c604f5cbf51f501528239a7ed50d19f93ea505bc5bdc72639e4b926b03f4b8782a5733041f7cdb4aebb9948ac7cfd5a8ad9a0fe309944e595517b
|
||||
|
29
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/gfxpayload.patch
vendored
Normal file
29
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/gfxpayload.patch
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Thu, 16 Oct 2014 23:43:51 -0400
|
||||
Subject: [PATCH] 10_linux: Default gfxpayload=keep only when booting using efi
|
||||
|
||||
vesafb seems to be unreliable when using BIOS compat mode.
|
||||
|
||||
---
|
||||
util/grub.d/10_linux.in | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
index d2e2a8f..a54b888 100644
|
||||
--- a/util/grub.d/10_linux.in
|
||||
+++ b/util/grub.d/10_linux.in
|
||||
@@ -104,7 +104,9 @@ linux_entry ()
|
||||
echo " load_video" | sed "s/^/$submenu_indentation/"
|
||||
if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
|
||||
&& grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
|
||||
- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
|
||||
+ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/"
|
||||
+ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
|
||||
+ echo ' fi' | sed "s/^/$submenu_indentation/"
|
||||
fi
|
||||
else
|
||||
if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
|
||||
--
|
||||
2.7.2
|
||||
|
@ -1,47 +0,0 @@
|
||||
From 7801d671905329d28e789082225570fc54fe5784 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <mchang@suse.com>
|
||||
Date: Fri, 19 Feb 2021 17:40:43 +0800
|
||||
Subject: [PATCH] Fix build error in binutils 2.36
|
||||
|
||||
The build fails in binutils 2.36
|
||||
|
||||
[ 520s] cat kernel_syms.lst > syminfo.lst.new
|
||||
[ 520s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: section .note.gnu.property VMA [0000000000400158,0000000000400187] overlaps section .bss VMA [000000000000f000,000000000041e1af]
|
||||
|
||||
It is caused by assembler now generates the GNU property notes section
|
||||
by default. Use the assmbler option -mx86-used-note=no to disable the
|
||||
section from being generated to workaround the ensuing linker issue.
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
---
|
||||
configure.ac | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c39e8379f..a3fb713ad 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -827,6 +827,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
|
||||
fi
|
||||
|
||||
+if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
|
||||
+ AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
|
||||
+ CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
+ [grub_cv_cc_mx86_used_note=yes],
|
||||
+ [grub_cv_cc_mx86_used_note=no])
|
||||
+ ])
|
||||
+
|
||||
+ if test "x$grub_cv_cc_mx86_used_note" = xyes; then
|
||||
+ TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
|
||||
+ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
# GRUB doesn't use float or doubles at all. Yet some toolchains may decide
|
||||
# that floats are a good fit to run instead of what's written in the code.
|
||||
# Given that floating point unit is disabled (if present to begin with)
|
||||
--
|
||||
2.30.0
|
||||
|
@ -1,24 +0,0 @@
|
||||
From 1fef848147fb1e09a96dbebee5fdc1760519c259 Mon Sep 17 00:00:00 2001
|
||||
From: Krzesimir Nowak <knowak@microsoft.com>
|
||||
Date: Thu, 6 Jan 2022 14:06:04 +0100
|
||||
Subject: [PATCH] configure: specify gettext version
|
||||
|
||||
---
|
||||
configure.ac | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index edd184154..d661f1446 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -343,6 +343,7 @@ AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
||||
|
||||
AC_GNU_SOURCE
|
||||
AM_GNU_GETTEXT([external])
|
||||
+AM_GNU_GETTEXT_VERSION([0.20])
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# Identify characteristics of the host architecture.
|
||||
--
|
||||
2.34.1
|
||||
|
@ -0,0 +1,74 @@
|
||||
From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001
|
||||
From: "Robin H. Johnson" <robbat2@gentoo.org>
|
||||
Date: Tue, 29 Dec 2015 15:29:14 -0800
|
||||
Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection
|
||||
|
||||
* util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS
|
||||
* docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS
|
||||
|
||||
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
|
||||
---
|
||||
docs/grub.texi | 5 +++++
|
||||
util/grub.d/10_linux.in | 21 +++++++++++----------
|
||||
2 files changed, 16 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/docs/grub.texi b/docs/grub.texi
|
||||
index 9a25a0b..d1129ec 100644
|
||||
--- a/docs/grub.texi
|
||||
+++ b/docs/grub.texi
|
||||
@@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces.
|
||||
Each module will be loaded as early as possible, at the start of
|
||||
@file{grub.cfg}.
|
||||
|
||||
+@item GRUB_LINUX_KERNEL_GLOBS
|
||||
+This option may be set to override the list of path globs used to find Linux
|
||||
+kernels. The defaults vary by architecture, and generally include both
|
||||
+@file{/boot} and @file{/}.
|
||||
+
|
||||
@end table
|
||||
|
||||
The following options are still accepted for compatibility with existing
|
||||
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
index 859b608..e5ac11d 100644
|
||||
--- a/util/grub.d/10_linux.in
|
||||
+++ b/util/grub.d/10_linux.in
|
||||
@@ -145,18 +145,19 @@ EOF
|
||||
}
|
||||
|
||||
machine=`uname -m`
|
||||
-case "x$machine" in
|
||||
+globs="$GRUB_LINUX_KERNEL_GLOBS"
|
||||
+[ -z "$globs" ] && case "x$machine" in
|
||||
xi?86 | xx86_64)
|
||||
- list=
|
||||
- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
|
||||
- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
|
||||
- done ;;
|
||||
- *)
|
||||
- list=
|
||||
- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
|
||||
- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
|
||||
- done ;;
|
||||
+ globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*"
|
||||
+ ;;
|
||||
esac
|
||||
+list=
|
||||
+for i in ${globs} ; do
|
||||
+ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
|
||||
+done
|
||||
|
||||
case "$machine" in
|
||||
i?86) GENKERNEL_ARCH="x86" ;;
|
||||
--- a/util/grub-mkconfig.in
|
||||
+++ b/util/grub-mkconfig.in
|
||||
@@ -252,6 +252,7 @@
|
||||
GRUB_BADRAM \
|
||||
GRUB_OS_PROBER_SKIP_LIST \
|
||||
GRUB_DISABLE_SUBMENU
|
||||
+export GRUB_LINUX_KERNEL_GLOBS
|
||||
|
||||
if test "x${grub_cfg}" != "x"; then
|
||||
rm -f "${grub_cfg}.new"
|
@ -0,0 +1,62 @@
|
||||
https://bugs.gentoo.org/894200
|
||||
https://git.savannah.gnu.org/cgit/grub.git/patch/?id=7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763
|
||||
|
||||
From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Fri, 11 Jun 2021 21:36:16 +0200
|
||||
Subject: fs/ext2: Ignore checksum seed incompat feature
|
||||
|
||||
This incompat feature is used to denote that the filesystem stored its
|
||||
metadata checksum seed in the superblock. This is used to allow tune2fs
|
||||
changing the UUID on a mounted metdata_csum filesystem without having
|
||||
to rewrite all the disk metadata. However, the GRUB doesn't use the
|
||||
metadata checksum at all. So, it can just ignore this feature if it
|
||||
is enabled. This is consistent with the GRUB filesystem code in general
|
||||
which just does a best effort to access the filesystem's data.
|
||||
|
||||
The checksum seed incompat feature has to be removed from the ignore
|
||||
list if the support for metadata checksum verification is added to the
|
||||
GRUB ext2 driver later.
|
||||
|
||||
Suggested-by: Eric Sandeen <esandeen@redhat.com>
|
||||
Suggested-by: Lukas Czerner <lczerner@redhat.com>
|
||||
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
grub-core/fs/ext2.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
|
||||
index e7dd78e..4953a15 100644
|
||||
--- a/grub-core/fs/ext2.c
|
||||
+++ b/grub-core/fs/ext2.c
|
||||
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
|
||||
#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
|
||||
#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
|
||||
+#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000
|
||||
#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
|
||||
|
||||
/* The set of back-incompatible features this driver DOES support. Add (OR)
|
||||
@@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
* mmp: Not really back-incompatible - was added as such to
|
||||
* avoid multiple read-write mounts. Safe to ignore for this
|
||||
* RO driver.
|
||||
+ * checksum seed: Not really back-incompatible - was added to allow tools
|
||||
+ * such as tune2fs to change the UUID on a mounted metadata
|
||||
+ * checksummed filesystem. Safe to ignore for now since the
|
||||
+ * driver doesn't support checksum verification. However, it
|
||||
+ * has to be removed from this list if the support is added later.
|
||||
*/
|
||||
#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
|
||||
- | EXT4_FEATURE_INCOMPAT_MMP)
|
||||
-
|
||||
+ | EXT4_FEATURE_INCOMPAT_MMP \
|
||||
+ | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
|
||||
|
||||
#define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U
|
||||
|
||||
--
|
||||
cgit v1.1
|
||||
|
@ -0,0 +1,31 @@
|
||||
From 28ad1f9b95799afc94fa178ec935e297da94cced Mon Sep 17 00:00:00 2001
|
||||
From: Nicholas Vinson <nvinson234@gmail.com>
|
||||
Date: Fri, 13 Jan 2023 02:56:35 -0500
|
||||
Subject: [PATCH] gentpl.py: Remove .interp section from .img files.
|
||||
|
||||
Whn building .img files, a .interp section from the .image files will
|
||||
sometimes be copied into the .img file. This additional section pushes
|
||||
the .img file beyond the 512-byte limit and causes grub-install to fail
|
||||
to run for i386-pc platforms.
|
||||
|
||||
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
|
||||
---
|
||||
gentpl.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gentpl.py b/gentpl.py
|
||||
index c86550d4f..823a8b5f8 100644
|
||||
--- a/gentpl.py
|
||||
+++ b/gentpl.py
|
||||
@@ -766,7 +766,7 @@ def image(defn, platform):
|
||||
if test x$(TARGET_APPLE_LINKER) = x1; then \
|
||||
$(MACHO2IMG) $< $@; \
|
||||
else \
|
||||
- $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property -R .ARM.exidx $< $@; \
|
||||
+ $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property -R .ARM.exidx -R .interp $< $@; \
|
||||
fi
|
||||
""")
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 0adec29674561034771c13e446069b41ef41e4d4 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <mchang@suse.com>
|
||||
Date: Fri, 3 Dec 2021 16:13:28 +0800
|
||||
Subject: grub-mkconfig: Restore umask for the grub.cfg
|
||||
|
||||
The commit ab2e53c8a (grub-mkconfig: Honor a symlink when generating
|
||||
configuration by grub-mkconfig) has inadvertently discarded umask for
|
||||
creating grub.cfg in the process of running grub-mkconfig. The resulting
|
||||
wrong permission (0644) would allow unprivileged users to read GRUB
|
||||
configuration file content. This presents a low confidentiality risk
|
||||
as grub.cfg may contain non-secured plain-text passwords.
|
||||
|
||||
This patch restores the missing umask and sets the creation file mode
|
||||
to 0600 preventing unprivileged access.
|
||||
|
||||
Fixes: CVE-2021-3981
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
util/grub-mkconfig.in | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
|
||||
index c3ea761..62335d0 100644
|
||||
--- a/util/grub-mkconfig.in
|
||||
+++ b/util/grub-mkconfig.in
|
||||
@@ -301,7 +301,10 @@ and /etc/grub.d/* files or please file a bug report with
|
||||
exit 1
|
||||
else
|
||||
# none of the children aborted with error, install the new grub.cfg
|
||||
+ oldumask=$(umask)
|
||||
+ umask 077
|
||||
cat ${grub_cfg}.new > ${grub_cfg}
|
||||
+ umask $oldumask
|
||||
rm -f ${grub_cfg}.new
|
||||
fi
|
||||
fi
|
||||
--
|
||||
cgit v1.1
|
||||
|
68
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-locale.patch
vendored
Normal file
68
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-locale.patch
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
From 5983c2c6adf1c1bbb3ecd751253d1e898bdfd8a3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chang <mchang@suse.com>
|
||||
Date: Tue, 26 Oct 2021 15:11:00 +0800
|
||||
Subject: templates: Filter out POSIX locale for translation
|
||||
|
||||
The POSIX locale is default or native operating system's locale
|
||||
identical to the C locale, so no translation to human speaking languages
|
||||
are provided. For this reason we should filter out LANG=POSIX as well as
|
||||
LANG=C upon generating grub.cfg to avoid looking up for it's gettext's
|
||||
message catalogs that will consequently result in an unpleasant message:
|
||||
|
||||
error: file `/boot/grub/locale/POSIX.gmo' not found
|
||||
|
||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
util/grub.d/00_header.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
|
||||
index 93a9023..f74c2a4 100644
|
||||
--- a/util/grub.d/00_header.in
|
||||
+++ b/util/grub.d/00_header.in
|
||||
@@ -191,7 +191,7 @@ EOF
|
||||
EOF
|
||||
|
||||
# Gettext variables and module
|
||||
-if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "x" ]; then
|
||||
+if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "xPOSIX" ] && [ "x${LANG}" != "x" ]; then
|
||||
cat << EOF
|
||||
set locale_dir=\$prefix/locale
|
||||
set lang=${grub_lang}
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
From f42266a8a2a4215e4ffe419b8092bdf9ced33e8e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Hesse <mail@eworm.de>
|
||||
Date: Mon, 19 Sep 2022 15:31:28 +0200
|
||||
Subject: templates: Filter C.UTF-8 locale for translation
|
||||
|
||||
In addition to C locale there is also C.UTF-8 locale now. Filter that as
|
||||
well, by using ${grub_lang}, which contains a stripped value.
|
||||
This fixes the following message and resulting boot failure:
|
||||
|
||||
error: file `/boot/grub/locale/C.gmo' not found.
|
||||
|
||||
Signed-off-by: Christian Hesse <mail@eworm.de>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
util/grub.d/00_header.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
|
||||
index f74c2a4..6a316a5 100644
|
||||
--- a/util/grub.d/00_header.in
|
||||
+++ b/util/grub.d/00_header.in
|
||||
@@ -191,7 +191,7 @@ EOF
|
||||
EOF
|
||||
|
||||
# Gettext variables and module
|
||||
-if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "xPOSIX" ] && [ "x${LANG}" != "x" ]; then
|
||||
+if [ "x${grub_lang}" != "xC" ] && [ "x${LANG}" != "xPOSIX" ] && [ "x${LANG}" != "x" ]; then
|
||||
cat << EOF
|
||||
set locale_dir=\$prefix/locale
|
||||
set lang=${grub_lang}
|
||||
--
|
||||
cgit v1.1
|
||||
|
49
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-riscv.patch
vendored
Normal file
49
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-riscv.patch
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
https://bugs.gentoo.org/905785
|
||||
|
||||
From 049efdd72eb7baa7b2bf8884391ee7fe650da5a0 Mon Sep 17 00:00:00 2001
|
||||
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
||||
Date: Sat, 29 Jan 2022 13:36:55 +0100
|
||||
Subject: RISC-V: Adjust -march flags for binutils 2.38
|
||||
|
||||
As of version 2.38 binutils defaults to ISA specification version
|
||||
2019-12-13. This version of the specification has has separated the
|
||||
the csr read/write (csrr*/csrw*) instructions and the fence.i from
|
||||
the I extension and put them into separate Zicsr and Zifencei
|
||||
extensions.
|
||||
|
||||
This implies that we have to adjust the -march flag passed to the
|
||||
compiler accordingly.
|
||||
|
||||
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
---
|
||||
configure.ac | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 4f649ed..5c01af0 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -870,11 +870,19 @@ if test x"$platform" != xemu ; then
|
||||
CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], [])
|
||||
+ # ISA spec version 20191213 factored out extensions Zicsr and Zifencei
|
||||
+ CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror"
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
+ [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], [])
|
||||
fi
|
||||
if test "x$target_cpu" = xriscv64; then
|
||||
CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], [])
|
||||
+ # ISA spec version 20191213 factored out extensions Zicsr and Zifencei
|
||||
+ CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror"
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
+ [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], [])
|
||||
fi
|
||||
if test "x$target_cpu" = xia64; then
|
||||
CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror"
|
||||
--
|
||||
cgit v1.1
|
||||
|
25
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-test-words.patch
vendored
Normal file
25
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/files/grub-2.06-test-words.patch
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
From 0f5080a2f3c952e2ee00bd271f42c56bb955dc19 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Sun, 14 Mar 2021 12:44:52 -0400
|
||||
Subject: [PATCH] Use /usr/share/dict/words as a 'compressible' file
|
||||
|
||||
---
|
||||
tests/util/grub-fs-tester.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
|
||||
index bfc425e1f..efd2977b0 100644
|
||||
--- a/tests/util/grub-fs-tester.in
|
||||
+++ b/tests/util/grub-fs-tester.in
|
||||
@@ -265,7 +265,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
|
||||
MASTER="${tempdir}/master"
|
||||
FSLABEL="grub_;/testé莭莽茝😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfew"
|
||||
CFILESRC=
|
||||
- for cand in /usr/share/dict/american-english /usr/share/dict/linux.words /data/data/com.termux/files/usr/share/hunspell/en_US.dic; do
|
||||
+ for cand in /usr/share/dict/words; do
|
||||
if test -f "$cand" ; then
|
||||
CFILESRC="$cand"
|
||||
break
|
||||
--
|
||||
2.31.0.rc1
|
||||
|
@ -0,0 +1,31 @@
|
||||
From f827aac60d760a026db642b9d5c1ecbf587cfefc Mon Sep 17 00:00:00 2001
|
||||
From: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
|
||||
Date: Mon, 10 Jul 2023 23:55:43 -0500
|
||||
Subject: [PATCH] util/grub.d/25_bli.in: fix shebang on unmerged-usr
|
||||
|
||||
On an unmerged-usr system, grub-mkconfig errors out with the following
|
||||
error due to /usr/bin/sh not existing:
|
||||
|
||||
/usr/sbin/grub-mkconfig: /etc/grub.d/25_bli: /usr/bin/sh: bad interpreter: No such file or directory
|
||||
|
||||
Use a /bin/sh shebang to fix the error as well as match the other
|
||||
existing files.
|
||||
|
||||
Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
|
||||
---
|
||||
util/grub.d/25_bli.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/grub.d/25_bli.in b/util/grub.d/25_bli.in
|
||||
index 6e4538716..26e27a019 100644
|
||||
--- a/util/grub.d/25_bli.in
|
||||
+++ b/util/grub.d/25_bli.in
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/sh
|
||||
+#! /bin/sh
|
||||
set -e
|
||||
|
||||
# grub-mkconfig helper script.
|
||||
--
|
||||
2.41.0
|
||||
|
@ -1,13 +1,12 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-3,v 1.2 2014/02/28 18:07:13 floppym Exp $
|
||||
#
|
||||
# To populate all changes in this file you need to regenerate your
|
||||
# grub configuration file afterwards:
|
||||
# 'grub2-mkconfig -o /boot/grub/grub.cfg'
|
||||
# 'grub-mkconfig -o /boot/grub/grub.cfg'
|
||||
#
|
||||
# See the grub info page for documentation on possible variables and
|
||||
# their associated values.
|
||||
# their associated values.
|
||||
|
||||
GRUB_DISTRIBUTOR="Gentoo"
|
||||
|
||||
@ -40,6 +39,13 @@ GRUB_DISTRIBUTOR="Gentoo"
|
||||
# You can see them in real GRUB with the command `vbeinfo'.
|
||||
#GRUB_GFXMODE=640x480
|
||||
|
||||
# Set to 'text' to force the Linux kernel to boot in normal text
|
||||
# mode, 'keep' to preserve the graphics mode set using
|
||||
# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
|
||||
# graphics mode, or a sequence of these separated by commas or
|
||||
# semicolons to try several modes in sequence.
|
||||
#GRUB_GFXPAYLOAD_LINUX=
|
||||
|
||||
# Path to theme spec txt file.
|
||||
# The starfield is by default provided with use truetype.
|
||||
# NOTE: when enabling custom theme, ensure you have required font/etc.
|
||||
@ -52,5 +58,19 @@ GRUB_DISTRIBUTOR="Gentoo"
|
||||
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
|
||||
#GRUB_DISABLE_LINUX_UUID=true
|
||||
|
||||
# Comment if you don't want GRUB to pass "root=PARTUUID=xxx" parameter to kernel
|
||||
GRUB_DISABLE_LINUX_PARTUUID=false
|
||||
|
||||
# Uncomment to disable generation of recovery mode menu entries
|
||||
#GRUB_DISABLE_RECOVERY=true
|
||||
|
||||
# Uncomment to disable generation of the submenu and put all choices on
|
||||
# the top-level menu.
|
||||
# Besides the visual affect of no sub menu, this makes navigation of the
|
||||
# menu easier for a user who can't see the screen.
|
||||
#GRUB_DISABLE_SUBMENU=y
|
||||
|
||||
# Uncomment to play a tone when the main menu is displayed.
|
||||
# This is useful, for example, to allow users who can't see the screen
|
||||
# to know when they can make a choice on the menu.
|
||||
#GRUB_INIT_TUNE="60 800 1"
|
@ -1 +0,0 @@
|
||||
grub-9999.ebuild
|
351
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-2.06-r7.ebuild
vendored
Normal file
351
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-2.06-r7.ebuild
vendored
Normal file
@ -0,0 +1,351 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
# This ebuild uses 3 special global variables:
|
||||
# GRUB_BOOTSTRAP: Depend on python and invoke bootstrap (gnulib).
|
||||
# GRUB_AUTOGEN: Depend on python and invoke autogen.sh.
|
||||
# GRUB_AUTORECONF: Inherit autotools and invoke eautoreconf.
|
||||
#
|
||||
# When applying patches:
|
||||
# If gnulib is updated, set GRUB_BOOTSTRAP=1
|
||||
# If gentpl.py or *.def is updated, set GRUB_AUTOGEN=1
|
||||
# If gnulib, gentpl.py, *.def, or any autotools files are updated, set GRUB_AUTORECONF=1
|
||||
#
|
||||
# If any of the above applies to a user patch, the user should set the
|
||||
# corresponding variable in make.conf or the environment.
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
GRUB_AUTORECONF=1
|
||||
GRUB_BOOTSTRAP=1
|
||||
fi
|
||||
|
||||
GRUB_AUTOGEN=1
|
||||
GRUB_AUTORECONF=1
|
||||
PYTHON_COMPAT=( python3_{8..11} )
|
||||
WANT_LIBTOOL=none
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/dkiper.gpg
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
inherit python-any-r1
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
inherit autotools
|
||||
fi
|
||||
|
||||
inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs verify-sig
|
||||
|
||||
MY_P=${P}
|
||||
if [[ ${PV} != 9999 ]]; then
|
||||
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
|
||||
# The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
|
||||
MY_P=${P/_/'~'}
|
||||
SRC_URI="
|
||||
https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz
|
||||
verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig )
|
||||
"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
else
|
||||
SRC_URI="
|
||||
mirror://gnu/${PN}/${P}.tar.xz
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
S=${WORKDIR}/${P%_*}
|
||||
fi
|
||||
KEYWORDS="amd64 arm arm64 ~ia64 ppc ppc64 ~riscv sparc x86"
|
||||
else
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
|
||||
fi
|
||||
|
||||
SRC_URI+=" https://dev.gentoo.org/~floppym/dist/${P}-backports-r2.tar.xz"
|
||||
|
||||
PATCHES=(
|
||||
"${WORKDIR}/${P}-backports"
|
||||
"${FILESDIR}"/gfxpayload.patch
|
||||
"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
|
||||
"${FILESDIR}"/grub-2.06-test-words.patch
|
||||
"${FILESDIR}"/grub-2.06-grub-mkconfig-restore-umask.patch
|
||||
"${FILESDIR}"/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch
|
||||
"${FILESDIR}"/grub-2.06-fs-ext2-ignore-checksum-seed.patch
|
||||
"${FILESDIR}"/grub-2.06-riscv.patch
|
||||
"${FILESDIR}"/grub-2.06-locale.patch
|
||||
)
|
||||
|
||||
DEJAVU=dejavu-sans-ttf-2.37
|
||||
UNIFONT=unifont-12.1.02
|
||||
SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
|
||||
themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
|
||||
|
||||
DESCRIPTION="GNU GRUB boot loader"
|
||||
HOMEPAGE="https://www.gnu.org/software/grub/"
|
||||
|
||||
# Includes licenses for dejavu and unifont
|
||||
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )"
|
||||
SLOT="2/${PVR}"
|
||||
IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs"
|
||||
|
||||
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
|
||||
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
|
||||
IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
|
||||
|
||||
REQUIRED_USE="
|
||||
grub_platforms_coreboot? ( fonts )
|
||||
grub_platforms_qemu? ( fonts )
|
||||
grub_platforms_ieee1275? ( fonts )
|
||||
grub_platforms_loongson? ( fonts )
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
>=sys-devel/flex-2.5.35
|
||||
sys-devel/bison
|
||||
sys-apps/help2man
|
||||
sys-apps/texinfo
|
||||
fonts? (
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
test? (
|
||||
app-admin/genromfs
|
||||
app-arch/cpio
|
||||
app-arch/lzop
|
||||
app-emulation/qemu
|
||||
dev-libs/libisoburn
|
||||
sys-apps/miscfiles
|
||||
sys-block/parted
|
||||
sys-fs/squashfs-tools
|
||||
)
|
||||
themes? (
|
||||
app-arch/unzip
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
truetype? ( virtual/pkgconfig )
|
||||
verify-sig? ( sec-keys/openpgp-keys-danielkiper )
|
||||
"
|
||||
DEPEND="
|
||||
app-arch/xz-utils
|
||||
>=sys-libs/ncurses-5.2-r5:0=
|
||||
grub_platforms_emu? (
|
||||
sdl? ( media-libs/libsdl )
|
||||
)
|
||||
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
|
||||
libzfs? ( sys-fs/zfs:= )
|
||||
mount? ( sys-fs/fuse:0 )
|
||||
truetype? ( media-libs/freetype:2= )
|
||||
ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
kernel_linux? (
|
||||
grub_platforms_efi-32? ( sys-boot/efibootmgr )
|
||||
grub_platforms_efi-64? ( sys-boot/efibootmgr )
|
||||
)
|
||||
!sys-boot/grub:0
|
||||
nls? ( sys-devel/gettext )
|
||||
"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*"
|
||||
QA_PRESTRIPPED="usr/lib/grub/.*"
|
||||
QA_MULTILIB_PATHS="usr/lib/grub/.*"
|
||||
QA_WX_LOAD="usr/lib/grub/*"
|
||||
|
||||
pkg_setup() {
|
||||
:
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
git-r3_src_unpack
|
||||
pushd "${P}" >/dev/null || die
|
||||
local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git"
|
||||
local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}")
|
||||
git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
|
||||
git-r3_checkout "${GNULIB_URI}" gnulib
|
||||
popd >/dev/null || die
|
||||
elif use verify-sig; then
|
||||
verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig}
|
||||
fi
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
python_setup
|
||||
else
|
||||
export PYTHON=true
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
eautopoint --force
|
||||
AUTOPOINT=: AUTORECONF=: ./bootstrap || die
|
||||
elif [[ -n ${GRUB_AUTOGEN} ]]; then
|
||||
FROM_BOOTSTRAP=1 ./autogen.sh || die
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
eautoreconf
|
||||
fi
|
||||
}
|
||||
|
||||
grub_do() {
|
||||
multibuild_foreach_variant run_in_build_dir "$@"
|
||||
}
|
||||
|
||||
grub_do_once() {
|
||||
multibuild_for_best_variant run_in_build_dir "$@"
|
||||
}
|
||||
|
||||
grub_configure() {
|
||||
local platform
|
||||
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
efi*) platform=efi ;;
|
||||
xen-pvh) platform=xen_pvh ;;
|
||||
xen*) platform=xen ;;
|
||||
guessed) ;;
|
||||
*) platform=${MULTIBUILD_VARIANT} ;;
|
||||
esac
|
||||
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
*-32)
|
||||
if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
|
||||
local CTARGET=i386
|
||||
fi ;;
|
||||
*-64)
|
||||
if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
|
||||
local CTARGET=x86_64
|
||||
local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
|
||||
local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
local myeconfargs=(
|
||||
--disable-werror
|
||||
--program-prefix=
|
||||
--libdir="${EPREFIX}"/usr/lib
|
||||
$(use_enable device-mapper)
|
||||
$(use_enable mount grub-mount)
|
||||
$(use_enable nls)
|
||||
$(use_enable themes grub-themes)
|
||||
$(use_enable truetype grub-mkfont)
|
||||
$(use_enable libzfs)
|
||||
$(use_enable sdl grub-emu-sdl)
|
||||
${platform:+--with-platform=}${platform}
|
||||
|
||||
# Let configure detect this where supported
|
||||
$(usex efiemu '' '--disable-efiemu')
|
||||
)
|
||||
|
||||
if use fonts; then
|
||||
ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
|
||||
fi
|
||||
|
||||
if use themes; then
|
||||
ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
|
||||
fi
|
||||
|
||||
local ECONF_SOURCE="${S}"
|
||||
econf "${myeconfargs[@]}"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# Bug 508758.
|
||||
replace-flags -O3 -O2
|
||||
|
||||
# Workaround for bug 829165.
|
||||
filter-ldflags -pie
|
||||
|
||||
# We don't want to leak flags onto boot code.
|
||||
export HOST_CCASFLAGS=${CCASFLAGS}
|
||||
export HOST_CFLAGS=${CFLAGS}
|
||||
export HOST_CPPFLAGS=${CPPFLAGS}
|
||||
export HOST_LDFLAGS=${LDFLAGS}
|
||||
unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
|
||||
|
||||
tc-ld-disable-gold #439082 #466536 #526348
|
||||
export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
|
||||
unset LDFLAGS
|
||||
|
||||
tc-export CC NM OBJCOPY RANLIB STRIP
|
||||
tc-export BUILD_CC BUILD_PKG_CONFIG
|
||||
|
||||
# Force configure to use flex & bison, bug 887211.
|
||||
export LEX=flex
|
||||
unset YACC
|
||||
|
||||
MULTIBUILD_VARIANTS=()
|
||||
local p
|
||||
for p in "${GRUB_ALL_PLATFORMS[@]}"; do
|
||||
use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" )
|
||||
done
|
||||
[[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed )
|
||||
grub_do grub_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# Sandbox bug 404013.
|
||||
use libzfs && addpredict /etc/dfs:/dev/zfs
|
||||
|
||||
grub_do emake
|
||||
use doc && grub_do_once emake -C docs html
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# The qemu dependency is a bit complex.
|
||||
# You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
|
||||
grub_do emake check
|
||||
}
|
||||
|
||||
src_install() {
|
||||
grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)"
|
||||
use doc && grub_do_once emake -C docs install-html DESTDIR="${D}"
|
||||
|
||||
einstalldocs
|
||||
|
||||
insinto /etc/default
|
||||
newins "${FILESDIR}"/grub.default-4 grub
|
||||
|
||||
# https://bugs.gentoo.org/231935
|
||||
dostrip -x /usr/lib/grub
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "For information on how to configure GRUB2 please refer to the guide:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
|
||||
|
||||
if [[ -n ${REPLACING_VERSIONS} ]]; then
|
||||
local v
|
||||
for v in ${REPLACING_VERSIONS}; do
|
||||
if ver_test -gt ${v}; then
|
||||
ewarn
|
||||
ewarn "Re-run grub-install to update installed boot code!"
|
||||
ewarn "Re-run grub-mkconfig to update grub.cfg!"
|
||||
ewarn
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
elog
|
||||
optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober
|
||||
optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn
|
||||
optfeature "enabling RAID device detection" sys-fs/mdadm
|
||||
fi
|
||||
|
||||
if has_version 'sys-boot/grub:0'; then
|
||||
elog "A migration guide for GRUB Legacy users is available:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
|
||||
fi
|
||||
|
||||
if has_version sys-boot/os-prober; then
|
||||
ewarn "Due to security concerns, os-prober is disabled by default."
|
||||
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
|
||||
fi
|
||||
}
|
344
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-2.12_rc1-r1.ebuild
vendored
Normal file
344
sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-2.12_rc1-r1.ebuild
vendored
Normal file
@ -0,0 +1,344 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
# This ebuild uses 3 special global variables:
|
||||
# GRUB_BOOTSTRAP: Depend on python and invoke bootstrap (gnulib).
|
||||
# GRUB_AUTOGEN: Depend on python and invoke autogen.sh.
|
||||
# GRUB_AUTORECONF: Inherit autotools and invoke eautoreconf.
|
||||
#
|
||||
# When applying patches:
|
||||
# If gnulib is updated, set GRUB_BOOTSTRAP=1
|
||||
# If gentpl.py or *.def is updated, set GRUB_AUTOGEN=1
|
||||
# If gnulib, gentpl.py, *.def, or any autotools files are updated, set GRUB_AUTORECONF=1
|
||||
#
|
||||
# If any of the above applies to a user patch, the user should set the
|
||||
# corresponding variable in make.conf or the environment.
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
GRUB_AUTORECONF=1
|
||||
GRUB_BOOTSTRAP=1
|
||||
fi
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
WANT_LIBTOOL=none
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/dkiper.gpg
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
inherit python-any-r1
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
inherit autotools
|
||||
fi
|
||||
|
||||
inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs verify-sig
|
||||
|
||||
MY_P=${P}
|
||||
if [[ ${PV} != 9999 ]]; then
|
||||
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
|
||||
# The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
|
||||
MY_P=${P/_/'~'}
|
||||
SRC_URI="
|
||||
https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz
|
||||
verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig )
|
||||
"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
else
|
||||
SRC_URI="
|
||||
mirror://gnu/${PN}/${P}.tar.xz
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
S=${WORKDIR}/${P%_*}
|
||||
fi
|
||||
#KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
||||
else
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
|
||||
fi
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/gfxpayload.patch
|
||||
"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
|
||||
"${FILESDIR}"/grub-2.06-test-words.patch
|
||||
"${FILESDIR}"/grub-2.12_rc1-util-grub.d-25_bli.in-fix-shebang-on-unmerged-usr.patch
|
||||
)
|
||||
|
||||
DEJAVU=dejavu-sans-ttf-2.37
|
||||
UNIFONT=unifont-15.0.06
|
||||
SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
|
||||
themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
|
||||
|
||||
DESCRIPTION="GNU GRUB boot loader"
|
||||
HOMEPAGE="https://www.gnu.org/software/grub/"
|
||||
|
||||
# Includes licenses for dejavu and unifont
|
||||
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )"
|
||||
SLOT="2/${PVR}"
|
||||
IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs"
|
||||
|
||||
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
|
||||
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
|
||||
IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
|
||||
|
||||
REQUIRED_USE="
|
||||
grub_platforms_coreboot? ( fonts )
|
||||
grub_platforms_qemu? ( fonts )
|
||||
grub_platforms_ieee1275? ( fonts )
|
||||
grub_platforms_loongson? ( fonts )
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
>=sys-devel/flex-2.5.35
|
||||
sys-devel/bison
|
||||
sys-apps/help2man
|
||||
sys-apps/texinfo
|
||||
fonts? (
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
test? (
|
||||
app-admin/genromfs
|
||||
app-arch/cpio
|
||||
app-arch/lzop
|
||||
app-emulation/qemu
|
||||
dev-libs/libisoburn
|
||||
sys-apps/miscfiles
|
||||
sys-block/parted
|
||||
sys-fs/squashfs-tools
|
||||
)
|
||||
themes? (
|
||||
app-arch/unzip
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
truetype? ( virtual/pkgconfig )
|
||||
verify-sig? ( sec-keys/openpgp-keys-danielkiper )
|
||||
"
|
||||
DEPEND="
|
||||
app-arch/xz-utils
|
||||
>=sys-libs/ncurses-5.2-r5:0=
|
||||
grub_platforms_emu? (
|
||||
sdl? ( media-libs/libsdl )
|
||||
)
|
||||
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
|
||||
libzfs? ( sys-fs/zfs:= )
|
||||
mount? ( sys-fs/fuse:0 )
|
||||
truetype? ( media-libs/freetype:2= )
|
||||
ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
kernel_linux? (
|
||||
grub_platforms_efi-32? ( sys-boot/efibootmgr )
|
||||
grub_platforms_efi-64? ( sys-boot/efibootmgr )
|
||||
)
|
||||
!sys-boot/grub:0
|
||||
nls? ( sys-devel/gettext )
|
||||
"
|
||||
|
||||
RESTRICT="!test? ( test ) test? ( userpriv )"
|
||||
|
||||
QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*"
|
||||
QA_PRESTRIPPED="usr/lib/grub/.*"
|
||||
QA_MULTILIB_PATHS="usr/lib/grub/.*"
|
||||
QA_WX_LOAD="usr/lib/grub/*"
|
||||
|
||||
pkg_setup() {
|
||||
:
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
git-r3_src_unpack
|
||||
pushd "${P}" >/dev/null || die
|
||||
local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git"
|
||||
local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}")
|
||||
git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
|
||||
git-r3_checkout "${GNULIB_URI}" gnulib
|
||||
popd >/dev/null || die
|
||||
elif use verify-sig; then
|
||||
verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig}
|
||||
fi
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
python_setup
|
||||
else
|
||||
export PYTHON=true
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
eautopoint --force
|
||||
AUTOPOINT=: AUTORECONF=: ./bootstrap || die
|
||||
elif [[ -n ${GRUB_AUTOGEN} ]]; then
|
||||
FROM_BOOTSTRAP=1 ./autogen.sh || die
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
eautoreconf
|
||||
fi
|
||||
}
|
||||
|
||||
grub_do() {
|
||||
multibuild_foreach_variant run_in_build_dir "$@"
|
||||
}
|
||||
|
||||
grub_do_once() {
|
||||
multibuild_for_best_variant run_in_build_dir "$@"
|
||||
}
|
||||
|
||||
grub_configure() {
|
||||
local platform
|
||||
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
efi*) platform=efi ;;
|
||||
xen-pvh) platform=xen_pvh ;;
|
||||
xen*) platform=xen ;;
|
||||
guessed) ;;
|
||||
*) platform=${MULTIBUILD_VARIANT} ;;
|
||||
esac
|
||||
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
*-32)
|
||||
if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
|
||||
local CTARGET=i386
|
||||
fi ;;
|
||||
*-64)
|
||||
if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
|
||||
local CTARGET=x86_64
|
||||
local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
|
||||
local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
local myeconfargs=(
|
||||
--disable-werror
|
||||
--program-prefix=
|
||||
--libdir="${EPREFIX}"/usr/lib
|
||||
$(use_enable device-mapper)
|
||||
$(use_enable mount grub-mount)
|
||||
$(use_enable nls)
|
||||
$(use_enable themes grub-themes)
|
||||
$(use_enable truetype grub-mkfont)
|
||||
$(use_enable libzfs)
|
||||
$(use_enable sdl grub-emu-sdl)
|
||||
${platform:+--with-platform=}${platform}
|
||||
|
||||
# Let configure detect this where supported
|
||||
$(usex efiemu '' '--disable-efiemu')
|
||||
)
|
||||
|
||||
if use fonts; then
|
||||
ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
|
||||
fi
|
||||
|
||||
if use themes; then
|
||||
ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
|
||||
fi
|
||||
|
||||
local ECONF_SOURCE="${S}"
|
||||
econf "${myeconfargs[@]}"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# Bug 508758.
|
||||
replace-flags -O3 -O2
|
||||
|
||||
# Workaround for bug 829165.
|
||||
filter-ldflags -pie
|
||||
|
||||
# We don't want to leak flags onto boot code.
|
||||
export HOST_CCASFLAGS=${CCASFLAGS}
|
||||
export HOST_CFLAGS=${CFLAGS}
|
||||
export HOST_CPPFLAGS=${CPPFLAGS}
|
||||
export HOST_LDFLAGS=${LDFLAGS}
|
||||
unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
|
||||
|
||||
tc-ld-disable-gold #439082 #466536 #526348
|
||||
export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
|
||||
unset LDFLAGS
|
||||
|
||||
tc-export CC NM OBJCOPY RANLIB STRIP
|
||||
tc-export BUILD_CC BUILD_PKG_CONFIG
|
||||
|
||||
# Force configure to use flex & bison, bug 887211.
|
||||
export LEX=flex
|
||||
unset YACC
|
||||
|
||||
MULTIBUILD_VARIANTS=()
|
||||
local p
|
||||
for p in "${GRUB_ALL_PLATFORMS[@]}"; do
|
||||
use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" )
|
||||
done
|
||||
[[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed )
|
||||
grub_do grub_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# Sandbox bug 404013.
|
||||
use libzfs && addpredict /etc/dfs:/dev/zfs
|
||||
|
||||
grub_do emake
|
||||
use doc && grub_do_once emake -C docs html
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# The qemu dependency is a bit complex.
|
||||
# You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
|
||||
local SANDBOX_WRITE=${SANDBOX_WRITE}
|
||||
addwrite /dev
|
||||
grub_do emake -j1 check
|
||||
}
|
||||
|
||||
src_install() {
|
||||
grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)"
|
||||
use doc && grub_do_once emake -C docs install-html DESTDIR="${D}"
|
||||
|
||||
einstalldocs
|
||||
|
||||
insinto /etc/default
|
||||
newins "${FILESDIR}"/grub.default-4 grub
|
||||
|
||||
# https://bugs.gentoo.org/231935
|
||||
dostrip -x /usr/lib/grub
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "For information on how to configure GRUB2 please refer to the guide:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
|
||||
|
||||
if [[ -n ${REPLACING_VERSIONS} ]]; then
|
||||
local v
|
||||
for v in ${REPLACING_VERSIONS}; do
|
||||
if ver_test -gt ${v}; then
|
||||
ewarn
|
||||
ewarn "Re-run grub-install to update installed boot code!"
|
||||
ewarn "Re-run grub-mkconfig to update grub.cfg!"
|
||||
ewarn
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
elog
|
||||
optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober
|
||||
optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn
|
||||
optfeature "enabling RAID device detection" sys-fs/mdadm
|
||||
fi
|
||||
|
||||
if has_version 'sys-boot/grub:0'; then
|
||||
elog "A migration guide for GRUB Legacy users is available:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
|
||||
fi
|
||||
|
||||
if has_version sys-boot/os-prober; then
|
||||
ewarn "Due to security concerns, os-prober is disabled by default."
|
||||
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
|
||||
fi
|
||||
}
|
@ -1,29 +1,63 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
CROS_WORKON_PROJECT="flatcar/grub"
|
||||
CROS_WORKON_REPO="https://github.com"
|
||||
GRUB_AUTOGEN=1 # We start from Git, so always autogen.
|
||||
# This ebuild uses 3 special global variables:
|
||||
# GRUB_BOOTSTRAP: Depend on python and invoke bootstrap (gnulib).
|
||||
# GRUB_AUTOGEN: Depend on python and invoke autogen.sh.
|
||||
# GRUB_AUTORECONF: Inherit autotools and invoke eautoreconf.
|
||||
#
|
||||
# When applying patches:
|
||||
# If gnulib is updated, set GRUB_BOOTSTRAP=1
|
||||
# If gentpl.py or *.def is updated, set GRUB_AUTOGEN=1
|
||||
# If gnulib, gentpl.py, *.def, or any autotools files are updated, set GRUB_AUTORECONF=1
|
||||
#
|
||||
# If any of the above applies to a user patch, the user should set the
|
||||
# corresponding variable in make.conf or the environment.
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
KEYWORDS="~amd64 ~arm64 ~x86"
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
GRUB_AUTORECONF=1
|
||||
GRUB_BOOTSTRAP=1
|
||||
fi
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
WANT_LIBTOOL=none
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
inherit python-any-r1
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
inherit autotools
|
||||
fi
|
||||
|
||||
inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs
|
||||
|
||||
if [[ ${PV} != 9999 ]]; then
|
||||
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
|
||||
# The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
|
||||
MY_P=${P/_/'~'}
|
||||
SRC_URI="https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
else
|
||||
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
|
||||
S=${WORKDIR}/${P%_*}
|
||||
fi
|
||||
KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
||||
else
|
||||
CROS_WORKON_COMMIT="ba40c9d246602646b22b0d190f260f2d98c0351b" # flatcar-master
|
||||
KEYWORDS="amd64 arm64 x86"
|
||||
fi
|
||||
inherit cros-workon
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} ]]; then
|
||||
PYTHON_COMPAT=( python3_{6..11} )
|
||||
WANT_LIBTOOL=none
|
||||
inherit autotools python-any-r1
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
|
||||
fi
|
||||
|
||||
inherit autotools bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/gfxpayload.patch
|
||||
"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
|
||||
"${FILESDIR}"/grub-2.06-test-words.patch
|
||||
)
|
||||
|
||||
DEJAVU=dejavu-sans-ttf-2.37
|
||||
UNIFONT=unifont-9.0.06
|
||||
UNIFONT=unifont-15.0.06
|
||||
SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
|
||||
themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
|
||||
|
||||
@ -31,12 +65,12 @@ DESCRIPTION="GNU GRUB boot loader"
|
||||
HOMEPAGE="https://www.gnu.org/software/grub/"
|
||||
|
||||
# Includes licenses for dejavu and unifont
|
||||
LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )"
|
||||
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )"
|
||||
SLOT="2/${PVR}"
|
||||
IUSE="debug device-mapper doc efiemu +fonts mount multislot nls static sdl test +themes truetype libzfs"
|
||||
IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs"
|
||||
|
||||
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen xen-32 )
|
||||
GRUB_ALL_PLATFORMS+=( arm64 ) # Tack on arm64 for pulling in the cross-compiler.
|
||||
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
|
||||
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
|
||||
IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
|
||||
|
||||
REQUIRED_USE="
|
||||
@ -46,105 +80,96 @@ REQUIRED_USE="
|
||||
grub_platforms_loongson? ( fonts )
|
||||
"
|
||||
|
||||
# os-prober: Used on runtime to detect other OSes
|
||||
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
|
||||
RDEPEND="
|
||||
app-arch/xz-utils
|
||||
>=sys-libs/ncurses-5.2-r5
|
||||
debug? (
|
||||
sdl? ( media-libs/libsdl )
|
||||
)
|
||||
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
|
||||
libzfs? ( sys-fs/zfs )
|
||||
mount? ( sys-fs/fuse )
|
||||
truetype? ( media-libs/freetype:2= )
|
||||
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
|
||||
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
app-misc/pax-utils
|
||||
sys-devel/flex
|
||||
>=sys-devel/flex-2.5.35
|
||||
sys-devel/bison
|
||||
sys-apps/help2man
|
||||
sys-apps/texinfo
|
||||
grub_platforms_arm64? ( cross-aarch64-cros-linux-gnu/gcc )
|
||||
static? (
|
||||
app-arch/xz-utils[static-libs(+)]
|
||||
truetype? (
|
||||
app-arch/bzip2[static-libs(+)]
|
||||
media-libs/freetype[static-libs(+)]
|
||||
sys-libs/zlib[static-libs(+)]
|
||||
)
|
||||
fonts? (
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
test? (
|
||||
app-admin/genromfs
|
||||
app-arch/cpio
|
||||
app-arch/lzop
|
||||
grub_platforms_efi-64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] )
|
||||
grub_platforms_pc? ( app-emulation/qemu[qemu_softmmu_targets_i386] )
|
||||
grub_platforms_arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] )
|
||||
app-emulation/qemu
|
||||
dev-libs/libisoburn
|
||||
sys-apps/miscfiles
|
||||
sys-block/parted
|
||||
sys-fs/squashfs-tools[lzo,xz]
|
||||
sys-fs/squashfs-tools
|
||||
)
|
||||
themes? (
|
||||
app-arch/unzip
|
||||
media-libs/freetype:2
|
||||
virtual/pkgconfig
|
||||
)
|
||||
truetype? ( virtual/pkgconfig )
|
||||
"
|
||||
RDEPEND+="
|
||||
DEPEND="
|
||||
app-arch/xz-utils
|
||||
>=sys-libs/ncurses-5.2-r5:0=
|
||||
grub_platforms_emu? (
|
||||
sdl? ( media-libs/libsdl )
|
||||
)
|
||||
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
|
||||
libzfs? ( sys-fs/zfs:= )
|
||||
mount? ( sys-fs/fuse:0 )
|
||||
truetype? ( media-libs/freetype:2= )
|
||||
ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
kernel_linux? (
|
||||
grub_platforms_efi-32? ( sys-boot/efibootmgr )
|
||||
grub_platforms_efi-64? ( sys-boot/efibootmgr )
|
||||
)
|
||||
!multislot? ( !sys-boot/grub:0 !sys-boot/grub-static )
|
||||
!sys-boot/grub:0
|
||||
nls? ( sys-devel/gettext )
|
||||
"
|
||||
|
||||
DEPEND+=" !!=media-libs/freetype-2.5.4"
|
||||
RESTRICT="!test? ( test ) test? ( userpriv )"
|
||||
|
||||
RESTRICT="strip !test? ( test )"
|
||||
|
||||
QA_EXECSTACK="usr/bin/grub*-emu* usr/lib/grub/*"
|
||||
QA_WX_LOAD="usr/lib/grub/*"
|
||||
QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*"
|
||||
QA_PRESTRIPPED="usr/lib/grub/.*"
|
||||
QA_MULTILIB_PATHS="usr/lib/grub/.*"
|
||||
QA_WX_LOAD="usr/lib/grub/*"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.02-binutils-2.36-x86-used-note.patch"
|
||||
"${FILESDIR}/${PN}-2.02-configure-specify-gettext-version.patch"
|
||||
)
|
||||
pkg_setup() {
|
||||
:
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
cros-workon_src_unpack
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
git-r3_src_unpack
|
||||
pushd "${P}" >/dev/null || die
|
||||
local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git"
|
||||
local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}")
|
||||
git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
|
||||
git-r3_checkout "${GNULIB_URI}" gnulib
|
||||
popd >/dev/null || die
|
||||
fi
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
sed -i -e /autoreconf/d autogen.sh || die
|
||||
|
||||
if use multislot; then
|
||||
# fix texinfo file name, bug 416035
|
||||
sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
|
||||
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
python_setup
|
||||
else
|
||||
export PYTHON=true
|
||||
fi
|
||||
|
||||
# Nothing in Gentoo packages 'american-english' in the exact path
|
||||
# wanted for the test, but all that is needed is a compressible text
|
||||
# file, and we do have 'words' from miscfiles in the same path.
|
||||
sed -i \
|
||||
-e '/CFILESSRC.*=/s,american-english,words,' \
|
||||
tests/util/grub-fs-tester.in \
|
||||
|| die
|
||||
|
||||
if [[ -n ${GRUB_AUTOGEN} ]]; then
|
||||
python_setup
|
||||
bash autogen.sh || die
|
||||
# Flatcar: Force the use of newer gettext infra to
|
||||
# avoid build issues with infra version mismatches.
|
||||
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
|
||||
eautopoint --force
|
||||
AUTOPOINT=: AUTORECONF=: ./bootstrap || die
|
||||
elif [[ -n ${GRUB_AUTOGEN} ]]; then
|
||||
FROM_BOOTSTRAP=1 ./autogen.sh || die
|
||||
fi
|
||||
|
||||
if [[ -n ${GRUB_AUTORECONF} ]]; then
|
||||
eautoreconf
|
||||
fi
|
||||
}
|
||||
@ -162,8 +187,8 @@ grub_configure() {
|
||||
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
efi*) platform=efi ;;
|
||||
xen-pvh) platform=xen_pvh ;;
|
||||
xen*) platform=xen ;;
|
||||
arm64) platform=efi ;;
|
||||
guessed) ;;
|
||||
*) platform=${MULTIBUILD_VARIANT} ;;
|
||||
esac
|
||||
@ -171,45 +196,39 @@ grub_configure() {
|
||||
case ${MULTIBUILD_VARIANT} in
|
||||
*-32)
|
||||
if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
|
||||
local CTARGET=${CTARGET:-i386}
|
||||
local CTARGET=i386
|
||||
fi ;;
|
||||
*-64)
|
||||
if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
|
||||
local CTARGET=${CTARGET:-x86_64}
|
||||
local CTARGET=x86_64
|
||||
local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
|
||||
local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
|
||||
fi ;;
|
||||
arm64)
|
||||
local CTARGET=aarch64-cros-linux-gnu ;;
|
||||
esac
|
||||
|
||||
local myeconfargs=(
|
||||
--disable-werror
|
||||
--program-prefix=
|
||||
--libdir="${EPREFIX}"/usr/lib
|
||||
--htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
|
||||
$(use_enable debug mm-debug)
|
||||
$(use_enable device-mapper)
|
||||
$(use_enable mount grub-mount)
|
||||
$(use_enable nls)
|
||||
$(use_enable themes grub-themes)
|
||||
$(use_enable truetype grub-mkfont)
|
||||
$(use_enable libzfs)
|
||||
$(use sdl && use_enable debug grub-emu-sdl)
|
||||
$(use_enable sdl grub-emu-sdl)
|
||||
${platform:+--with-platform=}${platform}
|
||||
|
||||
# Let configure detect this where supported
|
||||
$(usex efiemu '' '--disable-efiemu')
|
||||
)
|
||||
|
||||
if use multislot; then
|
||||
myeconfargs+=( --program-transform-name="s,grub,grub2," )
|
||||
if use fonts; then
|
||||
ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
|
||||
fi
|
||||
|
||||
# Set up font symlinks
|
||||
ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
|
||||
if use themes; then
|
||||
ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
|
||||
ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
|
||||
fi
|
||||
|
||||
local ECONF_SOURCE="${S}"
|
||||
@ -220,6 +239,9 @@ src_configure() {
|
||||
# Bug 508758.
|
||||
replace-flags -O3 -O2
|
||||
|
||||
# Workaround for bug 829165.
|
||||
filter-ldflags -pie
|
||||
|
||||
# We don't want to leak flags onto boot code.
|
||||
export HOST_CCASFLAGS=${CCASFLAGS}
|
||||
export HOST_CFLAGS=${CFLAGS}
|
||||
@ -227,14 +249,16 @@ src_configure() {
|
||||
export HOST_LDFLAGS=${LDFLAGS}
|
||||
unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
|
||||
|
||||
use static && HOST_LDFLAGS+=" -static"
|
||||
|
||||
tc-ld-disable-gold #439082 #466536 #526348
|
||||
export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
|
||||
unset LDFLAGS
|
||||
|
||||
tc-export CC NM OBJCOPY RANLIB STRIP
|
||||
tc-export BUILD_CC # Bug 485592
|
||||
tc-export BUILD_CC BUILD_PKG_CONFIG
|
||||
|
||||
# Force configure to use flex & bison, bug 887211.
|
||||
export LEX=flex
|
||||
unset YACC
|
||||
|
||||
MULTIBUILD_VARIANTS=()
|
||||
local p
|
||||
@ -256,7 +280,9 @@ src_compile() {
|
||||
src_test() {
|
||||
# The qemu dependency is a bit complex.
|
||||
# You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
|
||||
grub_do emake check
|
||||
local SANDBOX_WRITE=${SANDBOX_WRITE}
|
||||
addwrite /dev
|
||||
grub_do emake -j1 check
|
||||
}
|
||||
|
||||
src_install() {
|
||||
@ -265,28 +291,42 @@ src_install() {
|
||||
|
||||
einstalldocs
|
||||
|
||||
if use multislot; then
|
||||
mv "${ED%/}"/usr/share/info/grub{,2}.info || die
|
||||
fi
|
||||
|
||||
insinto /etc/default
|
||||
newins "${FILESDIR}"/grub.default-3 grub
|
||||
newins "${FILESDIR}"/grub.default-4 grub
|
||||
|
||||
# https://bugs.gentoo.org/231935
|
||||
dostrip -x /usr/lib/grub
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "For information on how to configure GRUB2 please refer to the guide:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
|
||||
|
||||
if [[ -n ${REPLACING_VERSIONS} ]]; then
|
||||
local v
|
||||
for v in ${REPLACING_VERSIONS}; do
|
||||
if ver_test -gt ${v}; then
|
||||
ewarn
|
||||
ewarn "Re-run grub-install to update installed boot code!"
|
||||
ewarn "Re-run grub-mkconfig to update grub.cfg!"
|
||||
ewarn
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
elog
|
||||
optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober
|
||||
optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn
|
||||
optfeature "enabling RAID device detection" sys-fs/mdadm
|
||||
fi
|
||||
|
||||
if has_version 'sys-boot/grub:0'; then
|
||||
elog "A migration guide for GRUB Legacy users is available:"
|
||||
elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
|
||||
fi
|
||||
|
||||
if [[ -z ${REPLACING_VERSIONS} ]]; then
|
||||
elog
|
||||
elog "You may consider installing the following optional packages:"
|
||||
optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober
|
||||
optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn
|
||||
optfeature "Enable RAID device detection" sys-fs/mdadm
|
||||
if has_version sys-boot/os-prober; then
|
||||
ewarn "Due to security concerns, os-prober is disabled by default."
|
||||
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
|
||||
fi
|
||||
}
|
||||
|
@ -1,15 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer restrict=">=sys-boot/grub-2" type="person">
|
||||
<maintainer type="person">
|
||||
<email>floppym@gentoo.org</email>
|
||||
<name>Mike Gilbert</name>
|
||||
<description>GRUB2 only - do not assign bugs related to GRUB Legacy (0.97)</description>
|
||||
</maintainer>
|
||||
<maintainer restrict="<sys-boot/grub-1" type="person">
|
||||
<email>axs@gentoo.org</email>
|
||||
<name>Ian Stakenvicius</name>
|
||||
<description>GRUB-Legacy only - do not assign bugs related to GRUB2</description>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>base-system@gentoo.org</email>
|
||||
@ -29,14 +23,10 @@
|
||||
<flag name="libzfs">
|
||||
Enable support for <pkg>sys-fs/zfs</pkg>
|
||||
</flag>
|
||||
<flag name="multislot">
|
||||
Allow concurrent installation of <pkg>sys-boot/grub</pkg> SLOT 0 and
|
||||
<pkg>sys-boot/grub</pkg> SLOT 2 by renaming all programs.
|
||||
</flag>
|
||||
<flag name="themes">Build and install GRUB themes (starfield)</flag>
|
||||
<flag name="truetype">Build and install grub-mkfont conversion utility</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
<remote-id type="sourceforge">dejavu</remote-id>
|
||||
<remote-id type="cpe">cpe:/a:gnu:grub</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
Loading…
Reference in New Issue
Block a user