zoukankan      html  css  js  c++  java
  • Linux --编译kernel

    1. download the kernel package that you want to install .

    2. unzip the package to the path that has enough space :use command ("df -h /usr/local ")to check the space;

    3.check the kernel :uname -r

    4.go to /usr/local/kernel ...

      cp /boot/config$kernel .config   复制现在的kernel 的文件到当前的需要安装的kernel包的路径下,并且改名为.config

    5.make menuconfig 

    [root@localhost linux-5.9.10]# make menuconfig
      HOSTCC  scripts/basic/fixdep
      UPD     scripts/kconfig/mconf-cfg
      HOSTCC  scripts/kconfig/mconf.o
      HOSTCC  scripts/kconfig/lxdialog/checklist.o
      HOSTCC  scripts/kconfig/lxdialog/inputbox.o
      HOSTCC  scripts/kconfig/lxdialog/menubox.o
      HOSTCC  scripts/kconfig/lxdialog/textbox.o
      HOSTCC  scripts/kconfig/lxdialog/util.o
      HOSTCC  scripts/kconfig/lxdialog/yesno.o
      HOSTCC  scripts/kconfig/confdata.o
      HOSTCC  scripts/kconfig/expr.o
      LEX     scripts/kconfig/lexer.lex.c
      YACC    scripts/kconfig/parser.tab.[ch]
      HOSTCC  scripts/kconfig/lexer.lex.o
      HOSTCC  scripts/kconfig/parser.tab.o
      HOSTCC  scripts/kconfig/preprocess.o
      HOSTCC  scripts/kconfig/symbol.o
      HOSTCC  scripts/kconfig/util.o
      HOSTLD  scripts/kconfig/mconf
    scripts/kconfig/mconf  Kconfig
    configuration written to .config
    
    *** End of the configuration.
    *** Execute 'make' to start the build or try 'make help'.

    就会出现下图的配置:

     7.go to the "Genernal setup "可以在标黄的地方改名;再退出

     8. 找到file system

     9.go to DOS/FAT/EXFAT/NT filesystems-----

     10 到NTFS files system support 的位置输入"M",NTFS write support (NEW )输入y 

     通过以上菜单,就是修改config文件中的内容:

    [root@localhost linux-5.9.10]# grep -i ntfs .config
    CONFIG_NTFS_FS=m
    # CONFIG_NTFS_DEBUG is not set
    CONFIG_NTFS_RW=y

    最后开始编译:

    make -j 8

    编译完成后安装模块

    sudo make modules_install

    安装内核相关

    make install 

    此时到/boot 的路径下check,已经有vmlinuz 和initramfs的文件

    [root@localhost src]# cd /boot
    [root@localhost boot]# ls
    System.map
    System.map-4.18.0-193.el8.x86_64
    System.map-5.9.10x86_5.9.10_debug
    config-4.18.0-193.el8.x86_64
    efi
    extlinux
    grub2
    initramfs-4.18.0-193.el8.x86_64.img
    initramfs-4.18.0-193.el8.x86_64kdump.img
    initramfs-5.9.10x86_5.9.10_debug.img
    loader
    vmlinuz
    vmlinuz-0-rescue-203f6b7975c648658a1e9b53121d0eab
    vmlinuz-4.18.0-193.el8.x86_64
    vmlinuz-5.9.10x86_5.9.10_debug

    然后在 /boot/efi/EFI/centos/grubenv 中可以check到我们新安装的kernel。

    重启吧~~

  • 相关阅读:
    LeetCode 81 Search in Rotated Sorted Array II(循环有序数组中的查找问题)
    LeetCode 80 Remove Duplicates from Sorted Array II(移除数组中出现两次以上的元素)
    LeetCode 79 Word Search(单词查找)
    LeetCode 78 Subsets (所有子集)
    LeetCode 77 Combinations(排列组合)
    LeetCode 50 Pow(x, n) (实现幂运算)
    LeetCode 49 Group Anagrams(字符串分组)
    LeetCode 48 Rotate Image(2D图像旋转问题)
    LeetCode 47 Permutations II(全排列)
    LeetCode 46 Permutations(全排列问题)
  • 原文地址:https://www.cnblogs.com/clairedandan/p/14046491.html
Copyright © 2011-2022 走看看