准备源码包
linux-stable-sw.tar.gz
开始编译
[root@host158 local]# cd linux-stable-sw/
[root@host158 linux-stable-sw]# make xuelang_defconfig
[root@host158 linux-stable-sw]# make -j64
编译大概需要几分钟,然后在同级目录生成vmlinux
[root@host158 linux-stable-sw]# mkdir _install
[root@host158 linux-stable-sw]# make modules_install INSTALL_MOD_PATH=./_install
[root@host158 linux-stable-sw]# ls _install/lib/modules/
4.19.90-xuelang
[root@host158 linux-stable-sw]#
[root@host158 linux-stable-sw]# cd _install/lib/modules/
[root@host158 modules]# dracut --kver 4.19.90-xuelang --force
dracut-install: Failed to find module 'virtio_gpu'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.5xcJRO/initramfs --kerneldir /lib/modules/4.19.90-xuelang/ -m virtio_gpu
dracut-install: ERROR: installing '/usr/lib64/plymouth/label.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/details.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/script.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/two-step.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/tribar.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/fade-throbber.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/text.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/renderers/frame-buffer.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/renderers/drm.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/space-flares.so'
dracut-install: ERROR: installing '/usr/lib64/plymouth/throbgress.so'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.5xcJRO/initramfs -a /usr/share/fonts/kingsoft/FZKTK.TTF /etc/fonts/fonts.conf /usr/lib64/plymouth/label.so /usr/lib64/plymouth/details.so /usr/lib64/plymouth/script.so /usr/lib64/plymouth/two-step.so /usr/lib64/plymouth/tribar.so /usr/lib64/plymouth/fade-throbber.so /usr/lib64/plymouth/text.so /usr/lib64/plymouth/renderers/frame-buffer.so /usr/lib64/plymouth/renderers/drm.so /usr/lib64/plymouth/space-flares.so /usr/lib64/plymouth/throbgress.so
[root@host158 modules]#
在boot目录下生成initramfs-4.19.90-xuelang.img文件,为了使用方便,拷贝相关文件至指定目录,上面的error无关紧要,是dracut这个包的问题
[root@host158 kernel]# ls
4.19.90-xuelang initramfs-4.19.90-xuelang.img vmlinux-xuelang
开始使用
[root@host158 kernel]# cp 4.19.90-xuelang/ /lib/modules/ -r
[root@host158 kernel]# cp vmlinux-xuelang /boot/
[root@host158 kernel]# cp initramfs-4.19.90-xuelang.img /boot/
[root@host158 kernel]# dracut --kver 4.19.90-xuelang --force
[root@host158 kernel]# vim /boot/boot/grub/grub.cfg
[root@host158 kernel]# reboot