Back to home page

LXR

 
 

    


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