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。

    重启吧~~

  • 相关阅读:
    ZeptoLab Code Rush 2015
    UVa 10048 Audiophobia【Floyd】
    POJ 1847 Tram【Floyd】
    UVa 247 Calling Circles【传递闭包】
    UVa 1395 Slim Span【最小生成树】
    HDU 4006 The kth great number【优先队列】
    UVa 674 Coin Change【记忆化搜索】
    UVa 10285 Longest Run on a Snowboard【记忆化搜索】
    【NOIP2016提高A组模拟9.28】求导
    【NOIP2012模拟10.9】电费结算
  • 原文地址:https://www.cnblogs.com/clairedandan/p/14046491.html
Copyright © 2011-2022 走看看