mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 07:44:21 +08:00
docs: quickly-build-trimmed-linux: various small fixes and improvements
* 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=v6.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 <linux@leemhuis.info> Link: https://lore.kernel.org/r/6f4684b9a5d11d3adb04e0af3cfc60db8b28eeb2.1684140700.git.linux@leemhuis.info Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
96e3cc270d
commit
0d8aa3212e
@ -215,12 +215,14 @@ again.
|
|||||||
reduce the compile time enormously, especially if you are running an
|
reduce the compile time enormously, especially if you are running an
|
||||||
universal kernel from a commodity Linux distribution.
|
universal kernel from a commodity Linux distribution.
|
||||||
|
|
||||||
There is a catch: the make target 'localmodconfig' will disable kernel
|
There is a catch: 'localmodconfig' is likely to disable kernel features you
|
||||||
features you have not directly or indirectly through some program utilized
|
did not use since you booted your Linux -- like drivers for currently
|
||||||
since you booted the system. You can reduce or nearly eliminate that risk by
|
disconnected peripherals or a virtualization software not haven't used yet.
|
||||||
using tricks outlined in the reference section; for quick testing purposes
|
You can reduce or nearly eliminate that risk with tricks the reference
|
||||||
that risk is often negligible, but it is an aspect you want to keep in mind
|
section outlines; but when building a kernel just for quick testing purposes
|
||||||
in case your kernel behaves oddly.
|
it is often negligible if such features are missing. But you should keep that
|
||||||
|
aspect in mind when using a kernel built with this make target, as it might
|
||||||
|
be the reason why something you only use occasionally stopped working.
|
||||||
|
|
||||||
[:ref:`details<configuration>`]
|
[:ref:`details<configuration>`]
|
||||||
|
|
||||||
@ -271,6 +273,9 @@ again.
|
|||||||
does nothing at all; in that case you have to manually install your kernel,
|
does nothing at all; in that case you have to manually install your kernel,
|
||||||
as outlined in the reference section.
|
as outlined in the reference section.
|
||||||
|
|
||||||
|
If you are running a immutable Linux distribution, check its documentation
|
||||||
|
and the web to find out how to install your own kernel there.
|
||||||
|
|
||||||
[:ref:`details<install>`]
|
[:ref:`details<install>`]
|
||||||
|
|
||||||
.. _another_sbs:
|
.. _another_sbs:
|
||||||
@ -291,29 +296,29 @@ again.
|
|||||||
version you care about, as git otherwise might retrieve the entire commit
|
version you care about, as git otherwise might retrieve the entire commit
|
||||||
history::
|
history::
|
||||||
|
|
||||||
git fetch --shallow-exclude=v6.1 origin
|
git fetch --shallow-exclude=v6.0 origin
|
||||||
|
|
||||||
If you modified the sources (for example by applying a patch), you now need
|
Now switch to the version you are interested in -- but be aware the command
|
||||||
to discard those modifications; that's because git otherwise will not be able
|
used here will discard any modifications you performed, as they would
|
||||||
to switch to the sources of another version due to potential conflicting
|
conflict with the sources you want to checkout::
|
||||||
changes::
|
|
||||||
|
|
||||||
git reset --hard
|
git checkout --force --detach origin/master
|
||||||
|
|
||||||
Now checkout the version you are interested in, as explained above::
|
|
||||||
|
|
||||||
git checkout --detach origin/master
|
|
||||||
|
|
||||||
At this point you might want to patch the sources again or set/modify a build
|
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
|
tag, as explained earlier. Afterwards adjust the build configuration to the
|
||||||
new codebase and build your next kernel::
|
new codebase using olddefconfig, which will now adjust the configuration file
|
||||||
|
you prepared earlier using localmodconfig (~/linux/.config) for your next
|
||||||
|
kernel::
|
||||||
|
|
||||||
# reminder: if you want to apply patches, do it at this point
|
# reminder: if you want to apply patches, do it at this point
|
||||||
# reminder: you might want to update your build tag at this point
|
# reminder: you might want to update your build tag at this point
|
||||||
make olddefconfig
|
make olddefconfig
|
||||||
|
|
||||||
|
Now build your kernel::
|
||||||
|
|
||||||
make -j $(nproc --all)
|
make -j $(nproc --all)
|
||||||
|
|
||||||
Install the kernel as outlined above::
|
Afterwards install the kernel as outlined above::
|
||||||
|
|
||||||
command -v installkernel && sudo make modules_install install
|
command -v installkernel && sudo make modules_install install
|
||||||
|
|
||||||
@ -584,10 +589,10 @@ versions and individual commits at hand at any time::
|
|||||||
curl -L \
|
curl -L \
|
||||||
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/clone.bundle \
|
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/clone.bundle \
|
||||||
-o linux-stable.git.bundle
|
-o linux-stable.git.bundle
|
||||||
git clone clone.bundle ~/linux/
|
git clone linux-stable.git.bundle ~/linux/
|
||||||
rm linux-stable.git.bundle
|
rm linux-stable.git.bundle
|
||||||
cd ~/linux/
|
cd ~/linux/
|
||||||
git remote set-url origin
|
git remote set-url origin \
|
||||||
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
|
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git checkout --detach origin/master
|
git checkout --detach origin/master
|
||||||
|
Loading…
Reference in New Issue
Block a user