Commit 89bb8943 authored by Luca Giambonini's avatar Luca Giambonini

mkinitcpio 27

parent a42311c7
From 5bba09cb1c661627fde76b977cfe9f937b1264a3 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 6 Oct 2017 08:15:43 -0400
Subject: [mkinitcpio] [PATCH] Restore addition of modules from config file
Broken by c5ad00c2.
ref: https://bugs.archlinux.org/task/55870
---
functions | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/functions b/functions
index 1486f2f..ba95e80 100644
--- a/functions
+++ b/functions
@@ -627,9 +627,18 @@ parse_config() {
map add_file "${FILES[@]}"
tee "$BUILDROOT/buildconfig" < "$1" | {
+ # When MODULES is not an array (but instead implicitly converted at
+ # startup), sourcing the config causes the string value of MODULES
+ # to be assigned as MODULES[0]. Avoid this by explicitly unsetting
+ # MODULES before re-sourcing the config.
+ unset MODULES
+
. /dev/stdin
- for mod in "${modules[@]%\?}"; do
+ # arrayize MODULES if necessary.
+ [[ ${MODULES@a} != *a* ]] && read -ra MODULES <<<"${MODULES//-/_}"
+
+ for mod in "${MODULES[@]%\?}"; do
mod=${mod//-/_}
# only add real modules (2 == builtin)
(( _addedmodules["$mod"] == 1 )) && add+=("$mod")
--
2.14.2
From ea4c4154205372154457c794513ae46b61ea4e4c Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Mon, 4 Aug 2014 08:31:37 -0400
Subject: [mkinitcpio] [PATCH] avoid compound conditional leading to spurious
"errors"
As seen:
https://bbs.archlinux.org/viewtopic.php?id=185204
https://bbs.archlinux.org/viewtopic.php?id=185265
---
functions | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/functions b/functions
index 20bbffe..362d07b 100644
--- a/functions
+++ b/functions
@@ -423,11 +423,15 @@ add_full_dir() {
for f in "$1"/*; do
if [[ -L $f ]]; then
- [[ $f = $filter ]] && add_symlink "$f" "$(readlink "$f")"
+ if [[ $f = $filter ]]; then
+ add_symlink "$f" "$(readlink "$f")"
+ fi
elif [[ -d $f ]]; then
add_full_dir "$f"
elif [[ -f $f ]]; then
- [[ $f = $filter ]] && add_file "$f"
+ if [[ $f = $filter ]]; then
+ add_file "$f"
+ fi
fi
done
fi
--
2.1.0
diff --git a/libalpm/scripts/mkinitcpio-remove b/libalpm/scripts/mkinitcpio-remove
index 86838e4..17b4b31 100644
--- a/libalpm/scripts/mkinitcpio-remove
+++ b/libalpm/scripts/mkinitcpio-remove
@@ -2,6 +2,20 @@
package=0
+process_preset() {
+ if [[ -n "${pkgbase}" && -e $preset ]]; then
+ if ! cmp $preset > /dev/null 2>&1 <(sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset); then
+ if [[ ! -e $preset.pacsave ]]; then
+ # save the preset as pacsave
+ mv $preset $preset.pacsave && return 0
+ fi
+ else
+ # remove the preset
+ rm $preset && return 0
+ fi
+ fi
+}
+
while read -r line; do
if [[ $line != */vmlinuz ]]; then
# triggers when it's a change to usr/lib/initcpio/*
@@ -23,17 +37,25 @@ while read -r line; do
# remove the installed kernel
rm $kernel
fi
- if [[ -e $preset ]]; then
- # remove the preset
- rm $preset
+
+ process_preset "${pkgbase}" $preset
+
+ if [[ -e $initramfs ]]; then
+ # remove the main image
+ rm $initramfs
fi
- if [[ -e $initramfs && -e $fallback_initramfs ]]; then
- # remove the images
- rm $initramfs $fallback_initramfs
+ if [[ -e $fallback_initramfs ]]; then
+ # remove the fallback image
+ rm $fallback_initramfs
fi
done
if (( package )) && compgen -G /etc/mkinitcpio.d/"*.preset" > /dev/null; then
- # remove all presets
- rm /etc/mkinitcpio.d/*.preset
+ shopt -s nullglob
+ for preset in /etc/mkinitcpio.d/*.preset; do
+ pkgbase=${preset##*/}
+ pkgbase=${pkgbase%.preset}
+ process_preset "${pkgbase}" $preset
+ done
+ shopt -u nullglob
fi
pkgname=mkinitcpio
pkgver=24
pkgrel=2
pkgver=27
pkgrel=1
pkgdesc="Modular initramfs image creation utility"
arch=('any')
url="https://projects.archlinux.org/mkinitcpio.git/"
......@@ -16,19 +16,20 @@ optdepends=('xz: Use lzma or xz compression for the initramfs image'
backup=('etc/mkinitcpio.conf')
install=mkinitcpio.install
source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"
"microcode.patch::https://github.com/wengxt/mkinitcpio/commit/bb1cc272b23f520f512ec3eb17c87063a84ce854.patch"
0001-Restore-addition-of-modules-from-config-file.patch)
sha256sums=('ec0ecbc518c14ecacf5a8ece2f068fe86fcaf3aed09ee6b82737e773e5d7d02b'
#"microcode.patch::https://github.com/wengxt/mkinitcpio/commit/bb1cc272b23f520f512ec3eb17c87063a84ce854.patch"
0001-mkinitcpio-remove-preset-pacsave.patch)
sha256sums=('e6bff1cb78b677538eb9aace900b715fd59de8fc210b74fb9d899dfaa32bc354'
'1d6d689b45f3bbe75c53cccc344edd36d8ebd16bcada16e879000c7c8892a798'
'd4cbbf7b05f5dcaf23139469376ff6c29e948ce77a8c51ad4867413b4bddc4db')
'845569fa760f70c868ecb3dc8ae9667287970526dddaf403fdafcb716e8b3d51')
validpgpkeys=('487EACC08557AD082088DABA1EB2638FF56C0C53' # Dave Reisner
'86CFFCA918CF3AF47147588051E8B148A9999C34') # Evangelos Foutras
prepare() {
cd ${pkgname}-${pkgver}
patch -Np1 -i ../microcode.patch
patch -Np1 <"$srcdir"/0001-Restore-addition-of-modules-from-config-file.patch
cd $pkgname-$pkgver
#patch -Np1 -i ../microcode.patch
# Apply 0001-mkinitcpio-remove-preset-pacsave.patch
patch -Np1 <"$srcdir"/0001-mkinitcpio-remove-preset-pacsave.patch
sed -i 's/HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)/HOOKS=(base udev autodetect resume keymap modconf block filesystems keyboard fsck microcode)/g' mkinitcpio.conf
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment