From dfcdcf483c1b27dbb9fb91bc53f745cedba709cb Mon Sep 17 00:00:00 2001 From: Giancarlo Razzolini Date: Wed, 9 Oct 2019 14:48:42 -0300 Subject: Rework the script to create the preset and install the actual kernel to /boot The script now will use a prepared preset to create presets when new kernels are installed. It will also always copy the vmlinuz kernel to /boot. --- libalpm/scripts/mkinitcpio-install | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 libalpm/scripts/mkinitcpio-install diff --git a/libalpm/scripts/mkinitcpio-install b/libalpm/scripts/mkinitcpio-install new file mode 100644 index 0000000..88876e2 --- /dev/null +++ b/libalpm/scripts/mkinitcpio-install @@ -0,0 +1,19 @@ +#!/bin/bash + +args=('-p') + +while read -r line; do + if [[ $line = usr/lib/modules/+([^/])/pkgbase ]]; then + pkgbase=$(< "/$line") + if [[ ! -e /etc/mkinitcpio.d/"${pkgbase}".preset ]]; then + sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset | install -Dm644 /dev/stdin \ + /etc/mkinitcpio.d/"${pkgbase}".preset + fi + install -Dm644 $(dirname $line)/vmlinuz /boot/vmlinuz-"${pkgbase}" + else + args=('-P') # all presets + break + fi +done + +mkinitcpio "${args[@]}" "${pkgbase}" -- cgit v1.2.3-24-g4f1b