前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Linux 内核】编译 Linux 内核 ⑦ ( 安装内核模块 | 安装内核 | 重启系统 | 查看当前内核版本 )

【Linux 内核】编译 Linux 内核 ⑦ ( 安装内核模块 | 安装内核 | 重启系统 | 查看当前内核版本 )

作者头像
韩曙亮
发布2023-03-30 13:38:28
15.6K0
发布2023-03-30 13:38:28
举报
文章被收录于专栏:韩曙亮的移动开发专栏

文章目录

一、安装内核模块


确保 Linux 内核编译完成 , 没有任何报错之后 ; 参考 【Linux 内核】编译 Linux 内核 ⑥ ( 安装 OpenSSL | 安装其它依赖库 | 内核编译完成 ) 博客 ;

进入 Linux 内核源码的根目录 , 执行

代码语言:javascript
复制
sudo make modules_install

命令 , 安装编译好的内核模块 ;

在这里插入图片描述
在这里插入图片描述

安装成功后命令行最后一页内容 :

在这里插入图片描述
在这里插入图片描述

完整过程如下 :

代码语言:javascript
复制
root@ubuntu:~# cd kernel/
root@ubuntu:~/kernel# cd linux-5.6.14
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# ls
arch   COPYING  Documentation  include  Kbuild   lib          Makefile         modules.builtin.modinfo  net      scripts   System.map  virt            vmlinux.o
block  CREDITS  drivers        init     Kconfig  LICENSES     mm               modules.order            README   security  tools       vmlinux
certs  crypto   fs             ipc      kernel   MAINTAINERS  modules.builtin  Module.symvers           samples  sound     usr         vmlinux-gdb.py
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# sudo make modules_install
  INSTALL arch/x86/crypto/aesni-intel.ko
  INSTALL arch/x86/crypto/blowfish-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx2.ko
  INSTALL arch/x86/crypto/camellia-x86_64.ko
  INSTALL arch/x86/crypto/cast5-avx-x86_64.ko
  INSTALL arch/x86/crypto/cast6-avx-x86_64.ko
  INSTALL arch/x86/crypto/chacha-x86_64.ko
  INSTALL arch/x86/crypto/crc32-pclmul.ko
  INSTALL arch/x86/crypto/crct10dif-pclmul.ko
  INSTALL arch/x86/crypto/des3_ede-x86_64.ko
  INSTALL arch/x86/crypto/ghash-clmulni-intel.ko
  INSTALL arch/x86/crypto/glue_helper.ko
  INSTALL arch/x86/crypto/poly1305-x86_64.ko
  INSTALL arch/x86/crypto/serpent-avx-x86_64.ko
  INSTALL arch/x86/crypto/serpent-avx2.ko
  INSTALL arch/x86/crypto/serpent-sse2-x86_64.ko
  INSTALL arch/x86/crypto/sha1-ssse3.ko
  INSTALL arch/x86/crypto/sha256-ssse3.ko
  INSTALL arch/x86/crypto/sha512-ssse3.ko
  INSTALL arch/x86/crypto/twofish-avx-x86_64.ko
  INSTALL arch/x86/crypto/twofish-x86_64-3way.ko
  INSTALL arch/x86/crypto/twofish-x86_64.ko
  INSTALL arch/x86/events/intel/intel-cstate.ko
  INSTALL arch/x86/events/intel/intel-rapl-perf.ko
  INSTALL arch/x86/kernel/cpu/mce/mce-inject.ko
  INSTALL arch/x86/kernel/cpuid.ko
  INSTALL arch/x86/kernel/msr.ko
  INSTALL arch/x86/kvm/kvm-amd.ko
  INSTALL arch/x86/kvm/kvm-intel.ko
  INSTALL arch/x86/kvm/kvm.ko
  INSTALL arch/x86/oprofile/oprofile.ko
  INSTALL arch/x86/platform/atom/punit_atom_debug.ko
  INSTALL block/bfq.ko
  INSTALL block/kyber-iosched.ko
  INSTALL crypto/842.ko
  INSTALL crypto/aes_ti.ko
  INSTALL crypto/af_alg.ko
  INSTALL crypto/algif_aead.ko
  INSTALL crypto/algif_hash.ko
  INSTALL crypto/algif_rng.ko
  INSTALL crypto/algif_skcipher.ko
  INSTALL crypto/ansi_cprng.ko
  INSTALL crypto/anubis.ko
  INSTALL crypto/arc4.ko
  INSTALL crypto/asymmetric_keys/pkcs7_test_key.ko
  INSTALL crypto/async_tx/async_memcpy.ko
  INSTALL crypto/async_tx/async_pq.ko
  INSTALL crypto/async_tx/async_raid6_recov.ko
  INSTALL crypto/async_tx/async_tx.ko
  INSTALL crypto/async_tx/async_xor.ko
  INSTALL crypto/authenc.ko
  INSTALL crypto/authencesn.ko
  INSTALL crypto/blake2b_generic.ko
  INSTALL crypto/blowfish_common.ko
  INSTALL crypto/blowfish_generic.ko
  INSTALL crypto/camellia_generic.ko
  INSTALL crypto/cast5_generic.ko
  INSTALL crypto/cast6_generic.ko
  INSTALL crypto/cast_common.ko
  INSTALL crypto/ccm.ko
  INSTALL crypto/chacha20poly1305.ko
  INSTALL crypto/chacha_generic.ko
  INSTALL crypto/cmac.ko
  INSTALL crypto/crc32_generic.ko
  INSTALL crypto/cryptd.ko
  INSTALL crypto/crypto_engine.ko
  INSTALL crypto/crypto_simd.ko
  INSTALL crypto/crypto_user.ko
  INSTALL crypto/des_generic.ko
  INSTALL crypto/ecc.ko
  INSTALL crypto/ecdh_generic.ko
  INSTALL crypto/echainiv.ko
  INSTALL crypto/essiv.ko
  INSTALL crypto/fcrypt.ko
  INSTALL crypto/keywrap.ko
  INSTALL crypto/khazad.ko
  INSTALL crypto/lrw.ko
  INSTALL crypto/lz4.ko
  INSTALL crypto/lz4hc.ko
  INSTALL crypto/md4.ko
  INSTALL crypto/michael_mic.ko
  INSTALL crypto/pcbc.ko
  INSTALL crypto/pcrypt.ko
  INSTALL crypto/poly1305_generic.ko
  INSTALL crypto/rmd128.ko
  INSTALL crypto/rmd160.ko
  INSTALL crypto/rmd256.ko
  INSTALL crypto/rmd320.ko
  INSTALL crypto/salsa20_generic.ko
  INSTALL crypto/seed.ko
  INSTALL crypto/serpent_generic.ko
  INSTALL crypto/sha3_generic.ko
  INSTALL crypto/tcrypt.ko
  INSTALL crypto/tea.ko
  INSTALL crypto/tgr192.ko
  INSTALL crypto/twofish_common.ko
  INSTALL crypto/twofish_generic.ko
  INSTALL crypto/vmac.ko
  INSTALL crypto/wp512.ko
  INSTALL crypto/xcbc.ko
  INSTALL crypto/xor.ko
  INSTALL crypto/xxhash_generic.ko
  INSTALL crypto/zstd.ko
  INSTALL drivers/acpi/acpi_configfs.ko
  INSTALL drivers/acpi/acpi_extlog.ko
  INSTALL drivers/acpi/acpi_ipmi.ko
  INSTALL drivers/acpi/acpi_pad.ko
  INSTALL drivers/acpi/apei/einj.ko
  INSTALL drivers/acpi/dptf/dptf_power.ko
  INSTALL drivers/acpi/ec_sys.ko
  INSTALL drivers/acpi/nfit/nfit.ko
  INSTALL drivers/acpi/sbs.ko
  INSTALL drivers/acpi/sbshc.ko
  INSTALL drivers/acpi/video.ko
  INSTALL drivers/ata/acard-ahci.ko
  INSTALL drivers/ata/ahci.ko
  # 省略5000 行
  INSTALL sound/usb/line6/snd-usb-toneport.ko
  INSTALL sound/usb/line6/snd-usb-variax.ko
  INSTALL sound/usb/misc/snd-ua101.ko
  INSTALL sound/usb/snd-usb-audio.ko
  INSTALL sound/usb/snd-usbmidi-lib.ko
  INSTALL sound/usb/usx2y/snd-usb-us122l.ko
  INSTALL sound/usb/usx2y/snd-usb-usx2y.ko
  INSTALL sound/x86/snd-hdmi-lpe-audio.ko
  INSTALL virt/lib/irqbypass.ko
  DEPMOD  5.6.14
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# 

