HPlogo HP-UX Reference Volume 2 of 5 > m

mk_kernel(1M)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

mk_kernel — build a bootable HP-UX kernel and/or kernel modules

SYNOPSIS

usr/sbin/mk_kernel [-o pathname] [-s system_file] [-S] [-v]

/usr/sbin/mk_kernel -M module_name [[-M module_name]...] [-v]

DESCRIPTION

mk_kernel builds an executable file which can be used as a bootable kernel and kernel modules if any are configured. If the build succeeds, the newly built kernel is called vmunix_test, and the kernel function set directory (where the function set directory is the directory structure containing the set of modules that correspond to the kernel) is called dlkm.vmunix_test. The file and directory are placed in the build directory, as defined below.

The build directory is the target directory where mk_kernel places files and directories. In addition to the kernel and kernel modules, files such as conf.c, conf.o, and tune.h are also placed in the build directory.

If the path used to designate the system file is /stand/system, the build directory is /stand/build. If another path is used to designate the system file, the build directory is the current working directory. System files for the kernel modules are expected to be found in /stand/system.d. Libraries for the kernel are expected to be found in /usr/conf/lib. The master file used is the composite of files found under /usr/conf/master.d.

If the -o option is not specified, the kernel file and kernel function set directory remain in the working directory. If -o /stand/vmunix is specified, the target kernel file and kernel function set directory are not overwritten. The new kernel file and the kernel function set directory are moved to the default path as the system shuts down or starts up. The previous versions of the file and directory are renamed to /stand/vmunix.prev and /stand/dlkm.vmunix.prev. Until the system reboots, the new kernel file and the directory must be kept as vmunix_test and dlkm.vmunix_test, respectively.

If the -o option is specified with other than /stand/vmunix, the kernel file and kernel function set directory is created or updated immediately. In case the administrator needs to place these targets to the system default path, the kmupdate command must be used to trigger the replacement. Manually replacing the default kernel (/stand/vmunix) or any file under the kernel function set directory (/stand/dlkm) must be avoided.

mk_kernel exits with no action if the environment variable SW_INITIAL_INSTALL has the value of 1. SW_INITIAL_INSTALL is exported by SD with that value only when the system is undergoing its initial software system installation.

Options

mk_kernel recognizes the following options.

-M module_name

Specify the module to configure. No kernel image will be generated. For details see config(1M).

-o pathname

Specify the target file path. The created kernel file, vmunix_test, is moved from the build directory to the path specified by the option argument. The associated kernel function set directory, dlkm.vmunix_test, is moved to the same destination directory.

If the default kernel, /stand/vmunix, is specified or the -o option is not specified, the created kernel file does not replace /stand/vmunix and remains as vmunix_test.

The kernel file and associated kernel function set directory are automatically moved to /stand/vmunix and /stand/dlkm during either shutdown or startup.

-s system_file

Specify the kernel template file. If this option is not specified, the system file /stand/system is used.

-S

Specify that all configured kernel modules are to be statically linked into the kernel. For details see config(1M).

-v

Verbose mode.

RETURN VALUE

mk_kernel returns 0 upon normal completion, and 1 if an error occurred.

DIAGNOSTICS

Messages and warnings are sent to stdout. Messages from config and other commands are displayed when invoked from mk_kernel. Errors cause mk_kernel to halt immediately; warnings allow the program to continue.

EXAMPLES

mk_kernel -o /stand/vmunix

Uses the file /stand/system to build a new kernel and kernel module(s). The new kernel file is placed in /stand/build/vmunix_test upon success. Kernel function set directory is placed in /stand/build/dlkm.vmunix_test. These files are moved automatically to /stand/vmunix and /stand/dlkm during shutdown or startup. The current set is saved as /stand/vmunix.prev and /stand/dlkm.vmunix.prev.

mk_kernel -s /mnt/altsys/stand/system.new

Uses the file /mnt/altsys/stand/system.new to build a new kernel and kernel module(s). The new kernel is named vmunix_test in the present working directory. The kernel function set directory, dlkm.vmunix_test, is placed in the current working directory.

mk_kernel -s /stand/system -o /tmp/new_kernel

Uses the file /stand/system to build a new kernel and kernel module(s). The new kernel file is placed in /tmp/new_kernel. The kernel function set directory is in /tmp/dlkm.new_kernel. If the administrator wants to use this kernel as the default kernel, the kmupdate command can be used.

WARNINGS

System administrators are expected to treat the kernel and dlkm, kernel_name, as a set. Do not manually copy the kernel or manually update the current kernel file with its associated kernel function set directory. To update the default kernel, always use the kmupdate command.

Kernel modules are separate objects to be independently configured into the system without requiring a reboot. To accomplish this, the kernel relies on several files under the kernel function set directory.

  • kernel file: kernel_name or /stand/vmunix

  • kernel function set directory: dlkm.kernel_name or /stand/dlkm

The kernel function set directory contains kernel modules, a module database file, and a kernel symbol table file. These files and directories are expected to be found in a directory whose name matches the booted kernel. If the kernel function set directory is not found, the dynamically loadable kernel module feature is disabled.

FILES

/stand/vmunix

Default kernel

/stand/dlkm

Default kernel function set directory

/stand/system

Default system file

/stand/build/vmunix_test

Kernel built by mk_kernel

/stand/build/dlkm.vmunix_test

Kernel function set directory build by mk_kernel

/stand/vmunix.prev

Saved kernel

/stand/dlkm.vmunix.prev

Saved kernel function set directory

© Hewlett-Packard Development Company, L.P.