Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. _readme:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) Linux kernel release 5.x <http://kernel.org/>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) =============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) These are the release notes for Linux version 5.  Read them carefully,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) as they tell you what this is all about, explain how to install the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) kernel, and what to do if something goes wrong.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) What is Linux?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) --------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)   Linux is a clone of the operating system Unix, written from scratch by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)   Linus Torvalds with assistance from a loosely-knit team of hackers across
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)   the Net. It aims towards POSIX and Single UNIX Specification compliance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)   It has all the features you would expect in a modern fully-fledged Unix,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)   including true multitasking, virtual memory, shared libraries, demand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)   loading, shared copy-on-write executables, proper memory management,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)   and multistack networking including IPv4 and IPv6.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)   It is distributed under the GNU General Public License v2 - see the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)   accompanying COPYING file for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) On what hardware does it run?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) -----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)   Although originally developed first for 32-bit x86-based PCs (386 or higher),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)   today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)   UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)   IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64 Xtensa, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)   ARC architectures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)   Linux is easily portable to most general-purpose 32- or 64-bit architectures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)   as long as they have a paged memory management unit (PMMU) and a port of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)   GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)   also been ported to a number of architectures without a PMMU, although
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)   functionality is then obviously somewhat limited.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)   Linux has also been ported to itself. You can now run the kernel as a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)   userspace application - this is called UserMode Linux (UML).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) Documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  - There is a lot of documentation available both in electronic form on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)    the Internet and in books, both Linux-specific and pertaining to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)    general UNIX questions.  I'd recommend looking into the documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)    subdirectories on any Linux FTP site for the LDP (Linux Documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)    Project) books.  This README is not meant to be documentation on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)    system: there are much better sources available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  - There are various README files in the Documentation/ subdirectory:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)    these typically contain kernel-specific installation notes for some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)    drivers for example. Please read the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)    :ref:`Documentation/process/changes.rst <changes>` file, as it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)    contains information about the problems, which may result by upgrading
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)    your kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) Installing the kernel source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) ----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  - If you install the full sources, put the kernel tarball in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)    directory where you have permissions (e.g. your home directory) and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)    unpack it::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)      xz -cd linux-5.x.tar.xz | tar xvf -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)    Replace "X" with the version number of the latest kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)    Do NOT use the /usr/src/linux area! This area has a (usually
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)    incomplete) set of kernel headers that are used by the library header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)    files.  They should match the library, and not get messed up by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)    whatever the kernel-du-jour happens to be.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  - You can also upgrade between 5.x releases by patching.  Patches are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)    distributed in the xz format.  To install by patching, get all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)    newer patch files, enter the top level directory of the kernel source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)    (linux-5.x) and execute::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)      xz -cd ../patch-5.x.xz | patch -p1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)    Replace "x" for all versions bigger than the version "x" of your current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)    source tree, **in_order**, and you should be ok.  You may want to remove
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)    the backup files (some-file-name~ or some-file-name.orig), and make sure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)    that there are no failed patches (some-file-name# or some-file-name.rej).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)    If there are, either you or I have made a mistake.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)    Unlike patches for the 5.x kernels, patches for the 5.x.y kernels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)    (also known as the -stable kernels) are not incremental but instead apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)    directly to the base 5.x kernel.  For example, if your base kernel is 5.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)    and you want to apply the 5.0.3 patch, you must not first apply the 5.0.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)    and 5.0.2 patches. Similarly, if you are running kernel version 5.0.2 and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)    want to jump to 5.0.3, you must first reverse the 5.0.2 patch (that is,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)    patch -R) **before** applying the 5.0.3 patch. You can read more on this in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)    :ref:`Documentation/process/applying-patches.rst <applying_patches>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)    Alternatively, the script patch-kernel can be used to automate this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)    process.  It determines the current kernel version and applies any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)    patches found::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)      linux/scripts/patch-kernel linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)    The first argument in the command above is the location of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)    kernel source.  Patches are applied from the current directory, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)    an alternative directory can be specified as the second argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  - Make sure you have no stale .o files and dependencies lying around::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)      cd linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)      make mrproper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)    You should now have the sources correctly installed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) Software requirements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)    Compiling and running the 5.x kernels requires up-to-date
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)    versions of various software packages.  Consult
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)    :ref:`Documentation/process/changes.rst <changes>` for the minimum version numbers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)    required and how to get updates for these packages.  Beware that using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)    excessively old versions of these packages can cause indirect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)    errors that are very difficult to track down, so don't assume that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)    you can just update packages when obvious problems arise during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)    build or operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) Build directory for the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) ------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)    When compiling the kernel, all output files will per default be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)    stored together with the kernel source code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)    Using the option ``make O=output/dir`` allows you to specify an alternate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)    place for the output files (including .config).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)    Example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)      kernel source code: /usr/src/linux-5.x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)      build directory:    /home/name/build/kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)    To configure and build the kernel, use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)      cd /usr/src/linux-5.x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)      make O=/home/name/build/kernel menuconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)      make O=/home/name/build/kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)      sudo make O=/home/name/build/kernel modules_install install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)    Please note: If the ``O=output/dir`` option is used, then it must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)    used for all invocations of make.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) Configuring the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)    Do not skip this step even if you are only upgrading one minor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)    version.  New configuration options are added in each release, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)    odd problems will turn up if the configuration files are not set up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)    as expected.  If you want to carry your existing configuration to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)    new version with minimal work, use ``make oldconfig``, which will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)    only ask you for the answers to new questions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  - Alternative configuration commands are::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)      "make config"      Plain text interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)      "make menuconfig"  Text based color menus, radiolists & dialogs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)      "make nconfig"     Enhanced text based color menus.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)      "make xconfig"     Qt based configuration tool.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)      "make gconfig"     GTK+ based configuration tool.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)      "make oldconfig"   Default all questions based on the contents of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)                         your existing ./.config file and asking about
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)                         new config symbols.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)      "make olddefconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)                         Like above, but sets new symbols to their default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)                         values without prompting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)      "make defconfig"   Create a ./.config file by using the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)                         symbol values from either arch/$ARCH/defconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)                         or arch/$ARCH/configs/${PLATFORM}_defconfig,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)                         depending on the architecture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)      "make ${PLATFORM}_defconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)                         Create a ./.config file by using the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)                         symbol values from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)                         arch/$ARCH/configs/${PLATFORM}_defconfig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)                         Use "make help" to get a list of all available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)                         platforms of your architecture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)      "make allyesconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)                         Create a ./.config file by setting symbol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)                         values to 'y' as much as possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)      "make allmodconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)                         Create a ./.config file by setting symbol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)                         values to 'm' as much as possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)      "make allnoconfig" Create a ./.config file by setting symbol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)                         values to 'n' as much as possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)      "make randconfig"  Create a ./.config file by setting symbol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)                         values to random values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)      "make localmodconfig" Create a config based on current config and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)                            loaded modules (lsmod). Disables any module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)                            option that is not needed for the loaded modules.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)                            To create a localmodconfig for another machine,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)                            store the lsmod of that machine into a file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)                            and pass it in as a LSMOD parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)                            Also, you can preserve modules in certain folders
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)                            or kconfig files by specifying their paths in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)                            parameter LMC_KEEP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)                    target$ lsmod > /tmp/mylsmod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)                    target$ scp /tmp/mylsmod host:/tmp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)                    host$ make LSMOD=/tmp/mylsmod \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)                            LMC_KEEP="drivers/usb:drivers/gpu:fs" \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)                            localmodconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)                            The above also works when cross compiling.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)      "make localyesconfig" Similar to localmodconfig, except it will convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)                            all module options to built in (=y) options. You can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)                            also preserve modules by LMC_KEEP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)      "make kvmconfig"   Enable additional options for kvm guest kernel support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)      "make xenconfig"   Enable additional options for xen dom0 guest kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)                         support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)      "make tinyconfig"  Configure the tiniest possible kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)    You can find more information on using the Linux kernel config tools
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)    in Documentation/kbuild/kconfig.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)  - NOTES on ``make config``:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)     - Having unnecessary drivers will make the kernel bigger, and can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)       under some circumstances lead to problems: probing for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)       nonexistent controller card may confuse your other controllers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)     - A kernel with math-emulation compiled in will still use the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)       coprocessor if one is present: the math emulation will just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)       never get used in that case.  The kernel will be slightly larger,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)       but will work on different machines regardless of whether they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)       have a math coprocessor or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)     - The "kernel hacking" configuration details usually result in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)       bigger or slower kernel (or both), and can even make the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)       less stable by configuring some routines to actively try to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)       break bad code to find kernel problems (kmalloc()).  Thus you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)       should probably answer 'n' to the questions for "development",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)       "experimental", or "debugging" features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) Compiling the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) --------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)  - Make sure you have at least gcc 4.9 available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)    For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)    Please note that you can still run a.out user programs with this kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  - Do a ``make`` to create a compressed kernel image. It is also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)    possible to do ``make install`` if you have lilo installed to suit the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)    kernel makefiles, but you may want to check your particular lilo setup first.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)    To do the actual install, you have to be root, but none of the normal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)    build should require that. Don't take the name of root in vain.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)  - If you configured any of the parts of the kernel as ``modules``, you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)    will also have to do ``make modules_install``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)  - Verbose kernel compile/build output:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)    Normally, the kernel build system runs in a fairly quiet mode (but not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)    totally silent).  However, sometimes you or other kernel developers need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)    to see compile, link, or other commands exactly as they are executed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)    For this, use "verbose" build mode.  This is done by passing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)    ``V=1`` to the ``make`` command, e.g.::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)      make V=1 all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)    To have the build system also tell the reason for the rebuild of each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)    target, use ``V=2``.  The default is ``V=0``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)  - Keep a backup kernel handy in case something goes wrong.  This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)    especially true for the development releases, since each new release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)    contains new code which has not been debugged.  Make sure you keep a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)    backup of the modules corresponding to that kernel, as well.  If you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)    are installing a new kernel with the same version number as your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)    working kernel, make a backup of your modules directory before you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)    do a ``make modules_install``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)    Alternatively, before compiling, use the kernel config option
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)    "LOCALVERSION" to append a unique suffix to the regular kernel version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)    LOCALVERSION can be set in the "General Setup" menu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)  - In order to boot your new kernel, you'll need to copy the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)    image (e.g. .../linux/arch/x86/boot/bzImage after compilation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)    to the place where your regular bootable kernel is found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)  - Booting a kernel directly from a floppy without the assistance of a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)    bootloader such as LILO, is no longer supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)    If you boot Linux from the hard drive, chances are you use LILO, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)    uses the kernel image as specified in the file /etc/lilo.conf.  The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)    kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)    /boot/bzImage.  To use the new kernel, save a copy of the old image
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)    and copy the new image over the old one.  Then, you MUST RERUN LILO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)    to update the loading map! If you don't, you won't be able to boot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)    the new kernel image.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)    Reinstalling LILO is usually a matter of running /sbin/lilo.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)    You may wish to edit /etc/lilo.conf to specify an entry for your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)    old kernel image (say, /vmlinux.old) in case the new one does not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)    work.  See the LILO docs for more information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)    After reinstalling LILO, you should be all set.  Shutdown the system,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)    reboot, and enjoy!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)    If you ever need to change the default root device, video mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)    etc. in the kernel image, use your bootloader's boot options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)    where appropriate.  No need to recompile the kernel to change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)    these parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)  - Reboot with the new kernel and enjoy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) If something goes wrong
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) -----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)  - If you have problems that seem to be due to kernel bugs, please check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)    the file MAINTAINERS to see if there is a particular person associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)    with the part of the kernel that you are having trouble with. If there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)    isn't anyone listed there, then the second best thing is to mail
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)    them to me (torvalds@linux-foundation.org), and possibly to any other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)    relevant mailing-list or to the newsgroup.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)  - In all bug-reports, *please* tell what kernel you are talking about,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)    how to duplicate the problem, and what your setup is (use your common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343)    sense).  If the problem is new, tell me so, and if the problem is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)    old, please try to tell me when you first noticed it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)  - If the bug results in a message like::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)      unable to handle kernel paging request at address C0000010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)      Oops: 0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)      EIP:   0010:XXXXXXXX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)      eax: xxxxxxxx   ebx: xxxxxxxx   ecx: xxxxxxxx   edx: xxxxxxxx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)      esi: xxxxxxxx   edi: xxxxxxxx   ebp: xxxxxxxx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)      ds: xxxx  es: xxxx  fs: xxxx  gs: xxxx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)      Pid: xx, process nr: xx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)      xx xx xx xx xx xx xx xx xx xx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)    or similar kernel debugging information on your screen or in your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)    system log, please duplicate it *exactly*.  The dump may look
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)    incomprehensible to you, but it does contain information that may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)    help debugging the problem.  The text above the dump is also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)    important: it tells something about why the kernel dumped code (in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)    the above example, it's due to a bad kernel pointer). More information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)    on making sense of the dump is in Documentation/admin-guide/bug-hunting.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)  - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)    as is, otherwise you will have to use the ``ksymoops`` program to make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)    sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)    This utility can be downloaded from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)    https://www.kernel.org/pub/linux/utils/kernel/ksymoops/ .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)    Alternatively, you can do the dump lookup by hand:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)  - In debugging dumps like the above, it helps enormously if you can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)    look up what the EIP value means.  The hex value as such doesn't help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)    me or anybody else very much: it will depend on your particular
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)    kernel setup.  What you should do is take the hex value from the EIP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)    line (ignore the ``0010:``), and look it up in the kernel namelist to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)    see which kernel function contains the offending address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)    To find out the kernel function name, you'll need to find the system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)    binary associated with the kernel that exhibited the symptom.  This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)    the file 'linux/vmlinux'.  To extract the namelist and match it against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)    the EIP from the kernel crash, do::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)      nm vmlinux | sort | less
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)    This will give you a list of kernel addresses sorted in ascending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)    order, from which it is simple to find the function that contains the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)    offending address.  Note that the address given by the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)    debugging messages will not necessarily match exactly with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390)    function addresses (in fact, that is very unlikely), so you can't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)    just 'grep' the list: the list will, however, give you the starting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)    point of each kernel function, so by looking for the function that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)    has a starting address lower than the one you are searching for but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)    is followed by a function with a higher address you will find the one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)    you want.  In fact, it may be a good idea to include a bit of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)    "context" in your problem report, giving a few lines around the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)    interesting one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)    If you for some reason cannot do the above (you have a pre-compiled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)    kernel image or similar), telling me as much about your setup as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)    possible will help.  Please read the :ref:`admin-guide/reporting-bugs.rst <reportingbugs>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)    document for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)  - Alternatively, you can use gdb on a running kernel. (read-only; i.e. you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)    cannot change values or set break points.) To do this, first compile the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)    kernel with -g; edit arch/x86/Makefile appropriately, then do a ``make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)    clean``. You'll also need to enable CONFIG_PROC_FS (via ``make config``).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)    After you've rebooted with the new kernel, do ``gdb vmlinux /proc/kcore``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)    You can now use all the usual gdb commands. The command to look up the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)    point where your system crashed is ``l *0xXXXXXXXX``. (Replace the XXXes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)    with the EIP value.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)    gdb'ing a non-running kernel currently fails because ``gdb`` (wrongly)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415)    disregards the starting offset for which the kernel is compiled.