From nobody Mon Feb 9 08:34:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB565C7EE26 for ; Mon, 15 May 2023 08:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237864AbjEOIwj (ORCPT ); Mon, 15 May 2023 04:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238193AbjEOIw2 (ORCPT ); Mon, 15 May 2023 04:52:28 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53E951AE; Mon, 15 May 2023 01:52:24 -0700 (PDT) Received: from ip4d148da6.dynamic.kabel-deutschland.de ([77.20.141.166] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1pyTwK-000721-PL; Mon, 15 May 2023 10:52:20 +0200 From: Thorsten Leemhuis To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] docs: quickly-build-trimmed-linux: various small fixes and improvements Date: Mon, 15 May 2023 10:52:19 +0200 Message-Id: <6f4684b9a5d11d3adb04e0af3cfc60db8b28eeb2.1684140700.git.linux@leemhuis.info> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1684140744;00699a24; X-HE-SMSGID: 1pyTwK-000721-PL Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" * improve the short description of localmodconfig in the step-by-step guide while fixing its broken first sentence * briefly mention immutable Linux distributions * use '--shallow-exclude=3Dv6.0' throughout the document * instead of "git reset --hard; git checkout ..." use "git checkout --force ..." in the step-by-step guide: this matches the TLDR and is one command less to execute. This led to a few small adjustments to the text and the flow in the surrounding area. * fix two thinkos in the section explaining full git clones Signed-off-by: Thorsten Leemhuis --- Hi. Let me know if you would have prefered this as five seperate commits. Ciao, Thorsten --- .../quickly-build-trimmed-linux.rst | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Documentation/admin-guide/quickly-build-trimmed-linux.rst b/Do= cumentation/admin-guide/quickly-build-trimmed-linux.rst index ff4f4cc8522b..f08149bc53f8 100644 --- a/Documentation/admin-guide/quickly-build-trimmed-linux.rst +++ b/Documentation/admin-guide/quickly-build-trimmed-linux.rst @@ -215,12 +215,14 @@ again. reduce the compile time enormously, especially if you are running an universal kernel from a commodity Linux distribution. =20 - There is a catch: the make target 'localmodconfig' will disable kernel - features you have not directly or indirectly through some program utili= zed - since you booted the system. You can reduce or nearly eliminate that ri= sk by - using tricks outlined in the reference section; for quick testing purpo= ses - that risk is often negligible, but it is an aspect you want to keep in = mind - in case your kernel behaves oddly. + There is a catch: 'localmodconfig' is likely to disable kernel features= you + did not use since you booted your Linux -- like drivers for currently + disconnected peripherals or a virtualization software not haven't used = yet. + You can reduce or nearly eliminate that risk with tricks the reference + section outlines; but when building a kernel just for quick testing pur= poses + it is often negligible if such features are missing. But you should kee= p that + aspect in mind when using a kernel built with this make target, as it m= ight + be the reason why something you only use occasionally stopped working. =20 [:ref:`details`] =20 @@ -271,6 +273,9 @@ again. does nothing at all; in that case you have to manually install your ker= nel, as outlined in the reference section. =20 + If you are running a immutable Linux distribution, check its documentat= ion + and the web to find out how to install your own kernel there. + [:ref:`details`] =20 .. _another_sbs: @@ -291,29 +296,29 @@ again. version you care about, as git otherwise might retrieve the entire comm= it history:: =20 - git fetch --shallow-exclude=3Dv6.1 origin - - If you modified the sources (for example by applying a patch), you now = need - to discard those modifications; that's because git otherwise will not b= e able - to switch to the sources of another version due to potential conflicting - changes:: - - git reset --hard + git fetch --shallow-exclude=3Dv6.0 origin =20 - Now checkout the version you are interested in, as explained above:: + Now switch to the version you are interested in -- but be aware the com= mand + used here will discard any modifications you performed, as they would + conflict with the sources you want to checkout:: =20 - git checkout --detach origin/master + git checkout --force --detach origin/master =20 At this point you might want to patch the sources again or set/modify a= build - tag, as explained earlier; afterwards adjust the build configuration to= the - new codebase and build your next kernel:: + tag, as explained earlier. Afterwards adjust the build configuration to= the + new codebase using olddefconfig, which will now adjust the configuratio= n file + you prepared earlier using localmodconfig (~/linux/.config) for your n= ext + kernel:: =20 # reminder: if you want to apply patches, do it at this point # reminder: you might want to update your build tag at this point make olddefconfig + + Now build your kernel:: + make -j $(nproc --all) =20 - Install the kernel as outlined above:: + Afterwards install the kernel as outlined above:: =20 command -v installkernel && sudo make modules_install install =20 @@ -584,11 +589,11 @@ versions and individual commits at hand at any time:: curl -L \ https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/clo= ne.bundle \ -o linux-stable.git.bundle - git clone clone.bundle ~/linux/ + git clone linux-stable.git.bundle ~/linux/ rm linux-stable.git.bundle cd ~/linux/ - git remote set-url origin - https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + git remote set-url origin \ + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git git fetch origin git checkout --detach origin/master =20 base-commit: cdc822dda6f82269b94d5fa60ddc71d98c160fa0 --=20 2.40.1