Skip to content

add python script to generate xpadneo kernel patch from sources#600

Open
GloriousEggroll wants to merge 11 commits into
atar-axis:masterfrom
GloriousEggroll:kernel-patch-generator
Open

add python script to generate xpadneo kernel patch from sources#600
GloriousEggroll wants to merge 11 commits into
atar-axis:masterfrom
GloriousEggroll:kernel-patch-generator

Conversation

@GloriousEggroll

@GloriousEggroll GloriousEggroll commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Allows generating a kernel patch for xpadneo instead of installing via dkms or akmods.

Usage example for kernel 6.19.9 and xpadneo v0.10:

wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.19.9.tar.xz
tar -xf linux-6.19.9.tar.xz
git clone https://github.com/atar-axis/xpadneo
cd xpadneo
git checkout v0.10
cd ..
cp xpadneo/generate-xpadneo-patch.py .
./generate-xpadneo-patch.py 6.19.9

Result: xpadneo-kernel-integration.patch

Folder structure:
Parent folder->
(Linux kernel source)
(xpadneo source)
generate-xpadneo-patch.py

Update 3/29/26:
Also generates udev rules and modprobe file needed for xpadneo.

  • I agree that my contribution is accepted under the project's existing license terms, and that contributions to
    the module source code are accepted under GPL-2.0-only.

@kakra

kakra commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks, this looks useful, I will look into it. It's a perfect opportunity because I'm maintaining a direct kernel patch myself which needs to be updated: kakra/linux#38

@kakra kakra added the 0 | type: enhancement New feature or request label Mar 24, 2026
@kakra kakra added this to the v0.11 milestone Mar 24, 2026

@kakra kakra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick first review without having it tried for my own kernel patches yet.

Comment thread generate-xpadneo-patch.py Outdated
Comment thread generate-xpadneo-patch.py Outdated
@kakra kakra force-pushed the kernel-patch-generator branch from fcb3b8d to 8944d04 Compare April 10, 2026 23:28
@kakra

kakra commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

@GloriousEggroll I've reworked the patch generator to better fit my workflow, and to reuse files from the source tree instead of hard-coding them in the script. Please review and let me know if this works for you, so I can merge it into xpadneo.

If ready, I'll merge the commits in one squashed commit adding your co-authored-by.

I'm not very fluent in python so I used multiple AI agents to change and review the changes, including some manual cleanups.

Changes:

  • The script has been moved to misc.
  • The script now expects a git repo as the kernel source, and optionally a second argument for the kernel version.
  • Generated output will be written into dedicated output directories.
  • Instead of unpacking/copying kernel/xpadneo sources, the script now uses temporary git worktrees.
  • Instead of using diff, the script now uses a temporary git commit and exports the generated commit.

You can now run the script from the xpadneo directory without providing a Linux source tree at a predefined location, instead an existing Linux git clone is needed and can be placed anywhere in the file system.

GloriousEggroll and others added 11 commits April 11, 2026 02:44
Allows generating a kernel patch for xpadneo instead of installing via
dkms or akmods.

Usage example for kernel 6.19.9 and xpadneo v0.10:
```
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.19.9.tar.xz
tar -xf linux-6.19.9.tar.xz
git clone https://github.com/atar-axis/xpadneo
cd xpadneo
git checkout v0.10
cd ..
cp xpadneo/generate-xpadneo-patch.py .
./generate-xpadneo-patch.py 6.19.9
```
Result: xpadneo-kernel-integration.patch

Folder structure:
Parent folder->
  (Linux kernel source)
  (xpadneo source)
  generate-xpadneo-patch.py
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra kakra force-pushed the kernel-patch-generator branch from c2d848b to 7ab70c2 Compare April 11, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 | type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants