雑記

SEもどきのメモ帳

openSuSEでカーネルダンプ解析・・・の準備(デバッグつきカーネルのmake)

カーネルダンプ解析に必要なもの

・crash コマンド

デバッグカーネル

・根性

C言語の知識(少なくともポインタとスタック、構造体あたりは必修)

・根気

 

 

1. crash コマンドの準備

zypperコマンドでインストールしましょう

 

zypper in crash

f:id:konbu-conception:20151024232709j:plain

 

でも、crashコマンドだけだと何もできないです

f:id:konbu-conception:20151024233152j:plain

 

2. デバッグつきカーネルの準備

同じくzypperでとりあえずソースとかをインストールします

 

zypper in kernel-source

zypper in gcc

zypper in ncurses-devel

f:id:konbu-conception:20151024234617j:plain

 

configure作り

/usr/src/linuxに移動して make menuconfig

 

f:id:konbu-conception:20151025003432j:plain

Kernel hacking  --->

    Compile-time checks and compiler options  --->

      [*] Compile the kernel with debug info

 

Compile the kernel with debug infoにチェックが入っていることを確認します。

f:id:konbu-conception:20151025002641j:plain

 

 Saveでconfig を作ったら make します

make "CFLAGS= -g"

 

vmlinuzができたことを確認します

f:id:konbu-conception:20151025085717j:plain