Installkernel
Installkernel は、新しいカーネルのインストールとブートローダの設定の更新を自動的に行う、スクリプトのコレクションです。
パッケージ sys-kernel/installkernel はカーネルのインストールを管理するための 2 通りの方法を提供しています。1 つは Debian に由来する伝統的な installkernel
で、もう 1 つは systemd の kernel-install
です。
systemd USE フラグは、どちらがデフォルトで使用されるかを変更します。このデフォルトは SYSTEMD_KERNEL_INSTALL 環境変数で無視することができます。
USE flags for sys-kernel/installkernel Gentoo fork of installkernel script from debianutils
dracut
|
Generate an initramfs or UKI on each kernel installation |
efistub
|
EXPERIMENTAL: Update UEFI configuration on each kernel installation |
grub
|
Re-generate grub.cfg on each kernel installation, used grub.cfg is overridable with GRUB_CFG env var |
refind
|
Install a Gentoo icon for rEFInd alongside the (unified) kernel image, used icon is overridable with REFIND_ICON env var |
systemd
|
Use systemd's kernel-install to install kernels, overridable with SYSTEMD_KERNEL_INSTALL env var |
systemd-boot
|
Use systemd-boot's native layout by default |
ugrd
|
Generate an initramfs using UGRD on each kernel installation |
uki
|
Install UKIs to ESP/EFI/Linux for EFI stub booting and/or bootloaders with support for auto-discovering UKIs |
ukify
|
Build an UKI with systemd's ukify on each kernel installation |
Systemd の kernel-install
このインストール手法を選択するためには、systemd USE フラグを有効化するか、環境で SYSTEMD_KERNEL_INSTALL=1 を設定してください。sys-kernel/installkernel に対する追加の USE フラグは、以下に示す通り、kernel-install
のデフォルト設定を制御します。
/etc/portage/package.use/installkernel
sys-kernel/installkernel systemd
root #
emerge --ask sys-kernel/installkernel
Or
/etc/env.d/99systemd-kernel-install
SYSTEMD_KERNEL_INSTALL=1
root #
env-update
Systemd's kernel-install can not only install kernels (kernel-install add), it can also handle kernel removal (kernel-install remove). If kernel-install is installed it will automatically be called by eclean-kernel.
構成設定
kernel-install の構成は /etc/kernel/install.conf および /usr/lib/kernel/install.conf で行われ、後者よりも前者が優先されます。3 個の構成オプションを設定することができます:
/etc/kernel/install.conf
layout=
initrd_generator=
uki_generator=
Debian の installkernel のために追加の自動化プラグインを提供していた sys-kernel/installkernel に対する USE フラグは、systemd の kernel-install のためのデフォルトの install.conf 構成設定ファイルの制御も行います。もちろん、手動で構成設定を変更することもできます。
/etc/kernel/install.conf overrides /usr/lib/kernel/install.conf as a whole! When /etc/kernel/install.conf exists all settings in /usr/lib/kernel/install.conf are ignored. Therefore, when the intention is to only override one setting, the user must also copy the other settings which should not be overridden from /usr/lib/kernel/install.conf to /etc/kernel/install.conf.
layout
上流の systemd は Boot Loader Specification type 1 (layout=bls) および type 2 (layout=uki) レイアウトをサポートしています。type 1 レイアウトは systemd-boot によって使用され、type 2 レイアウトは Unified カーネルイメージのために使用されることが想定されており、GRUB、systemd-boot および refind によってサポートされています。installkernel は現時点では refind の構成設定を更新するプラグインを提供していません。
Gentoo は GRUB との併用を意図した、より伝統的なレイアウト (layout=grub) もサポートしています。これは上に記述した Debian の installkernel によって使用されるレイアウトに非常に似ています (が、同一ではありません)。このレイアウトは、より基本的で伝統的なレイアウトが望まれるような他の場合でも使用することができます。Unified カーネルイメージと組み合わせて GRUB を使用するためには、代わりに uki レイアウトを使用してください。
When the grub, systemd-boot, efistub, and uki USE flags are all disabled, the kernels will be installed in a layout that is mostly backwards compatible with Debian's installkernel (layout=compat).
When multiple layout-specifying flags are enabled, the uki layout (enabled by the uki USE flag) takes precedence over the bls layout (enabled by the systemd-boot USE flag), which in turn takes precedence over the grub layout (enabled by the grub USE flag).
An overview of each layout is shown in the sections below:
compat
The compat layout is very similar, but not identical, to the layout used by Debian's traditional installkernel:
/boot/initramfs-x.y.z-gentoo-dist.img # If USE=dracut (or other initramfs generator)
/boot/kernel-x.y.z-gentoo-dist
efistub
The efistub layout is identical to the compat layout, but relocated to the EFI system partition for EFI stub booting. The kernel image gains the .efi suffix as some firmware vendors enforce this:
/${ESP}/EFI/Gentoo/initramfs-x.y.z-gentoo-dist.img # If USE=dracut (or other initramfs generator)
/${ESP}/EFI/Gentoo/kernel-x.y.z-gentoo-dist.efi
Whether or not (automated) EFI stub booting works is highly dependent on the UEFI vendor. This is considered an advanced and experimental feature.
grub
The grub layout is identical to the compat layout, with an added grub.cfg, used by GRUB:
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img # If USE=dracut (or other initramfs generator)
/boot/kernel-x.y.z-gentoo-dist
bls
The Bootloader Specification Type 1 or bls layout, used by systemd-boot:
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd # If USE=dracut (or other initramfs generator)
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
uki
The Bootloader Specification Type 2 or uki layout:
/boot/grub/grub.cfg # If USE=grub
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
initrd_generator
この設定は initramfs を生成するためにどのプラグインを使用すべきかを制御します。現時点でそのようなプラグインをインストールする唯一のパッケージは、sys-kernel/dracut の Dracut です。この設定は ${KERNEL_INSTALL_INITRD_GENERATOR} としてプラグインに公開されます。
uki_generator
この設定は Unified カーネルイメージを生成するためにどのプラグインを使用すべきかを制御します。現時点でそのようなプラグインを提供するパッケージは 2 つあります: sys-kernel/dracut と systemd (sys-apps/systemd と sys-apps/systemd-utils の ukify フラグを介して) です。この設定は ${KERNEL_INSTALL_UKI_GENERATOR} としてプラグインに公開されます。
kernel-install commands
Below an overview is provided of the available commands in systemd's kernel-install.
kernel-install add
(Re-)installs a kernel version. This command is called by sys-kernel/installkernel if the systemd USE flag is enabled.
root #
kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]
kernel-install remove
Uninstalls a kernel version. This command is called by app-admin/eclean-kernel if it is available.
root #
kernel-install [OPTIONS...] remove KERNEL-VERSION
kernel-install inspect
Prints an overview of parameters that will be used when installing a kernel version.
root #
kernel-install [OPTIONS...] inspect [KERNEL-VERSION] [KERNEL-IMAGE] [INITRD-FILE...]
kernel-install list
Prints an overview of all installed kernel versions. Meaning all kernel versions for which a directory is present in /lib/modules.
root #
kernel-install [OPTIONS...] list
kernel-install add-all
(Re-)installs all kernel versions. Iterates kernel-install add over each kernel for which a vmlinuz file is present in the associated /lib/modules directory.
root #
kernel-install [OPTIONS...] add-all
Runtime overrides
When the dracut and ukify plugins are enabled (i.e. the dracut and/or ukify USE flags are enabled) they may be skipped at runtime by overriding the default configuration provided by sys-kernel/installkernel at /usr/lib/kernel/install.conf with a custom configuration at /etc/kernel/install.conf. This may be useful on systems that have both the distribution kernels installed and manually configured kernels where the former enforces the enablement of the dracut USE flag but the latter might not require an initramfs at all.
For example:
/etc/kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
Note that this override will apply to all installed kernels. It is also possible to specify several different configurations and switch between them at runtime using the KERNEL_INSTALL_CONF_ROOT environment variable.
For example:
/etc/manual-kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
root #
KERNEL_INSTALL_CONF_ROOT=/etc/manual-kernel make install
Another method of overriding the default kernel installation is to use the KERNEL_INSTALL_PLUGINS environment variable. When this variable is set, only the specified plugins are run.
For example:
root #
KERNEL_INSTALL_PLUGINS="90-compat.install 90-loaderentry.install 90-uki-copy.install" make install
カスタマイズ
カスタムプラグインは、例えば initramfs または UKI を生成したり、あるいはブートローダ構成設定を更新したりするために、/etc/kernel/install.d 内にインストールすることができます。initramfs プラグインは ${KERNEL_INSTALL_STAGING_AREA} 上に initrd という名前のファイルとしてインストールすべきです。UKI プラグインは ${KERNEL_INSTALL_STAGING_AREA} 上に uki.efi という名前のファイルとしてインストールすべきです。すべてのプラグインファイルは .install の接尾辞を持たなくてはなりません。/etc/kernel/install.d 内のプラグインは、/usr/lib/kernel/install.d 内にある同名のデフォルトプラグインを無効化します。
Descriptions of plugin scripts
In exection order, the install.d plugins
- /usr/lib/kernel/install.d/00-00machineid-directory.install
- Create the ENTRY_DIR_ABS directory where kernels will be installed for systemd-boot.
- Installed by: sys-kernel/installkernel
- Executed if: layout=bls and kernel-install command is add
- /usr/lib/kernel/install.d/10-copy-prebuilt.install
- Copy prebuilt initramfs and Unified Kernel Image to the staging area if they exist. A prebuilt initramfs and Unified Kernel Image are present when the distribution kernels are installed with the generic-uki USE flag enabled.
- Installed by: sys-kernel/installkernel
- Executed if: kernel-install command is add
- /usr/lib/kernel/install.d/35-amd-microcode-systemd.install
- Builds an AMD CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
- Installed by: sys-kernel/linux-firmware if the initramfs is enabled.
- Executed if: kernel-install command is add and initrd_generator!=dracut.
- /usr/lib/kernel/install.d/35-intel-microcode-systemd.install
- Builds an Intel CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
- Installed by: sys-firmware/intel-microcode if the initramfs is enabled.
- Executed if: kernel-install command is add and initrd_generator!=dracut.
- /usr/lib/kernel/install.d/40-dkms.install
- Automatically rebuild kernel modules registered with DKMS on kernel installation, and clean them up on kernel removal.
- Installed by: sys-kernel/dkms
- Executed if: Always
- /usr/lib/kernel/install.d/50-depmod.install
- Update kernel module dependencies on kernel installation, and cleanup depmod files on kernel removal.
- Installed by: sys-apps/systemd or sys-apps/systemd-utils
- Executed if: Always
- /usr/lib/kernel/install.d/50-dracut.install
- Builds a initramfs or Unified Kernel Image (UKI) with dracut. A initramfs is built if initrd_generator=dracut. If uki_generator=dracut and not layout=bls then an UKI is built, this will be the case if the uki USE flag is enabled on sys-kernel/installkernel but the ukify USE flag is disabled.
- Installed by: sys-kernel/dracut
- Executed if: kernel-install command is add and initrd_generator=dracut (USE dracut) or uki_generator=dracut (USE dracut and USE uki but not USE ukify). Also executed if layout is set to an unsupported value.
- /usr/lib/kernel/install.d/51-dracut-rescue.install
- Build a dracut rescue initramfs image, currently not supported in combination with Unified Kernel Images.
- Installed by: sys-kernel/dracut
- Executed if: kernel-install command is add and dracut_rescue_image=yes in any dracut configuration file
- /usr/lib/kernel/install.d/52-ugrd.install
- Builds an initramfs using the ugrd initramfs generator.
- Installed by: sys-kernel/ugrd
- Executed if: kernel-install command is add and initrd_generator=ugrd.
- /usr/lib/kernel/install.d/85-check-diskspace.install
- Checks if there is enough disk space on the target partition to install the kernel.
- Installed by: sys-kernel/installkernel
- Executed if: Always
- /usr/lib/kernel/install.d/90-compat.install
- Install the staged (unified) kernel image (and initramfs) in a backwards compatibility layout similar to Debian's installkernel. And clean them up when the kernel is removed.
- Installed by: sys-kernel/installkernel
- Executed if: layout=compat or layout=grub
- /usr/lib/kernel/install.d/90-loaderentry.install
- Install the staged kernel image (and initramfs) in systemd-boot's native format and register the new kernel with systemd-boot. And clean up these files when the kernel is removed.
- Installed by: sys-apps/systemd or sys-apps/systemd-utils
- Executed if: layout=bls
- /usr/lib/kernel/install.d/90-runlilo.install
- Update LILO's configuration.
- Installed by: sys-boot/lilo
- Executed if: Always
- /usr/lib/kernel/install.d/90-uki-copy.install
- Copy the staged Unified Kernel Image to the EFI/Linux directory on the EFI System Partition. And clean it up on kernel removal. This plugin script will exit fatally if there is no UKI to install.
- Installed by: sys-apps/systemd or sys-apps/systemd-utils
- Executed if: layout=uki
- /usr/lib/kernel/install.d/90-zz-update-static.install
- Update version-less files or symlinks if they exist at the target location.
- Installed by: sys-kernel/installkernel
- Executed if: kernel-install command is add and layout=uki or layout=efistub or layout=compat or layout=grub
- /usr/lib/kernel/install.d/91-grub-mkconfig.install
- Update GRUB's configuration by running grub-mkconfig. Automatically finds Unified Kernel Images in the EFI/Linux directory on the EFI System Partition. Which grub.cfg to use is overridable with the GRUB_CFG environment variable.
- Installed by: sys-kernel/installkernel with grub
- Executed if: layout=uki or layout=grub
- /usr/lib/kernel/install.d/91-sbctl.install
- Sign the installed (unified) kernel image with sbctl's keys and add it to the sbctl database. Upon kernel removal it is removed from the database. The plugin script will exit fatally if sbctl's keys are not already setup. Note that both dracut and ukify are capable of signing generated unified kernel images by themselves and distribution kernels can already be signed using the secureboot USE flag. This plugin may be useful however for manually compiled kernels.
- Installed by: app-crypt/sbctl
- Executed if: Always
- /usr/lib/kernel/install.d/95-efistub-kernel-bootcfg.install
- Adds and removes UEFI boot entries on kernel installation or removal using kernel-bootcfg from app-emulation/virt-firmware.
- Installed by: sys-kernel/installkernel with USE efistub
- Executed if: layout=efistub or layout=uki
- /usr/lib/kernel/install.d/95-refind-copy-icon.install
- Install a Gentoo icon for the rEFInd bootloader alongside the (unified) kernel image. Which icon file to use is overridable with the REFIND_ICON environment variable.
- Installed by: sys-kernel/installkernel with USE refind
- Executed if: layout=uki or layout=compat
- /usr/lib/kernel/install.d/99-write-log.install
- Appends last installed kernel to /var/log/installkernel.log and updates state file at /var/lib/installkernel.
- Installed by: sys-kernel/installkernel
- Executed if: Always
Debian の installkernel
このインストール手法を選択するには、systemd USE フラグを無効化するか、環境で SYSTEMD_KERNEL_INSTALL=0 を設定してください。sys-kernel/installkernel に対する追加の USE フラグは、以下の概要に示す通り、追加の自動化プラグインのインストールを制御するために使用されるべきです。
/etc/portage/package.use/installkernel
sys-kernel/installkernel -systemd
root #
emerge --ask sys-kernel/installkernel
root #
emerge --ask sys-kernel/installkernel
Or
/etc/env.d/99no-systemd-kernel-install
SYSTEMD_KERNEL_INSTALL=0
root #
env-update
伝統的な installkernel は initramfs や Unified カーネルイメージ (UKI) をカーネルイメージと同じ場所にインストールするので、initramfs や Unified カーネルイメージを使用する構成から使用しない構成に切り換えたとき、これらのファイルが残り続けてしまうかもしれません。そのような状況では、これらのファイルが installkernel によって選択されてインストールされてしまうことがないようにするために、これらのファイルを手動で削除する必要があるかもしれません。
Configuration
Configuration of kernel-install is done in /etc/kernel/install.conf and /usr/lib/kernel/install.conf, where the former takes precedence over the latter. Three configuration options can be set:
/etc/kernel/install.conf
layout=
initrd_generator=
uki_generator=
The default /usr/lib/kernel/install.conf configuration file is provided by sys-kernel/installkernel. Of course the configuration may also be changed manually in /etc/kernel/install.conf.
/etc/kernel/install.conf overrides /usr/lib/kernel/install.conf as a whole! When /etc/kernel/install.conf exists, all settings in /usr/lib/kernel/install.conf are ignored. Therefore, when the intention is to only override one setting, the user must also copy the other settings which should not be overridden from /usr/lib/kernel/install.conf to /etc/kernel/install.conf.
layout
Debian's traditional installkernel installs the kernel and initramfs or Unified Kernel Image in a layout that looks like this:
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg # If USE=grub
/boot/initramfs-x.y.z-gentoo-dist.img # If USE=dracut (or another initramfs generator)
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png # If USE=refind
efistub
If the efistub USE flag is enabled, then the install tree is relocated to the EFI System Partition (ESP) and the kernel image gains the .efi suffix.
/${ESP}/EFI/Gentoo/System.map-x.y.z-gentoo-dist
/${ESP}/EFI/Gentoo/config-x.y.z-gentoo-dist
/${ESP}/EFI/Gentoo/initramfs-x.y.z-gentoo-dist.img # If USE=dracut (or another initramfs generator)
/${ESP}/EFI/Gentoo/vmlinuz-x.y.z-gentoo-dist.efi
uki
If the uki USE flag is enabled, then generated Unified Kernel Image is installed to the EFI/Linux directory on the EFI System Partition (ESP).
/boot/grub/grub.cfg # If USE=grub
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png # If USE=refind
initrd_generator
This setting controls which plugin should be used to generate the initramfs. Currently the only package that installs such a plugin is Dracut from sys-kernel/dracut. This setting is exposed to the plugins as ${INSTALLKERNEL_INITRD_GENERATOR}. When the dracut USE flag is enabled, this setting is automatically set to dracut. This setting is otherwise automatically set to none.
uki_generator
This setting controls which plugin should be used to generate the Unified Kernel Image. Currently two packages provide such a plugin: sys-kernel/dracut and systemd (via the ukify flag on sys-apps/systemd and sys-apps/systemd-utils). This setting is exposed to the plugins as ${INSTALLKERNEL_UKI_GENERATOR} When the ukify USE flag is enabled, this setting is automatically set to ukify. When the ukify USE flag is disabled, but the dracut and uki USE flags are enabled, this setting is automatically set to dracut. Otherwise this setting is automatically set to none.
Runtime overrides
When the dracut and ukify plugins are installed (i.e. the dracut and/or ukify USE flags are enabled) they may be skipped at runtime using the INSTALLKERNEL_INITRD_GENERATOR and INSTALLKERNEL_UKI_GENERATOR environment variables. This may be useful on systems that have both the distribution kernels installed and manually configured kernels where the former enforces the enabling of the dracut USE flag but the latter might not require an initramfs at all.
root #
INSTALLKERNEL_INITRD_GENERATOR=none INSTALLKERNEL_UKI_GENERATOR=none make install
Alternatively, these settings may be set permanently using /etc/kernel/install.conf:
/etc/kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
Note that this override will apply to all installed kernels. It is also possible to specify several different configurations and switch between them at runtime using the INSTALLKERNEL_CONF_ROOT environment variable.
For example:
/etc/manual-kernel/install.conf
layout=compat
initrd_generator=none
uki_generator=none
root #
INSTALLKERNEL_CONF_ROOT=/etc/manual-kernel make install
Another method of overriding the default kernel installation is to use the INSTALLKERNEL_PREINST_PLUGINS and INSTALLKERNEL_POSTINST_PLUGINS environment variables. When these variables are set, only the specified plugins are run.
For example:
root #
INSTALLKERNEL_POSTINST_PLUGINS="91-grub-mkconfig.install" make install
カスタマイズ
カスタムプラグインには、例えば initramfs または Unified カーネルイメージ (UKI) を生成するためのカスタムプラグインがありますが、これらは /etc/kernel/preinst.d にインストールすることができます。initramfs プラグインはカーネルイメージと同じ場所に initrd という名前のファイルをインストールするはずです。そして、UKI プラグインはカーネルイメージと同じ場所に uki.efi という名前のファイルをインストールするはずです。
さらに、例えばブートローダの構成設定を更新するためのカスタムプラグインもあり、これらは /etc/kernel/postinst.d にインストールすることができます。
Plugins in /etc/kernel/preinst.d or /etc/kernel/postinst.d override default plugins in /usr/lib/kernel/preinst.d and /usr/lib/kernel/postinst.d with the same name.
Descriptions of plugin scripts
In exection order, the preinst.d plugins
- /usr/lib/kernel/preinst.d/35-amd-microcode.install
- Builds an AMD CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
- Installed by: sys-kernel/linux-firmware if the initramfs is enabled.
- Executed if: initrd_generator!=dracut.
- /usr/lib/kernel/preinst.d/35-intel-microcode.install
- Builds an Intel CPU microcode early initramfs if an initramfs generator is used that does not already bundle the CPU microcode.
- Installed by: sys-firmware/intel-microcode if the initramfs is enabled.
- Executed if: initrd_generator!=dracut.
- /usr/lib/kernel/preinst.d/50-dracut.install
- Builds a initramfs or Unified Kernel Image (UKI) with dracut. To build a UKI instead of a initramfs, set uefi=yes in /etc/dracut.conf.
- Installed by: sys-kernel/installkernel with USE dracut
- Executed if: initrd_generator=dracut.
- /usr/lib/kernel/preinst.d/52-ugrd.install
- Builds an initramfs using the ugrd initramfs generator.
- Installed by: sys-kernel/ugrd
- Executed if: initrd_generator=ugrd.
- /usr/lib/kernel/preinst.d/60-ukify.install
- Builds a Unified Kernel Image with systemd's ukify, will include a initramfs if one was built by an earlier plugin.
- Installed by: sys-kernel/installkernel with USE ukify
- Executed if: uki_generator=ukify and layout=uki.
- /usr/lib/kernel/preinst.d/99-check-diskspace.install
- Checks if there is enough disk space on the target partition to install the kernel.
- Installed by: sys-kernel/installkernel
- Executed if: Always
In execution order, the postinst.d plugins
- /usr/lib/kernel/postinst.d/40-dkms.install
- Automatically rebuild kernel modules registered with DKMS on kernel installation.
- Installed by: sys-kernel/dkms
- Executed if: Always
- /usr/lib/kernel/postinst.d/91-grub-mkconfig.install
- Update GRUB's configuration by running grub-mkconfig. Automatically finds Unified Kernel Images in the EFI/Linux direcotry on the EFI System Partition. Which grub.cfg to use is overridable with the GRUB_CFG environment variable.
- Installed by: sys-kernel/installkernel with USE grub
- Executed if: Always
- /usr/lib/kernel/postinst.d/95-efistub-uefi-mkconfig.install
- Adds UEFI boot entries for newly installed kernels and removes entries for removed kernels using sys-boot/uefi-mkconfig.
- Installed by: sys-kernel/installkernel with USE efistub
- Executed if: Always
- /usr/lib/kernel/postinst.d/95-refind-copy-icon.install
- Install a Gentoo icon for the rEFInd bootloader alongside the (unified) kernel image. Which icon file to use is overridable with the REFIND_ICON environment variable.
- Installed by: sys-kernel/installkernel with USE refind
- Executed if: Always
- /usr/lib/kernel/postinst.d/99-write-log.install
- Appends last installed kernel to /var/log/installkernel.log and updates state file at /var/lib/installkernel.
- Installed by: sys-kernel/installkernel
- Executed if: Always
- /usr/lib/kernel/postinst.d/90-runlilo.install
- Update LILO's configuration.
- Installed by: sys-boot/lilo
- Executed if: Always
USE configuration to boot layout mapping
The code boxes below maps possible sys-kernel/installkernel USE configurations to how the kernel and related files will be installed. It may be useful for users who are unsure which USE configuration suits their setup. ESP refers to the mount point of the EFI System Partition which may be /efi, /boot, /boot/efi or {{Path|/boot/EFI}. generic-uki refers to the generic-uki USE flag on the Distribution kernels.
For all layouts (except for the bls type 1 layout for systemd-boot) sys-kernel/installkernel supports updating an unversioned symlink or file at the same location as the installed kernel images. For example, if the kernel images are installed as /efi/EFI/Gentoo/kernel-x.y.z-gentoo-dist.efi then /efi/EFI/Gentoo/kernel.efi will be updated every time a kernel is installed if this file or symlink exists.
Systemd kernel-install (USE=+systemd)
Layouts with GRUB
Plain kernel image installation.
/boot/grub/grub.cfg
/boot/kernel-x.y.z-gentoo-dist
Plain kernel image installation, with initramfs generated by dracut.
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Layouts with Unified Kernel Images
Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.
/boot/grub/grub.cfg
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.
/boot/grub/grub.cfg
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is pregenerated by the distribution kernel package.
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Layouts with systemd-boot
Plain kernel image installation.
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
Plain kernel image installation, with initramfs generated by dracut.
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.
/${ESP}/gentoo/x.y.z-gentoo-dist/initrd
/${ESP}/gentoo/x.y.z-gentoo-dist/linux
/${ESP}/loader/entries/gentoo-x.y.z-gentoo-dist.conf
Layouts with Unified Kernel Images
Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is pregenerated by the distribution kernel package.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Layouts with rEFInd
Plain kernel image installation with icon for rEFInd.
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png
Plain kernel image installation, with a initramfs generated by dracut and icon for rEFInd.
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png
Plain kernel image installation with icon for rEFInd, initramfs is pregenerated by the distribution kernel package.
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
/boot/kernel-x.y.z-gentoo-dist.png
Layouts with Unified Kernel Images
Unified kernel image installation with icon for rEFInd, uki is generated with ukify and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is pregenerated by the distribution kernel package.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Layouts without GRUB/systemd-boot/rEFInd (other bootloaders)
Plain kernel image installation.
/boot/kernel-x.y.z-gentoo-dist
Plain kernel image installation, with a initramfs generated by dracut.
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/kernel-x.y.z-gentoo-dist
Layouts with Unified Kernel Images
Unified kernel image installation, uki is generated with ukify and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then installed to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is pregenerated by the distribution kernel package.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Traditional installkernel (USE=-systemd)
Layouts with GRUB
Plain kernel image installation.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/vmlinuz-x.y.z-gentoo-dist
Plain kernel image installation, with initramfs generated by dracut.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/grub/grub.cfg
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Layouts with Unified Kernel Images
Unified kernel image installation, with an uki generated by dracut (uki has no effect since there is no unified kernel image).
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and is then copied to the ESP.
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is pregenerated by the distribution kernel package and is then copied to the ESP.
/boot/grub/grub.cfg
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Layouts with rEFInd
Plain kernel image installation with icon for rEFInd.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png
Plain kernel image installation, with a initramfs generated by dracut and icon for rEFInd.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png
Plain kernel image installation with icon for rEFInd, initramfs is pregenerated by the distribution kernel package.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist.png
Layouts with Unified Kernel Images
Unified kernel image installation, with a initramfs generated by dracut.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is generated with ukify and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Unified kernel image installation with icon for rEFInd, uki is pregenerated by the distribution kernel package and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.png
Layouts without GRUB/systemd-boot/rEFInd (other bootloaders)
Plain kernel image installation.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/vmlinuz-x.y.z-gentoo-dist
Plain kernel image installation, with a initramfs generated by dracut.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Plain kernel image installation, initramfs is pregenerated by the distribution kernel package.
/boot/System.map-x.y.z-gentoo-dist
/boot/config-x.y.z-gentoo-dist
/boot/initramfs-x.y.z-gentoo-dist.img
/boot/vmlinuz-x.y.z-gentoo-dist
Layouts with Unified Kernel Images
Unified kernel image installation, with uki generated by dracut.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is generated with ukify and includes a initramfs generated with dracut and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
Unified kernel image installation, uki is pregenerated by the distribution kernel package and is then copied to the ESP.
/${ESP}/EFI/Linux/gentoo-x.y.z-gentoo-dist.efi
関連項目
- GRUB — 多くのシステムアーキテクチャ上で、様々なファイルシステムからカーネルをロードすることができる、マルチブート 2 次ブートローダです。
- systemd-boot — a minimal UEFI boot manager.
- EFI stub — EFI スタブカーネル、つまり、UEFI から直接実行可能なカーネルについて記載します。
- initramfs — is used to prepare Linux systems during boot before the init process starts.
- Project:Distribution_Kernel — aims to maintain sys-kernel/*-kernel packages.