Ampere ARM Server 内核版本更新

2023-09-18 19:33:27

本篇记录 Ampere ARM Server 服务器上,升级内核版本或部分驱动的方法。

安装编译依赖库

sudo  apt-get install build-essential kernel-package libncurses5-dev libncurses-dev
sudo apt-get install gcc make bison flex libssl-dev

升级内核

##<1>. 编译内容

下载内核

选择国内内核镜像网站,下载对应版本内核。

使用运行版本的 config 文件

先清除前面编译残留文件,使用 ARM Server 运行的 config 文件编译内核;

$ make mrproper 
$ cp /boot/config-5.15.0-73-generic ./.config
$ make menuconfig  

修改配置项

make menuconfig 选择

 Kernel hacking —> Compile-time checks and compiler options —>(1024)Warn for stack frames larger than //将1024改为2048
 Kernel hacking —> Compile-time checks and compiler options —> [ ]   Generate BTF typeinfo //选中该选项

去除 system_trusted 内容

vim .config
#
# Certificates for signature checking
#
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""       ## 清空 keys 内容
CONFIG_SYSTEM_EXTRA_CERTIFICATE=y
CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE=4096
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_HASH_LIST=""
CONFIG_SYSTEM_REVOCATION_LIST=y
CONFIG_SYSTEM_REVOCATION_KEYS=""   ## 清空 keys 内容 
# end of Certificates for signature checking

安装内核编译支持库libssl-dev

sudo apt-get install libssl-dev

编译内核

make menuconfig 开启 android 相关支持模块, binder ashmem模块支持,
并修改 Makefile 文件中内核版本号。

make -j 64

<2>. 更新内核版本

以下指令在 /usr/src/linux-5.15.23 内核源码根目录.

2.1> 安装内核

将生成的Image镜像文件复制到目录下

cp arch/arm64/boot/Image /boot/vmliuz-5.15.23

将源代码目录下的System.map复制到/boot目录下:

cp System.map /boot/System.map-5.15.23

将源代码目录下的.config复制到/boot/目录下:

cp .config /boot/config-5.15.23

2.2> 安装模块

root@armtest:/usr/src/linux-5.15.23# make modules_install

  INSTALL /lib/modules/5.15.23/kernel/sound/soc/xtensa/snd-soc-xtfpga-i2s.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/soundcore.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/synth/emux/snd-emux-synth.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/synth/snd-util-mem.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/6fire/snd-usb-6fire.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/bcd2000/snd-bcd2000.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/caiaq/snd-usb-caiaq.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/hiface/snd-usb-hiface.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/line6/snd-usb-line6.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/line6/snd-usb-pod.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/line6/snd-usb-podhd.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/line6/snd-usb-toneport.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/line6/snd-usb-variax.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/misc/snd-ua101.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/snd-usb-audio.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/usb/snd-usbmidi-lib.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/virtio/virtio_snd.ko
  INSTALL /lib/modules/5.15.23/kernel/sound/xen/snd_xen_front.ko
  DEPMOD  /lib/modules/5.15.23

2.3> 安装编译内核vmlinuz

root@armtest:/usr/src/linux-5.15.23# make install
sh ./arch/arm64/boot/install.sh 5.15.23 \
arch/arm64/boot/Image System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/dkms 5.15.23 /boot/vmlinuz-5.15.23
 * dkms: running auto installation service for kernel 5.15.23
Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...(bad exit status: 2)
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j16 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.15.23 IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.15.23/build LD=/usr/bin/ld.bfd CONFIG_X86_KERNEL_IBT= modules...(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.15.23 is not supported
Error! Bad return status for module build on kernel: 5.15.23 (aarch64)
Consult /var/lib/dkms/nvidia/530.41.03/build/make.log for more information.
                                                                                                                                                     [ OK ]
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.15.23 /boot/vmlinuz-5.15.23
update-initramfs: Generating /boot/initrd.img-5.15.23
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.15.23 /boot/vmlinuz-5.15.23
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.15.23 /boot/vmlinuz-5.15.23
run-parts: executing /etc/kernel/postinst.d/xx-update-initrd-links 5.15.23 /boot/vmlinuz-5.15.23
I: /boot/initrd.img is now a symlink to initrd.img-5.15.23
run-parts: executing /etc/kernel/postinst.d/zz-shim 5.15.23 /boot/vmlinuz-5.15.23
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.15.23 /boot/vmlinuz-5.15.23
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.23
Found initrd image: /boot/initrd.img-5.15.23
Found linux image: /boot/vmlinuz-5.15.23.old
Found initrd image: /boot/initrd.img-5.15.23
Found linux image: /boot/vmlinuz-5.15.0-73-generic
Found initrd image: /boot/initrd.img-5.15.0-73-generic
Found linux image: /boot/vmlinuz-5.15.0-72-generic
Found initrd image: /boot/initrd.img-5.15.0-72-generic
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

2.4> 更新 grub 引导

root@armtest:cd /boot/grub
root@armtest:/boot/grub# udate-grub
root@armtest:/usr/src/linux-5.15.23# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.23
Found initrd image: /boot/initrd.img-5.15.23
Found linux image: /boot/vmlinuz-5.15.23.old
Found initrd image: /boot/initrd.img-5.15.23
Found linux image: /boot/vmlinuz-5.15.0-73-generic
Found initrd image: /boot/initrd.img-5.15.0-73-generic
Found linux image: /boot/vmlinuz-5.15.0-72-generic
Found initrd image: /boot/initrd.img-5.15.0-72-generic
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

更新 grub 后已经把 grub 缺省为当前的系统版本,重启系统后就自动进入 5.15.23 系统。

升级驱动

如果仅更新部分 *.ko 内容,可以指定安装位置,然后把模块更新到系统中。内核编译过程与升级内核部分
描述的方法相同,make menuconfig 中选择相关驱动模块,编译出 *.ko 文件,把此模块拷贝至对应的文件目录下,
记着执行 depmod -a 刷新驱动的依赖关系。通过 modinfo 查看模块是否为更新后的驱动模块。

更多推荐

【Android】SVGAPlayer的使用介绍

背景客户需要通过SVG来做直播场景的炫酷动画。故调用得到如下的工具库:GIthub-SVAGPlayer组装通过xml组装到项目中,然后调用提供的api实现自己的需求即可。<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http://s

9月13日扒面经

文章目录2)char可以存放汉字吗3)list,map,set区别是什么4)讲一下反射5)实现反射的类6)重载和重写区别7)类加载过程8)什么时候会内存泄漏9)子父类加载顺序10)String,StringBuilderStringBuffer区别,哪些是线程安全的,哪一个快一些11)线程创建方式,你常用的是哪个,为什

