2020年4月16日木曜日

FreeBSD kernel build

まずは、FreeBSD Handbookの8.5. Building and Installing a Custom Kernelを読む

#cd /usr/src
#make buildkernel KERNCONF=MYKERNE

詳しく知るには、
/usr/src/Makefileを読む。

その前に、Developers' HandbookのChapter 9. Building and Installing a FreeBSD Kernelを読む

#/usr/sbin/config MYKERNEL

続いて、config(8)を読む
man config

SYNOPSIS
     config [-CVgp] [-I path] [-d destdir] [-s srcdir] SYSTEM_NAME
     config [-x kernel]

     SYSTEM_NAME      Specify the name of the system configuration file
                      containing device specifications, configuration options
                      and other system parameters for one system
                      configuration.

MYKERNELは、SYSTEM_NAMEのことでシステムの構成を記述したファイル、
通常は、/sys/ARCH/confに存在する。(ARCHは、amd64)
configは、Makefileなどビルドに必要なファイルを作成する。
テンプレートが/sys/ARCH/confにある。テンプレートを修正してはいけない。
コピーして使う。
書き方は、config(5)に書かれている。

FILES
     /sys/conf/files                                         list of common files system is built from
     /sys/conf/Makefile.ARCH                                 generic makefile for the ARCH
     /sys/conf/files.ARCH                                    list of ARCH specific files
     /sys/ARCH/compile/SYSTEM_NAME   
                       default kernel  build directory for system  SYSTEM_NAME on ARCH

時間があれば、Building 4.4BSD Kernels with Configを読む。

config(5)によると
     device name [, name [...]]
     devices name [, name [...]]
             Configures the specified devices for inclusion into the kernel
             image.  Devices that are common to all architectures are defined
             in the file sys/conf/files.  Devices that are specific to
             architecture arch are defined in the file sys/conf/files.<arch>.


0 件のコメント:

コメントを投稿