Possible to patch kernel??

jingato

New Member
Jul 31, 2025
2
0
1
Hi,

I am fairly new to Linux and definitely a noob to Proxmox so I was hoping I could get some answers here. I wanted to Run HyperHDR an lxc and I found this helpful script which will do that for me. The problem that the default Linux Kernel has a specific feature turned off by default, support for the P010 format, outlined here. This is supposed to give vastly superior colors for HDR10 content. The author of HyperHDR has made this patch for the kernel which turns this on so I was wandering if there was any way to apply this same patch to Proxmox. Just for testing, I tried installing a Linux build to my Pi and and then running his script and it did work as expected. Is it possible to run the same script on Proxmox or would that break Proxmox? I did try, but it kept telling me it couldn't find Sudo. I got that installed but then gave me a bunch of other errors about restricted access or something.

Would I have to download the Proxmox source and apply the patch to that instead of to an installed OS? If so, is there any info on how to do that? I was looking at the documentation on his page about how he created an image based on the Pi OS by running a "Github Action script". Maybe that is possible for using the Proxmox source too? For reference though, I won't be using a Pi, I want to use a MiniPC that is arriving in a couple days.

I would really hate to have to use a full VM just for HyperHDR, but I suppose that is always a last resort.

Thanks in advance for the advice.
 
Are you trying to apply p010.patch?
Assuming that p010.patch can be applied as is...

apt update
apt install git nano screen patch fakeroot build-essential devscripts libncurses5 libncurses5-dev libssl-dev bc flex bison libelf-dev libaudit-dev libgtk2.0-dev libperl-dev asciidoc xmlto gawk gnupg gnupg2 rsync lintian debhelper libdw-dev libnuma-dev libslang2-dev sphinx-common asciidoc-base automake cpio dh-python file gcc kmod libiberty-dev libpve-common-perl libtool sed tar zlib1g-dev lz4 dwarves python3-dev

mkdir /root/tmp/git/ -p
cd /root/tmp/git
rm -rf .git
git init
git clone git://git.proxmox.com/git/pve-kernel.git
cd /root/tmp/git/pve-kernel
nano /root/tmp/git/pve-kernel/patches/kernel/p010.patch?
sed -i '22s/EXTRAVERSION=-$(KREL)$(KREL_EXTRA)-pve/EXTRAVERSION=-$(KREL)$(KREL_EXTRA)-pve-p010/g' Makefile
make

dpkg -i *.deb
reboot
apt autoremove
apt dist-upgrade

These files must exist, and the modified parts must match.

./include/linux/usb/uvc.h
@@ -105,6 +105,9 @@

./drivers/media/common/uvc.c
@@ -41,6 +41,10 @@

./drivers/media/usb/uvc/uvc_v4l2.c
@@ -203,6 +203,9 @@
 
Last edited:
Are you trying to apply p010.patch?
Assuming that p010.patch can be applied as is...



These files must exist, and the modified parts must match.

./include/linux/usb/uvc.h
@@ -105,6 +105,9 @@

./drivers/media/common/uvc.c
@@ -41,6 +41,10 @@

./drivers/media/usb/uvc/uvc_v4l2.c
@@ -203,6 +203,9 @@

Yeah, just trying to get that patch installed. That's certainly a lot of stuff there that I don't understand. I truly appreciate you taking the time to type all that out. I will give it a try and let you know what happens.

One question though about this line nano /root/tmp/git/pve-kernel/patches/kernel/p010.patch? Are you implying that this patch is already included in the repo that was cloned or do I need to get that from the source I linked about and put it in that directory? Do you know if there is a way to verify that the patch is actually applied? If not, I can probably tell from inside HyperHdr.

Thanks
 
Please forgive me, as I am not familiar with proxmox (or even Linux).

If you can use the URL below as is, you can simply place the downloaded file in /root/tmp/git/pve-kernel/patches/kernel/.

https://github.com/awawa-dev/P010_for_V4L2/blob/master/p010.patch

scp
cp p010.patch /root/tmp/git/pve-kernel/patches/kernel/

You can also create and write to the file using nano.

nano /root/tmp/git/pve-kernel/patches/kernel/p010.patch

Once you have make it, it is a good idea to view the files in the submodule that have been downloaded.

./include/linux/usb/uvc.h
./drivers/media/common/uvc.c
./drivers/media/usb/uvc/uvc_v4l2.c

If those files are not there, I don't know what to do next.

If you want to make changes, modify the following XXXX.

sed -i '22s/EXTRAVERSION=-$(KREL)$(KREL_EXTRA)-pve/EXTRAVERSION=-$(KREL)$(KREL_EXTRA)-pve-XXXX/g' Makefile
 
Last edited:
I have applied the patch and used it following the steps below, but it's up to you whether you believe it or not.

https://lore.kernel.org/all/20250502224035.3183451-1-alex.williamson@redhat.com/
https://lore.proxmox.com/pve-devel/20250722095659.79468-1-d.csapak@proxmox.com/T/#t

I have experienced issues related to vfio when using pass-through with rx9070 in the past.
While kernel 6.14.1 and later versions no longer require this, to resolve the vfio issues, I applied the patches by following the procedures outlined separately and placing the files with the following content in /root/tmp/git/pve-kernel/patches/kernel/.

By creating a kernel with the patch placed in /root/tmp/git/pve-kernel/patches/kernel/, I have confirmed that the patch is applied.

However, I can only confirm this through research and cannot provide detailed solutions, as I am not an expert in this area.

nano /root/tmp/git/pve-kernel/patches/kernel/vfio-bug220057.patch
---
drivers/vfio/pci/vfio_pci_core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index 35f9046af315..6328c3a05bcd 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -1646,14 +1646,14 @@ static vm_fault_t vfio_pci_mmap_huge_fault(struct vm_fault *vmf,
{
struct vm_area_struct *vma = vmf->vma;
struct vfio_pci_core_device *vdev = vma->vm_private_data;
- unsigned long pfn, pgoff = vmf->pgoff - vma->vm_pgoff;
+ unsigned long addr = vmf->address & ~((PAGE_SIZE << order) - 1);
+ unsigned long pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
+ unsigned long pfn = vma_to_pfn(vma) + pgoff;
vm_fault_t ret = VM_FAULT_SIGBUS;

- pfn = vma_to_pfn(vma) + pgoff;
-
- if (order && (pfn & ((1 << order) - 1) ||
- vmf->address & ((PAGE_SIZE << order) - 1) ||
- vmf->address + (PAGE_SIZE << order) > vma->vm_end)) {
+ if (order && (addr < vma->vm_start ||
+ addr + (PAGE_SIZE << order) > vma->vm_end ||
+ pfn & ((1 << order) - 1))) {
ret = VM_FAULT_FALLBACK;
goto out;
}
---

If what is included in this area is not called a patch, then the procedure I have presented is incorrect.

https://github.com/proxmox/pve-kernel/tree/master/patches/kernel
 
Last edited:
  • Like
Reactions: jingato