core/mkinitcpio to 35.1-1

This commit is contained in:
Kevin Mihelich 2023-03-22 01:05:52 +00:00
parent 8ef86bc3e9
commit 71396748d2
5 changed files with 99 additions and 63 deletions

View file

@ -1,26 +0,0 @@
From eabdad3798b43fa5e9aacd0d0395a74154e56434 Mon Sep 17 00:00:00 2001
From: nl6720 <nl6720@gmail.com>
Date: Thu, 8 Dec 2022 10:51:49 +0200
Subject: [mkinitcpio] [PATCH 1/1] functions: fix overwriting of symlinks with
regular files
Use `cp --remove-destination` in `add_file` to remove the destination
file. Without this, if the destination file is an existing symlink, it
will be the link target that will get overwritten, not the symlink.
---
functions | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/functions b/functions
index 9939e25..3b3de05 100644
--- a/functions
+++ b/functions
@@ -650,7 +650,7 @@ add_file() {
fi
if [[ -z "$mode" ]]; then
add_dir "${dest%/*}"
- command cp -f --preserve=mode,ownership "$src" "${BUILDROOT}${dest}"
+ command cp --remove-destination --preserve=mode,ownership "$src" "${BUILDROOT}${dest}"
else
command install -Dm"$mode" "$src" "${BUILDROOT}${dest}"
fi

View file

@ -1,18 +1,18 @@
From a85995cb175bcbc806435443a21f0b0b70f2b170 Mon Sep 17 00:00:00 2001
From 4161236377c4ce53c160ca14b32928e6c94574e6 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sat, 20 Feb 2021 10:02:34 -0700
Subject: [PATCH 1/2] use gzip for compression by default
Subject: [PATCH 1/3] use gzip for compression by default
---
man/mkinitcpio.conf.5.txt | 2 +-
mkinitcpio | 2 +-
mkinitcpio.conf | 2 +-
man/mkinitcpio.conf.5.adoc | 2 +-
mkinitcpio | 2 +-
mkinitcpio.conf | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/mkinitcpio.conf.5.txt b/man/mkinitcpio.conf.5.txt
index 59909f3..69bc683 100644
--- a/man/mkinitcpio.conf.5.txt
+++ b/man/mkinitcpio.conf.5.txt
diff --git a/man/mkinitcpio.conf.5.adoc b/man/mkinitcpio.conf.5.adoc
index 08b95c5..41c29be 100644
--- a/man/mkinitcpio.conf.5.adoc
+++ b/man/mkinitcpio.conf.5.adoc
@@ -56,7 +56,7 @@ Variables
Defines a program to filter the generated image through. The kernel
understands the compression formats yielded by the *zstd*, *gzip*, *bzip2*,
@ -23,20 +23,20 @@ index 59909f3..69bc683 100644
+
It's not hard to realize that a filter such as a *tac* or *rev* will cause
diff --git a/mkinitcpio b/mkinitcpio
index 49ca3f9..952e049 100755
index 0c6dc60..f68d70c 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -734,7 +734,7 @@ if [[ $_optgenimg ]]; then
die 'Unable to write to %s' "$_optgenimg"
@@ -856,7 +856,7 @@ if [[ -n "$_optgenimg" ]]; then
die "Unable to write to '%s'" "$_optgenimg"
fi
- _optcompress=${_optcompress:-${COMPRESSION:-zstd}}
+ _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
- _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
warning "Unable to locate compression method: '%s'" "$_optcompress"
_optcompress='cat'
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index 710e05f..ac0de1c 100644
index 710e05f..4a2ce87 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -52,7 +52,7 @@ FILES=()
@ -44,7 +44,7 @@ index 710e05f..ac0de1c 100644
# COMPRESSION
-# Use this to compress the initramfs image. By default, zstd compression
+# Use this to compress the initramfs image. By default, gazip compression
+# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"

View file

@ -1,7 +1,7 @@
From efe14b76219f065b99983f305ac0d71e8c8658a4 Mon Sep 17 00:00:00 2001
From d7b7d85e2d43b98671d1a47f1dfff3a6df0cc717 Mon Sep 17 00:00:00 2001
From: Janne Grunau <j@jannau.net>
Date: Sun, 30 Jan 2022 10:01:43 +0000
Subject: [PATCH 2/2] functions: handle gzip compressed kernels in kver_generic
Subject: [PATCH 2/3] functions: handle gzip compressed kernels in kver_generic
Signed-off-by: Janne Grunau <j@jannau.net>
---
@ -9,12 +9,12 @@ Signed-off-by: Janne Grunau <j@jannau.net>
1 file changed, 5 insertions(+)
diff --git a/functions b/functions
index 9939e25..7e58d57 100644
index ae31e40..c4cc536 100644
--- a/functions
+++ b/functions
@@ -222,6 +222,11 @@ kver_generic() {
@@ -223,6 +223,11 @@ kver_generic() {
read _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+')
read -r _ _ kver _ < <($reader "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+')
+ # try if the image is gzip compressed
+ if [[ -z "$kver" ]]; then

View file

@ -0,0 +1,63 @@
From ed70b30b59325835b8ae418c17f0d11631bd5de0 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 21 Mar 2023 17:56:32 -0600
Subject: [PATCH 3/3] check for ALARM kernels in run_post_hooks
---
functions | 15 ++++++++++-----
mkinitcpio | 11 +++++++++++
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/functions b/functions
index c4cc536..b978c2e 100644
--- a/functions
+++ b/functions
@@ -219,13 +219,18 @@ kver_generic() {
# https://elixir.bootlin.com/linux/v5.7.2/source/init/version.c#L46
local kver='' reader='cat'
- [[ "$(detect_compression "$1")" == 'gzip' ]] && reader='zcat'
+ # Check for xz zImage
+ if [[ $1 =~ "/zImage" ]]; then
+ read -r _ _ kver _ < <(dd if=$1 iflag=skip_bytes skip=$(LC_ALL=C grep -a -b -o $'\xFD\x37\x7A\x58\x5A\x00' $1 | tail -n 1 | cut -d ':' -f 1) | xzcat | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+')
+ 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:]+]+)+')
- # try if the image is gzip compressed
- if [[ -z "$kver" ]]; then
- read _ _ kver _ < <(gzip -c -d "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+')
+ # try if the image is gzip compressed
+ if [[ -z "$kver" ]]; then
+ read _ _ kver _ < <(gzip -c -d "$1" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+')
+ fi
fi
printf '%s' "$kver"
diff --git a/mkinitcpio b/mkinitcpio
index f68d70c..7789ddf 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -801,6 +801,17 @@ if [[ "$KERNELVERSION" != 'none' ]]; then
done
fi
+ if [[ -z "$KERNELIMAGE" ]]; then
+ # check version of ALARM kernels in /boot
+ for img in /boot/*Image*; do
+ if [[ "$(kver "$img")" == "$KERNELVERSION" ]]; then
+ KERNELIMAGE="$img"
+ quiet "located kernel image: '%s'" "$KERNELIMAGE"
+ break
+ fi
+ done
+ fi
+
if [[ -z "$KERNELIMAGE" ]]; then
# check version of all kernels in /boot
for img in /boot/vmlinuz-*; do
--
2.36.1

View file

@ -9,8 +9,8 @@
# - patch for gzip kernel image support (https://github.com/archlinux/mkinitcpio/pull/86)
pkgname=mkinitcpio
pkgver=34
pkgrel=2
pkgver=35.1
pkgrel=1
pkgdesc="Modular initramfs image creation utility"
arch=('any')
url='https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio'
@ -27,29 +27,28 @@ optdepends=('xz: Use lzma or xz compression for the initramfs image'
provides=('initramfs')
backup=('etc/mkinitcpio.conf')
source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig}
'0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch'
'0001-use-gzip-for-compression-by-default.patch'
'0002-functions-handle-gzip-compressed-kernels-in-kver_gen.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=('cf8ab66d4609911ca6a1d2af1bfcf320eed99d29657c0ccfeca2fdc8ea00cfb6575e55645424de13fcf37aa12a39ac7b43a330c716e73e9c16a75178738ebe70'
sha512sums=('71dd4bcad75c60178e8f152568fbb70b37a983641d4953035aabcbff5bd49571182c9d92383f34ffc0078532674793790b181cf96c1654edb39b4ca94aefc7a4'
'SKIP'
'a43e66101edc301ae893a25eee6caa83c56a790cbac1685697fb999008c8210e46ca49e0700242f8321731264084462641285954db55d3daa2c7e8b62d1cc66c'
'08472d71eeefa7f547033096250703138658d056ae7922841c586bb419c6ae7063b4cfa7ec8bdc0a50b10a7d18e201f10a5db98ab5fe25d6e7f0d8e801904c4a'
'e9b1bc7eb74271738c18a20cc8f4e391d7c3342c20763615ba8dadafc5259147bfad98ad059e5c1b19e3cb25f2f214a816bb8864351edef5b9db170abe4bc72d')
b2sums=('06a6c6a0951b9b6161e2db01e2956d87da303b2ec029bdd183efed3b074b176a9f107e9a723fc6a7fa157ecd703d7627d8aaa0b9290022a09e30daa46784841c'
'4205c5977d58728f6cdec22b553e000091e19b28e07c6099c14882842f964f66abf7b1b0a341e9b061e04c3c3ed1275647caf51d3770a61b60271712a8ecf74d'
'693bddd2d3e3760479c6615085a6d7426cf2a6f92a42925192658eae1bcd66ae1bc46027321a2a5538abbb21025467c42d07569024f338b7bb6d4416e9922406'
'bc801badec17abc54ba6e65727ee0facbc9da5b5b8bd2bd69ae8eef41b7c96bcbc4931378ba7bc78522f3fe4cb67b20707989a671789314b5ba09b07d58e6d60')
b2sums=('50783c27d7fad38ca3e02e1d8f15e42062b32e640ea26bc235ccd603659be5a2c218869fbd9e8491b3e0b027fa4613a599c7ce9768cd17c47e68053215a97f66'
'SKIP'
'a2ed9e8ff4b6fab1d6f6c1dae4dcf890b4434cb31ebdfe73ea54fd4af499849e2b98e565915cc331bd97f15f21d9147ee0499cf75b516562bfd7f1793e838e99'
'f7760eadafa2916875cf37ce22dc66d8fa0ef9c844f18e5462e37f5d5d6b5654ec515a404aeefb63fb2ec2bd6f442c42c69513800ff62e51ebf55d392d5dbc6e'
'9cd2d5c8aa9c26ee92a2c047f6f54f619102b764d76585d90a58a9d9616d09683734ca13404d8f8e7217c3bbe9ae988ea58adf7c71f7b8353079f555277c6455')
'ae8e25ab7e8d4cac52dcee7176bf132ea7cefeab67c3af69cecdf4871f50e42753dbe0c09a6fd20ef69c10a5b56bf6bc8f0614df1fd593d7a1ad3a5043f5c7b5'
'8ca2d8902ae18402c18b3874c3977953a16f3ffaad760f21aafa7f15421a034bdd10fb58962ea5e15ace7407fa1f36343ddfcdca1bcd58ef12aded22ae2cabca'
'ec9dabe43a405f4f3bf0172ac6a03568a49e342305626c2cd35cb0815ed3e74398efb34a9fea2427033a83b631afac5dc3b214e110686856a4fd4b366580dd4b')
validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB' # Giancarlo Razzolini
'C100346676634E80C940FB9E9C02FF419FECBE16') # Morten Linderud
prepare() {
patch -Np1 -d "$pkgname-$pkgver" < '0001-functions-fix-overwriting-of-symlinks-with-regular-f.patch'
cd $pkgname-$pkgver
patch -p1 -i ../0001-use-gzip-for-compression-by-default.patch
patch -p1 -i ../0002-functions-handle-gzip-compressed-kernels-in-kver_gen.patch
patch -p1 -i ../0003-check-for-ALARM-kernels-in-run_post_hooks.patch
}
check() {