-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstallkernel.8
140 lines (139 loc) · 4.33 KB
/
installkernel.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.TH INSTALLKERNEL 8 "2019-12-06" "Gentoo Linux"
.SH NAME
installkernel \- install a new kernel image
.SH SYNOPSIS
.BI "installkernel " "version kernel System.map [directory] [--verbose] [--all] [--systemd|--no-systemd]"
.SH DESCRIPTION
.PP
.B installkernel
installs a new kernel image onto the system from the Linux source
tree. It is called by the Linux kernel makefiles when
.B make install
is invoked there, and also by portage when distribution kernels are installed.
.P
If an unified kernel image was generated, it is installed as
.IR {directory}/vmlinuz-{version}.efi .
Otherwise, the new kernel is installed into
.IR {directory}/vmlinuz-{version} .
If a symbolic link
.I {directory}/vmlinuz
already exists, it is refreshed by making a link from
.I {directory}/vmlinuz
to the new kernel, and the previously installed kernel is available as
.IR {directory}/vmlinuz.old .
.P
In addition to that,
.I System.map
passed on the command-line is installed using the same logic.
If the directory containing
.I System.map
contains
.I .config
or
.I config
file, it is also installed. If the directory containing the kernel image
contains an
.I initrd
file, it is also installed.
.P
Kernel installs are logged to
.IR /var/log/installkernel.log
in a tab separated file containing the columns:
DATE, KI_VENDOR, VERSION, CONF_ROOT, LAYOUT, INITRD_GEN, UKI_GEN, BOOT_ROOT, KERNEL_REL_PATH, INITRD_REL_PATH and PLUGIN_OVERRIDE.
.P
When the
.I version,
.I kernel,
and/or
.I System.map
positional arguments are not
given then these values default to the currently running kernel. Meaning
that version defaults to the value of
.I uname -r
and the kernel image defaults to
.I /lib/modules/$(uname -r)/vmlinuz
and the System.map defaults to
.I /lib/modules/$(uname -r)/System.map.
The fourth positional argument for the installation directory defaults to
.I /boot.
.P
If systemd's kernel-install is present on the system and the environment
variable
.B SYSTEMD_KERNEL_INSTALL
is set to 1 or the --systemd argument is given, then kernel-install is called
to install the kernel instead of this script. Any extra arguments given to
installkernel are passed on to kernel-install. The default setting for this
environment variable is controlled by the installkernel ebuild. When kernel
installation is delegated to systemd's kernel-install this manual is not
applicable. See the kernel-install manual for more information. Systemd's
kernel-install supports various different layouts, the default "compat" layout
is similar, but not identical, to the layout used by this installkernel. The
locations of plugin scripts, as well as recognized environment variables, are
also different.
.P
The
.I --all
argument may be used to iteratively install all kernel versions found
under
.I /lib/modules.
When
.I --all
is combined with
.I --systemd
then systemd's kernel-install is called with the
.I add-all
operator instead of the
.I
add
operator.
.SH BUGS
installkernel resides in /sbin only because the Linux kernel makefiles
call it from there. It should really be in /usr/sbin. It isn't
needed to boot a system.
.SH PLUGINS
Custom preinst and postinst plugin scripts may be installed into
.IR /etc/kernel/preinst.d
and
.IR /etc/kernel/postinst.d.
Plugins provided by packages should be installed into
.IR /usr/lib/kernel/preinst.d
and
.IR /usr/lib/kernel/postinst.d
instead.
Plugin scripts that generate an initramfs should install the generated
initramfs, named "initrd", in the same location as the kernel image. Plugin
scripts that generate an unified kernel image should install the generated UKI,
named "uki.efi", in the same location as the kernel image.
The environment variables
.B INSTALLKERNEL_PREINST_PLUGINS
and
.B INSTALLKERNEL_POSTINST_PLUGINS
may be used to provide a custom list of plugin scripts to execute
.P
The settings
.RS
.IP \(bu (bullet)
layout
.IP \(bu (bullet)
initrd_generator
.IP \(bu (bullet)
uki_generator
.RE
are read from one of these locations
.IR /etc/kernel/install.conf
.IR /run/kernel/install.conf
.IR /usr/local/lib/kernel/install.conf
.IR /usr/lib/kernel/install.conf
, where the first available file is used. And exposed to the plugins
as:
.RS
.IP \(bu (bullet)
INSTALLKERNEL_LAYOUT
.IP \(bu (bullet)
INSTALLKERNEL_INITRD_GENERATOR
.IP \(bu (bullet)
INSTALLKERNEL_UKI_GENERATOR
.RE
respectively. If the environment variable
.B INSTALLKERNEL_CONF_ROOT
is set, then the install.conf at this location is used instead.