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
安裝
選擇核心,啟動計算機
改為可讀可寫也不可以