A mirror of the official Linux kernel repository just in case
Go to file
2024-10-01 17:43:19 +05:30
arch x86: kvm: fix build error 2024-09-29 14:47:33 -07:00
block for-6.12/block-20240925 2024-09-25 14:56:40 -07:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
crypto KEYS: prevent NULL pointer dereference in find_asymmetric_key() 2024-09-20 19:49:49 +03:00
Documentation vfs-6.12-rc2.fixes 2024-09-30 10:59:44 -07:00
drivers mhu-v3, omap2+ : fix kconfig dependencies 2024-09-29 09:53:04 -07:00
fs vfs-6.12-rc2.fixes 2024-09-30 10:59:44 -07:00
include vfs-6.12-rc2.fixes 2024-09-30 10:59:44 -07:00
init Rust changes for v6.12 2024-09-25 10:25:40 -07:00
io_uring for-6.12/io_uring-20240922 2024-09-24 11:11:38 -07:00
ipc struct fd layout change (and conversion to accessor helpers) 2024-09-23 09:35:36 -07:00
kernel sched_ext: A second set of fixes for v6.12-rc1 2024-09-30 12:58:17 -07:00
lib bitmap-for-6.12 2024-09-27 12:10:45 -07:00
LICENSES LICENSES: add 0BSD license text 2024-09-01 20:43:24 -07:00
mm 19 hotfixes. 13 are cc:stable. 2024-09-27 10:27:22 -07:00
net Three CephFS fixes from Xiubo and Luis and a bunch of assorted 2024-09-28 08:40:36 -07:00
rust Rust changes for v6.12 2024-09-25 10:25:40 -07:00
samples [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
scripts Reduce Coccinelle choices in string_choices.cocci 2024-09-28 21:33:11 +02:00
security One bugfix patch, one preparation patch, and one conversion patch. 2024-09-27 12:03:48 -07:00
sound [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
tools sched_ext: A second set of fixes for v6.12-rc1 2024-09-30 12:58:17 -07:00
usr initramfs: shorten cmd_initfs in usr/Makefile 2024-07-16 01:07:52 +09:00
virt x86: 2024-09-28 09:20:14 -07:00
.clang-format clang-format: Update with v6.11-rc1's for_each macro list 2024-08-02 13:20:31 +02:00
.cocciconfig
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore Add Jeff Kirsher to .get_maintainer.ignore 2024-03-08 11:36:54 +00:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore Kbuild updates for v6.12 2024-09-24 13:02:06 -07:00
.mailmap Summary 2024-09-24 11:08:40 -07:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Mark powerpc spufs as orphaned 2024-08-19 21:27:56 +10:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Modules changes for v6.12-rc1 2024-09-28 09:06:15 -07:00
Makefile Linux 6.12-rc1 2024-09-29 15:06:19 -07:00
README Update README 2024-10-01 17:43:19 +05:30

# Linux Kernel Source Tree - Official Documentation

Welcome to the official **Linux Kernel Source Tree** repository. This repository contains the source code for the Linux kernel, which powers millions of devices across the world, from personal computers and servers to smartphones, embedded systems, and more. The Linux kernel is one of the most influential and widely-used open-source projects in history.

## Table of Contents

- [Introduction](#introduction)
- [License](#license)
- [Repository Layout](#repository-layout)
- [Building the Kernel](#building-the-kernel)
- [Running the Kernel](#running-the-kernel)
- [Contributing](#contributing)
- [Kernel Documentation](#kernel-documentation)
- [Community & Support](#community-support)
- [Security Disclosures](#security-disclosures)
- [Maintainers](#maintainers)
- [FAQ](#faq)

## Introduction

The **Linux Kernel** is a monolithic Unix-like operating system kernel initially created by **Linus Torvalds** in 1991. It serves as the core component of the Linux operating system, handling process management, memory management, device drivers, and system calls. The kernel operates on a vast range of devices, including mainframes, supercomputers, mobile phones, desktops, and embedded systems.

This repository contains the official source tree for the Linux kernel, updated regularly by a global community of contributors, including individuals, organizations, and companies. Linux development is open to anyone, and contributions are welcome.

## License

The Linux kernel is licensed under the **GNU General Public License version 2 (GPLv2)**. This license allows you to freely use, modify, and distribute the software, provided that you release any modifications under the same license. Some parts of the kernel may be covered by other licenses, but they are all compatible with GPLv2.

For more detailed licensing information, see the `COPYING` file in the root directory.

## Repository Layout

The source tree is organized into various directories. Here's an overview of the key directories and their purposes:

- **arch/**: Contains architecture-specific code (e.g., `x86`, `arm`, `riscv`, etc.).
- **block/**: Block layer and block device drivers.
- **drivers/**: Hardware drivers for various devices (e.g., networking, sound, graphics, storage).
- **fs/**: File system code, including ext4, btrfs, xfs, and others.
- **include/**: Kernel header files.
- **init/**: System and kernel initialization code.
- **ipc/**: Inter-process communication (IPC) facilities like semaphores and message queues.
- **kernel/**: Core kernel code, including process scheduling and system calls.
- **lib/**: Generic libraries used throughout the kernel.
- **mm/**: Memory management, paging, and virtual memory code.
- **net/**: Networking stack code (TCP/IP, sockets, etc.).
- **scripts/**: Helper scripts for building and maintaining the kernel.
- **security/**: Security-related code, such as SELinux, AppArmor, and kernel security modules.
- **sound/**: Sound subsystem and audio drivers.
- **tools/**: Development and diagnostic tools.
- **usr/**: Initial RAM filesystem (initramfs) code.
- **Documentation/**: Contains extensive documentation for developers and users.

## Building the Kernel

To build the kernel from source, follow the steps below. These instructions assume you're working on a Linux-based system with a properly set up development environment.

### Prerequisites

Ensure you have the necessary tools installed:

- **GCC (GNU Compiler Collection)**
- **binutils**
- **make**
- **ncurses (for menu configuration)**
- **bison**
- **flex**
- **libssl-dev**
- **libelf-dev**

On Debian/Ubuntu:
```bash
sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev
```

On Fedora/RHEL:
```bash
sudo dnf groupinstall "Development Tools"
sudo dnf install ncurses-devel bison flex elfutils-libelf-devel openssl-devel
```

### Cloning the Repository

Clone the official Linux kernel source tree:

```bash
git clone https://github.com/torvalds/linux.git
cd linux
```

### Configuring the Kernel

Before building the kernel, you need to configure it. You can either use an existing configuration or customize your own:

1. **Default Configuration**:
   Use the default configuration for your system architecture:
   ```bash
   make defconfig
   ```

2. **Custom Configuration**:
   Customize the kernel configuration using a menu-based interface:
   ```bash
   make menuconfig
   ```

### Building the Kernel

Once the kernel is configured, build it:

```bash
make -j$(nproc)
```

The `-j$(nproc)` flag tells `make` to use all available processor cores to speed up the build process.

### Installing the Kernel

After building the kernel, install the modules and the kernel image:

```bash
sudo make modules_install
sudo make install
```

### Updating the Bootloader

Ensure your bootloader is updated to recognize the new kernel. For systems using GRUB:

```bash
sudo update-grub
```

### Rebooting into the New Kernel

Reboot your system to load the new kernel:

```bash
sudo reboot
```

After rebooting, you can confirm that the system is running the new kernel with:

```bash
uname -r
```

## Running the Kernel

Running a custom-built kernel is straightforward once installed. However, make sure to test it thoroughly before deploying it on production systems. You can boot the new kernel by simply rebooting your machine after following the installation steps above.

## Contributing

The Linux kernel is a community-driven project. Contributions are welcome from everyone, whether you're fixing a bug, adding new features, or improving documentation. Before contributing, please familiarize yourself with the following resources:

1. **Coding Guidelines**: Follow the coding style described in `Documentation/process/coding-style.rst`.
2. **Submitting Patches**: Read `Documentation/process/submitting-patches.rst` to understand how to submit patches.
3. **Maintainers**: Check the `MAINTAINERS` file to determine the right people and mailing lists for your changes.
4. **Patchwork**: Review active patches on `patchwork.kernel.org`.

To submit a patch, follow these steps:

1. Fork the repository.
2. Create a branch for your changes.
3. Make your changes following the coding guidelines.
4. Test your changes thoroughly.
5. Submit your patch via email to the relevant maintainers and the appropriate mailing list (e.g., `linux-kernel@vger.kernel.org`).

## Kernel Documentation

The kernel source tree includes extensive documentation for both new and experienced developers. You can find it in the `Documentation/` directory.

Some important documentation files include:

- **Coding Style**: `Documentation/process/coding-style.rst`
- **Submitting Patches**: `Documentation/process/submitting-patches.rst`
- **Subsystem Documentation**: `Documentation/driver-api/` and `Documentation/networking/`
- **Kernel Parameters**: `Documentation/admin-guide/kernel-parameters.txt`
- **Developer Tools**: `Documentation/dev-tools/`

You can also access the latest kernel documentation online at [https://www.kernel.org/doc/](https://www.kernel.org/doc/).

## Community & Support

The Linux kernel community is vast and supportive. Here are some ways to engage with the community:

- **Mailing Lists**: The primary way to discuss kernel development. Subscribe at [https://vger.kernel.org/vger-lists.html#linux-kernel](https://vger.kernel.org/vger-lists.html#linux-kernel).
- **IRC**: Join the `#kernelnewbies` channel on Libera Chat for real-time discussions and support.
- **Bug Tracker**: Report kernel bugs at [https://bugzilla.kernel.org/](https://bugzilla.kernel.org/).
- **Conferences**: Attend events like the Linux Plumbers Conference and Kernel Summit for face-to-face interaction.

## Security Disclosures

If you discover a security vulnerability in the Linux kernel, please follow the responsible disclosure process. Report security issues to the Linux kernel security team as outlined in `Documentation/admin-guide/security-bugs.rst`.

## Maintainers

The Linux kernel is maintained by a large group of individuals, including Linus Torvalds and subsystem maintainers across various architectures, drivers, and features. You can find a list of maintainers and their responsibilities in the `MAINTAINERS` file in the root directory.

## FAQ

**Q: What is the Linux Kernel?**
A: The Linux kernel is the core component of the Linux operating system, managing hardware resources and providing services to applications.

**Q: How do I contribute to the Linux kernel?**
A: Start by reading `Documentation/process/submitting-patches.rst` to learn how to submit patches. Engage with the community on mailing lists and submit changes via email.

**Q: Can I build and run the kernel on my laptop or desktop?**
A: Yes, the kernel can be built and run on most architectures, including x86, ARM, and others. Follow the instructions in the "Building the Kernel" section.

**Q: How often are new kernel versions released?**
A: The kernel follows a regular release cycle, with new stable releases every 2-3 months.

## Contact

For general questions or further information, visit [https://www.kernel.org](https://www.kernel.org). You can also reach out to the community on the Linux Kernel Mailing List (LKML).

Thank you for your interest in the Linux kernel!
```

This README is comprehensive, includes key information for developers, maintainers,

 and newcomers, and follows a clear structure. It provides instructions on building and contributing to the Linux kernel and includes details on community engagement, security practices, and more.