Back to home page

OSCL-LXR

 
 

    


0001 .. _readme:
0002 
0003 Linux kernel release 6.x <http://kernel.org/>
0004 =============================================
0005 
0006 These are the release notes for Linux version 6.  Read them carefully,
0007 as they tell you what this is all about, explain how to install the
0008 kernel, and what to do if something goes wrong.
0009 
0010 What is Linux?
0011 --------------
0012 
0013   Linux is a clone of the operating system Unix, written from scratch by
0014   Linus Torvalds with assistance from a loosely-knit team of hackers across
0015   the Net. It aims towards POSIX and Single UNIX Specification compliance.
0016 
0017   It has all the features you would expect in a modern fully-fledged Unix,
0018   including true multitasking, virtual memory, shared libraries, demand
0019   loading, shared copy-on-write executables, proper memory management,
0020   and multistack networking including IPv4 and IPv6.
0021 
0022   It is distributed under the GNU General Public License v2 - see the
0023   accompanying COPYING file for more details.
0024 
0025 On what hardware does it run?
0026 -----------------------------
0027 
0028   Although originally developed first for 32-bit x86-based PCs (386 or higher),
0029   today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and
0030   UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell,
0031   IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64 Xtensa, and
0032   ARC architectures.
0033 
0034   Linux is easily portable to most general-purpose 32- or 64-bit architectures
0035   as long as they have a paged memory management unit (PMMU) and a port of the
0036   GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has
0037   also been ported to a number of architectures without a PMMU, although
0038   functionality is then obviously somewhat limited.
0039   Linux has also been ported to itself. You can now run the kernel as a
0040   userspace application - this is called UserMode Linux (UML).
0041 
0042 Documentation
0043 -------------
0044 
0045  - There is a lot of documentation available both in electronic form on
0046    the Internet and in books, both Linux-specific and pertaining to
0047    general UNIX questions.  I'd recommend looking into the documentation
0048    subdirectories on any Linux FTP site for the LDP (Linux Documentation
0049    Project) books.  This README is not meant to be documentation on the
0050    system: there are much better sources available.
0051 
0052  - There are various README files in the Documentation/ subdirectory:
0053    these typically contain kernel-specific installation notes for some
0054    drivers for example. Please read the
0055    :ref:`Documentation/process/changes.rst <changes>` file, as it
0056    contains information about the problems, which may result by upgrading
0057    your kernel.
0058 
0059 Installing the kernel source
0060 ----------------------------
0061 
0062  - If you install the full sources, put the kernel tarball in a
0063    directory where you have permissions (e.g. your home directory) and
0064    unpack it::
0065 
0066      xz -cd linux-6.x.tar.xz | tar xvf -
0067 
0068    Replace "X" with the version number of the latest kernel.
0069 
0070    Do NOT use the /usr/src/linux area! This area has a (usually
0071    incomplete) set of kernel headers that are used by the library header
0072    files.  They should match the library, and not get messed up by
0073    whatever the kernel-du-jour happens to be.
0074 
0075  - You can also upgrade between 6.x releases by patching.  Patches are
0076    distributed in the xz format.  To install by patching, get all the
0077    newer patch files, enter the top level directory of the kernel source
0078    (linux-6.x) and execute::
0079 
0080      xz -cd ../patch-6.x.xz | patch -p1
0081 
0082    Replace "x" for all versions bigger than the version "x" of your current
0083    source tree, **in_order**, and you should be ok.  You may want to remove
0084    the backup files (some-file-name~ or some-file-name.orig), and make sure
0085    that there are no failed patches (some-file-name# or some-file-name.rej).
0086    If there are, either you or I have made a mistake.
0087 
0088    Unlike patches for the 6.x kernels, patches for the 6.x.y kernels
0089    (also known as the -stable kernels) are not incremental but instead apply
0090    directly to the base 6.x kernel.  For example, if your base kernel is 6.0
0091    and you want to apply the 6.0.3 patch, you must not first apply the 6.0.1
0092    and 6.0.2 patches. Similarly, if you are running kernel version 6.0.2 and
0093    want to jump to 6.0.3, you must first reverse the 6.0.2 patch (that is,
0094    patch -R) **before** applying the 6.0.3 patch. You can read more on this in
0095    :ref:`Documentation/process/applying-patches.rst <applying_patches>`.
0096 
0097    Alternatively, the script patch-kernel can be used to automate this
0098    process.  It determines the current kernel version and applies any
0099    patches found::
0100 
0101      linux/scripts/patch-kernel linux
0102 
0103    The first argument in the command above is the location of the
0104    kernel source.  Patches are applied from the current directory, but
0105    an alternative directory can be specified as the second argument.
0106 
0107  - Make sure you have no stale .o files and dependencies lying around::
0108 
0109      cd linux
0110      make mrproper
0111 
0112    You should now have the sources correctly installed.
0113 
0114 Software requirements
0115 ---------------------
0116 
0117    Compiling and running the 6.x kernels requires up-to-date
0118    versions of various software packages.  Consult
0119    :ref:`Documentation/process/changes.rst <changes>` for the minimum version numbers
0120    required and how to get updates for these packages.  Beware that using
0121    excessively old versions of these packages can cause indirect
0122    errors that are very difficult to track down, so don't assume that
0123    you can just update packages when obvious problems arise during
0124    build or operation.
0125 
0126 Build directory for the kernel
0127 ------------------------------
0128 
0129    When compiling the kernel, all output files will per default be
0130    stored together with the kernel source code.
0131    Using the option ``make O=output/dir`` allows you to specify an alternate
0132    place for the output files (including .config).
0133    Example::
0134 
0135      kernel source code: /usr/src/linux-6.x
0136      build directory:    /home/name/build/kernel
0137 
0138    To configure and build the kernel, use::
0139 
0140      cd /usr/src/linux-6.x
0141      make O=/home/name/build/kernel menuconfig
0142      make O=/home/name/build/kernel
0143      sudo make O=/home/name/build/kernel modules_install install
0144 
0145    Please note: If the ``O=output/dir`` option is used, then it must be
0146    used for all invocations of make.
0147 
0148 Configuring the kernel
0149 ----------------------
0150 
0151    Do not skip this step even if you are only upgrading one minor
0152    version.  New configuration options are added in each release, and
0153    odd problems will turn up if the configuration files are not set up
0154    as expected.  If you want to carry your existing configuration to a
0155    new version with minimal work, use ``make oldconfig``, which will
0156    only ask you for the answers to new questions.
0157 
0158  - Alternative configuration commands are::
0159 
0160      "make config"      Plain text interface.
0161 
0162      "make menuconfig"  Text based color menus, radiolists & dialogs.
0163 
0164      "make nconfig"     Enhanced text based color menus.
0165 
0166      "make xconfig"     Qt based configuration tool.
0167 
0168      "make gconfig"     GTK+ based configuration tool.
0169 
0170      "make oldconfig"   Default all questions based on the contents of
0171                         your existing ./.config file and asking about
0172                         new config symbols.
0173 
0174      "make olddefconfig"
0175                         Like above, but sets new symbols to their default
0176                         values without prompting.
0177 
0178      "make defconfig"   Create a ./.config file by using the default
0179                         symbol values from either arch/$ARCH/defconfig
0180                         or arch/$ARCH/configs/${PLATFORM}_defconfig,
0181                         depending on the architecture.
0182 
0183      "make ${PLATFORM}_defconfig"
0184                         Create a ./.config file by using the default
0185                         symbol values from
0186                         arch/$ARCH/configs/${PLATFORM}_defconfig.
0187                         Use "make help" to get a list of all available
0188                         platforms of your architecture.
0189 
0190      "make allyesconfig"
0191                         Create a ./.config file by setting symbol
0192                         values to 'y' as much as possible.
0193 
0194      "make allmodconfig"
0195                         Create a ./.config file by setting symbol
0196                         values to 'm' as much as possible.
0197 
0198      "make allnoconfig" Create a ./.config file by setting symbol
0199                         values to 'n' as much as possible.
0200 
0201      "make randconfig"  Create a ./.config file by setting symbol
0202                         values to random values.
0203 
0204      "make localmodconfig" Create a config based on current config and
0205                            loaded modules (lsmod). Disables any module
0206                            option that is not needed for the loaded modules.
0207 
0208                            To create a localmodconfig for another machine,
0209                            store the lsmod of that machine into a file
0210                            and pass it in as a LSMOD parameter.
0211 
0212                            Also, you can preserve modules in certain folders
0213                            or kconfig files by specifying their paths in
0214                            parameter LMC_KEEP.
0215 
0216                    target$ lsmod > /tmp/mylsmod
0217                    target$ scp /tmp/mylsmod host:/tmp
0218 
0219                    host$ make LSMOD=/tmp/mylsmod \
0220                            LMC_KEEP="drivers/usb:drivers/gpu:fs" \
0221                            localmodconfig
0222 
0223                            The above also works when cross compiling.
0224 
0225      "make localyesconfig" Similar to localmodconfig, except it will convert
0226                            all module options to built in (=y) options. You can
0227                            also preserve modules by LMC_KEEP.
0228 
0229      "make kvm_guest.config"   Enable additional options for kvm guest kernel
0230                                support.
0231 
0232      "make xen.config"   Enable additional options for xen dom0 guest kernel
0233                          support.
0234 
0235      "make tinyconfig"  Configure the tiniest possible kernel.
0236 
0237    You can find more information on using the Linux kernel config tools
0238    in Documentation/kbuild/kconfig.rst.
0239 
0240  - NOTES on ``make config``:
0241 
0242     - Having unnecessary drivers will make the kernel bigger, and can
0243       under some circumstances lead to problems: probing for a
0244       nonexistent controller card may confuse your other controllers.
0245 
0246     - A kernel with math-emulation compiled in will still use the
0247       coprocessor if one is present: the math emulation will just
0248       never get used in that case.  The kernel will be slightly larger,
0249       but will work on different machines regardless of whether they
0250       have a math coprocessor or not.
0251 
0252     - The "kernel hacking" configuration details usually result in a
0253       bigger or slower kernel (or both), and can even make the kernel
0254       less stable by configuring some routines to actively try to
0255       break bad code to find kernel problems (kmalloc()).  Thus you
0256       should probably answer 'n' to the questions for "development",
0257       "experimental", or "debugging" features.
0258 
0259 Compiling the kernel
0260 --------------------
0261 
0262  - Make sure you have at least gcc 5.1 available.
0263    For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
0264 
0265    Please note that you can still run a.out user programs with this kernel.
0266 
0267  - Do a ``make`` to create a compressed kernel image. It is also
0268    possible to do ``make install`` if you have lilo installed to suit the
0269    kernel makefiles, but you may want to check your particular lilo setup first.
0270 
0271    To do the actual install, you have to be root, but none of the normal
0272    build should require that. Don't take the name of root in vain.
0273 
0274  - If you configured any of the parts of the kernel as ``modules``, you
0275    will also have to do ``make modules_install``.
0276 
0277  - Verbose kernel compile/build output:
0278 
0279    Normally, the kernel build system runs in a fairly quiet mode (but not
0280    totally silent).  However, sometimes you or other kernel developers need
0281    to see compile, link, or other commands exactly as they are executed.
0282    For this, use "verbose" build mode.  This is done by passing
0283    ``V=1`` to the ``make`` command, e.g.::
0284 
0285      make V=1 all
0286 
0287    To have the build system also tell the reason for the rebuild of each
0288    target, use ``V=2``.  The default is ``V=0``.
0289 
0290  - Keep a backup kernel handy in case something goes wrong.  This is
0291    especially true for the development releases, since each new release
0292    contains new code which has not been debugged.  Make sure you keep a
0293    backup of the modules corresponding to that kernel, as well.  If you
0294    are installing a new kernel with the same version number as your
0295    working kernel, make a backup of your modules directory before you
0296    do a ``make modules_install``.
0297 
0298    Alternatively, before compiling, use the kernel config option
0299    "LOCALVERSION" to append a unique suffix to the regular kernel version.
0300    LOCALVERSION can be set in the "General Setup" menu.
0301 
0302  - In order to boot your new kernel, you'll need to copy the kernel
0303    image (e.g. .../linux/arch/x86/boot/bzImage after compilation)
0304    to the place where your regular bootable kernel is found.
0305 
0306  - Booting a kernel directly from a floppy without the assistance of a
0307    bootloader such as LILO, is no longer supported.
0308 
0309    If you boot Linux from the hard drive, chances are you use LILO, which
0310    uses the kernel image as specified in the file /etc/lilo.conf.  The
0311    kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or
0312    /boot/bzImage.  To use the new kernel, save a copy of the old image
0313    and copy the new image over the old one.  Then, you MUST RERUN LILO
0314    to update the loading map! If you don't, you won't be able to boot
0315    the new kernel image.
0316 
0317    Reinstalling LILO is usually a matter of running /sbin/lilo.
0318    You may wish to edit /etc/lilo.conf to specify an entry for your
0319    old kernel image (say, /vmlinux.old) in case the new one does not
0320    work.  See the LILO docs for more information.
0321 
0322    After reinstalling LILO, you should be all set.  Shutdown the system,
0323    reboot, and enjoy!
0324 
0325    If you ever need to change the default root device, video mode,
0326    etc. in the kernel image, use your bootloader's boot options
0327    where appropriate.  No need to recompile the kernel to change
0328    these parameters.
0329 
0330  - Reboot with the new kernel and enjoy.
0331 
0332 If something goes wrong
0333 -----------------------
0334 
0335  - If you have problems that seem to be due to kernel bugs, please check
0336    the file MAINTAINERS to see if there is a particular person associated
0337    with the part of the kernel that you are having trouble with. If there
0338    isn't anyone listed there, then the second best thing is to mail
0339    them to me (torvalds@linux-foundation.org), and possibly to any other
0340    relevant mailing-list or to the newsgroup.
0341 
0342  - In all bug-reports, *please* tell what kernel you are talking about,
0343    how to duplicate the problem, and what your setup is (use your common
0344    sense).  If the problem is new, tell me so, and if the problem is
0345    old, please try to tell me when you first noticed it.
0346 
0347  - If the bug results in a message like::
0348 
0349      unable to handle kernel paging request at address C0000010
0350      Oops: 0002
0351      EIP:   0010:XXXXXXXX
0352      eax: xxxxxxxx   ebx: xxxxxxxx   ecx: xxxxxxxx   edx: xxxxxxxx
0353      esi: xxxxxxxx   edi: xxxxxxxx   ebp: xxxxxxxx
0354      ds: xxxx  es: xxxx  fs: xxxx  gs: xxxx
0355      Pid: xx, process nr: xx
0356      xx xx xx xx xx xx xx xx xx xx
0357 
0358    or similar kernel debugging information on your screen or in your
0359    system log, please duplicate it *exactly*.  The dump may look
0360    incomprehensible to you, but it does contain information that may
0361    help debugging the problem.  The text above the dump is also
0362    important: it tells something about why the kernel dumped code (in
0363    the above example, it's due to a bad kernel pointer). More information
0364    on making sense of the dump is in Documentation/admin-guide/bug-hunting.rst
0365 
0366  - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump
0367    as is, otherwise you will have to use the ``ksymoops`` program to make
0368    sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred).
0369    This utility can be downloaded from
0370    https://www.kernel.org/pub/linux/utils/kernel/ksymoops/ .
0371    Alternatively, you can do the dump lookup by hand:
0372 
0373  - In debugging dumps like the above, it helps enormously if you can
0374    look up what the EIP value means.  The hex value as such doesn't help
0375    me or anybody else very much: it will depend on your particular
0376    kernel setup.  What you should do is take the hex value from the EIP
0377    line (ignore the ``0010:``), and look it up in the kernel namelist to
0378    see which kernel function contains the offending address.
0379 
0380    To find out the kernel function name, you'll need to find the system
0381    binary associated with the kernel that exhibited the symptom.  This is
0382    the file 'linux/vmlinux'.  To extract the namelist and match it against
0383    the EIP from the kernel crash, do::
0384 
0385      nm vmlinux | sort | less
0386 
0387    This will give you a list of kernel addresses sorted in ascending
0388    order, from which it is simple to find the function that contains the
0389    offending address.  Note that the address given by the kernel
0390    debugging messages will not necessarily match exactly with the
0391    function addresses (in fact, that is very unlikely), so you can't
0392    just 'grep' the list: the list will, however, give you the starting
0393    point of each kernel function, so by looking for the function that
0394    has a starting address lower than the one you are searching for but
0395    is followed by a function with a higher address you will find the one
0396    you want.  In fact, it may be a good idea to include a bit of
0397    "context" in your problem report, giving a few lines around the
0398    interesting one.
0399 
0400    If you for some reason cannot do the above (you have a pre-compiled
0401    kernel image or similar), telling me as much about your setup as
0402    possible will help.  Please read
0403    'Documentation/admin-guide/reporting-issues.rst' for details.
0404 
0405  - Alternatively, you can use gdb on a running kernel. (read-only; i.e. you
0406    cannot change values or set break points.) To do this, first compile the
0407    kernel with -g; edit arch/x86/Makefile appropriately, then do a ``make
0408    clean``. You'll also need to enable CONFIG_PROC_FS (via ``make config``).
0409 
0410    After you've rebooted with the new kernel, do ``gdb vmlinux /proc/kcore``.
0411    You can now use all the usual gdb commands. The command to look up the
0412    point where your system crashed is ``l *0xXXXXXXXX``. (Replace the XXXes
0413    with the EIP value.)
0414 
0415    gdb'ing a non-running kernel currently fails because ``gdb`` (wrongly)
0416    disregards the starting offset for which the kernel is compiled.