linux-5.14 の AlmaLinux 9.2 へのインストール

linux-5.14 の AlmaLinux 9.2へのインストールログです.複数のトラブルが発生します.

sudo su -
dnf -y update
dnf -y install make gcc flex bison openssl-devel elfutils-libelf-devel
cd /usr/src
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.tar.xz
tar xfJ linux-5.14.tar.xz
cd linux-5.14
cp /boot/config-5.14.0-284.25.1.el9_2.x86_64 .config
make oldconfig

make oldconfig の質問への回答は,結局 Enter を連打することになると思います.

もし
-bash: make: command not found
となってしまったら
dnf -y install make
を忘れています

もし
HOSTCC scripts/basic/fixdep
/bin/sh: line 1: gcc: command not found
make[1]: *** [scripts/Makefile.host:95: scripts/basic/fixdep] Error 127
make: *** [Makefile:548: scripts_basic] Error 2
となってしまったら
dnf -y install gcc
を忘れています

もし
/bin/sh: line 1: flex: command not found
make[1]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127
make: *** [Makefile:625: oldconfig] Error 2
となってしまったら
dnf -y install flex
を忘れています

もし
YACC scripts/kconfig/parser.tab.[ch]
/bin/sh: line 1: bison: command not found
make[1]: *** [scripts/Makefile.host:17: scripts/kconfig/parser.tab.h] Error 127
make: *** [Makefile:625: oldconfig] Error 2
となってしまったら
dnf -y install bison
を忘れています

cp .config .config.bak
vi .config

vi .config は以下の2カ所の修正をする

7698行目
CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem"

CONFIG_SYSTEM_TRUSTED_KEYS=""

7872行目
CONFIG_DEBUG_INFO_BTF=y

# CONFIG_DEBUG_INFO_DWARF5 is not set
CONFIG_DEBUG_INFO_BTF=n

make -j8 bzImage modules

もし
HOSTCC scripts/sign-file
scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
25 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:95: scripts/sign-file] Error 1
make: *** [Makefile:1196: scripts] Error 2
となってしまったら
dnf -y install openssl-devel
を忘れています

もし
DESCEND objtool
<stdin>:1:10: fatal error: libelf.h: No such file or directory
compilation terminated.
CC /usr/src/linux-5.14/tools/objtool/arch/x86/special.o
In file included from /usr/src/linux-5.14/tools/objtool/include/objtool/objtool.h:13,
from /usr/src/linux-5.14/tools/objtool/include/objtool/arch.h:11,
from /usr/src/linux-5.14/tools/objtool/include/objtool/check.h:11,
from /usr/src/linux-5.14/tools/objtool/include/objtool/special.h:10,
from arch/x86/special.c:4:
/usr/src/linux-5.14/tools/objtool/include/objtool/elf.h:10:10: fatal error: gelf.h: No such file or directory
10 | #include <gelf.h>
| ^~~~~~~~
compilation terminated.
make[4]: *** [/usr/src/linux-5.14/tools/build/Makefile.build:97: /usr/src/linux-5.14/tools/objtool/arch/x86/special.o] Error 1
make[3]: *** [/usr/src/linux-5.14/tools/build/Makefile.build:139: arch/x86] Error 2
make[2]: *** [Makefile:56: /usr/src/linux-5.14/tools/objtool/objtool-in.o] Error 2
make[1]: *** [Makefile:69: objtool] Error 2
make: *** [Makefile:1364: tools/objtool] Error 2
となってしまったら
dnf -y install elfutils-libelf-devel
を忘れています

もし
/bin/sh: line 1: perl: command not found
make[2]: *** [usr/include/Makefile:106: usr/include/asm-generic/auxvec.hdrtest] Error 127
make[1]: *** [scripts/Makefile.build:514: usr/include] Error 2
make: *** [Makefile:1851: usr] Error 2
となってしまったら
dnf -y install perl
を忘れています

もし
make[1]: *** No rule to make target 'certs/rhel.pem', needed by 'certs/x509_certificate_list'. Stop.
make: *** [Makefile:1851: certs] Error 2
となってしまったら
vi .config
>7698行目
>CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem"
>↓
>CONFIG_SYSTEM_TRUSTED_KEYS=""
を忘れています

もし
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1176: vmlinux] Error 1
となってしまったら
vi .config
>7872行目
>CONFIG_DEBUG_INFO_BTF=y
>↓
># CONFIG_DEBUG_INFO_DWARF5 is not set
>CONFIG_DEBUG_INFO_BTF=n
を忘れています

make modules_install install

#linux
#カーネル
#kernel
#Alma
#AlmaLinux
#AlmaLinux9
#AlmaLinux9_2
#linux5
#linux5_14


この記事が気に入ったらサポートをしてみませんか?