LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-13-2021, 07:16 AM   #1
Geoknyda
LQ Newbie
 
Registered: Jul 2021
Posts: 2

Rep: Reputation: Disabled
A better way to upstream/patch Kernel?


Hi all. I am updating my Linux kernel (for use in Lineage AOSP) using the following commands:

// To clone the kernel onto my local machine:
git clone [address of kernel on github]

// To apply patches from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-4.9.y
curl [address of patch] | git am

// To push the newly patched kernel back to my github repo:
git push

So the curl command I use to upstream 4.9.235 to 4.9.236 looks like this:

curl https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=6048d57b66d724a3aa0faf52bf3eb2126396450f https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=20e63db77149deb52d76ff9c8e7ddd3349c390ea https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=3412e0266322b706f21caceecbea4981b9356852 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=a542f4fe6e353af48bb28f4f4d24b003ce1661f6 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=23603e69bc6c95c846f3d1d93affaa24c18cf9f0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ce391ac20e6308fab5819560aba6e01cccdd354e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=e942ed86e5252fe206ef0c83f14bce331aa43d70 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=f0c44a60acdd95852d982491cf03938853d7bebd https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ad2eb69aefa38bf31d0136051407dbafa3b52228 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=968ec616e7074b379954e7d93fc22a6ecb631e37 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=2e34f0fcc673374f7918d462ab905ffe7f2c0cc4 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=47b1be395352d54f888f4331fa291dc9199fff4c https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=913412eda13d2797bb49461854829132afab0682 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=54764e8dfbd4fd2bf615aa5a2445ce7faa216cbc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=d370e957788316dbf08ed22446f3eed6821918cd https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=f4461490c38105bc040fb9ef5966c949da483d0e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=0696d08a50ae19e272e61b30e5968c13256f073e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ce749a04ba871e5cbc8a6c665e0b250ff6be1563 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=b9ca3f9b8643444ad4a69b9a43f8c7573c3a0136 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=f8890efdeac2bb064619be05fc3ceb0c6326c5f4 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=5f2c69e2ef24a79b6909a6dc6b249a17909965f8 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=de5dcf9226b35e498c67d43a840e5443d518ea90 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=33c25edfe15d6f914a26e74dd23468d5417ea3a0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=fb9b5bc196be35bda0382a79c569b591777bf64b https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=41718a868f611b386bc53d167518375563f456b1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=1c1630436a53ebf2cec68c120f2200422d89f0b0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=8c36cde29ad1e563def83c41094a96027b7a9b1b https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=d24c407b0f7af675a3928fdd4121306ad32c60ab https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=0c7cee63ec92b316f8b891b667177a080b670566 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=f66489209fcf8aea7038d0048e7a16a7e1067b05 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=a664f1a5d39ec4954e4a2e6fae4552ef3b35a166 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ff797b3bc8a5dbd1bf8279482f9aee87379e2de3 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=eba015400a0fc485e78f8b3430b35af290b2c0d9 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=53ce132f5555479424da90b1e62666392c64ebac https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=e2da4616ac0372a646389fd847c636a27e49213e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=6a14d943fcc6dcabf52690732471fe84ff0ee181 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=52245f066ca7027acc270050e6b3916059ee21c7 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=6faf75bacc39732aac1785340f9bf959a2425699 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ab6d8b281d8d8a8103cf0a828c492a25c5f264dc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=cc037d65658da025b45b229e996777baec72049c https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=87ce624f5cb032e17c8c95a89d6e291637fe7382 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=a2c79a9f156a6db0c1e18d0c165d419c8e4dc2b2 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=4e989d243e65b2cd79442f4413c91a7d62bf075d https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ad68326969f850d6ddf8151ee76299078f73a3cf https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=2e4a2bac24b8fd3ad95c152d911831e120f79b96 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=094031c4a363bb07a77a595b731237a41028e85f https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=dbf1ea0b3803b29675cc3dbea873d9ff25333e7d https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=8238ee93a30a5ff6fc75751e122a28e0d92f3e12 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ba13c07c58562d2c5e04928eccca01a5577ca5ba https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=7f3aa14ce1c8a2a2d22da48ca42727d8875d6228 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=8064eaf3a52469936adbb7da7ae32c90492fbdf4 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=3af826c80d371b3ba4511cf5315acbac064c6f5c https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=1f952fce59241d068ebcc434cc977f372e09a5d0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=fe46ff0c50b7df57371d6b0f218f6a87c1f3ad1e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=f08569eb18b5c402ff0e03b92e5ed6d5e64f7622 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=0cd49365e148e25ef38ea8a6d1a41a72cac12ea0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=76a2878f460e1544ffeebf9af655234ed38ea599 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=39f2dc7b03fe3d79d0df78503e95582d27a047d8 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=334dc5f712518f7ca791209569cb85bfa3b899e4 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=a073dabeea79c4df630ede960e79c20b44c20f91 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=a073dabeea79c4df630ede960e79c20b44c20f91 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=6f67b9d38ab08c89ef5865ab8c60cecb49fee382 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=79d62daab036907f565dc38e74be1233d683cc7f https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=942a35dabe83cc3d7ad3b7362435d85226d1dea5 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=921a52280f510d7520719ab81f3f7aefa1aa85f0 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=73888a8f8ceebddb34460ea82a6e106c1ee83c3e https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=7627de7f3379ba988cfafb4cc4ba57265228dff8 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=20696cd1723693124979f8cdcb6ed65e30b32e60 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ccf676d5103bcb02d83574b636af43fcccb74e80 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=d6d8c21e7db3cb9f6c26b76b1e878f96c10cabf8 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ac48d8300edd1aa4ce0fbef0ff5136d363f44cdf https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=cf7797ea60e3e721e3ae5090edbc2ec72d715436 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=65676505f8fbee350e75a9d4b933d2857cb17c4d | git am

To obtain the address of each patch I have to:
  1. Manually go into the patch page (e.g.: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=cf7797ea60e3e721e3ae5090edbc2ec72d715436)
  2. Right-click click on "(patch)"
  3. Copy the address and paste into the curl list above

I've already done patches from 4.9.118 to 4.9.236, and I want to upstream all the way to the current patch (right now it's 4.9.275).

Needless to say, this is a VERY manually intensive process. Please, can someone show me an easier way to do this?! Is there somewhere I can acquire a list of all the patch addresses so I don't have to go into each one and copy/paste their respective addresses?

N.B. I would like to keep the ability to skip individual patches; sometimes I have to 'git am --skip' a few for each upstream. Thanks!

Last edited by Geoknyda; 07-13-2021 at 07:31 AM.
 
Old 07-13-2021, 05:02 PM   #2
Geoknyda
LQ Newbie
 
Registered: Jul 2021
Posts: 2

Original Poster
Rep: Reputation: Disabled
I just decided to use a macro to automate all those clicks and keyboard presses. Works like a charm.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What is upstream /downstream with ref to kernel baggister Linux - Newbie 10 02-14-2020 08:28 AM
LXer: Fixing the Linux Graphics Kernel for True DisplayPort Compliance, Or: How to Upstream a Patch LXer Syndicated Linux News 0 03-31-2017 02:14 AM
After patch a patch to kernel? Do I need to compile whole kernel again? Anders Lind Linux - Kernel 2 02-29-2012 03:40 PM
[SOLVED] What is an "upstream" kernel ? wagaboy Linux - Kernel 3 07-28-2011 06:10 AM
RHEL4 ES, Is there a way to Bond two NICs for Redundancy for upstream connectivity? jtollack Linux - Networking 3 07-18-2010 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration