このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン | |||
02_freebsd:99_その他:カーネル再構築 [2012/12/20 09:47] – matsui | 02_freebsd:99_その他:カーネル再構築 [2012/12/20 09:53] (現在) – [コンパイル&インストール] matsui | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== FreeBSD カーネル再構築 ====== | ||
+ | デフォルトのカーネルには必要のないものも含まれているのでメモリを占有したりして良いことはありません。\\ | ||
+ | 自分用に要らないデバイス等を省いて、スマートなカーネルにしましょう。~ | ||
+ | |||
+ | ====== 環境 ====== | ||
+ | FreeBSD 6.0 | ||
+ | |||
+ | |||
+ | ====== デフォルトのカーネルをコピー ====== | ||
+ | ■デフォルトのカーネル(GENERIC)をコピーして自分用のカーネル名にする。\\ | ||
+ | MYKERNELの所は自分の好きな名前でいいです。今回は例としてMYKERNELとしてあります。\\ | ||
+ | < | ||
+ | # cd / | ||
+ | # cp GENERIC MYKERNEL | ||
+ | </ | ||
+ | |||
+ | ====== MYKERNELを修正 ====== | ||
+ | < | ||
+ | # | ||
+ | # GENERIC -- Generic kernel configuration file for FreeBSD/ | ||
+ | # | ||
+ | # For more information on this file, please read the handbook section on | ||
+ | # Kernel Configuration Files: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # The handbook is also available locally in / | ||
+ | # if you've installed the doc distribution, | ||
+ | # FreeBSD World Wide Web server (http:// | ||
+ | # latest information. | ||
+ | # | ||
+ | # An exhaustive list of options and more detailed explanations of the | ||
+ | # device lines is also present in the ../ | ||
+ | # If you are in doubt as to the purpose or necessity of a line, check first | ||
+ | # in NOTES. | ||
+ | # | ||
+ | # $FreeBSD: src/ | ||
+ | |||
+ | | ||
+ | # | ||
+ | # | ||
+ | | ||
+ | | ||
+ | |||
+ | # To statically compile in device wiring instead of / | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # output. | ||
+ | | ||
+ | # output. | ||
+ | | ||
+ | |||
+ | # | ||
+ | | ||
+ | |||
+ | # PPPoE | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | # NAT | ||
+ | | ||
+ | # FIREWALL | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | |||
+ | | ||
+ | |||
+ | # Bus support. | ||
+ | | ||
+ | # | ||
+ | | ||
+ | |||
+ | # Floppy drives | ||
+ | | ||
+ | |||
+ | # ATA and ATAPI devices | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | # | ||
+ | | ||
+ | |||
+ | # SCSI Controllers | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # SCSI peripherals | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # RAID controllers interfaced to the SCSI subsystem | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # RAID controllers | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # atkbdc0 controls both the keyboard and the PS/2 mouse | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | # | ||
+ | |||
+ | # syscons is the default console driver, resembling an SCO console | ||
+ | | ||
+ | |||
+ | # Enable this for the pcvt (VT220 compatible) console driver | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | | ||
+ | |||
+ | # Floating point support - do not disable. | ||
+ | | ||
+ | |||
+ | # Power management support (see NOTES for more options) | ||
+ | # | ||
+ | # Add suspend/ | ||
+ | | ||
+ | |||
+ | # PCCARD (PCMCIA) support | ||
+ | # PCMCIA and cardbus bridge support | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Serial (COM) ports | ||
+ | | ||
+ | |||
+ | # Parallel port | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # If you've got a " | ||
+ | # supported by the puc(4) glue driver, uncomment the following | ||
+ | # line to enable it (connects to the sio and/or ppc drivers): | ||
+ | # | ||
+ | |||
+ | # PCI Ethernet NICs. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | # PCI Ethernet NICs that use the common MII bus controller code. | ||
+ | # NOTE: Be sure to keep the ' | ||
+ | | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # ISA Ethernet NICs. pccard NICs included. | ||
+ | # | ||
+ | # ' | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # ISA devices that use the old ISA shims | ||
+ | # | ||
+ | |||
+ | # Wireless NIC cards | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Pseudo devices. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | # The `bpf' device enables the Berkeley Packet Filter. | ||
+ | # Be aware of the administrative consequences of enabling this! | ||
+ | # Note that ' | ||
+ | | ||
+ | |||
+ | # USB support | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # USB Ethernet, requires mii | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # FireWire support | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | ====== コンパイル& | ||
+ | |||
+ | ■処理にかなりの時間がかかります。\\ | ||
+ | [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | < | ||
+ | # config MYKERNEL | ||
+ | # cd ../ | ||
+ | # make depend | ||
+ | # make | ||
+ | # make install | ||
+ | </ | ||
+ | ====== 万が一新しいカーネルが起動できない場合 ====== | ||
+ | ■起動時にブートオプションが表示される箇所で、6番を押して起動しloaderの画面を表示させます。\\ | ||
+ | unloadコマンドで現在のカーネルをアンロードし、loadコマンドで古いカーネルをロードしてからbootコマンドで起動します。\\ | ||
+ | < | ||
+ | | ||
+ | local / | ||
+ | boot | ||
+ | </ |