brintos

brintos / linux-shallow public Read only

0
0
Text · 15.4 KiB · f2bebff Raw
361 lines · plain
1.. _readme:2 3Linux kernel release 6.x <http://kernel.org/>4=============================================5 6These are the release notes for Linux version 6.  Read them carefully,7as they tell you what this is all about, explain how to install the8kernel, and what to do if something goes wrong.9 10What is Linux?11--------------12 13  Linux is a clone of the operating system Unix, written from scratch by14  Linus Torvalds with assistance from a loosely-knit team of hackers across15  the Net. It aims towards POSIX and Single UNIX Specification compliance.16 17  It has all the features you would expect in a modern fully-fledged Unix,18  including true multitasking, virtual memory, shared libraries, demand19  loading, shared copy-on-write executables, proper memory management,20  and multistack networking including IPv4 and IPv6.21 22  It is distributed under the GNU General Public License v2 - see the23  accompanying COPYING file for more details.24 25On what hardware does it run?26-----------------------------27 28  Although originally developed first for 32-bit x86-based PCs (386 or higher),29  today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and30  UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell,31  IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64 Xtensa, and32  ARC architectures.33 34  Linux is easily portable to most general-purpose 32- or 64-bit architectures35  as long as they have a paged memory management unit (PMMU) and a port of the36  GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has37  also been ported to a number of architectures without a PMMU, although38  functionality is then obviously somewhat limited.39  Linux has also been ported to itself. You can now run the kernel as a40  userspace application - this is called UserMode Linux (UML).41 42Documentation43-------------44 45 - There is a lot of documentation available both in electronic form on46   the Internet and in books, both Linux-specific and pertaining to47   general UNIX questions.  I'd recommend looking into the documentation48   subdirectories on any Linux FTP site for the LDP (Linux Documentation49   Project) books.  This README is not meant to be documentation on the50   system: there are much better sources available.51 52 - There are various README files in the Documentation/ subdirectory:53   these typically contain kernel-specific installation notes for some54   drivers for example. Please read the55   :ref:`Documentation/process/changes.rst <changes>` file, as it56   contains information about the problems, which may result by upgrading57   your kernel.58 59Installing the kernel source60----------------------------61 62 - If you install the full sources, put the kernel tarball in a63   directory where you have permissions (e.g. your home directory) and64   unpack it::65 66     xz -cd linux-6.x.tar.xz | tar xvf -67 68   Replace "X" with the version number of the latest kernel.69 70   Do NOT use the /usr/src/linux area! This area has a (usually71   incomplete) set of kernel headers that are used by the library header72   files.  They should match the library, and not get messed up by73   whatever the kernel-du-jour happens to be.74 75 - You can also upgrade between 6.x releases by patching.  Patches are76   distributed in the xz format.  To install by patching, get all the77   newer patch files, enter the top level directory of the kernel source78   (linux-6.x) and execute::79 80     xz -cd ../patch-6.x.xz | patch -p181 82   Replace "x" for all versions bigger than the version "x" of your current83   source tree, **in_order**, and you should be ok.  You may want to remove84   the backup files (some-file-name~ or some-file-name.orig), and make sure85   that there are no failed patches (some-file-name# or some-file-name.rej).86   If there are, either you or I have made a mistake.87 88   Unlike patches for the 6.x kernels, patches for the 6.x.y kernels89   (also known as the -stable kernels) are not incremental but instead apply90   directly to the base 6.x kernel.  For example, if your base kernel is 6.091   and you want to apply the 6.0.3 patch, you must not first apply the 6.0.192   and 6.0.2 patches. Similarly, if you are running kernel version 6.0.2 and93   want to jump to 6.0.3, you must first reverse the 6.0.2 patch (that is,94   patch -R) **before** applying the 6.0.3 patch. You can read more on this in95   :ref:`Documentation/process/applying-patches.rst <applying_patches>`.96 97   Alternatively, the script patch-kernel can be used to automate this98   process.  It determines the current kernel version and applies any99   patches found::100 101     linux/scripts/patch-kernel linux102 103   The first argument in the command above is the location of the104   kernel source.  Patches are applied from the current directory, but105   an alternative directory can be specified as the second argument.106 107 - Make sure you have no stale .o files and dependencies lying around::108 109     cd linux110     make mrproper111 112   You should now have the sources correctly installed.113 114Software requirements115---------------------116 117   Compiling and running the 6.x kernels requires up-to-date118   versions of various software packages.  Consult119   :ref:`Documentation/process/changes.rst <changes>` for the minimum version numbers120   required and how to get updates for these packages.  Beware that using121   excessively old versions of these packages can cause indirect122   errors that are very difficult to track down, so don't assume that123   you can just update packages when obvious problems arise during124   build or operation.125 126Build directory for the kernel127------------------------------128 129   When compiling the kernel, all output files will per default be130   stored together with the kernel source code.131   Using the option ``make O=output/dir`` allows you to specify an alternate132   place for the output files (including .config).133   Example::134 135     kernel source code: /usr/src/linux-6.x136     build directory:    /home/name/build/kernel137 138   To configure and build the kernel, use::139 140     cd /usr/src/linux-6.x141     make O=/home/name/build/kernel menuconfig142     make O=/home/name/build/kernel143     sudo make O=/home/name/build/kernel modules_install install144 145   Please note: If the ``O=output/dir`` option is used, then it must be146   used for all invocations of make.147 148Configuring the kernel149----------------------150 151   Do not skip this step even if you are only upgrading one minor152   version.  New configuration options are added in each release, and153   odd problems will turn up if the configuration files are not set up154   as expected.  If you want to carry your existing configuration to a155   new version with minimal work, use ``make oldconfig``, which will156   only ask you for the answers to new questions.157 158 - Alternative configuration commands are::159 160     "make config"      Plain text interface.161 162     "make menuconfig"  Text based color menus, radiolists & dialogs.163 164     "make nconfig"     Enhanced text based color menus.165 166     "make xconfig"     Qt based configuration tool.167 168     "make gconfig"     GTK+ based configuration tool.169 170     "make oldconfig"   Default all questions based on the contents of171                        your existing ./.config file and asking about172                        new config symbols.173 174     "make olddefconfig"175                        Like above, but sets new symbols to their default176                        values without prompting.177 178     "make defconfig"   Create a ./.config file by using the default179                        symbol values from either arch/$ARCH/defconfig180                        or arch/$ARCH/configs/${PLATFORM}_defconfig,181                        depending on the architecture.182 183     "make ${PLATFORM}_defconfig"184                        Create a ./.config file by using the default185                        symbol values from186                        arch/$ARCH/configs/${PLATFORM}_defconfig.187                        Use "make help" to get a list of all available188                        platforms of your architecture.189 190     "make allyesconfig"191                        Create a ./.config file by setting symbol192                        values to 'y' as much as possible.193 194     "make allmodconfig"195                        Create a ./.config file by setting symbol196                        values to 'm' as much as possible.197 198     "make allnoconfig" Create a ./.config file by setting symbol199                        values to 'n' as much as possible.200 201     "make randconfig"  Create a ./.config file by setting symbol202                        values to random values.203 204     "make localmodconfig" Create a config based on current config and205                           loaded modules (lsmod). Disables any module206                           option that is not needed for the loaded modules.207 208                           To create a localmodconfig for another machine,209                           store the lsmod of that machine into a file210                           and pass it in as a LSMOD parameter.211 212                           Also, you can preserve modules in certain folders213                           or kconfig files by specifying their paths in214                           parameter LMC_KEEP.215 216                   target$ lsmod > /tmp/mylsmod217                   target$ scp /tmp/mylsmod host:/tmp218 219                   host$ make LSMOD=/tmp/mylsmod \220                           LMC_KEEP="drivers/usb:drivers/gpu:fs" \221                           localmodconfig222 223                           The above also works when cross compiling.224 225     "make localyesconfig" Similar to localmodconfig, except it will convert226                           all module options to built in (=y) options. You can227                           also preserve modules by LMC_KEEP.228 229     "make kvm_guest.config"   Enable additional options for kvm guest kernel230                               support.231 232     "make xen.config"   Enable additional options for xen dom0 guest kernel233                         support.234 235     "make tinyconfig"  Configure the tiniest possible kernel.236 237   You can find more information on using the Linux kernel config tools238   in Documentation/kbuild/kconfig.rst.239 240 - NOTES on ``make config``:241 242    - Having unnecessary drivers will make the kernel bigger, and can243      under some circumstances lead to problems: probing for a244      nonexistent controller card may confuse your other controllers.245 246    - A kernel with math-emulation compiled in will still use the247      coprocessor if one is present: the math emulation will just248      never get used in that case.  The kernel will be slightly larger,249      but will work on different machines regardless of whether they250      have a math coprocessor or not.251 252    - The "kernel hacking" configuration details usually result in a253      bigger or slower kernel (or both), and can even make the kernel254      less stable by configuring some routines to actively try to255      break bad code to find kernel problems (kmalloc()).  Thus you256      should probably answer 'n' to the questions for "development",257      "experimental", or "debugging" features.258 259Compiling the kernel260--------------------261 262 - Make sure you have at least gcc 5.1 available.263   For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.264 265 - Do a ``make`` to create a compressed kernel image. It is also possible to do266   ``make install`` if you have lilo installed or if your distribution has an267   install script recognised by the kernel's installer. Most popular268   distributions will have a recognized install script. You may want to269   check your distribution's setup first.270 271   To do the actual install, you have to be root, but none of the normal272   build should require that. Don't take the name of root in vain.273 274 - If you configured any of the parts of the kernel as ``modules``, you275   will also have to do ``make modules_install``.276 277 - Verbose kernel compile/build output:278 279   Normally, the kernel build system runs in a fairly quiet mode (but not280   totally silent).  However, sometimes you or other kernel developers need281   to see compile, link, or other commands exactly as they are executed.282   For this, use "verbose" build mode.  This is done by passing283   ``V=1`` to the ``make`` command, e.g.::284 285     make V=1 all286 287   To have the build system also tell the reason for the rebuild of each288   target, use ``V=2``.  The default is ``V=0``.289 290 - Keep a backup kernel handy in case something goes wrong.  This is291   especially true for the development releases, since each new release292   contains new code which has not been debugged.  Make sure you keep a293   backup of the modules corresponding to that kernel, as well.  If you294   are installing a new kernel with the same version number as your295   working kernel, make a backup of your modules directory before you296   do a ``make modules_install``.297 298   Alternatively, before compiling, use the kernel config option299   "LOCALVERSION" to append a unique suffix to the regular kernel version.300   LOCALVERSION can be set in the "General Setup" menu.301 302 - In order to boot your new kernel, you'll need to copy the kernel303   image (e.g. .../linux/arch/x86/boot/bzImage after compilation)304   to the place where your regular bootable kernel is found.305 306 - Booting a kernel directly from a storage device without the assistance307   of a bootloader such as LILO or GRUB, is no longer supported in BIOS308   (non-EFI systems). On UEFI/EFI systems, however, you can use EFISTUB309   which allows the motherboard to boot directly to the kernel.310   On modern workstations and desktops, it's generally recommended to use a311   bootloader as difficulties can arise with multiple kernels and secure boot.312   For more details on EFISTUB,313   see "Documentation/admin-guide/efi-stub.rst".314 315 - It's important to note that as of 2016 LILO (LInux LOader) is no longer in316   active development, though as it was extremely popular, it often comes up317   in documentation. Popular alternatives include GRUB2, rEFInd, Syslinux,318   systemd-boot, or EFISTUB. For various reasons, it's not recommended to use319   software that's no longer in active development.320 321 - Chances are your distribution includes an install script and running322   ``make install`` will be all that's needed. Should that not be the case323   you'll have to identify your bootloader and reference its documentation or324   configure your EFI.325 326Legacy LILO Instructions327------------------------328 329 330 - If you use LILO the kernel images are specified in the file /etc/lilo.conf.331   The kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or332   /boot/bzImage. To use the new kernel, save a copy of the old image and copy333   the new image over the old one. Then, you MUST RERUN LILO to update the334   loading map! If you don't, you won't be able to boot the new kernel image.335 336 - Reinstalling LILO is usually a matter of running /sbin/lilo. You may wish337   to edit /etc/lilo.conf to specify an entry for your old kernel image338   (say, /vmlinux.old) in case the new one does not work. See the LILO docs339   for more information.340 341 - After reinstalling LILO, you should be all set. Shutdown the system,342   reboot, and enjoy!343 344 - If you ever need to change the default root device, video mode, etc. in the345   kernel image, use your bootloader's boot options where appropriate. No need346   to recompile the kernel to change these parameters.347 348 - Reboot with the new kernel and enjoy.349 350 351If something goes wrong352-----------------------353 354If you have problems that seem to be due to kernel bugs, please follow the355instructions at 'Documentation/admin-guide/reporting-issues.rst'.356 357Hints on understanding kernel bug reports are in358'Documentation/admin-guide/bug-hunting.rst'. More on debugging the kernel359with gdb is in 'Documentation/dev-tools/gdb-kernel-debugging.rst' and360'Documentation/dev-tools/kgdb.rst'.361