I suggest(ed) to learn packaging as the alternative is what you already noted: Building Grub direct and local, which is quite more with issues. Surely possible, but the results may vary besides building Grub is also with more traps when using for example on Coreboot-systems (or Libreboot). I referenced the PKGBUILD for exactly the reasoning to get inside perspective in the build-process (which is clearly to be seen there), the needed dependencies from a clean environment and direct also to learn packaging.
So with the PKGBUILD you can first learn how to build a reversible to be used package: Install or remove it, use the one from the repositories again or use your own build instead. The difference is: You have always an up- or downgrade on your choice. Therefore the first and most important fields in the PKGBUILD (https://git.hyperbola.info:50100/~team/ … 34a54ef004):
pkgver=2.04
pkgrel=6
epoch=2
pkgver marks as the name says the used version of the package, either 2.04 or what you want then 2.12.
pkgrel is starting for 2.04 at 6 current, needs for another local build (and any following to be rised in one step, so for example 2.04-7 when you do your own or starting new at 1 when you use a complete new version, so 2.12-1)
epoch is same as pkgver but used for complex packages like Grub to differ better between minor and major releases (so for a 2.12 it would start again with 1)
You need to look at those parts: Package-versions (explained above), the source-array and the hashsum-array. Example:
source=("https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz"{,.sig}
"https://repo.hyperbola.info:50000/sources/grub/grub-extras.tar.gz"{,.sig}
"https://repo.hyperbola.info:50000/sources/grub/gnulib.tar.gz"{,.sig}
"https://repo.hyperbola.info:50000/sources/grub/grub2_${_debver}-${_debrel}.debian.tar.xz"{,.sig}
"https://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz"{,.sig}
'0001-10_linux-20_linux_xen-detect-hyperbola-initramfs.patch'
'0002-add-GRUB_COLOR_variables.patch'
'0003-10_linux-20_linux_xen-rebrand-free-distros.patch'
'0004-20_linux_xen-detect-kernel-configuration-files.patch'
'0005-20_linux_xen-remove-placeholder-entry.patch'
'grub.default'
'remove-relocator64.patch')
sha512sums=('9c15c42d0cf5d61446b752194e3b628bb04be0fe6ea0240ab62b3d753784712744846e1f7c3651d8e0968d22012e6d713c38c44936d4004ded3ca4d4007babbb'
'SKIP'
'ba34812007ab2acac08ae7bcf7f9168473657704d65a82ece28a93666cdf1b8d49f5f4aa67d4edc1d8bbf498dc0e2f3adb0e1164f3c9af1bfe0a955043bf4fa3'
'SKIP'
'8012a5472de910bd4d6637a7a889d81bfc12cfbd00adeb6a12d4aad43e8d8a90884fc9ecfcaef43faf9b7030f14b0071b57d71f1c87dab1d9cfe94371d4bb5e9'
'SKIP'
'61d6900140f83a5e4c066e3f530d5093cd1961b036f37c29eefd14131fb2e2022602dcfff2ac6cd58769bca1cb824446550b0c2a9aba6b4a3ae5c7ed82943b5a'
'SKIP'
'45cf6a0c08d498a41a0bf2acff1ba34c1a59991f9f4a7b73c2124b408ce17b5aece8a008b85a196e84e031448c0333bc1fdaa65ad6329f1c0889ef56a218ae27'
'SKIP'
'3529ab4d08a4165e081c49dfc1cf40079ad9a1b9dd7ab6d39147fc347cb6aa615fd90292ecd5ecbfb543bf444bef27043a2392029d0210f9b4a6369365d3da1b'
'0ae2f50a397268ea0ff46faa180e699ba956acaa68504d9dde7c33ab194430df57c2e2e5f9fe30b6c31e7806666faad4b274747ba151035e338bcaab3d875c3e'
'f88b937b9a4f24cc1f2a113c55a8ab01b8b610616e72d2191f375d32b2ae27ca6a50811632711848253026e0c9a36a40f8be8bec1daa33f03666b00f60f1b14b'
'63938fde65f20a616a1611f2b533ae596a2e13ca7b30796071bc59762cde0fe588fcc5008bfa593f0fb01e0f929642eeecd687072fdb6aa0d0456d0e8778ceba'
'22b0b479b1cc448a240739b0be164dc202bfb9688f8219aef5c711a1b96aaf06da78323a5e79d74adefd34ac42fe6566592bf398c9de99f6f35fcd28794d1418'
'c715b089ba869ed957450403bb2c57b5650a0bb0f6a8e823893e030296268a53870825ea37e219ab3e7261c79e6efacab9fe624a70ecce4c3c4456c2cf54e816'
'fa7ccf679d69e0ebe2b7b537e566b11122f8dc6d8de85f952e4eec19ac724c63251b40660446d8141be014ac9cd8d6d1da05453c44f9869c1e69c3d1f7e30d4a')
When you change a package-version and leave the rest: At minimum the first entry will change. So you have to change also the first line in sha512sums with the correct hashsum for the newly downloaded tarball. This is the command to help you in that:
As said: Downloading all parts listed in the concrete folder into a local one and execute the command makepkg -s brings you at minimum a bit more deeper and nearer towards your own package to be used at any given time. This has advantages:
- as said reversible testing
- good starting conditions for your further research
- no manual intervention outside packaging direct in your root-filesystem
What can you learn from a PKGBUILD?
- how to build the package, even if you do not want to learn more about packaging itself it shows how to build in which order and where traps are
- what dependencies are needed
- patching needed in different situations (your wished feature is not supported upstream so far I have seen, this is important then)
Human being in favor with clear principles and so also for freedom in soft- and hardware!
Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!