基于完整发行版搭建内核验证环境

0x01 虚拟机(VM)安装及启动 1. 选择一个发行版,下载其安装镜像 选择格式为 .iso 的安装镜像进行下载。 2. 制作根文件系统(rootfs)镜像 总体思路:启动一个 QEMU 虚拟机,以 rootfs 镜像文件为硬盘,以安装镜像 iso 文件为光盘。设置虚拟机从光盘启动,将系统安装至硬盘。 1# create an empty rootfs image file 2qemu-img create -f qcow2 rootfs.qcow2 128G 3 4# boot from CD-ROM, so that OS can be installed into the rootfs image …

向 Linux 内核社区提交补丁的流程

制作补丁 下载代码, 如 linux-next 仓 : 1git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 编辑文件,git diff 查看修改的内容。 添加文件到工作区: 1git add <file> 生成 commit(-s 添加 Signed-off-by): 1git commit -s 编写 Commit Message 的注意事项 补丁的标题要合适,可以使用 git log 参考已有补丁的标题;标题要反映补丁实际修改,避免太抽象或空乏。 Commit Message 要写清楚问题,根因分析,以及解决方 …