Update compatibility patch

i9
Arkady L. Shane 4 months ago
parent 00b61efec6
commit 70e5fcf3f2
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -1,59 +1,68 @@
From 4f64fe52b50af7f79a59eb89f8bfd4983dce5ea3 Mon Sep 17 00:00:00 2001
From 92371030adbe10c12861ff9917fd251b51618fa8 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Sat, 18 Nov 2023 22:59:08 +0300
Date: Mon, 21 Oct 2024 12:06:03 +0300
Subject: [PATCH] Fix build on RedHat 9.3 kernel
---
ashmem/ashmem.c | 2 +-
ashmem/ashmem.c | 4 ++--
binder/binder.c | 2 +-
binder/binder_alloc.c | 2 +-
binder/deps.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c
index 9c38c9e..5589bfd 100644
index df9cf90..009a04e 100644
--- a/ashmem/ashmem.c
+++ b/ashmem/ashmem.c
@@ -874,7 +874,7 @@ static int __init ashmem_init(void)
return ret;
@@ -390,7 +390,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EPERM;
goto out;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask));
#else
vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
@@ -897,7 +897,7 @@ static int __init ashmem_init(void)
} else {
return -ENOMEM;
}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
register_shrinker(&ashmem_shrinker, "android-ashmem");
#else
register_shrinker(&ashmem_shrinker);
diff --git a/binder/binder.c b/binder/binder.c
index 99f47c3..45aa600 100644
index c0f6f12..45fa723 100644
--- a/binder/binder.c
+++ b/binder/binder.c
@@ -2236,7 +2236,7 @@ static void binder_deferred_fd_close(int fd)
if (!twcb)
return;
@@ -2238,7 +2238,7 @@ static void binder_deferred_fd_close(int fd)
init_task_work(&twcb->twork, binder_do_fd_close);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
twcb->file = file_close_fd(fd);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
twcb->file = close_fd_get_file(fd);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
close_fd_get_file(fd, &twcb->file);
diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c
index 13b8b32..350edb5 100644
index bfdec52..4663c2a 100644
--- a/binder/binder_alloc.c
+++ b/binder/binder_alloc.c
@@ -1084,7 +1084,7 @@ int binder_alloc_shrinker_init(void)
int ret = list_lru_init(&binder_alloc_lru);
if (ret == 0) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
@@ -1110,7 +1110,7 @@ int binder_alloc_shrinker_init(void)
} else {
ret = -ENOMEM;
}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
ret = register_shrinker(&binder_shrinker, "android-binder");
#else
ret = register_shrinker(&binder_shrinker);
diff --git a/binder/deps.c b/binder/deps.c
index 232bded..95b896a 100644
index 63accc0..c77e720 100644
--- a/binder/deps.c
+++ b/binder/deps.c
@@ -70,14 +70,14 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
@@ -70,7 +70,7 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
#endif
}
@ -62,15 +71,16 @@ index 232bded..95b896a 100644
static struct file *(*close_fd_get_file_ptr)(unsigned int fd)
#else
static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
#endif
= NULL;
@@ -79,7 +79,7 @@ static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
struct file *file_close_fd(unsigned int fd)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
struct file *close_fd_get_file(unsigned int fd)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
int close_fd_get_file(unsigned int fd, struct file **res)
@@ -92,7 +92,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
@@ -96,7 +96,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
close_fd_get_file_ptr = kallsyms_lookup_name_wrapper("__close_fd_get_file");
#endif
@ -80,5 +90,5 @@ index 232bded..95b896a 100644
#else
return close_fd_get_file_ptr(fd, res);
--
2.41.0
2.47.0

@ -23,16 +23,16 @@
Name: kmod-%{kmod_name}
Version: 0.0.1
Release: 2.20230505git.bead1deb%{?dist}
Release: 3.20240526git.ee4c25f0%{?dist}
Summary: %{kmod_name} kernel module(s)
License: GPLv2
URL: https://github.com/choff/anbox-modules
# Sources.
Source0: anbox-modules-bead1deb.tar.gz
Source0: anbox-modules-ee4c25f0.tar.gz
Source5: GPL-v2.0.txt
Patch0: 0001-Fix-build-on-RedHat-9.3-kernel.patch
Patch0: 0001-Fix-build-on-RedHat-9.5-kernel.patch
# Fix for the SB-signing issue caused by a bug in /usr/lib/rpm/brp-strip
# https://bugzilla.redhat.com/show_bug.cgi?id=1967291
@ -67,7 +67,7 @@ It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.
%prep
%autosetup -p1 -n anbox-abead1debfae56e8d0307c642865ec23aaa854d3
%autosetup -p1 -n anbox-ee4c25f064d89f08136d5814bf2368512973017f
echo "override ashmem_linux * weak-updates/ashmem_linux" > kmod-%{kmod_name}.conf
echo "override binder_linux * weak-updates/binder_linux" >> kmod-%{kmod_name}.conf
@ -191,6 +191,9 @@ exit 0
%{_modulesloaddir}/anbox.conf
%changelog
* Mon Oct 21 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-3.20240526git.ee4c25f0
- Update to 20240526git.ee4c25f0
* Mon Oct 21 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-2.20230505git.bead1deb
- Rebuilt for kernel-5.14.0-503.2.1.el9_5

Loading…
Cancel
Save