From e8106a8e24588c1ba65f4c563d55a4275b0e4b70 Mon Sep 17 00:00:00 2001 From: Giancarlo Razzolini Date: Wed, 9 Oct 2019 00:08:21 -0300 Subject: Add a mkinitcpio pacman script This script runs on mkinitcpio package updates as well as on kernel updates that have the pkgbase file on their modules directory. It will use the contents of that file to determine which preset to run or, in case not pkgbase file is passed to it, it will run all presets with -P. --- libalpm/scripts/mkinitcpio.script | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 libalpm/scripts/mkinitcpio.script (limited to 'libalpm/scripts') diff --git a/libalpm/scripts/mkinitcpio.script b/libalpm/scripts/mkinitcpio.script new file mode 100644 index 0000000..70c9784 --- /dev/null +++ b/libalpm/scripts/mkinitcpio.script @@ -0,0 +1,14 @@ +#!/bin/bash + +args=('-p') + +while read -r line; do + if [[ $line = usr/lib/modules/+([^/])/pkgbase ]]; then + mapfile -O ${#targets[@]} -t targets < "/$line" + else + args=('-P') # all presets + break + fi +done + +mkinitcpio "${args[@]}" "${targets[@]}" -- cgit v1.2.3-24-g4f1b