二、安装内核


内核模块安装完成后 , 执行

代码语言:javascript
复制
sudo make install

命令 , 安装内核 ;

下面的内核安装过程会持续很长时间 ;

在这里插入图片描述
在这里插入图片描述

内核安装过程 :

代码语言:javascript
复制
root@ubuntu:~# cd kernel/linux-5.6.14
root@ubuntu:~/kernel/linux-5.6.14# 
root@ubuntu:~/kernel/linux-5.6.14# sudo make install
sh ./arch/x86/boot/install.sh 5.6.14 arch/x86/boot/bzImage \
	System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.6.14 /boot/vmlinuz-5.6.14
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.6.14 /boot/vmlinuz-5.6.14
update-initramfs: Generating /boot/initrd.img-5.6.14
run-parts: executing /etc/kernel/postinst.d/pm-utils 5.6.14 /boot/vmlinuz-5.6.14
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.6.14 /boot/vmlinuz-5.6.14
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.6.14 /boot/vmlinuz-5.6.14
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.6.14 /boot/vmlinuz-5.6.14
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-5.6.14
Found initrd image: /boot/initrd.img-5.6.14
Found linux image: /boot/vmlinuz-4.15.0-142-generic
Found initrd image: /boot/initrd.img-4.15.0-142-generic
Found linux image: /boot/vmlinuz-4.13.0-36-generic
Found initrd image: /boot/initrd.img-4.13.0-36-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
root@ubuntu:~/kernel/linux-5.6.14# 
在这里插入图片描述
在这里插入图片描述

三、重启系统


执行

代码语言:javascript
复制
reboot

命令 , 重启 Ubuntu 操作系统 ;

四、查看当前内核版本


重启之后 , 在命令行终端执行

代码语言:javascript
复制
uname -a

命令 , 查看当前的内核版本 , 发现当前内核版本已经

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-03-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 一、安装内核模块
  • 二、安装内核
  • 三、重启系统
  • 四、查看当前内核版本
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档