Skip to content

Commit da5afb2

Browse files
kalyazinclaude
andcommitted
feat: apply per-version patches during kernel build
Add a `patches/<kernel-version>/` mechanism: any .patch files placed in that directory are applied with `git apply` after the source tree is reset to the kernel tag and the .config is copied into place, before `make olddefconfig`. Versions without a patch directory are built unmodified, so this commit is a no-op until patches are added. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Nikita Kalyazin <nikita.kalyazin@e2b.dev>
1 parent 4146be0 commit da5afb2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ function build_version {
5959
# Configs live in configs/{arch}/
6060
cp ../configs/"${TARGET_ARCH}/${version}.config" .config
6161

62+
# Apply per-version patches if any exist under patches/<version>/
63+
local patch_dir="../patches/${version}"
64+
if [ -d "$patch_dir" ]; then
65+
echo "Applying patches from $patch_dir"
66+
for p in "$patch_dir"/*.patch; do
67+
[ -e "$p" ] || continue
68+
echo " -> $(basename "$p")"
69+
git apply --verbose "$p"
70+
done
71+
fi
72+
6273
# Set up cross-compilation if building arm64 on x86_64
6374
local make_opts=""
6475
if [[ "$TARGET_ARCH" == "arm64" ]]; then

0 commit comments

Comments
 (0)