从0搭建夜莺v6基础监控告警系统(一):基础服务安装

文章目录1.写在前面1.1.官方文档传送门1.2.部署环境2.服务安装2.1.基础设置2.2.安装中间件2.3.安装nightingale-v62.4.安装VictoriaMetrics2.5.安装Categraf3.部署总结3.1.安装总结1.写在前面1.1.官方文档传送门项目介绍架构介绍仪表盘黄埔营培训计划相关信息

【OpenSSL】HMAC消息认证码

HMAC消息认证码哈希运算消息码(Hash-basedMessageAuthenticationCode)与密钥相关的单向散列函数应用在SSL协议中消息是否被正确传输消息完整性消息认证算法流程密钥填充0(填充到与散列函数分组长度一致)填充后的密钥与0X36做异或ipad与消息内容组合第一次与单向散列函数进行散列计算填充

HTTP 状态码

状态码状态码英文名称中文描述100Continue继续。客户端应继续其请求101SwitchingProtocols切换协议。服务器根据客户端的请求切换协议。只能切换到更高级的协议,例如,切换到HTTP的新版本协议200OK请求成功。一般用于GET与POST请求201Created已创建。成功请求并创建了新的资源202

【Spring Boot】拦截器学习笔记

一、普通拦截器1,新建类MyWebConfig实现WebMvcConfigurer,实现addInterceptors方法@OverridepublicvoidaddInterceptors(InterceptorRegistryregistry){registry//不拦截哪些请求.excludePathPatter

电磁逆设计中伴随变量法的详细指南:Python在Jupyter环境下的完整演示

第一部分:电磁逆设计与伴随变量法的基础介绍1.电磁逆设计简介电磁逆设计是一种寻找最优电磁结构的方法,以实现特定的电磁响应。与传统的电磁设计方法不同,逆设计方法不是从已知的结构出发,而是从期望的响应出发,反向求解最佳的结构参数。2.伴随变量法的概念伴随变量法是一种优化技术,广泛应用于多种工程领域,包括电磁逆设计。它的核心

jsoup框架技术文档--java爬虫--基本概念

阿丹:之前使用python写的爬虫,但是现在项目的技术选型是需要使用jsoup来爬取网页的数据。那就需要重新学习一个框架。首先了解一下整体框架的基本概念。jsoup的概念JSoup是一个开源的Java库,它用于处理HTML文档,类似于一个用于解析和操作HTML的瑞士军刀。其强大的功能使得对HTML的处理变得非常容易和简

2023/09/21 day5 qt

将注册的账号密码存储到数据库中登录的账号密码与数据库中的账号密码进行匹配头文件#ifndefDENGLU_H#defineDENGLU_H#include<QMainWindow>#include<QDebug>#include<QIcon>#include<QLabel>#include<QLineEdit>#inc

大模型Tuning分类

类型总结微调(Fine-tunning)语言模型的参数需要一起参与梯度更新轻量微调(lightweightfine-tunning)冻结了大部分预训练参数,仅添加任务层,语言模型层参数不变适配器微调(Adapter-tunning)Adapter在预训练模型每层中插入用于下游任务的参数,在微调时将模型主体冻结,仅训练特

FPGA计数器边界问题解析

FPGA计数器边界问题解析一次作者在处理AMBE2000数据接收过程中,遇到一个问题,对该计数器边界总是模糊不清。现在予以说明,以警示以后工作时书写错误代码。AMBE2000数据一旦准备好后,一次会输出24个字,其中第1个字0x13ec是同步头,连上同步头的前12个字为控制字,后12个字为数据字,我们需要提前数据字,抛

热文推荐