Tutorial
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* チュートリアル環境を構築する [#o3436f00]
* 好きにいじれる Linux kernel を用意する [#o35498de]
仮想環境を使い Linux kernel 内で動作するプログラムを作っ...
** 仮想マシンを用意する [#lceaaaab]
*** 仮想マシンを作成する [#qa679cee]
VirtualBox に次のような設定の仮想マシンを用意してください...
|構成要素|設定|説明|h
|仮想マシンOS (Type)|linux|この OS のデバイス・ドライバ開...
|仮想マシンディストリビューション (Version)|Ubuntu ホスト...
|仮想マシンメモリ容量 (Base Memory)|1024Mibyte 以上|遅い...
|プロセッサ数(Processor(s))|2 個以上|2個を割り当てると可...
|リモート・ディスプレイ(Remote Display)|Disable|リモート...
|光学ドライブ (optical drive)|1 台|Ubuntu インストーラー ...
|ハード・ディスク (hard disk)|1 台, 200G byte|Ubuntu、Lin...
|ネットワーク・アダプタ接続 (Attached to)|bridged adapter...
|シリアル・ポート番号 (Port Number)|COM1|もしかしたら使う...
|シリアル・ポート・モード (Port Mode)|Disconnected|もしか...
次は VirtualBox の仮想マシン設定一覧の画像です。赤線を引...
#ref(vbox-055-caped.png)
*** 仮想マシンに Ubuntu をインストールする [#c27be73f]
単純なパーティション構成で Ubuntu をインストールします。&...
#ref(vbox-090-resize.png)
次の表のようにパーティションが分割されます。
|パーティション|ファイル・システム|マウント・ポイント|備...
|/dev/sda1|ext4|/|殆どこのパーティションに容量が割れ当て...
|/dev/sda5|swap||おおよそメモリ容量と同じ量が割り当てられ...
次はパーティション分割を終えた後のスクリーン・ショットで...
#textbox(note,仮想マシンの画面がせまい){{
インストール後、仮想マシンの画面がせまく感じる場合は &ref...
}}
*** パッケージ追加 [#w542b321]
私の好みも含め、パッケージを追加しデバイス・ドライバ開発...
- ssh server をインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service ssh s...
&span(ConsoleOut){$ };&span(ConsoleIn){ifconfig};&span(Co...
}}
- system V init ツールをインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
- ssh server を常に起動しておく
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
}}
- git ツールをインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo git config --...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo git config --...
}}
- kernel source を make するのに必要なツールをインストー...
curses ライブラリを使い、テキスト文字によって視覚的に把握...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
#textbox(note,ノート){{
git gui コマンドを使って GUI の git ツールを起動し、commi...
}}
- grub2 boot loader を更新するのに必要なツールをインスト...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
- (好みで) NFS server をインストールする~
NFS server 機能を使うことでコンパイルをホスト・マシンなど...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service nfs-k...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
}}
#textbox(note,ノート){{
設定ファイル /etc/exportfs を編集していないので NFS で共...
}}
- (好みで) samba server をインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/sam...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/nss...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service nmb s...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service smb s...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service winbi...
}}
** ソースを取ってくる [#x5344e46]
Linux kernel のソースコードを取得します。ローカルの git ...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){mkdir -p };&span(C...
&span(ConsoleOut){$ };&span(ConsoleIn){cd };&span(Console...
&span(ConsoleOut){$ };&span(ConsoleIn){git clone git://gi...
}}
#textbox(note,ノート){{
git clone コマンドは完了するのに 2 時間 ~ 半日程度かかる...
}}
** コンパイルができる様に準備する [#wdda3304]
Ubuntu 14.04 に使っている Linux kernel よりは新しく、long...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){cd linux-stable};
&span(ConsoleOut){$ };&span(ConsoleIn){git checkout v4.1....
&span(ConsoleOut){$ };&span(ConsoleIn){git branch v4.1.27...
&span(ConsoleOut){$ };&span(ConsoleIn){git checkout v4.1....
}}
#textbox(note,ノート){{
Linux kernel はバージョンを上げても user space 向け API ...
}}
#textbox(note,ノート){{
ここで branch を作成しても、本稿で積極的に topic branch (...
Linux kernel のソースコードを読むと、おそらく普通の開発で...
}}
** make menuconfig [#s8697094]
ソース・コード・ツリーの根にある .config ファイルの内容を...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){cd linux-stable};&...
&span(ConsoleOut){$ };&span(ConsoleIn){cp /boot/config-`u...
&span(ConsoleOut){$ };&span(ConsoleIn){make menuconfig};
}}
#textbox(caution,良くあるエラー){{
&span(ConsoleOut){In file included from scripts/kconfig/m...
&span(ConsoleOut){scripts/kconfig/lxdialog/dialog.h:38:20...
上のようなエラーが出た場合は、パッケージを追加してくださ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
#textbox(note,ノート){{
&span(ConsoleIn){uname -r};で「今の」kernel version を出...
}}
#textbox(note,ノート){{
menuconfig を使う理由の一つは、古い kernel に無かった新し...
}}
#textbox(note,ノート){{
クロス開発では .config ファイルをどうやって手に入れるのか...
}}
&span(ConsoleIn){make menuconfig};を実行すると次のような...
#pre(soft,width:800px, overflow:scroll){{
.config - Linux/x86 4.1.27 Kernel Configuration
──────────────────────────────────────────────
┌── Linux/x86 4.1.27 Kernel Configuration ────────────...
│ Arrow keys navigate the menu. <Enter> selects subme...
│ ----). Highlighted letters are hotkeys. Pressing <...
│ modularizes features. Press <Esc><Esc> to exit, <?>...
│ Legend: [*] built-in [ ] excluded <M> module < > ...
│ ┌────────────────────────────────────────┐ │
│ │ [*] 64-bit kernel ...
│ │ &span(Focus){General setup --->}; ...
│ │ [*] Enable loadable module support ---> ...
│ │ [*] Enable the block layer ---> ...
│ │ Processor type and features ---> ...
│ │ Power management and ACPI options ---> ...
│ │ Bus options (PCI etc.) ---> ...
│ │ Executable file formats / Emulations --->...
│ │ [*] Networking support ---> ...
│ │ Device Drivers ---> ...
│ │ Firmware Drivers ---> ...
│ │ File systems ---> ...
│ │ Kernel hacking ---> ...
│ │ Security options ---> ...
│ │ -*- Cryptographic API ---> ...
│ │ -*- Virtualization ---> ...
│ │ Library routines ---> ...
│ │ ...
│ └────────────────────────────────────────┘ │
├────────────────────────────────────────────┤
│ <Select> < Exit > < Help > < S...
└────────────────────────────────────────────┘
}}
+ "&span(ConsoleOut){General setup};" -> "&span(ConsoleOu...
+ "&span(ConsoleOut){< Ok >};" と "&span(ConsoleOut){< Ex...
menuconfig を終えると linux-stable ディレクトリに .config...
- 何ケ所かで行の入れ替えがある。
- 新しい kernel で追加された機能に関係する値が設定されて...
menuconfig を使用すると、設定を一覧でき修正も楽です。しか...
** 構築 [#u0ace359]
おおよそプロセッサ数(同時実行可能な Thread 数) x 2 の並列...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){make -j };&span(Co...
}}
#textbox(note,ノート){{
コンパイル中に警告をいくつか見ると思います。このページに...
}}
** 起動するように組み込む [#de483ee6]
make で構築したファイルは起動時にメモリ上に展開される ker...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo make modules_...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo make install}...
}}
#textbox(note,ノート){{
header file はインストール &span(ConsoleOut){$ };&span(Co...
}}
上記の make コマンドで Linux kernel に組み込まれるモジュ...
|make target|インストールされるファイル・場所|h
|modules_install|カーネルに組み込むモジュール(オブジェク...
|kernel|config-&span(Alias){kernel_version};, initrd-&spa...
構築した Linux kernel を起動する様に grub2 boot loader を...
#pre(soft, width:800px, overflow:scroll){{
&span(ConsoleOut){$ };&span(ConsoleIn){grep -w menuentry ...
&span(ConsoleOut){ menuentry 'Ubuntu' --class ubun...
&span(ConsoleOut){ menuentry '};&span(ConsoleOut,F...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 4...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 3...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 3...
&span(ConsoleOut){menuentry 'Memory test (memtest86+)' &#...
&span(ConsoleOut){menuentry 'Memory test (memtest86+, ser...
}}
確認が済んだら、 /etc/default/grub を編集します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/def...
}}
構築した Linux kernel を起動する様に修正します。下線をつ...
#pre(soft, width:800px, overflow:scroll){{
# If you change this file, run 'update-grub' afterwards t...
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
&span(Focus){GRUB_DEFAULT="Ubuntu>Ubuntu, with Linux 4.1....
&span(Focus){#GRUB_HIDDEN_TIMEOUT=0};
&span(Focus){GRUB_HIDDEN_TIMEOUT_QUIET=false};
&span(Focus){GRUB_TIMEOUT=5};
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo ...
&span(Focus){GRUB_CMDLINE_LINUX_DEFAULT=""};
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit yo...
# This works with Linux (no patch required) and with any ...
# the memory map information from GRUB (GNU Mach, kernel ...
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic car...
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx...
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu e...
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
}}
次の表は grub に施した修正の詳細です。万が一起動しない場...
|修正箇所|修正内容|h
|GRUB_DEFAULT|起動するイメージを選択する指定です。|
|GRUB_HIDDEN_TIMEOUT|コメントアウトし、起動メニューを隠さ...
|GRUB_HIDDEN_TIMEOUT_QUIET|上の変更と同様の目的で修正しま...
|GRUB_TIMEOUT|起動時に別の kernel を選択する時間的余裕を...
|GRUB_CMDLINE_LINUX_DEFAULT|起動中のメッセージを隠す指定...
grub2 boot loader を更新します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo update-grub};
}}
特にエラーが無ければ、再起動します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo /sbin/reboot};
}}
** 起動したことを確認する [#y45d8e06]
おそらく、起動中にメッセージが流れるようになった以外は何...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){uname -a};
&span(ConsoleOut){Linux lkdqwin01 };&span(ConsoleOut,Focu...
}}
時間が掛かった割には、大きな変化が無く少々残念かもしれま...
&span(ConsoleIn){dmesg}; コマンドで起動時に流れたメッセー...
#pre(soft,width:800px,overflow:scroll){{
&span(ConsoleOut){$ };&span(ConsoleIn){dmesg};
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] };&span(ConsoleOut,Focus...
&span(ConsoleOut){[ 0.000000] Command line: BOOT_IMAGE...
&span(ConsoleOut){[ 0.000000] KERNEL supported cpus:};
&span(ConsoleOut){[ 0.000000] Intel GenuineIntel};
&span(ConsoleOut){[ 0.000000] AMD AuthenticAMD};
&span(ConsoleOut){[ 0.000000] Centaur CentaurHauls};
&span(ConsoleOut){[ 0.000000] tseg: 0000000000};
&span(ConsoleOut){[ 0.000000] e820: BIOS-provided phys...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
... 以下省略&ref(dmesg-20160802.log,,dmesg 出力全て); ...
}}
終了行:
* チュートリアル環境を構築する [#o3436f00]
* 好きにいじれる Linux kernel を用意する [#o35498de]
仮想環境を使い Linux kernel 内で動作するプログラムを作っ...
** 仮想マシンを用意する [#lceaaaab]
*** 仮想マシンを作成する [#qa679cee]
VirtualBox に次のような設定の仮想マシンを用意してください...
|構成要素|設定|説明|h
|仮想マシンOS (Type)|linux|この OS のデバイス・ドライバ開...
|仮想マシンディストリビューション (Version)|Ubuntu ホスト...
|仮想マシンメモリ容量 (Base Memory)|1024Mibyte 以上|遅い...
|プロセッサ数(Processor(s))|2 個以上|2個を割り当てると可...
|リモート・ディスプレイ(Remote Display)|Disable|リモート...
|光学ドライブ (optical drive)|1 台|Ubuntu インストーラー ...
|ハード・ディスク (hard disk)|1 台, 200G byte|Ubuntu、Lin...
|ネットワーク・アダプタ接続 (Attached to)|bridged adapter...
|シリアル・ポート番号 (Port Number)|COM1|もしかしたら使う...
|シリアル・ポート・モード (Port Mode)|Disconnected|もしか...
次は VirtualBox の仮想マシン設定一覧の画像です。赤線を引...
#ref(vbox-055-caped.png)
*** 仮想マシンに Ubuntu をインストールする [#c27be73f]
単純なパーティション構成で Ubuntu をインストールします。&...
#ref(vbox-090-resize.png)
次の表のようにパーティションが分割されます。
|パーティション|ファイル・システム|マウント・ポイント|備...
|/dev/sda1|ext4|/|殆どこのパーティションに容量が割れ当て...
|/dev/sda5|swap||おおよそメモリ容量と同じ量が割り当てられ...
次はパーティション分割を終えた後のスクリーン・ショットで...
#textbox(note,仮想マシンの画面がせまい){{
インストール後、仮想マシンの画面がせまく感じる場合は &ref...
}}
*** パッケージ追加 [#w542b321]
私の好みも含め、パッケージを追加しデバイス・ドライバ開発...
- ssh server をインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service ssh s...
&span(ConsoleOut){$ };&span(ConsoleIn){ifconfig};&span(Co...
}}
- system V init ツールをインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
- ssh server を常に起動しておく
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
}}
- git ツールをインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo git config --...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo git config --...
}}
- kernel source を make するのに必要なツールをインストー...
curses ライブラリを使い、テキスト文字によって視覚的に把握...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
#textbox(note,ノート){{
git gui コマンドを使って GUI の git ツールを起動し、commi...
}}
- grub2 boot loader を更新するのに必要なツールをインスト...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
- (好みで) NFS server をインストールする~
NFS server 機能を使うことでコンパイルをホスト・マシンなど...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service nfs-k...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
}}
#textbox(note,ノート){{
設定ファイル /etc/exportfs を編集していないので NFS で共...
}}
- (好みで) samba server をインストールする
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo sysv-rc-conf ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/sam...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/nss...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service nmb s...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service smb s...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo service winbi...
}}
** ソースを取ってくる [#x5344e46]
Linux kernel のソースコードを取得します。ローカルの git ...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){mkdir -p };&span(C...
&span(ConsoleOut){$ };&span(ConsoleIn){cd };&span(Console...
&span(ConsoleOut){$ };&span(ConsoleIn){git clone git://gi...
}}
#textbox(note,ノート){{
git clone コマンドは完了するのに 2 時間 ~ 半日程度かかる...
}}
** コンパイルができる様に準備する [#wdda3304]
Ubuntu 14.04 に使っている Linux kernel よりは新しく、long...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){cd linux-stable};
&span(ConsoleOut){$ };&span(ConsoleIn){git checkout v4.1....
&span(ConsoleOut){$ };&span(ConsoleIn){git branch v4.1.27...
&span(ConsoleOut){$ };&span(ConsoleIn){git checkout v4.1....
}}
#textbox(note,ノート){{
Linux kernel はバージョンを上げても user space 向け API ...
}}
#textbox(note,ノート){{
ここで branch を作成しても、本稿で積極的に topic branch (...
Linux kernel のソースコードを読むと、おそらく普通の開発で...
}}
** make menuconfig [#s8697094]
ソース・コード・ツリーの根にある .config ファイルの内容を...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){cd linux-stable};&...
&span(ConsoleOut){$ };&span(ConsoleIn){cp /boot/config-`u...
&span(ConsoleOut){$ };&span(ConsoleIn){make menuconfig};
}}
#textbox(caution,良くあるエラー){{
&span(ConsoleOut){In file included from scripts/kconfig/m...
&span(ConsoleOut){scripts/kconfig/lxdialog/dialog.h:38:20...
上のようなエラーが出た場合は、パッケージを追加してくださ...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo apt-get insta...
}}
#textbox(note,ノート){{
&span(ConsoleIn){uname -r};で「今の」kernel version を出...
}}
#textbox(note,ノート){{
menuconfig を使う理由の一つは、古い kernel に無かった新し...
}}
#textbox(note,ノート){{
クロス開発では .config ファイルをどうやって手に入れるのか...
}}
&span(ConsoleIn){make menuconfig};を実行すると次のような...
#pre(soft,width:800px, overflow:scroll){{
.config - Linux/x86 4.1.27 Kernel Configuration
──────────────────────────────────────────────
┌── Linux/x86 4.1.27 Kernel Configuration ────────────...
│ Arrow keys navigate the menu. <Enter> selects subme...
│ ----). Highlighted letters are hotkeys. Pressing <...
│ modularizes features. Press <Esc><Esc> to exit, <?>...
│ Legend: [*] built-in [ ] excluded <M> module < > ...
│ ┌────────────────────────────────────────┐ │
│ │ [*] 64-bit kernel ...
│ │ &span(Focus){General setup --->}; ...
│ │ [*] Enable loadable module support ---> ...
│ │ [*] Enable the block layer ---> ...
│ │ Processor type and features ---> ...
│ │ Power management and ACPI options ---> ...
│ │ Bus options (PCI etc.) ---> ...
│ │ Executable file formats / Emulations --->...
│ │ [*] Networking support ---> ...
│ │ Device Drivers ---> ...
│ │ Firmware Drivers ---> ...
│ │ File systems ---> ...
│ │ Kernel hacking ---> ...
│ │ Security options ---> ...
│ │ -*- Cryptographic API ---> ...
│ │ -*- Virtualization ---> ...
│ │ Library routines ---> ...
│ │ ...
│ └────────────────────────────────────────┘ │
├────────────────────────────────────────────┤
│ <Select> < Exit > < Help > < S...
└────────────────────────────────────────────┘
}}
+ "&span(ConsoleOut){General setup};" -> "&span(ConsoleOu...
+ "&span(ConsoleOut){< Ok >};" と "&span(ConsoleOut){< Ex...
menuconfig を終えると linux-stable ディレクトリに .config...
- 何ケ所かで行の入れ替えがある。
- 新しい kernel で追加された機能に関係する値が設定されて...
menuconfig を使用すると、設定を一覧でき修正も楽です。しか...
** 構築 [#u0ace359]
おおよそプロセッサ数(同時実行可能な Thread 数) x 2 の並列...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){make -j };&span(Co...
}}
#textbox(note,ノート){{
コンパイル中に警告をいくつか見ると思います。このページに...
}}
** 起動するように組み込む [#de483ee6]
make で構築したファイルは起動時にメモリ上に展開される ker...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo make modules_...
&span(ConsoleOut){$ };&span(ConsoleIn){sudo make install}...
}}
#textbox(note,ノート){{
header file はインストール &span(ConsoleOut){$ };&span(Co...
}}
上記の make コマンドで Linux kernel に組み込まれるモジュ...
|make target|インストールされるファイル・場所|h
|modules_install|カーネルに組み込むモジュール(オブジェク...
|kernel|config-&span(Alias){kernel_version};, initrd-&spa...
構築した Linux kernel を起動する様に grub2 boot loader を...
#pre(soft, width:800px, overflow:scroll){{
&span(ConsoleOut){$ };&span(ConsoleIn){grep -w menuentry ...
&span(ConsoleOut){ menuentry 'Ubuntu' --class ubun...
&span(ConsoleOut){ menuentry '};&span(ConsoleOut,F...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 4...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 3...
&span(ConsoleOut){ menuentry 'Ubuntu, with Linux 3...
&span(ConsoleOut){menuentry 'Memory test (memtest86+)' &#...
&span(ConsoleOut){menuentry 'Memory test (memtest86+, ser...
}}
確認が済んだら、 /etc/default/grub を編集します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo nano /etc/def...
}}
構築した Linux kernel を起動する様に修正します。下線をつ...
#pre(soft, width:800px, overflow:scroll){{
# If you change this file, run 'update-grub' afterwards t...
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
&span(Focus){GRUB_DEFAULT="Ubuntu>Ubuntu, with Linux 4.1....
&span(Focus){#GRUB_HIDDEN_TIMEOUT=0};
&span(Focus){GRUB_HIDDEN_TIMEOUT_QUIET=false};
&span(Focus){GRUB_TIMEOUT=5};
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo ...
&span(Focus){GRUB_CMDLINE_LINUX_DEFAULT=""};
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit yo...
# This works with Linux (no patch required) and with any ...
# the memory map information from GRUB (GNU Mach, kernel ...
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic car...
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx...
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu e...
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
}}
次の表は grub に施した修正の詳細です。万が一起動しない場...
|修正箇所|修正内容|h
|GRUB_DEFAULT|起動するイメージを選択する指定です。|
|GRUB_HIDDEN_TIMEOUT|コメントアウトし、起動メニューを隠さ...
|GRUB_HIDDEN_TIMEOUT_QUIET|上の変更と同様の目的で修正しま...
|GRUB_TIMEOUT|起動時に別の kernel を選択する時間的余裕を...
|GRUB_CMDLINE_LINUX_DEFAULT|起動中のメッセージを隠す指定...
grub2 boot loader を更新します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo update-grub};
}}
特にエラーが無ければ、再起動します。
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){sudo /sbin/reboot};
}}
** 起動したことを確認する [#y45d8e06]
おそらく、起動中にメッセージが流れるようになった以外は何...
#pre(soft){{
&span(ConsoleOut){$ };&span(ConsoleIn){uname -a};
&span(ConsoleOut){Linux lkdqwin01 };&span(ConsoleOut,Focu...
}}
時間が掛かった割には、大きな変化が無く少々残念かもしれま...
&span(ConsoleIn){dmesg}; コマンドで起動時に流れたメッセー...
#pre(soft,width:800px,overflow:scroll){{
&span(ConsoleOut){$ };&span(ConsoleIn){dmesg};
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] Initializing cgroup subs...
&span(ConsoleOut){[ 0.000000] };&span(ConsoleOut,Focus...
&span(ConsoleOut){[ 0.000000] Command line: BOOT_IMAGE...
&span(ConsoleOut){[ 0.000000] KERNEL supported cpus:};
&span(ConsoleOut){[ 0.000000] Intel GenuineIntel};
&span(ConsoleOut){[ 0.000000] AMD AuthenticAMD};
&span(ConsoleOut){[ 0.000000] Centaur CentaurHauls};
&span(ConsoleOut){[ 0.000000] tseg: 0000000000};
&span(ConsoleOut){[ 0.000000] e820: BIOS-provided phys...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
&span(ConsoleOut){[ 0.000000] BIOS-e820: [mem 0x000000...
... 以下省略&ref(dmesg-20160802.log,,dmesg 出力全て); ...
}}
ページ名: