Compare commits

..

No commits in common. 'i9' and 'i9ce' have entirely different histories.
i9 ... i9ce

@ -1 +1 @@
f9b4c2bbb208f0123224d9aabc185c9a9ef6b8a9 SOURCES/anbox-modules-ee4c25f0.tar.gz cc6fc7716d34b5c7ab74249e6fc995dc02a763e0 SOURCES/anbox-modules-bead1deb.tar.gz

@ -1,172 +0,0 @@
From 9757b9e6b0d396163ae7e25d45ac80aae393e720 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Mon, 21 Oct 2024 12:06:03 +0300
Subject: [PATCH] Fix build on RedHat 9.5 kernel
---
ashmem/ashmem.c | 4 ++--
binder/binder.c | 10 +++++-----
binder/binder_alloc.c | 10 +++++-----
binder/deps.c | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c
index df9cf90..009a04e 100644
--- a/ashmem/ashmem.c
+++ b/ashmem/ashmem.c
@@ -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, 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 c0f6f12..3137760 100644
--- a/binder/binder.c
+++ b/binder/binder.c
@@ -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(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);
@@ -4111,12 +4111,12 @@ static int binder_wait_for_work(struct binder_thread *thread,
struct binder_proc *proc = thread->proc;
int ret = 0;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0))
freezer_do_not_count();
#endif
binder_inner_proc_lock(proc);
for (;;) {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0))
prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE);
#else
prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE|TASK_FREEZABLE);
@@ -4137,7 +4137,7 @@ static int binder_wait_for_work(struct binder_thread *thread,
}
finish_wait(&thread->wait, &wait);
binder_inner_proc_unlock(proc);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0))
freezer_count();
#endif
@@ -5236,7 +5236,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM);
return -EPERM;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
vm_flags_mod(vma, VM_DONTCOPY | VM_MIXEDMAP, VM_MAYWRITE);
#else
vma->vm_flags |= VM_DONTCOPY | VM_MIXEDMAP;
diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c
index bfdec52..d94fe82 100644
--- a/binder/binder_alloc.c
+++ b/binder/binder_alloc.c
@@ -235,7 +235,7 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
if (page->page_ptr) {
trace_binder_alloc_lru_start(alloc, index);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
on_lru = list_lru_del_obj(&binder_alloc_lru, &page->lru);
#else
on_lru = list_lru_del(&binder_alloc_lru, &page->lru);
@@ -290,7 +290,7 @@ free_range:
trace_binder_free_lru_start(alloc, index);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
ret = list_lru_add_obj(&binder_alloc_lru, &page->lru);
#else
ret = list_lru_add(&binder_alloc_lru, &page->lru);
@@ -854,7 +854,7 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
if (!alloc->pages[i].page_ptr)
continue;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
on_lru = list_lru_del_obj(&binder_alloc_lru,
&alloc->pages[i].lru);
#else
@@ -1024,7 +1024,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
if (vma) {
trace_binder_unmap_user_start(alloc, index);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
zap_page_range_single(vma, page_addr, PAGE_SIZE, NULL);
#else
zap_page_range(vma, page_addr, PAGE_SIZE);
@@ -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 63accc0..c8e7db1 100644
--- a/binder/deps.c
+++ b/binder/deps.c
@@ -70,7 +70,7 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
#endif
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
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)
@@ -79,7 +79,7 @@ static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
#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)
@@ -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
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
return close_fd_get_file_ptr(fd);
#else
return close_fd_get_file_ptr(fd, res);
@@ -168,7 +168,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
return task_work_add_ptr(task, work, notify);
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
static void (*zap_page_range_single_ptr)(struct vm_area_struct *, unsigned long, unsigned long, struct zap_details *) = NULL;
void zap_page_range_single(struct vm_area_struct *vma, unsigned long address, unsigned long size, struct zap_details *details)
--
2.47.0

@ -17,23 +17,21 @@
# If kmod_kernel_version isn't defined on the rpmbuild line, define it here. # If kmod_kernel_version isn't defined on the rpmbuild line, define it here.
%{!?kmod_kernel_version: %define kmod_kernel_version 5.14.0-503.11.1.el9_5} %{!?kmod_kernel_version: %define kmod_kernel_version 5.14.0-284.11.1.el9_2}
%{!?dist: %define dist .el9} %{!?dist: %define dist .el9}
Name: kmod-%{kmod_name} Name: kmod-%{kmod_name}
Version: 0.0.1 Version: 0.0.1
Release: 4.20240526git.ee4c25f0%{?dist} Release: 1.20230505git.bead1deb%{?dist}
Summary: %{kmod_name} kernel module(s) Summary: %{kmod_name} kernel module(s)
License: GPLv2 License: GPLv2
URL: https://github.com/choff/anbox-modules URL: https://github.com/choff/anbox-modules
# Sources. # Sources.
Source0: anbox-modules-ee4c25f0.tar.gz Source0: anbox-modules-bead1deb.tar.gz
Source5: GPL-v2.0.txt Source5: GPL-v2.0.txt
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 # 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 # https://bugzilla.redhat.com/show_bug.cgi?id=1967291
@ -67,7 +65,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. of the same variant of the Linux kernel and not on any one specific build.
%prep %prep
%autosetup -p1 -n anbox-ee4c25f064d89f08136d5814bf2368512973017f %setup -q -n anbox-abead1debfae56e8d0307c642865ec23aaa854d3
echo "override ashmem_linux * weak-updates/ashmem_linux" > kmod-%{kmod_name}.conf echo "override ashmem_linux * weak-updates/ashmem_linux" > kmod-%{kmod_name}.conf
echo "override binder_linux * weak-updates/binder_linux" >> kmod-%{kmod_name}.conf echo "override binder_linux * weak-updates/binder_linux" >> kmod-%{kmod_name}.conf
@ -107,8 +105,8 @@ find %{buildroot} -name \*.ko -type f | xargs --no-run-if-empty %{__strip} --str
# Sign the modules(s) # Sign the modules(s)
%if %{?_with_modsign:1}%{!?_with_modsign:0} %if %{?_with_modsign:1}%{!?_with_modsign:0}
# If the module signing keys are not defined, define them here. # If the module signing keys are not defined, define them here.
%{!?privkey: %define privkey %{_sysconfdir}/pki/kmod/msvsphere_kmod.priv} %{!?privkey: %define privkey %{_sysconfdir}/pki/SECURE-BOOT-KEY.priv}
%{!?pubkey: %define pubkey %{_sysconfdir}/pki/kmod/msvsphere_kmod.pem} %{!?pubkey: %define pubkey %{_sysconfdir}/pki/SECURE-BOOT-KEY.der}
for module in $(find %{buildroot} -type f -name \*.ko); for module in $(find %{buildroot} -type f -name \*.ko);
do %{_usrsrc}/kernels/%{kmod_kernel_version}.%{_arch}/scripts/sign-file \ do %{_usrsrc}/kernels/%{kmod_kernel_version}.%{_arch}/scripts/sign-file \
sha256 %{privkey} %{pubkey} $module; sha256 %{privkey} %{pubkey} $module;
@ -191,30 +189,6 @@ exit 0
%{_modulesloaddir}/anbox.conf %{_modulesloaddir}/anbox.conf
%changelog %changelog
* Sat Nov 16 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-4.20240526git.ee4c25f0
- Update to kernel kernel-5.14.0-503.11.1.el9_5
* 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
* Tue Jul 23 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-1.20230505git.bead1deb.5
- Rebuilt for kernel-5.14.0-427.26.1.el9_4
* Thu May 02 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-1.20230505git.bead1deb.4
- Rebuilt for kernel-5.14.0-427.13.1.el9_4
* Tue Mar 19 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-1.20230505git.bead1deb.3
- Rebuilt for kernel-5.14.0-362.24.1.el9_3
* Wed Feb 14 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-1.20230505git.bead1deb.2
- Rebuilt for kernel 5.14.0-362.18.1.el9_3
* Sat Nov 18 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.0.1-1.20230505git.bead1deb.1
- Fix build for MSVSphere 9.3
* Wed Sep 06 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 0.0.1-1.20230505git.bead1deb * Wed Sep 06 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 0.0.1-1.20230505git.bead1deb
- Rebuilt for MSVSphere 9.2 - Rebuilt for MSVSphere 9.2

Loading…
Cancel
Save