Add a simple post transaction hook to clean remnant dir/files
Since the move to the new hooking mechanisms, we got remnant files after package upgrade. They aren't part of the package and get generated by the depmod hook. This addresses the issue by checking for tkg kernels module dirs and removing the ones missing a vmlinuz file (which is part of the package). Due to the way it works, it'll also get rid of all past remnants to stay transparent for users.
This commit is contained in:
@@ -96,6 +96,8 @@ options=('!strip')
|
||||
source=("https://git.kernel.org/torvalds/t/linux-${_basekernel}-${_sub}.tar.gz"
|
||||
'config.x86_64' # stock Arch config
|
||||
#'config_hardened.x86_64' # hardened Arch config
|
||||
90-cleanup.hook
|
||||
cleanup
|
||||
# ARCH Patches
|
||||
0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
|
||||
# TkG
|
||||
@@ -120,6 +122,8 @@ source=("https://git.kernel.org/torvalds/t/linux-${_basekernel}-${_sub}.tar.gz"
|
||||
)
|
||||
sha256sums=('861dec2280e325d7bdc1d21278df4c8c5c3aa01cb825e5062da85ff17f5b043f'
|
||||
'0352c5ef2030d6bbdeae2325454d20575339917411c646004e5c7b7b5794db60'
|
||||
'1e15fc2ef3fa770217ecc63a220e5df2ddbcf3295eb4a021171e7edd4c6cc898'
|
||||
'66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997'
|
||||
'31dc68e84aecfb7d069efb1305049122c65694676be8b955634abcf0675922a2'
|
||||
'd02bf5ca08fd610394b9d3a0c3b176d74af206f897dee826e5cbaec97bb4a4aa'
|
||||
'4604141e95f3b30bbfac6a27bd642c5e1b616ee1292107c9cb9ebe76f261230e'
|
||||
@@ -945,6 +949,10 @@ hackbase() {
|
||||
# remove build and source links
|
||||
rm "$modulesdir"/{source,build}
|
||||
|
||||
# install cleanup pacman hook and script
|
||||
install -Dm644 "${srcdir}"/90-cleanup.hook "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
|
||||
install -Dm755 "${srcdir}"/cleanup "${pkgdir}/usr/share/libalpm/scripts/cleanup"
|
||||
|
||||
msg2 "Fixing permissions..."
|
||||
chmod -Rc u=rwX,go=rX "$pkgdir"
|
||||
}
|
||||
@@ -1050,6 +1058,8 @@ function exit_cleanup {
|
||||
rm -rf "$_where"/*.patch
|
||||
rm -rf "$_where"/*-profile.cfg
|
||||
rm -f "$_where"/config*
|
||||
rm -f "$_where"/*.hook
|
||||
rm -f "$_where"/cleanup
|
||||
|
||||
# Community patches removal in case of failure
|
||||
for _p in ${_community_patches[@]}; do
|
||||
|
Reference in New Issue
Block a user