summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Perez2021-05-21 08:09:08 -0400
committerAngel Perez2021-05-21 08:09:08 -0400
commit71b2cb623707f0d544e68a7005d3a84863682387 (patch)
tree53b4ed84575e7271249b1d529e878418e0e38858
parent51b1946bfba1459baed18c001539508a6fcf09e6 (diff)
downloadaur-71b2cb623707f0d544e68a7005d3a84863682387.tar.gz
Feel free to test and report bugs
* Set timeout_style from menu to hidden (if you are using this package, then you want an actual silent boot) * Added patch to fix wrong image size calculation * Minior changes
-rwxr-xr-x.SRCINFO8
-rw-r--r--02-linux-detect-archlinux-initramfs.patch41
-rw-r--r--07-quick_boot.patch5
-rw-r--r--08-fix_wrong_image_size.patch48
-rw-r--r--PKGBUILD18
5 files changed, 109 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bab3919c05e4..035e47d2bb6e 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = grub-silent
pkgdesc = GNU GRand Unified Bootloader (2) [without welcome and kernel messages]
pkgver = 2.04
- pkgrel = 4
+ pkgrel = 5
url = https://www.gnu.org/software/grub/
install = grub.install
arch = x86_64
@@ -46,12 +46,13 @@ pkgbase = grub-silent
source = https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz
source = https://git.savannah.nongnu.org/cgit/grub-extras.git/snapshot/grub-extras-8a245d5c1800627af4cefa99162a89c7a46d8842.tar.gz
source = 01-intel-ucode.patch
- source = 02-10_linux-detect-archlinux-initramfs.patch
+ source = 02-linux-detect-archlinux-initramfs.patch
source = 03-add-GRUB_COLOR_variables.patch
source = 04-gettext_quiet.patch
source = 05-sleep_shift.patch
source = 06-maybe_quiet.patch
source = 07-quick_boot.patch
+ source = 08-fix_wrong_image_size.patch
source = grub.silent
sha256sums = e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
sha256sums = fb6b37db9b14fd03e4d26775d84b570fbe91d4ea5de3df4e31114d79a2dfa97e
@@ -61,7 +62,8 @@ pkgbase = grub-silent
sha256sums = 39d7843dfe1e10ead912a81be370813b8621794a7967b3cc5e4d4188b5bf7264
sha256sums = 4b189e00a8c97ec09903e9588e02fc78b4bb114ee4822fcce13811aca00c8884
sha256sums = b7489c7facc4fb3dad4426c9c00079b64908640a2bec2409e22194daa3f72af4
- sha256sums = 057f076ddca241d92a094bc05828e3eb18d3439bf4d2f3d8ca8fa1c51b5b1b2b
+ sha256sums = 1723340737b91a5bf503829bbe66b1c56683ef0e533f20d18b7098840aecb3a2
+ sha256sums = 13053d6f36456234a5ed7dc4d4006459f6f9d2c9a19e6febfa4dc17cb5982bd3
sha256sums = 4f2e9d585b7b0ef8ce0d09e88391d1397b50883c7cb1516dc99785934abe15a2
pkgname = grub-silent
diff --git a/02-linux-detect-archlinux-initramfs.patch b/02-linux-detect-archlinux-initramfs.patch
new file mode 100644
index 000000000000..cea7706ad44c
--- /dev/null
+++ b/02-linux-detect-archlinux-initramfs.patch
@@ -0,0 +1,41 @@
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 892d34d..e69bef8 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -93,6 +93,8 @@ linux_entry ()
+ case $type in
+ recovery)
+ title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
++ fallback)
++ title="$(gettext_printf "%s, with Linux %s (fallback initramfs)" "${os}" "${version}")" ;;
+ *)
+ title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
+ esac
+@@ -195,7 +197,7 @@ while [ "x$list" != "x" ] ; do
+ basename=`basename $linux`
+ dirname=`dirname $linux`
+ rel_dirname=`make_system_path_relative_to_its_root $dirname`
+- version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
++ version=`echo $basename | sed -e "s,vmlinuz-,,g"`
+ alt_version=`echo $version | sed -e "s,\.old$,,g"`
+ linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+@@ -277,6 +279,18 @@ while [ "x$list" != "x" ] ; do
+
+ linux_entry "${OS}" "${version}" advanced \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++
++ if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
++ initrd="initramfs-${version}-fallback.img"
++
++ if test -n "${initrd}" ; then
++ gettext_printf "Found fallback initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
++ fi
++
++ linux_entry "${OS}" "${version}" fallback \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++ fi
++
+ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+ linux_entry "${OS}" "${version}" recovery \
+ "single ${GRUB_CMDLINE_LINUX}"
diff --git a/07-quick_boot.patch b/07-quick_boot.patch
index 075f9ea9bcde..3a593b238bc5 100644
--- a/07-quick_boot.patch
+++ b/07-quick_boot.patch
@@ -16,10 +16,11 @@ https://wiki.ubuntu.com/DesktopExperienceTeam/KarmicBootExperienceDesignSpec#Boo
If the previous boot failed (defined as failing to get to the end of one
of the normal runlevels), then show the boot menu regardless.
+Contributor : Angel Perez <drlorente97@gmail.com>
Author: Richard Laager <rlaager@wiktel.com>
Author: Robie Basak <robie.basak@ubuntu.com>
Forwarded: no
-Last-Update: 2015-09-04
+Last-Update: 2021-05-21
Patch-Name: quick_boot.patch
---
@@ -299,7 +300,7 @@ index 271044f59..da5f28876 100644
+adjust_timeout () {
+ if [ "$quick_boot" = 1 ] && [ "x${found_other_os}" != "x" ]; then
+ cat << EOF
-+set timeout_style=menu
++set timeout_style=hidden
+if [ "\${timeout}" = 0 ]; then
+ set timeout=10
+fi
diff --git a/08-fix_wrong_image_size.patch b/08-fix_wrong_image_size.patch
new file mode 100644
index 000000000000..17989adf3f87
--- /dev/null
+++ b/08-fix_wrong_image_size.patch
@@ -0,0 +1,48 @@
+From c0e647eb0e2bd09315612446cb4d90f7f75cb44c Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javierm@redhat.com>
+Date: Tue, 27 Apr 2021 12:25:08 +0200
+Subject: util/mkimage: Fix wrong PE32+ section sizes for some arches
+
+The commit f60ba9e5945 (util/mkimage: Refactor section setup to use a helper)
+added a helper function to setup PE sections. But it also changed how the
+raw data offsets were calculated since all the section sizes are aligned.
+However, for some platforms, i.e ia64-efi and arm64-efi, the kernel image
+size is not aligned using the section alignment. This leads to the situation
+in which the mods section offset in its PE section header does not match its
+real placement in the PE file. So, finally the GRUB is not able to locate
+and load built-in modules.
+
+The problem surfaces on ia64-efi and arm64-efi because both platforms
+require additional relocation data which is added behind .bss section.
+So, we have to add some padding behind this extra data to make the
+beginning of mods section properly aligned in the PE file. Fix it by
+aligning the kernel_size to the section alignment. That makes the sizes
+and offsets in the PE section headers to match relevant sections in the
+PE32+ binary file.
+
+Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ util/grub-mkimagexx.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
+index 00f49ccaa..d78fa3e53 100644
+--- a/util/grub-mkimagexx.c
++++ b/util/grub-mkimagexx.c
+@@ -2388,6 +2388,10 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
+ layout->kernel_size += ALIGN_UP (layout->got_size, 16);
+ }
+ #endif
++
++ if (image_target->id == IMAGE_EFI)
++ layout->kernel_size = ALIGN_UP (layout->kernel_size,
++ GRUB_PE32_FILE_ALIGNMENT);
+ }
+ else
+ {
+--
+cgit v1.2.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 26f6b4e5dc64..6efd71f223ff 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,5 @@
# Derived from official Arch Linux grub package
-# Maintainer : Angel Perez <near1297@nauta.cu>
+# Maintainer : Angel Perez <drlorente97@gmail.com>
# Maintainer : Martin Villagra <possum@archlinux.org>
# Contributor: Özgür Sarıer <echo b3pndXJzYXJpZXIxMDExNjAxMTE1QGdtYWlsLmNvbQo= | base64 -d>
# Maintainer : Christian Hesse <mail@eworm.de>
@@ -24,7 +24,7 @@ _GRUB_EXTRAS_COMMIT="8a245d5c1800627af4cefa99162a89c7a46d8842"
pkgname="grub-silent"
pkgdesc="GNU GRand Unified Bootloader (2) [without welcome and kernel messages]"
pkgver=2.04
-pkgrel=4
+pkgrel=5
url="https://www.gnu.org/software/grub/"
arch=('x86_64' 'i686')
license=('GPL3')
@@ -55,12 +55,13 @@ fi
source=("https://ftp.gnu.org/gnu/${pkgname%-*}/${pkgname%-*}-${pkgver}.tar.xz"
"https://git.savannah.nongnu.org/cgit/grub-extras.git/snapshot/grub-extras-${_GRUB_EXTRAS_COMMIT}.tar.gz"
'01-intel-ucode.patch'
- '02-10_linux-detect-archlinux-initramfs.patch'
+ '02-linux-detect-archlinux-initramfs.patch'
'03-add-GRUB_COLOR_variables.patch'
'04-gettext_quiet.patch'
'05-sleep_shift.patch'
'06-maybe_quiet.patch'
'07-quick_boot.patch'
+ '08-fix_wrong_image_size.patch'
'grub.silent')
sha256sums=('e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d'
@@ -71,7 +72,8 @@ sha256sums=('e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d'
'39d7843dfe1e10ead912a81be370813b8621794a7967b3cc5e4d4188b5bf7264'
'4b189e00a8c97ec09903e9588e02fc78b4bb114ee4822fcce13811aca00c8884'
'b7489c7facc4fb3dad4426c9c00079b64908640a2bec2409e22194daa3f72af4'
- '057f076ddca241d92a094bc05828e3eb18d3439bf4d2f3d8ca8fa1c51b5b1b2b'
+ '1723340737b91a5bf503829bbe66b1c56683ef0e533f20d18b7098840aecb3a2'
+ '13053d6f36456234a5ed7dc4d4006459f6f9d2c9a19e6febfa4dc17cb5982bd3'
'4f2e9d585b7b0ef8ce0d09e88391d1397b50883c7cb1516dc99785934abe15a2')
prepare() {
@@ -82,7 +84,7 @@ prepare() {
echo
msg "Patch to detect of Arch Linux initramfs images by grub-mkconfig"
- patch -Np1 -i "${srcdir}/02-10_linux-detect-archlinux-initramfs.patch"
+ patch -Np1 -i "${srcdir}/02-linux-detect-archlinux-initramfs.patch"
echo
msg "Patch to enable GRUB_COLOR_* variables in grub-mkconfig"
@@ -99,13 +101,17 @@ prepare() {
msg "Fix OS naming FS#33393"
sed 's|GNU/Linux|Linux|' -i "util/grub.d/10_linux.in"
- msg "Appling Ubuntu patches for making GRUB silent"
+ msg "Applying Ubuntu patches for making GRUB silent"
patch -Np1 -i "${srcdir}/04-gettext_quiet.patch"
patch -Np1 -i "${srcdir}/05-sleep_shift.patch"
patch -Np1 -i "${srcdir}/06-maybe_quiet.patch"
patch -Np1 -i "${srcdir}/07-quick_boot.patch"
echo
+ msg "Appliying patch to fix wrong image size on some rare cases"
+ patch -Np1 -i "${srcdir}/08-fix_wrong_image_size.patch"
+ echo
+
msg "Pull in latest language files"
./linguas.sh
echo