From 26afac4435dac8cde3120156d56f52cc99a306fb Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 30 Jan 2022 19:29:51 +0000 Subject: [PATCH v2 1/2] kmod: trigger hook only on install/update The hook does nothing on remove, so drop the "Operation = Remove" line. Add distinct -install suffix to indicate their nature - separate remove set is coming shortly. v2: Keep the script (don't inline it in the hook). Signed-off-by: Emil Velikov --- repos/core-x86_64/PKGBUILD | 8 ++++---- repos/core-x86_64/{depmod.hook => depmod-install.hook} | 3 +-- .../core-x86_64/{depmod.script => depmod-install.script} | 0 3 files changed, 5 insertions(+), 6 deletions(-) rename repos/core-x86_64/{depmod.hook => depmod-install.hook} (78%) rename repos/core-x86_64/{depmod.script => depmod-install.script} (100%) diff --git a/repos/core-x86_64/PKGBUILD b/repos/core-x86_64/PKGBUILD index c7849a74..b8338217 100644 --- a/repos/core-x86_64/PKGBUILD +++ b/repos/core-x86_64/PKGBUILD @@ -16,11 +16,11 @@ replaces=('module-init-tools') validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign} 'depmod-search.conf' - 'depmod.hook' 'depmod.script') + 'depmod-install.hook' 'depmod-install.script') md5sums=('e81e63acd80697d001c8d85c1acb38a0' 'SKIP' 'dd62cbf62bd8f212f51ef8c43bec9a77' - 'e179ace75721e92b04b2e145b69dab29' + '3551de7d33e15b699be906b9f4e09429' '18fb3d1f6024a5a84514c8276cb3ebff') build() { @@ -69,8 +69,8 @@ package() { install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf" # hook - install -Dm644 "$srcdir/depmod.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod.hook" - install -Dm755 "$srcdir/depmod.script" "$pkgdir/usr/share/libalpm/scripts/depmod" + install -Dm644 "$srcdir/depmod-install.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod-install.hook" + install -Dm755 "$srcdir/depmod-install.script" "$pkgdir/usr/share/libalpm/scripts/depmod-install" } # vim: ft=sh syn=sh et diff --git a/repos/core-x86_64/depmod.hook b/repos/core-x86_64/depmod-install.hook similarity index 78% rename from repos/core-x86_64/depmod.hook rename to repos/core-x86_64/depmod-install.hook index bbb39a95..29a0eb43 100644 --- a/repos/core-x86_64/depmod.hook +++ b/repos/core-x86_64/depmod-install.hook @@ -2,12 +2,11 @@ Type = Path Operation = Install Operation = Upgrade -Operation = Remove Target = usr/lib/modules/*/ Target = !usr/lib/modules/*/?* [Action] Description = Updating module dependencies... When = PostTransaction -Exec = /usr/share/libalpm/scripts/depmod +Exec = /usr/share/libalpm/scripts/depmod-install NeedsTargets diff --git a/repos/core-x86_64/depmod.script b/repos/core-x86_64/depmod-install.script similarity index 100% rename from repos/core-x86_64/depmod.script rename to repos/core-x86_64/depmod-install.script -- 2.35.1 From 284032da2fb4e593c281e0e9246adeb5e04702d5 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 30 Jan 2022 19:36:15 +0000 Subject: [PATCH v2 2/2] kmod: add depmod-remove hook Add a hook to balance the install/update actions. Currently they update the modules.foo files from the respective linux packages. Thus upon checking - say pacman -Qkk linux - we get handful or "Modification time mismatch" warnings. With this we can have the complete ownership of the files generated by depmod. As follow-up we'll drop them from the respective linux packages. v2: Remove only the files we've generated. Signed-off-by: Emil Velikov --- repos/core-x86_64/PKGBUILD | 9 +++++++-- repos/core-x86_64/depmod-remove.hook | 11 +++++++++++ repos/core-x86_64/depmod-remove.script | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 repos/core-x86_64/depmod-remove.hook create mode 100644 repos/core-x86_64/depmod-remove.script diff --git a/repos/core-x86_64/PKGBUILD b/repos/core-x86_64/PKGBUILD index b8338217..6cfcf7fe 100644 --- a/repos/core-x86_64/PKGBUILD +++ b/repos/core-x86_64/PKGBUILD @@ -16,12 +16,15 @@ replaces=('module-init-tools') validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign} 'depmod-search.conf' - 'depmod-install.hook' 'depmod-install.script') + 'depmod-install.hook' 'depmod-install.script' + 'depmod-remove.hook' 'depmod-remove.script') md5sums=('e81e63acd80697d001c8d85c1acb38a0' 'SKIP' 'dd62cbf62bd8f212f51ef8c43bec9a77' '3551de7d33e15b699be906b9f4e09429' - '18fb3d1f6024a5a84514c8276cb3ebff') + '18fb3d1f6024a5a84514c8276cb3ebff' + 'a8937ab7f48883c2a81fa61ad689e652' + '1240725b28283322d6a739ed10148837') build() { cd "$pkgname-$pkgver" @@ -71,6 +74,8 @@ package() { # hook install -Dm644 "$srcdir/depmod-install.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod-install.hook" install -Dm755 "$srcdir/depmod-install.script" "$pkgdir/usr/share/libalpm/scripts/depmod-install" + install -Dm644 "$srcdir/depmod-remove.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod-remove.hook" + install -Dm755 "$srcdir/depmod-remove.script" "$pkgdir/usr/share/libalpm/scripts/depmod-remove" } # vim: ft=sh syn=sh et diff --git a/repos/core-x86_64/depmod-remove.hook b/repos/core-x86_64/depmod-remove.hook new file mode 100644 index 00000000..0c63538b --- /dev/null +++ b/repos/core-x86_64/depmod-remove.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = Path +Operation = Remove +Target = usr/lib/modules/*/ +Target = !usr/lib/modules/*/?* + +[Action] +Description = Removing module dependencies... +When = PreTransaction +Exec = /usr/share/libalpm/scripts/depmod-remove +NeedsTargets diff --git a/repos/core-x86_64/depmod-remove.script b/repos/core-x86_64/depmod-remove.script new file mode 100644 index 00000000..6c602793 --- /dev/null +++ b/repos/core-x86_64/depmod-remove.script @@ -0,0 +1,9 @@ +#!/bin/bash + +while read -r f; do + for e in alias{,.bin} builtin{,.alias}.bin dep{,.bin} devname softdep symbols{,.bin}; do + rm -f "$f/modules.$e" + done +done + +# vim:set ft=sh sw=2 et: -- 2.35.1