summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bunton2017-03-05 14:56:28 +1100
committerJames Bunton2017-03-05 14:56:28 +1100
commit4f73152e1158a02f3213894cfe781adc1e69ebff (patch)
treee8d011fbc6818ccfebf2a6f176d81592406d2e8c
parentd3bd8222101dd5cb0206c069382cdedabc4b106f (diff)
downloadaur-4f73152e1158a02f3213894cfe781adc1e69ebff.tar.gz
Use pacman hook for mkinitcpio
-rw-r--r--99-linux.hook11
-rw-r--r--PKGBUILD7
-rw-r--r--linux.install11
3 files changed, 18 insertions, 11 deletions
diff --git a/99-linux.hook b/99-linux.hook
new file mode 100644
index 000000000000..9851151995bc
--- /dev/null
+++ b/99-linux.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Target = boot/vmlinuz-%PKGBASE%
+Target = usr/lib/initcpio/*
+
+[Action]
+Description = Updating %PKGBASE% initcpios
+When = PostTransaction
+Exec = /usr/bin/mkinitcpio -p %PKGBASE%
diff --git a/PKGBUILD b/PKGBUILD
index 5ffd6c26ebe3..9040c99cc244 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,6 +15,8 @@ source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
# the main kernel config files
'config' 'config.x86_64'
+ # pacman hook for initramfs regeneration
+ '99-linux.hook'
# standard config files for mkinitcpio ramdisk
'linux.preset'
'change-default-console-loglevel.patch'
@@ -23,6 +25,7 @@ sha256sums=('4813ad7927a7d92e5339a873ab16201b242b2748934f12cb5df9ba2cfe1d77a0'
'a6ada9d5678138a556d69b9f44c9d56ea274820b35990672ccb21607cd7ffa0f'
'3bce3e9adce8ae3f826eebab75e9784ca92a914e526ae352de61c1da93aab8d3'
'41ecf5fd8de0bc3dc4d5e20b1e0a28517dc77f96fc5ebdbf227126d85c503588'
+ '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0'
'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99')
@@ -118,6 +121,10 @@ _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
+ sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/99-linux.hook" |
+ install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.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 69a5c492f9c9..9ec2312e3a7c 100644
--- a/linux.install
+++ b/linux.install
@@ -4,19 +4,10 @@
KERNEL_NAME=
KERNEL_VERSION=
-note() {
- printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
-}
-
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}
-
- note "If you saw an error above you can try adding this to your mkinitcpio.conf"
- note " _addedmodules["dm_cache_smq"]=1"
}
post_upgrade() {
@@ -27,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}
}
post_remove() {