1. 编译安装内核准备:
(1) 准备好开发环境
(2) 获取目标主机上硬件设备的相关信息
(3) 获取目标主机系统功能的相关信息,例如:需要启用相应的文件系统
(4) 获取内核源代码包, www.kernel.org
2. 编译准备
红帽没有安装NTFS文件系统,现在编译安装添加这一功能
将U盘的FAT
挂载U盘
编译内核,让它支持NTFS格式
[root@c7-147 init.d]#head /boot/config-3.10.0-327.el7.x86_64
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.10.0-327.el7.x86_64 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
[root@centos8 ~]#yum -y install gcc make ncurses-devel flex bison openssl-devel elfutils-libelf-devel
[root@centos8 ~]#tar xf linux-5.6.12.tar.xz -C /usr/local/src
[root@centos8 ~]#cd /usr/local/src
[root@centos8 ~]#ln -sv linux-5.6.12 linux
[root@centos8 ~]#cd /usr/src/linux
[root@centos8 linux]#cp /boot/config-$(uname -r) ./.config
[root@centos8 linux]#vim .config
#修改下面两行,CentOS7无需修改
#CONFIG_MODULE_SIG is not set CONFIG_SYSTEM_TRUSTED_KEYS=""
[root@centos8 linux]#make help
[root@centos8 linux]#make menuconfig
[root@centos8 linux]#time make -j 2
#或者两步实现:make -j 2 bzImage ; make -j 2 modules
......
LD [M] sound/xen/snd_xen_front.ko LD [M] virt/lib/irqbypass.ko
real 82m52.128s
user 133m37.982s
sys 25m46.311s
[root@centos8 linux]#pwd
/usr/local/src/linux
[root@centos8 linux]#du -sh .
15G .
[root@centos8 linux]#make modules_install
[root@centos8 linux]#ls /lib/modules
4.18.0-147.el8.x86_64 5.6.12-wanglinux-6.6.6
[root@centos8 linux]#du -sh /lib/modules/5.6.12-wanglinux-6.6.6/
3.5G /lib/modules/5.6.12-wanglinux-6.6.6/
[root@centos8 linux]#make install
[root@centos8 linux]#ls /boot
config-4.18.0-147.el8.x86_64
efi
grub2
initramfs-0-rescue-5b85fc7444b240a992c42ce2a9f65db5.img
initramfs-4.18.0-147.el8.x86_64.img
initramfs-4.18.0-147.el8.x86_64kdump.img
initramfs-5.6.12-wanglinux-6.6.6.img
loader
lost+found
System.map
System.map-4.18.0-147.el8.x86_64
System.map-5.6.12-wanglinux-6.6.6
vmlinuz
vmlinuz-0-rescue-5b85fc7444b240a992c42ce2a9f65db5
vmlinuz-4.18.0-147.el8.x86_64
vmlinuz-5.6.12-wanglinux-6.6.6
[root@centos8 ~]#ls /boot/loader/entries/ 5b85fc7444b240a992c42ce2a9f65db5-0-rescue.conf
5b85fc7444b240a992c42ce2a9f65db5-4.18.0-147.el8.x86_64.conf
5b85fc7444b240a992c42ce2a9f65db5-5.6.12-wanglinux-6.6.6.conf
[root@centos8 ~]#cat /boot/loader/entries/5b85fc7444b240a992c42ce2a9f65db5-
5.6.12-wanglinux-6.6.6.conf
title CentOS Linux (5.6.12-wanglinux-6.6.6) 8 (Core)
version 5.6.12-wanglinux-6.6.6
linux /vmlinuz-5.6.12-wanglinux-6.6.6
initrd /initramfs-5.6.12-wanglinux-6.6.6.img $tuned_initrd options $kernelopts $tuned_params
id centos-20200513060531-5.6.12-wanglinux-6.6.6
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel
[root@centos8 ~]#reboot
[root@centos8 ~]#uname -r
5.6.12-wanglinux-6.6.
添加NTFS文件
make -j 8
安装
选择内核,启动计算机
改为可读可写也不可以