For upgrading present kernel to linux-next kernel, we need to follow below steps.

1. Check present kernel version:

Check which kernel you have, by running the following command. This should print the version of the kernel that you are using

uname -r

Saving present kernel version in present-version.txt

uname -r > present-version.txt

2. Install required packages:  like "git, make, tar, gcc, bc, patch, dos2unix, wget, xz"

Use below commands based on Linux distro.

zypper --non-interactive install git make tar gcc bc patch dos2unix wget xz

yum install -y git make tar gcc bc patch dos2unix wget xz

apt-get install -y git make tar gcc bc patch dos2unix wget

3. Download linux-next kernel from git.

git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

It will download the code into linux-next directory.

cd linux-next/

4. Creating the .config file.

Creating new .config file based on a previous .config file

if you have an existing configuration from an older kernel, copy the old .config file in to linux-next directory as ".config"(recommended way)

cp /boot/config-`uname -r` .config

if old configuration file  not exists, you can create a .config file by running below command

yes "" | make oldconfig

5. Modifications in “.config” file:

a. Enabling HyperV support:

Recent changes to kernel requires setting “CONFIG_HYPERVISOR_GUEST” to enable all guest virtualization drivers. So we need to add CONFIG_HYPERVISOR_GUEST=y to .config file.

CONFIG_HYPERVISOR_GUEST=y

b. Enable Ext4 support:

Ext3 is enabled by default, but in some distros Ext4 is not enable by default.

CONFIG_EXT4_FS=y

6. Configure the kernel options:

This “oldconfig” process will carry over your previous settings, and prompt you if there are new features not covered by your earlier .config file

yes "" | make oldconfig

7. Build the kernel:

Now compile the actual kernel. This can take more than 20 minutes to complete

Based on the processor count, we can run make cmd

make -j`nproc` (running “nproc” processes at a time)

Check make command executed successfully or not.

8. Following changes are needed on OpenSUSE, other distributions may not need this step:

Removing any scsi_id references in /etc/default/grub and /etc/default/grub_installdevice files

and then run "grub2-mkconfig"

grub2-mkconfig

9. Building the kernel modules:

a. Make the modules: Modules are parts of the kernel that are loaded on the fly, as they are needed. They are stored in individual files

make modules

b. Install the modules: This will copy all the modules to a new directory, "/lib/modules/<kernel version>"

make modules_install

10. Installing the kernel:

Now install linux-next kernel using below command.

make install

11. Grub Modification:

Update grub.conf based on grub version, make new kernel as default kernel

For grub V1 files, change default value to 0

default=0

For grub V2 files, run below commands

grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-set-default 0

12. Ensure eth0 is up and running

Sometimes eth0 will not run after reboot, so we need to add below command to either rc.local or after.local based on distro

ifup eth0 > /dev/null

13. Reboot the VM

Reboot the machine, you will be in the new kernel. Check the kernel using "uname -r"

reboot [or] init 6

uname -r

Note: Before reboot check new kernel position in the grub.cfg [or] grub2.cfg with older one and make it as default.

Issues we faced while installing new kernel:

1. Facing errors in crypto/signature/ksign-publickey.c file: For this issue try below procedure.

Run "make menuconfig", Disable "Module signature verification (EXPERIMENTAL)" in "Enable loadable module support" and

Disable "In-kernel signature checker (EXPERIMENTAL)" in "Cryptographic API" save and exit

Now build your kernel with the modified .config file

2. Facing errors Like "lib/locking-selftest.c:1546: error: implicit declaration of function ‘raw_spin_lock_nest_lock’"

You need to replace the raw_spin_lock_nest_lock with spin_lock_nest_lock in ww_test_spin_nest_unlocked function of lib/locking-selftest.c file

3. Facing disk space issues:

For this we need to make sure at least 20GB is available on disk.

