centos7环境
iso选择
https://mirrors.tuna.tsinghua.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso
自带qemu,未实测是否可用
选择编译版本2.6
下载地址
遇到的编译错误解决
yum list | grep curses
yum install ncurses-devel.x86_64 -y yum install ncurses.x86_64 -y
再执行
make menuconfig
编译2.6失败,编其他版本
https://www.cnblogs.com/EndPoem-ZH/p/17825933.html
参考上述链接
进行了make install_module
安装路径:
MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) export MODLIB modules_install: $(modinst_pre) PHONY += __modinst_pre __modinst_pre: @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB) ifdef CONFIG_MODULES @ln -s $(abspath $(srctree)) $(MODLIB)/source @if [ ! $(objtree) -ef $(MODLIB)/build ]; then rm -f $(MODLIB)/build ; ln -s $(CURDIR) $(MODLIB)/build ; fi @sed 's:^(.*).o$$:kernel/1.ko:' modules.order > $(MODLIB)/modules.order endif @cp -f modules.builtin $(MODLIB)/ @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
验证路径
[root@192 linux-6.5.7]# ls /lib/modules 3.10.0-1160.el7.x86_64 6.5.7
再进行make install
[root@192 linux-6.5.7]# make help | grep install modules_install - Install all modules to INSTALL_MOD_PATH (default: /) headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH Build, install, and boot kernel before kselftest-install - Build and install kernel selftest install - Install kernel using (your) ~/bin/installkernel or (distribution) /sbin/installkernel or install to
安装目录
total 121M -rw-r--r--. 1 root root 150K Oct 19 2020 config-3.10.0-1160.el7.x86_64 drwx------. 3 root root 17 Jul 29 2020 efi drwxr-xr-x. 2 root root 27 Dec 30 03:38 grub drwx------. 5 root root 97 Jan 20 20:47 grub2 -rw-------. 1 root root 77M Dec 30 03:41 initramfs-0-rescue-9763b08976f1446baca69088d34b6dcf.img -rw-------. 1 root root 28M Dec 30 03:43 initramfs-3.10.0-1160.el7.x86_64.img -rw-r--r--. 1 root root 314K Oct 19 2020 symvers-3.10.0-1160.el7.x86_64.gz -rw-------. 1 root root 3.5M Oct 19 2020 System.map-3.10.0-1160.el7.x86_64 -rwxr-xr-x. 1 root root 6.5M Dec 30 03:41 vmlinuz-0-rescue-9763b08976f1446baca69088d34b6dcf -rwxr-xr-x. 1 root root 6.5M Oct 19 2020 vmlinuz-3.10.0-1160.el7.x86_64 total 164M -rw-r--r--. 1 root root 150K Oct 19 2020 config-3.10.0-1160.el7.x86_64 drwx------. 3 root root 17 Jul 29 2020 efi drwxr-xr-x. 2 root root 27 Dec 30 03:38 grub drwx------. 5 root root 97 Jan 20 22:22 grub2 -rw-------. 1 root root 77M Dec 30 03:41 initramfs-0-rescue-9763b08976f1446baca69088d34b6dcf.img -rw-------. 1 root root 28M Dec 30 03:43 initramfs-3.10.0-1160.el7.x86_64.img -rw-------. 1 root root 30M Jan 20 22:22 initramfs-6.5.7.img -rw-r--r--. 1 root root 314K Oct 19 2020 symvers-3.10.0-1160.el7.x86_64.gz lrwxrwxrwx. 1 root root 22 Jan 20 22:22 System.map -> /boot/System.map-6.5.7 -rw-------. 1 root root 3.5M Oct 19 2020 System.map-3.10.0-1160.el7.x86_64 -rw-r--r--. 1 root root 3.9M Jan 20 22:22 System.map-6.5.7 lrwxrwxrwx. 1 root root 19 Jan 20 22:22 vmlinuz -> /boot/vmlinuz-6.5.7 -rwxr-xr-x. 1 root root 6.5M Dec 30 03:41 vmlinuz-0-rescue-9763b08976f1446baca69088d34b6dcf -rwxr-xr-x. 1 root root 6.5M Oct 19 2020 vmlinuz-3.10.0-1160.el7.x86_64 -rw-r--r--. 1 root root 9.9M Jan 20 22:22 vmlinuz-6.5.7 [root@192 linux-6.5.7]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-6.5.7 Found initrd image: /boot/initramfs-6.5.7.img Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-9763b08976f1446baca69088d34b6dcf Found initrd image: /boot/initramfs-0-rescue-9763b08976f1446baca69088d34b6dcf.img done
linux内核编译_make menuconfig报错(current_menu error)_make menuconfig失败-CSDN博客