From feb675243db63eecf7ce0f2d6bd48fb70a46f359 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sat, 4 May 2024 03:02:06 +0000 Subject: [PATCH] core/mkinitcpio to 39-1 --- core/mkinitcpio/.SRCINFO | 18 ++++----- ...-use-gzip-for-compression-by-default.patch | 38 +++++++++---------- ...-gzip-compressed-kernels-in-kver_gen.patch | 10 ++--- ...-for-ALARM-kernels-in-run_post_hooks.patch | 29 +++++++------- core/mkinitcpio/PKGBUILD | 30 ++++++--------- core/mkinitcpio/mkinitcpio.install | 15 -------- 6 files changed, 58 insertions(+), 82 deletions(-) delete mode 100644 core/mkinitcpio/mkinitcpio.install diff --git a/core/mkinitcpio/.SRCINFO b/core/mkinitcpio/.SRCINFO index 5ae5dac60..946ec5ea5 100644 --- a/core/mkinitcpio/.SRCINFO +++ b/core/mkinitcpio/.SRCINFO @@ -1,14 +1,14 @@ pkgbase = mkinitcpio pkgdesc = Modular initramfs image creation utility - pkgver = 38.1 + pkgver = 39 pkgrel = 1 url = https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio - install = mkinitcpio.install arch = any - license = GPL + license = GPL-2.0-only checkdepends = bats checkdepends = bats-assert checkdepends = lzop + makedepends = asciidoc depends = awk depends = mkinitcpio-busybox>=1.19.4-2 depends = kmod @@ -30,18 +30,14 @@ pkgbase = mkinitcpio optdepends = lz4: Use lz4 compression for the initramfs image optdepends = mkinitcpio-nfs-utils: Support for root filesystem on NFS provides = initramfs - conflicts = systemd<255.4-2 - conflicts = cryptsetup<2.7.0-3 - conflicts = mdadm<4.3-2 - conflicts = lvm2<2.03.23-3 backup = etc/mkinitcpio.conf - source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-38.1.tar.gz - source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-38.1.tar.gz.sig + source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-39.tar.xz + source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-39.tar.xz.sig validpgpkeys = ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB validpgpkeys = C100346676634E80C940FB9E9C02FF419FECBE16 - sha512sums = e727509badc528f45f2b193b3f49c202df41d4e75067bebd44c22ebc59f635d4a9596bc671d609d8941644f3a246267f7a199946730ba474040a1f24b94f663c + sha512sums = 50ae08ddf7596b821c89f927ff6692ca907a5045590096155ec6de64e0b5da647ff2c75d1603ab0035046096d37a6eacae383d458b1bb36bd525691b2b23c9ea sha512sums = SKIP - b2sums = 625455bb1140688bcdf04c946eb6fa1da53deaa221b2c8090c173aef1d7fc617227aa0674344f3c18d5b9ab77a093725856f4f0cd3b8a33462a2ac742f0dbf11 + b2sums = 3a28d6711ce843aafe2868b09ba5a723e57e4fdffe905ac915aa5d224279590a10bba902933f183de33e08e96a6aad4d9e1d4752be74c011a37c4cbe83c8d645 b2sums = SKIP pkgname = mkinitcpio diff --git a/core/mkinitcpio/0001-use-gzip-for-compression-by-default.patch b/core/mkinitcpio/0001-use-gzip-for-compression-by-default.patch index 6db8dde72..0c5f251a7 100644 --- a/core/mkinitcpio/0001-use-gzip-for-compression-by-default.patch +++ b/core/mkinitcpio/0001-use-gzip-for-compression-by-default.patch @@ -1,4 +1,4 @@ -From 74924b627ddc4093849b581d57c86a68dcea7000 Mon Sep 17 00:00:00 2001 +From 1643427d4fe48ea46ef1a9a04b6ada5276708e09 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sat, 20 Feb 2021 10:02:34 -0700 Subject: [PATCH 1/3] use gzip for compression by default @@ -10,33 +10,33 @@ Subject: [PATCH 1/3] use gzip for compression by default 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/mkinitcpio.conf.5.adoc b/man/mkinitcpio.conf.5.adoc -index 69bbc6a..ad60b6b 100644 +index 3029811..1bd60c5 100644 --- a/man/mkinitcpio.conf.5.adoc +++ b/man/mkinitcpio.conf.5.adoc -@@ -55,7 +55,7 @@ override the main configuration file. +@@ -56,7 +56,7 @@ override the main configuration file. Defines a program to filter the generated image through. The kernel understands the compression formats yielded by the *zstd*(1), *gzip*(1), *bzip2*(1), *lz4*(1), *lzop*(1), *lzma*(1), and *xz*(1) compressors. If -- unspecified, this setting defaults to _zstd_ compression. In order to create -+ unspecified, this setting defaults to _gzip_ compression. In order to create - an uncompressed image, define this variable as _cat_. +- unspecified, this setting defaults to _zstd_ compression for Linux ≥ 5.9 and ++ unspecified, this setting defaults to _gzip_ compression for Linux ≥ 5.9 and + gzip compression for Linux < 5.9. In order to create an uncompressed image, + define this variable as _cat_. + - It is not hard to realize that a filter such as a _tac_ or _rev_ will cause diff --git a/mkinitcpio b/mkinitcpio -index d6bec2f..c6d5731 100755 +index df8ead5..17eae23 100755 --- a/mkinitcpio +++ b/mkinitcpio -@@ -998,7 +998,7 @@ if [[ -n "$_optgenimg" ]]; then - die "Unable to write to '%s'" "$_optgenimg" - fi +@@ -413,7 +413,7 @@ build_image() { + } -- _optcompress="${_optcompress:-"${COMPRESSION:-zstd}"}" -+ _optcompress="${_optcompress:-"${COMPRESSION:-gzip}"}" - if ! type -P "$_optcompress" >/dev/null; then - warning "Unable to locate compression method: '%s'" "$_optcompress" - _optcompress='cat' + validate_compression() { +- local major minor compression_fallback='zstd' ++ local major minor compression_fallback='gzip' + + if [[ -z "$_optcompress" && -v COMPRESSION_OPTIONS && ! -v COMPRESSION ]]; then + warning 'COMPRESSION_OPTIONS is set without also setting COMPRESSION. Configure COMPRESSION explicitly!' diff --git a/mkinitcpio.conf b/mkinitcpio.conf -index fc54be6..f728198 100644 +index c07aa9e..4c0c571 100644 --- a/mkinitcpio.conf +++ b/mkinitcpio.conf @@ -55,7 +55,7 @@ FILES=() @@ -45,9 +45,9 @@ index fc54be6..f728198 100644 # COMPRESSION -# Use this to compress the initramfs image. By default, zstd compression +# Use this to compress the initramfs image. By default, gzip compression - # is used. Use 'cat' to create an uncompressed image. + # is used for Linux ≥ 5.9 and gzip compression is used for Linux < 5.9. + # Use 'cat' to create an uncompressed image. #COMPRESSION="zstd" - #COMPRESSION="gzip" -- 2.36.1 diff --git a/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch b/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch index ef5ecb6ef..351e542a5 100644 --- a/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch +++ b/core/mkinitcpio/0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch @@ -1,4 +1,4 @@ -From bf800eb0b545829bd1a63ffd862b8b093ed0060a Mon Sep 17 00:00:00 2001 +From f31b1dd5ef56948ade0292c812cec782a726b266 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 30 Jan 2022 10:01:43 +0000 Subject: [PATCH 2/3] functions: handle gzip compressed kernels in kver_generic @@ -9,12 +9,12 @@ Signed-off-by: Janne Grunau 1 file changed, 5 insertions(+) diff --git a/functions b/functions -index ca12618..75b379e 100644 +index 3dbc2e4..4e77418 100755 --- a/functions +++ b/functions -@@ -301,6 +301,11 @@ kver_generic() { - - read -r _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') +@@ -444,6 +444,11 @@ kver_generic() { + # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/version-timestamp.c?h=v6.7#n28 + read -r _ _ kver _ < <(decompress_cat "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') + # try if the image is gzip compressed + if [[ -z "$kver" ]]; then diff --git a/core/mkinitcpio/0003-check-for-ALARM-kernels-in-run_post_hooks.patch b/core/mkinitcpio/0003-check-for-ALARM-kernels-in-run_post_hooks.patch index 64d0d4ba5..8a0ce1841 100644 --- a/core/mkinitcpio/0003-check-for-ALARM-kernels-in-run_post_hooks.patch +++ b/core/mkinitcpio/0003-check-for-ALARM-kernels-in-run_post_hooks.patch @@ -1,22 +1,24 @@ -From b2b9ece774103b899d03526f6278451f0213d1fe Mon Sep 17 00:00:00 2001 +From 5742e332299eb12222f626a247c936b777de2ce9 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Tue, 21 Mar 2023 17:56:32 -0600 Subject: [PATCH 3/3] check for ALARM kernels in run_post_hooks --- - functions | 25 ++++++++++++++++++++----- + functions | 27 +++++++++++++++++++++------ mkinitcpio | 11 +++++++++++ - 2 files changed, 31 insertions(+), 5 deletions(-) + 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/functions b/functions -index 75b379e..287bd46 100644 +index 4e77418..bd9723a 100755 --- a/functions +++ b/functions -@@ -297,13 +297,28 @@ kver_generic() { - reader='zcat' - fi +@@ -440,13 +440,28 @@ kver_generic() { -- [[ "$(detect_compression "$1")" == 'gzip' ]] && reader='zcat' + local kver='' + +- # Loosely grep for `linux_banner`: +- # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/version-timestamp.c?h=v6.7#n28 +- read -r _ _ kver _ < <(decompress_cat "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') + if [[ $1 =~ "/zImage" || $1 =~ /kernel7.img ]]; then + # Check for xz zImage + skip=$(LC_ALL=C grep -a -b -o $'\xFD\x37\x7A\x58\x5A\x00' $1 | tail -n 1 | cut -d ':' -f 1) @@ -31,10 +33,9 @@ index 75b379e..287bd46 100644 + fi + fi + else -+ [[ "$(detect_compression "$1")" == 'gzip' ]] && reader='zcat' - -- read -r _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') -+ read -r _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') ++ # Loosely grep for `linux_banner`: ++ # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/version-timestamp.c?h=v6.7#n28 ++ read -r _ _ kver _ < <(decompress_cat "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+') - # try if the image is gzip compressed - if [[ -z "$kver" ]]; then @@ -47,10 +48,10 @@ index 75b379e..287bd46 100644 printf '%s' "$kver" diff --git a/mkinitcpio b/mkinitcpio -index c6d5731..fc90cd1 100755 +index 17eae23..0d0dd40 100755 --- a/mkinitcpio +++ b/mkinitcpio -@@ -923,6 +923,17 @@ if [[ "$KERNELVERSION" != 'none' ]]; then +@@ -1085,6 +1085,17 @@ if [[ "$KERNELVERSION" != 'none' ]]; then done fi diff --git a/core/mkinitcpio/PKGBUILD b/core/mkinitcpio/PKGBUILD index 2273012c4..45420d921 100644 --- a/core/mkinitcpio/PKGBUILD +++ b/core/mkinitcpio/PKGBUILD @@ -9,21 +9,16 @@ # - patch for gzip kernel image support (https://github.com/archlinux/mkinitcpio/pull/86) pkgname=mkinitcpio -pkgver=38.1 +pkgver=39 pkgrel=1 pkgdesc="Modular initramfs image creation utility" arch=('any') url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio' -license=('GPL') +license=('GPL-2.0-only') depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils' 'bash' 'binutils' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'gzip' 'systemd') +checkdepends=('bats' 'bats-assert' 'lzop') makedepends=('asciidoc') -conflicts=( - 'systemd<255.4-2' - 'cryptsetup<2.7.0-3' - 'mdadm<4.3-2' - 'lvm2<2.03.23-3' -) checkdepends=('bats' 'bats-assert' 'lzop') optdepends=('xz: Use lzma or xz compression for the initramfs image' 'bzip2: Use bzip2 compression for the initramfs image' @@ -32,21 +27,20 @@ optdepends=('xz: Use lzma or xz compression for the initramfs image' 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') provides=('initramfs') backup=('etc/mkinitcpio.conf') -source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig} +source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig} '0001-use-gzip-for-compression-by-default.patch' '0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch' '0003-check-for-ALARM-kernels-in-run_post_hooks.patch') -install=mkinitcpio.install -sha512sums=('e727509badc528f45f2b193b3f49c202df41d4e75067bebd44c22ebc59f635d4a9596bc671d609d8941644f3a246267f7a199946730ba474040a1f24b94f663c' +sha512sums=('50ae08ddf7596b821c89f927ff6692ca907a5045590096155ec6de64e0b5da647ff2c75d1603ab0035046096d37a6eacae383d458b1bb36bd525691b2b23c9ea' 'SKIP' - '52f9913b8c297919db34844439df0799d8699aa75f9d2adbdaf2bb3e68eee54ec9d27946ecd9e2053fef4057ae1859dedc7d99d8da7110b31ff9ac6970e970c1' - '7c0ea267567c23c37dc5b5aac587e64885ff36ec9818a250687b40ad4903ea74d50b033d1b1a1dd46f968cab53f70f3da96af171d8f2fdf1aacaca328fbd4e2d' - '674729df541f852153fb634b391df2b2af037efc9f2561c9ed1c211ce8b05e21f30f603a44c552283b449534b3f2ab95150fc0adc088069c86f91dfede5f7f3c') -b2sums=('625455bb1140688bcdf04c946eb6fa1da53deaa221b2c8090c173aef1d7fc617227aa0674344f3c18d5b9ab77a093725856f4f0cd3b8a33462a2ac742f0dbf11' + 'f8110186cb107b21f1234f53aea34aee1906b7f9b663fb212f455d53860debe52d0852abcde9ed7d911cbc36c86ad7213243678c25c517b0b9bcc13bd61ad17b' + '23dd4a2046bb1370917fff7a4922c287a7314a9dea7623eafad0caba197763bff585d3afa9cea22c5e0d4ee2a21471ce79a8690614905632f4acd4145f314e4e' + 'f6e3f5f8c97002d28a5eb7f9ad4327d76f4f6d1f072cb9f8d3473264424c76eb3417afcc69dae8fd53c9196f47fc2052a9bd2fbbd46eba49d1e6096b8bd119bb') +b2sums=('3a28d6711ce843aafe2868b09ba5a723e57e4fdffe905ac915aa5d224279590a10bba902933f183de33e08e96a6aad4d9e1d4752be74c011a37c4cbe83c8d645' 'SKIP' - '3c8ca4927c9eb39c8923e1000cf301605e2ded6d18d5d551941fdd8fc2c4a4b24ceff6593cf7afa02391f8559fafce5c80cfffd854612323905a41c90f55bb43' - 'c089ac622e6550c0ad9dc361c552e524b547f1124c127e8f32d7bd25ad45be7cbfe6afe1e0152d104f7c9c6a7e0d54f850b90b579bee33f9466a71c4cd40fa22' - 'dc5cd0fee2dc44cc76000e4875672b4e8b6cd53a09e7e98df2f648a8706dd276a06836bbe74903ad16d3633f104ac33a641d08e15a035cb379d92cb0fd0f84f3') + '04fbfd50700e5108738552a3fa16f891d3eced3a64b076834a2ac71cba45d073b701e0700bd9919be36680ed971a58bbcd93b3f65613eb1e836aaafcc3db37ab' + '2e5a30cc77f9108ee0f31540d22081817c3c223f5db27e3b9ae1bb8625f7ae2689bea4300872fdf646f8b19df7d8f3aff71790b1968a2a2e208dcb75a185d73e' + 'e10126da8fb8d47217b56fe9af72c1b16ea6940465081811d2ef55c21b64c67c72a2d2a565728dd9ed6ab06e4bfc62952f202b2b3dce2a3db046f8961f1c6f39') validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini 'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud diff --git a/core/mkinitcpio/mkinitcpio.install b/core/mkinitcpio/mkinitcpio.install deleted file mode 100644 index 8571ee7d3..000000000 --- a/core/mkinitcpio/mkinitcpio.install +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -post_upgrade() { - if [ "$(vercmp 0.9.0 "$2")" -eq 1 ]; then - printf '==> If your /usr is on a separate partition, you must add the "usr" hook\n' - printf ' to /etc/mkinitcpio.conf and regenerate your images before rebooting\n' - fi - - if [ "$(vercmp 0.12.0 "$2")" -eq 1 ]; then - printf '==> The "block" hook has replaced several hooks:\n' - printf ' fw, sata, pata, scsi, virtio, mmc, usb\n' - printf ' Replace any and all of these in /etc/mkinitcpio.conf with a single\n' - printf ' instance of the "block" hook\n' - fi -}