diff --git a/80-linux.hook b/80-linux.hook new file mode 100644 index 0000000..a32248e --- /dev/null +++ b/80-linux.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Target = boot/vmlinuz-linux +Target = usr/lib/initcpio/* + +[Action] +Description = Updating Arch Linux initramfs image +When = PostTransaction +Exec = /usr/bin/mkinitcpio -p linux diff --git a/PKGBUILD b/PKGBUILD index 95aa9f3..634d62e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -18,6 +18,8 @@ source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign" # the main kernel config files 'config' 'config.x86_64' + # pacman hook for initramfs regeneration + '80-linux.hook' # standard config files for mkinitcpio ramdisk 'linux.preset' 'change-default-console-loglevel.patch' @@ -29,6 +31,7 @@ sha256sums=('3e9150065f193d3d94bcf46a1fe9f033c7ef7122ab71d75a7fb5a2f0c9a7e11a' 'SKIP' '2ac8818414beb7dbacbd3ad450c516e6ada804827132a7132f63b8189e5f5151' '93a4ad4f6c7bb9296fddec436ed7477a5a5c11cf4d6e68482fa6610442cbcb1f' + '2d4424928ae3c5f63ee618b4685580f4bd24faf1778553dbd961f85a88ea0910' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99') validpgpkeys=( @@ -128,6 +131,9 @@ _package() { -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + # install pacman hook for initramfs regeneration + install -D -m644 "${srcdir}/80-linux.hook" "${pkgdir}/usr/share/libalpm/hooks/80-linux.hook" + # remove build and source links rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} # remove the firmware diff --git a/linux.install b/linux.install index dd2fa5c..15dc8b6 100644 --- a/linux.install +++ b/linux.install @@ -8,8 +8,6 @@ post_install () { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux${KERNEL_NAME} } post_upgrade() { @@ -20,8 +18,6 @@ post_upgrade() { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux${KERNEL_NAME} if [ $(vercmp $2 3.13) -lt 0 ]; then echo ">>> WARNING: AT keyboard support is no longer built into the kernel."