Linux - 升级+编译kernel的更多相关文章

  1. 【转载】Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置

    [转载]Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置 1. 系统与软件版本 1.1 系统版本 rhel6.4(Red Hat Enterprise Linux Server r ...

  2. Linux内核编译完整过程

    Linux内核编译完整过程 通过网上的资料我自己的实际内核编译,我把对Linux内核编译的过程写在这里,也许对其他的Linux爱好者的编译学习有些帮助,其中很大部分是网上的资料,另外就是我在实际编译过 ...

  3. linux下编译出现空间不足解决办法

    linux下编译出现空间不足解决办法 编译内核出现问题: AS      .tmp_kallsyms1.o .tmp_kallsyms1.S:2: fatal error: when writing ...

  4. 运行在TQ2440开发板上以及X86平台上的linux内核编译

    一.运行在TQ2440开发板上的linux内核编译 1.获取源码并解压 直接使用天嵌移植好的“linux-2.6.30.4_20100531.tar.bz2”源码包. 解压(天嵌默认解压到/opt/E ...

  5. linux下编译原理分析

    linux下编译hello.c 程序,使用gcc hello.c,然后./a.out就能够执行:在这个简单的命令后面隐藏了很多复杂的过程,这个过程包含了以下的步骤: ================= ...

  6. linux内核编译环境配置

    linux内核编译环境配置 如果不是编译内核,只需要安装与内核相匹配的kernel-devel开发包即可.即是/lib/modules/`uname -r`/build -> /usr/src/ ...

  7. linux下编译运行驱动

    linux下编译运行驱动 嵌入式linux下设备驱动的运行和linux x86 pc下运行设备驱动是类似的,由于手头没有嵌入式linux设备,先在vmware上的linux上学习驱动开发. 按照如下方 ...

  8. hi3531 SDK 编译 kernel, 修改 参数

    开发环境用户指南上这么写的 3.1 内核源代码 成功安装Hi3531 SDK后,内核源代码已存放于SDK目录下的osdrv/目录中,用户可 直接进入目录进行相关操作. 3.2 配置内核 如果对内核和H ...

  9. Linux内核编译与安装

    2013-04-16    Linux内核介绍  Linux内核是一个用C语言写成的,符合POSIX标准的类Unix操作系统.内核是操作系统中最基本的一部分,提供了众多应用程序访问计算机硬件的机制.L ...

随机推荐

  1. android自定义UI模板图文详解

    不知道大家在实际开发中有没有自定义过UI模板?今天花时间研究了一下android中自定义UI模板,与大家分享一下. 每个设计良好的App都是自定义标题栏,在自定义标题栏的过程中大部分人可能都是自定义一 ...

  2. table-layout:fixed 属性的解说

    table-layout:fixed 属性的解说如果想要一个table固定大小,里面的文字强制换行(尤其是在一长串英文文本,并且中间无空格分隔的情况下),以达到使过长的文字不撑破表格的目的,一般是使用 ...

  3. ubuntu上部署github博客,利用hexo

    安装Node.js三种安装方法,前两种是我安装过的,后一种是 Google 到的. #####①:apt-get 安装在 终端 输入 nodejs 或者 npm ,如果没有安装会提示你进行安装,命令如 ...

  4. js jquery jquery.wordexport.js 实现导出word

    由于工作需要,将一个页面导出word文档,主要是简历!经过百度搜索之后,没找到结果,无奈之下只能求助Google,意外发现jquery一款插件可以实现这个功能!而且效果还算可以! 基本可以实现想要的功 ...

  5. C#中Messagebox.Show()常用参数用法详解

    声明:IWin32Window owner   ,  HelpNavigator navigator ,    string keyword 上面的三个参数类型不是很了解.没有做讨论. 等以后了解多了 ...

  6. 将ubuntu14.04设置为文本模式启动?

    修改改GRUB 的配置文件(不建议直接改 grub.conf) $sudo vim /etc/default/grub 找到: GRUB_CMDLINE_LINUX_DEFAULT="qui ...

  7. Cocos2d-JS中的精灵菜单和图片菜单

    精灵菜单的菜单项类是cc.MenuItemSprite,图片菜单的菜单项类是cc.MenuItemImage.由于cc.MenuItemImage继承于cc.MenuItemSprite,所以图片菜单 ...

  8. TableView 中cell间的分割线(及其他控件间(内)的分割线)设置

    知识点: 1.在应用开发中,tableView中自带的分割线满足不了开发需求: 2.一些子空间中添加一些类似于分割线一样的东西等······ 补充知识点:导航条左侧或右侧的控件尽量靠近屏幕边缘设置 需 ...

  9. OC7_代理的基本概念

    // // Cat.h // OC7_代理的基本概念 // // Created by zhangxueming on 15/6/24. // Copyright (c) 2015年 zhangxue ...

  10. (转)如何构建高性能,稳定SOA应用之-负载均衡-Decoupled Invocation(一)

    当我们在为一个软件设计架构的时候,我们不仅仅要确保所做出来的架构要满足系统的业务需求,更加要确保做出来的架构要满足可维护性,安全,稳定性的非业务行的需求. 另外一个非常重要的非功能性需求就是性能.性能 ...