linux 端口complain,#Linux学习笔记#Linux kernel compi

本文档详细记录了在Ubuntu 18.04.2上安装GCC 9.1并从master分支获取Linux源码,编译内核5.3-rc5的过程。包括安装必要的依赖、解决编译错误,以及更新Grub以设置默认内核。过程中遇到了openssl头文件缺失的问题,并通过安装libcurl4-openssl-dev等包来解决。最后成功编译并安装了内核,但启动时提示缺少模块,需额外构建模块并安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The latest version built is 5.3-rc5, but it is not the target. I download source code from master branch, and compile, install it on Ubuntu18.04.2

install gcc-9.1

$sudo add-apt-repository ppa:jonathonf/gcc-9.1

$sudo apt install gcc-9

$sudo apt install build-essential

$git clone https://github.com/torvalds/linux.git

$make allyesconfig

$make -j6

complain missing flex, bison:

$sudo apt update

$sudo apt-get install flex

$sudo apt-get install bison

$make -j6

scripts/Makefile.host:90: recipe for target 'scripts/extract-cert' failed

scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory

#include

^~~~~~~~~~~~~~~~~~~~

compilation terminated.

scripts/Makefile.host:90: recipe for target 'scripts/sign-file' failed

make[1]: *** [scripts/sign-file] Error 1

make[1]: *** Waiting for unfinished jobs....

scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory

#include

^~~~~~~~~~~~~~~

compilation terminated.

scripts/Makefile.host:90: recipe for target 'scripts/extract-cert' failed

make[1]: *** [scripts/extract-cert] Error 1

Makefile:1097: recipe for target 'scripts' failed

make: *** [scripts] Error 2

make: *** Waiting for unfinished jobs....

$sudo apt-get install libcurl4-openssl-dev

$sudo apt-get install libncurses5-dev

$sudo apt-get install libcurl-openssl1.0-dev (this one works!)

$sudo make install

sh ./arch/x86/boot/install.sh 5.3.0-rc5 arch/x86/boot/bzImage \

System.map "/boot"

run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.3.0-rc5 /boot/vmlinuz-5.3.0-rc5

run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.3.0-rc5 /boot/vmlinuz-5.3.0-rc5

update-initramfs: Generating /boot/initrd.img-5.3.0-rc5

WARNING: missing /lib/modules/5.3.0-rc5

Ensure all necessary drivers are built into the linux image!

depmod: ERROR: could not open directory /lib/modules/5.3.0-rc5: No such file or directory

depmod: FATAL: could not search modules: No such file or directory

depmod: WARNING: could not open /var/tmp/mkinitramfs_aeewrk/lib/modules/5.3.0-rc5/modules.order: No such file or directory

depmod: WARNING: could not open /var/tmp/mkinitramfs_aeewrk/lib/modules/5.3.0-rc5/modules.builtin: No such file or directory

run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.3.0-rc5 /boot/vmlinuz-5.3.0-rc5

run-parts: executing /etc/kernel/postinst.d/update-notifier 5.3.0-rc5 /boot/vmlinuz-5.3.0-rc5

run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.3.0-rc5 /boot/vmlinuz-5.3.0-rc5

Sourcing file `/etc/default/grub'

Generating grub configuration file ...

.....

missing /lib/modules/5.3.0-rc5, need to make modules..

$make modules

$sudo make modules_install

$sudo make install

====================================

Modify grub

$sudo vi /etc/default/grub

GRUB_TIMEOUT=20

$sudo reboot

during restarting os, Press ESC, to select the target kenel version

===================================

Modify grub to add the compiled kernel as the default

$

================================

This is how to install the official compiled kernel.

$wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.3-rc5/linux-modules-5.3.0-050300rc5-generic_5.3.0-050300rc5.201908182231_amd64.deb

linux-headers-5.3.0-050300rc5_5.3.0-050300rc5.201908182231_all.deb

linux-headers-5.3.0-050300rc5-generic_5.3.0-050300rc5.201908182231_amd64.deb

linux-image-unsigned-5.3.0-050300rc5-generic_5.3.0-050300rc5.201908182231_amd64.deb

linux-modules-5.3.0-050300rc5-generic_5.3.0-050300rc5.201908182231_amd64.deb

$sudo dpkg -i *.deb /////install the built kernel

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值