From 512e59c17da6b2e35fc053ac4cc45adda27317b3 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 2 Apr 2023 11:05:50 +0800 Subject: [PATCH] update: kernel-modules-hook-hardlinks --- ...ux-modules-post.hook => 61-linux-modules-post.hook} | 0 kernel-modules-hook-hardlinks/PKGBUILD | 10 +++++----- kernel-modules-hook-hardlinks/linux-modules-restore | 2 +- kernel-modules-hook-hardlinks/linux-modules-save | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename kernel-modules-hook-hardlinks/{10-linux-modules-post.hook => 61-linux-modules-post.hook} (100%) diff --git a/kernel-modules-hook-hardlinks/10-linux-modules-post.hook b/kernel-modules-hook-hardlinks/61-linux-modules-post.hook similarity index 100% rename from kernel-modules-hook-hardlinks/10-linux-modules-post.hook rename to kernel-modules-hook-hardlinks/61-linux-modules-post.hook diff --git a/kernel-modules-hook-hardlinks/PKGBUILD b/kernel-modules-hook-hardlinks/PKGBUILD index 2d03844..83762f6 100644 --- a/kernel-modules-hook-hardlinks/PKGBUILD +++ b/kernel-modules-hook-hardlinks/PKGBUILD @@ -10,19 +10,19 @@ provides=("$_pkgname") url="https://github.com/VannTen/$_pkgname" license=('GPL3') source=("linux-modules-cleanup.conf" - "10-linux-modules-post.hook" "10-linux-modules-pre.hook" + "61-linux-modules-post.hook" "linux-modules-restore" "linux-modules-save" ) sha256sums=('950f851eba08dac4d0b93ff62b3fb16ddacd4f8ebb98a2435f80bf05f2ea5a29' - 'fc4d53dec520c80fe97dfda65b238c7d678e7ef26aaebffc5b43f924477ea4f4' '087e5ed70b2fc512d814fbded9e873955b1da5b6bf1e31975174d704ad143156' - '28b995f6ea62899620d43d71e542bfc3432ad3ce90a6582f4ded1173fe8c0837' - '5d9092689d9baa3d8e5ac65ae92d1c201e23c4ef42c99d131f9465c99d6505ef') + 'fc4d53dec520c80fe97dfda65b238c7d678e7ef26aaebffc5b43f924477ea4f4' + 'a6e3013f04f45e6d1ed63b4545fb0d4f102d230db582bec76568dbf40c529fbb' + '36a8ab6bcb3e0bf8c82324877471ec8798e5ae273b26bdfbc4b6f59035af0351') package() { install -Dm644 'linux-modules-cleanup.conf' "${pkgdir}/usr/lib/tmpfiles.d/linux-modules-cleanup.conf" - install -Dm644 10-linux-modules-{pre,post}.hook -t "${pkgdir}/usr/share/libalpm/hooks/" + install -Dm644 10-linux-modules-pre.hook 61-linux-modules-post.hook -t "${pkgdir}/usr/share/libalpm/hooks/" install -Dm755 linux-modules-{save,restore} -t "${pkgdir}/usr/share/libalpm/scripts/" } diff --git a/kernel-modules-hook-hardlinks/linux-modules-restore b/kernel-modules-hook-hardlinks/linux-modules-restore index baceebf..89d06c4 100644 --- a/kernel-modules-hook-hardlinks/linux-modules-restore +++ b/kernel-modules-hook-hardlinks/linux-modules-restore @@ -3,7 +3,7 @@ kver=$(uname -r) while read -r line; do # We only care about the running kernel - if [[ "$line" == usr/lib/modules/$kver/vmlinuz && -d "${line/$kver/running-kernel}" ]];then + if [[ "$line" == usr/lib/modules/$kver/vmlinuz && -d usr/lib/modules/running-kernel ]];then mount --mkdir --bind --options ro /usr/lib/modules/{running-kernel,$kver} # Mounting read-only since the only modification here should be unmounting # when rebooting or reinstalling the running kernel diff --git a/kernel-modules-hook-hardlinks/linux-modules-save b/kernel-modules-hook-hardlinks/linux-modules-save index 8bf2e29..90069dd 100644 --- a/kernel-modules-hook-hardlinks/linux-modules-save +++ b/kernel-modules-hook-hardlinks/linux-modules-save @@ -15,7 +15,7 @@ while read -r line; do # # This is the removal case, so we save the kernel mkdir /usr/lib/modules/running-kernel - cp --archive --link /usr/lib/modules/{$kver}/{kernel,modules*} \ + cp --archive --link --no-target-directory /usr/lib/modules/${kver}/ \ /usr/lib/modules/running-kernel/ fi # If we are re-removing the running kernel, (after removing + reinstalling),