/boot
目录下找到带有config
字样的配置文件linux-x.x.x
.config
# 首先把apt源文件中的deb-src注释全部打开
apt update
apt install -y libncurses-dev pkg-config wget git xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev
apt build-dep -y linux
如果是基于Rocky、 fedora的国产系统,命令替换为
sudo dnf groupinstall "Development Tools"
sudo dnf install ncurses-devel make gcc bc bison flex elfutils-libelf-devel openssl-devel rpm-build rpmdevtools
sudo dnf install dwarves perl
git init
git add .
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"
git commit -m "1"
make olddefconfig
make deb-pkg -j8
如果是基于Rocky、 fedora的国产系统,命令替换为
make olddefconfig
make certs
make rpm-pkg -j8
银河麒麟需要手动安装https://github.com/acmel/dwarves.git
Build instructions:
git clone https://github.com/acmel/dwarves.git
1. install cmake
2. mkdir build
3. cd build
4. cmake -D__LIB=lib ..
5. make install
cmake Options:
-DBUILD_SHARED_LIBS
By default SHARED libraries are created and applications are linked to it.
Use -DBUILD_SHARED_LIBS=OFF while invoking cmake to create STATIC libraries
and link applications to it.
Ex. cmake -D__LIB=lib -DBUILD_SHARED_LIBS=OFF ..
-DCMAKE_INSTALL_PREFIX
Default is to install to /usr/local, use -DCMAKE_INSTALL_PREFIX=
when invoking cmake to specify another install location.
You may need to update the libbpf git submodule:
git submodule update --init --recursive
# make rpm-pkg 需要改为
make
make install
如果报证书错误 需要用make menuconfig
命令进入配置菜单
导航到
# Cryptographic API
# > Certificates for signature checking
# > X.509 certificates to be preloaded into the system blacklist keyring
# 将内容清空
# 保存退出
make clean
make rpm-pkg
导出编译产物
和linux-x.x.x
同级目录下/或~/rpmbuild/RPMS/x86_64/
下的deb/rpm包就是目标产物
导出到实体机安装
主要安装linux-headers*
linux-image
(不带有dbg字样)
两个包即可
安装
将deb/rpm包移动到实体机的/tmp
目录下
执行
sudo apt install -d ../*.deb
或
sudo dnf localinstall ./rpmbuild/RPMS/x86_64/kernel-*.rpm
完成
如果您发现该资源为电子书等存在侵权的资源或对该资源描述不正确等,可点击“私信”按钮向作者进行反馈;如作者无回复可进行平台仲裁,我们会在第一时间进行处理!
添加我为好友,拉您入交流群!
请使用微信扫一扫!