This is a practical gist to propose backport from main kernel to a stable branch. This does not superseed the official documentation.
Documentation (Read. Carefully. Each. Line.):
- https://docs.kernel.org/process/stable-kernel-rules.html
- https://docs.kernel.org/process/submitting-patches.html#submittingpatches
Apply the patches you want to backport on the target branch, e.g:
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -b linux-6.12.y
$ git fetch origin linux-6.12.y
$ git am *.patch
# fix any issues
$ git rebase -i origin/linux-6.12.y --signoff
# reword every commit to add this line after the title: "commit 1234 upstream."
# e.g
# r8169: add support for RTL8125D
#
# commit f75d1fbe7809bc5ed134204b920fd9e2fc5db1df upstream.
#
# This adds support for new chip version RTL8125D, which can be found on
# boards like Gigabyte X870E AORUS ELITE WIFI7. Firmware rtl8125d-1.fw
# for this chip version is available in linux-firmware already.
Prepare the patches:
$ git format-patch @~<THE NUMBER OF PATCH YOU WANT TO SEND> --subject-prefix 'PATCH 6.<ADD YOUR KERNEL VERSION HERE>.y' --cover-letter -o outgoing
$ vim outgoing/0000-cover-letter.patch
# add here the title of your proposal + context + upstream Flatcar issue, test, etc.
# you can mention some stuffs you've done to adapt those patches to the current branch
Once done, you can tested those patches with Flatcar SDK:
--- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-6.12.34.ebuild
+++ b/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-6.12.35.ebuild
@@ -43,4 +43,7 @@ UNIPATCH_LIST="
${PATCH_DIR}/z0006-mtd-disable-slram-and-phram-when-locked-down.patch \
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when.patch \
${PATCH_DIR}/z0008-tools-hv-fix-cross-compilation-for-ARM64.patch \
+ ${PATCH_DIR}/z0009-f75d1fbe7809bc5ed134204b920fd9e2fc5db1df.patch \
+ ${PATCH_DIR}/z0010-f87a17ed3b51fba4dfdd8f8b643b5423a85fc551.patch \
+ ${PATCH_DIR}/z0011-8989bad541133c43550bff2b80edbe37b8fb9659.patch \
"
Then:
$ ./run_sdk_container -a amd64 -t
(sdk) $ cd sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/
(sdk) $ sudo ebuild coreos-sources-6.12.35.ebuild clean prepare
If the patches are applying correctly, you can kick-off a Flatcar CI. Once the CI is green, you can submit the patches:
$ git send-email --to [email protected] outgoing/*
If you need to reply, identify the Message-ID
of the mailing list and reply to the last email address:
$ git format-patch @~<THE NUMBER OF PATCH YOU WANT TO SEND> -v2 --subject-prefix 'PATCH 6.<ADD YOUR KERNEL VERSION HERE>.y' --cover-letter -o outgoing-v2
$ git send-email --in-reply-to=message@id --to=last@email-address [email protected] outgoing-v2/*