Linux
カーネルソースコードRPMをインストールします。
[root@localhost ~]# rpm -ivh kernel-3.10.0-229.el7.src.rpm
warning: kernel-3.10.0-229.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Updating / installing...
1:kernel-3.10.0-229.el7 ################################# [100%]
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
warning: user builder does not exist - using root
warning: group builder does not exist - using root
インストールプロセスは成功したようですが、rpm -ql kernel-3.10.0-229.el7.src
コマンドを使用しても、ソースコードがインストールされている場所を見つけることができません。
[root@localhost ~]# rpm -ql kernel-3.10.0-229.el7.src
package kernel-3.10.0-229.el7.src is not installed
RHEL7
カーネルソースコードはどこにインストールされていますか?
更新:rpm -qa | grep kernel
コマンド出力:
[root@localhost ~]# rpm -qa | grep kernel
kernel-headers-3.10.0-229.el7.x86_64
kernel-devel-3.10.0-229.el7.x86_64
kernel-3.10.0-229.el7.x86_64
kernel-tools-libs-3.10.0-229.el7.x86_64
abrt-addon-kerneloops-2.1.11-19.el7.x86_64
kernel-tools-3.10.0-229.el7.x86_64
ソースパッケージはrpmデータベースに追加されないため、クエリに表示されません。
推定される場所は〜/ rpmbuild/{SOURCES、SPECS}で、SOURCESにはパッケージソースと配布パッチが含まれ、SPECSサブディレクトリにはパッケージのビルドに使用される.specファイルが含まれます(詳細については、rpmbuild(8)のマニュアルページを参照してください)。
そこにソースが見つからない場合は、-vvオプションを指定して再インストールし、場所が上書きされていないかどうかを確認します。
$ rpm -ivvh kernel-3.10.0-229.7.2.el7.src.rpm
--- snip ---
Updating / installing...
1:kernel-3.10.0-229.7.2.el7 ################################# [100%]
D: ========== Directories not explicitly included in package:
D: 0 /home/user/rpmbuild/SOURCES/
D: 1 /home/user/rpmbuild/SPECS/
D: ==========
/ usr/src/kernelの下にある必要があります。
見つからない場合は、試すことができます
rpm -qa | grep -w kernel-devel
rpm -ql kernel-devel-x.x.x.x.x
これにより、カーネルrpmによってインストールされたファイルの場所がわかります。
ちなみに、カーネルソースはkernel-x.x.x.xではなくkernel-develパッケージでインストールする必要があります