简单的活着

Linux 4.10.2

Posted on By Mista Cai

Linux-4.10.2

编译内核v4.10.2

  1. 下载4.10.2的内核源码

  2. 进入该源码的目录,COPY一份/boot/config-到当前目录下重命名为.config。

  3. make mrproper

  4. make clean

  5. make menuconfig

    -curses.h: No such file or directory

    -apt install libncurses5-dev

  6. make -j8 bzImage

    No rule to make target 'bzlmag'. Stop. bzImage

    -fatal error: openssl/opensslv.h: No such file or directory

    -sudo apt-get update && sudo apt-get install libssl-dev

  7. make -j8 modules

  8. make -j8 modules_install

    4 Packages / Libraries: libssl-devlibncurses5-devqt4-defaultqt4-dev-tools

  9. make install

  10. update-grub2update-grub

  11. 重启,选择自定义的内核。

    按住 shift 只是 強制 顯示開機選單 按 向上/向下 及 Enter 鍵 才能選擇 Linux kernel 版本 開機選項

修改KVM模块

每次修改完kvm代码后,不用重新编译全部内核模块,进行对kvm模块编译,执行linux-4.10.2/recompile.sh脚本。

#!/bin/bash
make -j8 -C `pwd` M=`pwd`/arch/x86/kvm modules
cd arch/x86/kvm
rmmod kvm-intel.ko
rmmod kvm.ko
insmod kvm.ko
insmod kvm-intel.ko

每次改完KVM,执行bash。

T1开机引导界面

犯了个很低级的错误.

由于Ubuntu18更新,导致引导界面多了linux-4.15.0-46-generic版本,所以原来默认的linux-4.10.2引导变成了4.15.0-29-generic,导致了QEMU客户机WIN7加载驱动就卡死的问题。

最惨的是我还重新编译了内核。

修改ubuntu的默认启动顺序

打开ubuntu系统以后,我们打开超级终端,输入以下命令

sudo gedit /etc/default/grub

显示如下

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="locale=zh_CN"

GRUB_DEFAULT代表的就是启动项的顺序,从数字0开始.

修改为目标启动项,我的是1> 6,即Advanced options for Ubuntu -> Linux-4.10.2.

更新grub

sudo update-grub2

查询当前内核版本

uname -a