nikkov Posted June 7, 2023 Posted June 7, 2023 Hello, I try build kernel for NanopiNeo board with user kernel patch, but I don't understand with path needed put my patch. In previous version armbian's builds I just put files to userpatches/kernel/sunxi-current how it described in docs. But now with current version Armbian build system it's not working. I put my custom linux-sunxi-current.config to userpatches folder, my patch to userpatches/kernel/sunxi-current and try build kernel with command: ./compile.sh BOARD=nanopineo BRANCH=current kernel I see that linux-sunxi-current.config found and applied but not patch isn't. 1 Quote
ALIGMSTEN Posted June 7, 2023 Posted June 7, 2023 cmd line is one parameter at a time, in this case kernel-patch other patching options, atf and uboot same approach 0 Quote
nikkov Posted June 8, 2023 Author Posted June 8, 2023 Is this option used to create a patch and apply it at the same time? I've only used it for making patches, not for building the kernel. That is, to build the kernel with my patch, I have to use this command: ./compile.sh BOARD=nanopineo BRANCH=current kernel-patch,kernel ? 0 Quote
ALIGMSTEN Posted June 8, 2023 Posted June 8, 2023 11 hours ago, nikkov said: Is this option used to create a patch and apply it at the same time? No it creates your patch, then you have to manually apply. [🌱] You will find your patch here: [ /home/alistair/build/output/patch/kernel-sunxi64-edge.patch ] [✨] Now you can manually move the produced patch to your userpatches or core patches to have it included in the next build [ /home/alistair/build/output/patch/kernel-sunxi64-edge.patch ] [💖] Stopping after creating kernel patch [🌱] Runtime [ 2:27 min ] I do it this way for sunxi kernels as an example: git -C cache/sources/linux-kernel-worktree/6.2__sunxi64__arm64 format-patch -1 -o ~/build/patch/kernel/archive/sunxi-6.2/patches.armbian/ /home/alistair/build/patch/kernel/archive/sunxi-6.2/patches.armbian/0001-Patching-kernel-sunxi64-files-arch-arm64-boot-dts-al.patch cd into the directory: mv 0001-Patching-kernel-sunxi64-files-arch-arm64-boot-dts-al.patch <name of your new patch>.patch In order to apply the patch during the build you have to change the series files to include your patch. You include(commit) or discard your changes to git as you chose. I don't have a use for userpatches (can't comment whether or not it works 'as expected' in main) as I'm normally doing a specific task that will lead to a commit. I found inconsistencies (1st weeks of main) where patches (output/patch) were included in build even though not implicitly stated with cmd. Hope this somewhat helps! 0 Quote
nikkov Posted June 8, 2023 Author Posted June 8, 2023 (edited) Thank you for your time! 6 hours ago, ALIGMSTEN said: In order to apply the patch during the build you have to change the series files to include your patch. If I understand correctly, I have to include my patch in one of this files: /build/patch/kernel/archive/sunxi-6.1/series.* or just put it to folder /build/patch/kernel/archive/sunxi-6.1/. Not a very clear approach, the previous one was more understandable, especially since the userpatches folder is still used. Edited June 8, 2023 by nikkov 0 Quote
ALIGMSTEN Posted June 8, 2023 Posted June 8, 2023 Yes that's right you must include the file in the directory /sunxi-6.1/patches.armbian and then manually edit the file at patch/kernel/archive/sunxi-6.1/series.conf series.armbian to include your new patch. I've not tried userpatches and don't know if it functions or not - perhaps raise an issue if you are sure it not currently working. ADD: I think its correct that placing the file in the top directory series.conf picks it up (was smth like that master) 0 Quote
Matthijs Kooijman Posted April 8 Posted April 8 For anyone else looking to patch their kernel through userpatches - it seems that (at least with the updated build system that uses the quite complex lib/tools/patching.py to apply patches) you can just drop a patch in `userpatches/kernel/archive/<platform>-<version>/` and it will be picked up (in my case, it was `userpatches/kernel/archive/sunxi-6.7`). No series file needed. I used a patch generated with `git format-patch`, but it seems that the script supports different formats, even mbox with multiple patches inside. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.