# custom\_kernel

## 源码

使用 `git clone` 下载 Linux Kernel 源码，使用 `git am` 打上相关的 patch。

## 编译

```bash
## enter linux kernel source code root dir
## change the EXTRAVERSION in the Makefile to something you'll recognize later.

## configure
$ cp /boot/config-`uname -r`* .config
$ make oldconfig
$ make menuconfig
## compile
$ make bzImage
$ make modules
```

## 安装

```bash
## (opts) install by make
$ sudo make modules_install
$ sudo make install
## (opts) install by deb
$ make bindeb-pkg
$ sudo dpkg -i *.deb

$ sudo reboot
```

## Cleaning up

```bash
$ sudo su - root

$ rm -f /boot/config-*test* /boot/initramfs-*test* /boot/vmlinuz-*test* /boot/System.map-*test*
$ rm -rf /lib/modules/*test*
$ update-grub

$ reboot
```

## tips

将 BIOS Secure Boot 功能进行关闭，方便进行内核功能验证


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vernon2gb.gitbook.io/notes/linuxsystem/ubuntu/custom_kernel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
