Docs » The Linux kernel user’s and administrator’s guide » Linux kernel release 5.x ＜ http://kernel.org/ ＞
Compiling the kernel
Make sure you have at least gcc 4.6 available. For more information, refer to Documentation/process/changes.rst. Please note that you can still run a.out user programs with this kernel.
Make sure you have at least gcc 4.6 available. See Documentation / process / changes.rst. For more information. Note that this kernel can run the user program ./a.out.
Do a make to create a compressed kernel image. It is also possible to do make install if you have lilo installed to suit the kernel makefiles, but you may want to check your particular lilo setup first.
To do the actual install, you have to be root, but none of the normal build should require that. Don’t take the name of root in vain.
Run make to create a compressed kernel image. If the kernel makefile is started manually, you can install it to lilo with make install, but it is recommended to check the specific lilo setup first.
You must be root when you actually install. This is not needed when building. Don't waste the root name. Build as a sect user and just install as root.
If you configured any of the parts of the kernel as modules, you will also have to do make modules_install.
If you have set a part of the kernel as a module, do modules_install.
Verbose kernel compile/build output:
Normally, the kernel build system runs in a fairly quiet mode (but not totally silent). However, sometimes you or other kernel developers need to see compile, link, or other commands exactly as they are executed. For this, use “verbose” build mode. This is done by passing V=1 to the make command, e.g.:
make V=1 all
To have the build system also tell the reason for the rebuild of each target, use V=2. The default is V=0.
Refinement of kernel compile / build output.
Normally, the kernel build system operates in a very quiet mode (although it is not completely silent). However, sometimes you or the kernel developer want to check for compile, link or any other command you need. For that, use "verbose" build mode. This should pass "V = 1" to the make command: for example
make V=1 all
Use V = 2 to let the build system also tell you the reason for rebuilding each target. The default is V = 0.
Keep a backup kernel handy in case something goes wrong. This is especially true for the development releases, since each new release contains new code which has not been debugged. Make sure you keep a backup of the modules corresponding to that kernel, as well. If you are installing a new kernel with the same version number as your working kernel, make a backup of your modules directory before you do a make modules_install.
Alternatively, before compiling, use the kernel config option “LOCALVERSION” to append a unique suffix to the regular kernel version. LOCALVERSION can be set in the “General Setup” menu.
If something goes wrong, keep the backup kernel. This is especially useful if your new code contains something that you haven't been able to debug, such as a development release. Make a backup of the module corresponding to that kernel as well. If the new kernel is trying to install the same version as the kernel you are working on, make a backup of the module directory before running make modules_install.
In order to boot your new kernel, you’ll need to copy the kernel image (e.g. …/linux/arch/x86/boot/bzImage after compilation) to the place where your regular bootable kernel is found.
To boot a new kernel, copy the kernel image (eg linux / arch / x86 / boot / bzImage generated after compilation) to a location where you can usually find the bootable kernel.
Booting a kernel directly from a floppy without the assistance of a bootloader such as LILO, is no longer supported.
Booting the kernel directly from a floppy without the assistance of a boot loader such as LILO is no longer supported.
If you boot Linux from the hard drive, chances are you use LILO, which uses the kernel image as specified in the file /etc/lilo.conf. The kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or /boot/bzImage. To use the new kernel, save a copy of the old image and copy the new image over the old one. Then, you MUST RERUN LILO to update the loading map! If you don’t, you won’t be able to boot the new kernel image.
If you want to boot Linux from a hard driver, you can use LILO. This is where the kernel image is written in /etc/lilo.conf. The kernel image file is usually / vmlinuz, / boot / vmlinuz, / baimage or / boot / bzImage. To use the new kernel, make a copy of the old image and overwrite the old one with the new image. Then rerun LILO! !! Please update the map. If you don't do that, you won't be able to launch it with the new kernel image.
Reinstalling LILO is usually a matter of running /sbin/lilo. You may wish to edit /etc/lilo.conf to specify an entry for your old kernel image (say, /vmlinux.old) in case the new one does not work. See the LILO docs for more information.
Reinstalling LILO is usually by running / sbin / lilo. By editing /etc/lilo.conf, you can also specify the entry of the old kernel image in case the new kernel image does not start (/vmlinux.old). See LILO docs for more information.
After reinstalling LILO, you should be all set. Shutdown the system, reboot, and enjoy!
After reinstalling LILO, you're ready to go. Shut down your system, restart it and have fun!
If you ever need to change the default root device, video mode, ramdisk size, etc. in the kernel image, use the rdev program (or alternatively the LILO boot options when appropriate). No need to recompile the kernel to change these parameters.
If you need to change the default root device, video mode, ramdisk size, etc. for the kernel image, use the rdev program (or LILO boot oprion if needed). You do not need to recompile your kernel to change these parameters.
Reboot with the new kernel and enjoy.
Reboot with the new kernel and have fun!
Originally, it is a part of the Linux Kernel source code, so it will be treated as GPLv2 (recognition that it should be).
The following describes the license of the Linux kernel source code (GPLv2), how to properly mark the license of individual files in the source tree, as well as links to the full license text.