From a139582df35beb08f0612bddc97ec760b600a51b Mon Sep 17 00:00:00 2001 From: xhaa123 Date: Tue, 15 Oct 2024 20:34:46 +0800 Subject: [PATCH] grub 2.12-2 --- PKGBUILD | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ grub.default | 64 +++++++++++++++++++++++++++++++++++++++++++ grub.hook | 12 ++++++++ 3 files changed, 153 insertions(+) create mode 100644 PKGBUILD create mode 100644 grub.default create mode 100644 grub.hook diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..cac5619 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,77 @@ +# Maintainer: Future Linux Team + +pkgname=grub +pkgver=2.12 +_UNIFONT_VER=15.1.05 +pkgrel=2 +pkgdesc="GNU GRand Unified Bootloader (2)" +arch=('x86_64') +url="https://www.gnu.org/software/grub/" +license=('GPL-3.0-or-later') +depends=('bash' 'xz' 'gettext' 'device-mapper' 'efibootmgr') +makedepends=('rsync' 'freetype2' 'dejavu-fonts' 'python' 'texinfo' 'fuse3') +backup=(etc/default/grub + etc/grub.d/40_custom) +options=('!makeflags') +source=(https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz + https://unifoundry.com/pub/unifont/unifont-${_UNIFONT_VER}/font-builds/unifont-${_UNIFONT_VER}.pcf.gz + grub.default + grub.hook) +sha256sums=(f3c97391f7c4eaa677a78e090c7e97e6dc47b16f655f04683ebd37bef7fe0faa + ce973d6785d7be66bfb574583af000408a63c984bed573e268b645e3160f4dbc + 401bda89d3e04f213c9e8202e6f9b69a1f0ff565c3964e08f2014b5aa11b42ae + bb537329e43b1a040e6360379da645a61e3f4c7ed203a987c67a9f2df12017e4) + +prepare() { + cd ${pkgname}-${pkgver} + + echo depends bli part_gpt > grub-core/extra_deps.lst + + sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "configure.ac" + + gzip -cd ${srcdir}/unifont-${_UNIFONT_VER}.pcf.gz > unifont.pcf + + autoreconf -ivf + +} + +build() { + cd ${pkgname}-${pkgver} + + unset {C,CPP,CXX,LD}FLAGS + + ${CONFIGURE} \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --disable-efiemu \ + --enable-nls \ + --enable-grub-mkfont \ + --enable-device-mapper \ + --enable-cache-stats \ + --enable-boot-time \ + --enable-grub-mount \ + --with-platform=efi \ + --target=x86_64 \ + --disable-silent-rules \ + --disable-werror \ + --program-prefix="" \ + --with-grubdir="grub" \ + --with-bootdir="/boot" \ + FREETYPE="pkg-config freetype2" \ + BUILD_FREETYPE="pkg-config freetype2" + + make +} + +package() { + cd ${pkgname}-${pkgver} + + make DESTDIR=${pkgdir} install + make DESTDIR=${pkgdir} bashcompletiondir=/usr/share/bash-completion/completions install + + rm -rf ${pkgdir}/etc/bash_completion.d + + install -D -m0644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub + install -vDm644 ${srcdir}/grub.hook ${pkgdir}/usr/share/libalpm/hooks/grub.hook +} diff --git a/grub.default b/grub.default new file mode 100644 index 0000000..cade253 --- /dev/null +++ b/grub.default @@ -0,0 +1,64 @@ +# GRUB boot loader configuration + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Future Linux" +GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet" +GRUB_CMDLINE_LINUX="" + +# Preload both GPT and MBR modules so that they are not missed +GRUB_PRELOAD_MODULES="part_gpt part_msdos" + +# Uncomment to enable booting from LUKS encrypted devices +#GRUB_ENABLE_CRYPTODISK=y + +# Set to 'countdown' or 'hidden' to change timeout behavior, +# press ESC key to display menu. +GRUB_TIMEOUT_STYLE=menu + +# Uncomment to use basic console +GRUB_TERMINAL_INPUT=console + +# Uncomment to disable graphical terminal +#GRUB_TERMINAL_OUTPUT=console + +# The resolution used on graphical terminal +# note that you can use only modes which your graphic card supports via VBE +# you can see them in real GRUB with the command `videoinfo' +GRUB_GFXMODE=auto + +# Uncomment to allow the kernel use the same resolution used by grub +GRUB_GFXPAYLOAD_LINUX=keep + +# Uncomment if you want GRUB to pass to the Linux kernel the old parameter +# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +GRUB_DISABLE_RECOVERY=true + +# Uncomment and set to the desired menu colors. Used by normal and wallpaper +# modes only. Entries specified as foreground/background. +#GRUB_COLOR_NORMAL="light-blue/black" +#GRUB_COLOR_HIGHLIGHT="light-cyan/blue" + +# Uncomment one of them for the gfx desired, a image background or a gfxtheme +#GRUB_BACKGROUND="/path/to/wallpaper" +#GRUB_THEME="/path/to/gfxtheme" + +# Uncomment to get a beep at GRUB start +#GRUB_INIT_TUNE="480 440 1" + +# Uncomment to make GRUB remember the last selection. This requires +# setting 'GRUB_DEFAULT=saved' above. +#GRUB_SAVEDEFAULT=true + +# Uncomment to disable submenus in boot menu +#GRUB_DISABLE_SUBMENU=y + +# Probing for other operating systems is disabled for security reasons. Read +# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this +# functionality install os-prober and uncomment to detect and include other +# operating systems. +#GRUB_DISABLE_OS_PROBER=false + diff --git a/grub.hook b/grub.hook new file mode 100644 index 0000000..53c7bd3 --- /dev/null +++ b/grub.hook @@ -0,0 +1,12 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Operation = Remove +Type = File +Target = usr/lib/modules/*/vmlinuz + +[Action] +Description = Updating GRUB Config +Depends = grub +When = PostTransaction +Exec = /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg