1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

kernel-install: addresses post-merge comments for #36218 (#36304)

This commit is contained in:
Yu Watanabe 2025-02-07 21:11:03 +09:00 committed by GitHub
commit b92a2290c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 95 additions and 52 deletions

View File

@ -90,9 +90,7 @@
<para>The following commands are understood:</para>
<variablelist>
<varlistentry>
<term>
<command>add [[[<replaceable>KERNEL-VERSION</replaceable>] <replaceable>KERNEL-IMAGE</replaceable>] [<replaceable>INITRD-FILE</replaceable> ...]]</command>
</term>
<term><command>add [[[<replaceable>KERNEL-VERSION</replaceable>] <replaceable>KERNEL-IMAGE</replaceable>] [<replaceable>INITRD-FILE</replaceable> ...]]</command></term>
<listitem>
<para>This command takes a kernel version string and a path to a kernel image file as arguments. If
@ -107,8 +105,7 @@
<filename>/etc/kernel/install.d/*.install</filename> (i.e. the plugins) are called with the
following arguments:</para>
<programlisting>add <replaceable>KERNEL-VERSION</replaceable> <filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable> \
[<replaceable>INITRD-FILE</replaceable> ...]</programlisting>
<programlisting>add <replaceable>KERNEL-VERSION</replaceable> <filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable> [<replaceable>INITRD-FILE</replaceable> ...]</programlisting>
<para>The third argument directly refers to the path where to place kernel images, initrd
images and other resources for
@ -119,41 +116,66 @@
<para>The <replaceable>ENTRY-TOKEN</replaceable> string is typically the machine ID and is supposed
to identify the local installation on the system. For details see below.</para>
<para>Two default plugins execute the following operations in this case:</para>
<para><command>kernel-install</command> creates
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable></filename>,
if enabled (see <varname>$KERNEL_INSTALL_LAYOUT</varname>).</para>
<itemizedlist>
<listitem><para><command>kernel-install</command> creates
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable></filename>,
if enabled (see <varname>$KERNEL_INSTALL_LAYOUT</varname>).</para></listitem>
<para>Three default plugins execute the following operations in this case:</para>
<listitem><para><filename>50-depmod.install</filename> runs
<citerefentry project='man-pages'><refentrytitle>depmod</refentrytitle><manvolnum>8</manvolnum></citerefentry> for the
<replaceable>KERNEL-VERSION</replaceable>.</para></listitem>
<variablelist>
<varlistentry>
<term><filename>50-depmod.install</filename></term>
<listitem>
<para>The plugin runs
<citerefentry project='man-pages'><refentrytitle>depmod</refentrytitle><manvolnum>8</manvolnum></citerefentry>
for the <replaceable>KERNEL-VERSION</replaceable>.</para>
</listitem>
</varlistentry>
<listitem><para><filename>90-loaderentry.install</filename> copies
<replaceable>KERNEL-IMAGE</replaceable> to
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
If <replaceable>INITRD-FILE</replaceable>s are provided, it also copies them to
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL_VERSION</replaceable>/<replaceable>INITRD-FILE</replaceable></filename>.
This can also be used to prepend microcode before the actual initrd. It also creates a boot loader entry according to the <ulink
url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink> (Type #1) in
<filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
The title of the entry is the <replaceable>PRETTY_NAME</replaceable> parameter specified in
<filename>/etc/os-release</filename> or <filename>/usr/lib/os-release</filename> (if the former
is missing), or "Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.</para>
<varlistentry>
<term><filename>90-loaderentry.install</filename></term>
<listitem>
<para>The plugin copies <replaceable>KERNEL-IMAGE</replaceable> to
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
If <replaceable>INITRD-FILE</replaceable>s are provided, it also copies them to
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL_VERSION</replaceable>/<replaceable>INITRD-FILE</replaceable></filename>.
This can also be used to prepend microcode before the actual initrd. It also creates a boot
loader entry according to the
<ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>
(Type #1) in
<filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
The title of the entry is the <replaceable>PRETTY_NAME</replaceable> parameter specified in
<filename>/etc/os-release</filename> or <filename>/usr/lib/os-release</filename> (if the
former is missing), or "Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.</para>
<para>If <varname>$KERNEL_INSTALL_LAYOUT</varname> is not "bls", this plugin does nothing.</para></listitem>
<para>If <varname>$KERNEL_INSTALL_LAYOUT</varname> is not "bls", this plugin does nothing.</para>
</listitem>
</varlistentry>
<listitem><para><filename>90-uki-copy.install</filename> copies a file
<filename>uki.efi</filename> from <varname>$KERNEL_INSTALL_STAGING_AREA</varname> or if it does
not exist the <replaceable>KERNEL-IMAGE</replaceable> argument, only if it has a
<literal>.efi</literal> extension, to
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi</filename>.</para>
<varlistentry>
<term><filename>90-uki-copy.install</filename></term>
<listitem>
<para>If <varname>$KERNEL_INSTALL_STAGING_AREA/uki.efi</varname> exists, the plugin copies it
to
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi</filename>.
Also, files in <filename>$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/</filename> are copied
to
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi.extra.d/</filename>.</para>
<para>If <varname>$KERNEL_INSTALL_LAYOUT</varname> is not "uki", this plugin does nothing.</para></listitem>
</itemizedlist>
<para>If <varname>$KERNEL_INSTALL_STAGING_AREA/uki.efi</varname> does not exist, and the
<replaceable>KERNEL-IMAGE</replaceable> argument has a <literal>.efi</literal> extension, the
plugin copies the image to
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi</filename>.
Also, files in <filename><replaceable>KERNEL-IMAGE</replaceable>.extra.d/</filename> and
<filename>$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/</filename> are copied to
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi.extra.d/</filename>.</para>
<xi:include href="version-info.xml" xpointer="v198"/>
<para>If <varname>$KERNEL_INSTALL_LAYOUT</varname> is not "uki", this plugin does nothing.</para>
</listitem>
</varlistentry>
</variablelist>
<xi:include href="version-info.xml" xpointer="v198"/>
</listitem>
</varlistentry>
<varlistentry>
@ -185,22 +207,37 @@
<filename>$BOOT/<replaceable>ENTRY-TOKEN</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
and its contents, if it exists.</para>
<para>Two default plugins execute the following operations in this case:</para>
<para>Three default plugins execute the following operations in this case:</para>
<itemizedlist>
<listitem><para><filename>50-depmod.install</filename> removes the files generated by
<command>depmod</command> for this kernel again.</para></listitem>
<variablelist>
<varlistentry>
<term><filename>50-depmod.install</filename></term>
<listitem>
<para>The plugin removes the files generated by <command>depmod</command> for this kernel again.</para>
</listitem>
</varlistentry>
<listitem><para><filename>90-loaderentry.install</filename> removes the file
<filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
</para></listitem>
<varlistentry>
<term><filename>90-loaderentry.install</filename></term>
<listitem>
<para>The plugin removes the file
<filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
</para>
</listitem>
</varlistentry>
<listitem><para><filename>90-uki-copy.install</filename> removes the file
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi</filename>.
</para></listitem>
</itemizedlist>
<varlistentry>
<term><filename>90-uki-copy.install</filename></term>
<listitem>
<para>The plugin removes the file
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi</filename> and
<filename>$BOOT/EFI/Linux/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.efi.extra.d/</filename>
directory including its contents.</para>
</listitem>
</varlistentry>
</variablelist>
<xi:include href="version-info.xml" xpointer="v198"/>
<xi:include href="version-info.xml" xpointer="v198"/>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -73,7 +73,7 @@ else
UKI_FILE="$UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION.efi"
fi
ADDON_DIR="$UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION.efi.extra.d"
EXTRA_DIR="$UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION.efi.extra.d"
# If there is a UKI named uki.efi on the staging area use that, if not use what
# was passed in as $KERNEL_IMAGE but insist it has a .efi extension
@ -85,9 +85,9 @@ if [ -f "$KERNEL_INSTALL_STAGING_AREA/uki.efi" ]; then
}
for f in "$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/*; do
[ -f "$f" ] || continue
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $ADDON_DIR/$(basename "$f")"
install -D -m 0644 "$f" "$ADDON_DIR/$(basename "$f")" || {
echo "Error: could not copy '$f' to '$ADDON_DIR/$(basename "$f")'." >&2
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $EXTRA_DIR/$(basename "$f")"
install -D -m 0644 "$f" "$EXTRA_DIR/$(basename "$f")" || {
echo "Error: could not copy '$f' to '$EXTRA_DIR/$(basename "$f")'." >&2
exit 1
}
done
@ -107,9 +107,9 @@ elif [ -n "$KERNEL_IMAGE" ]; then
}
for f in "$KERNEL_IMAGE.extra.d"/* "$KERNEL_INSTALL_STAGING_AREA/uki.efi.extra.d"/*; do
[ -f "$f" ] || continue
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $ADDON_DIR/$(basename "$f")"
install -D -m 0644 "$f" "$ADDON_DIR/$(basename "$f")" || {
echo "Error: could not copy '$f' to '$ADDON_DIR/$(basename "$f")'." >&2
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing $f as $EXTRA_DIR/$(basename "$f")"
install -D -m 0644 "$f" "$EXTRA_DIR/$(basename "$f")" || {
echo "Error: could not copy '$f' to '$EXTRA_DIR/$(basename "$f")'." >&2
exit 1
}
done

View File

@ -14,6 +14,12 @@ journald.conf.xml /refsect1[title="Options"]/variablelist/varlistentry[term="Com
journald.conf.xml /refsect1[title="Options"]/variablelist/varlistentry[term="RateLimitIntervalSec="]
journald.conf.xml /refsect1[title="Options"]/variablelist/varlistentry[term="SystemMaxUse="]
journald.conf.xml /refsect1[title="Options"]/variablelist/varlistentry[term="ForwardToSyslog="]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="add [[[KERNEL-VERSION] KERNEL-IMAGE] [INITRD-FILE ...]]"]/listitem/variablelist/varlistentry[term="50-depmod.install"]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="add [[[KERNEL-VERSION] KERNEL-IMAGE] [INITRD-FILE ...]]"]/listitem/variablelist/varlistentry[term="90-loaderentry.install"]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="add [[[KERNEL-VERSION] KERNEL-IMAGE] [INITRD-FILE ...]]"]/listitem/variablelist/varlistentry[term="90-uki-copy.install"]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="remove KERNEL-VERSION"]/listitem/variablelist/varlistentry[term="50-depmod.install"]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="remove KERNEL-VERSION"]/listitem/variablelist/varlistentry[term="90-loaderentry.install"]
kernel-install.xml /refsect1[title="Commands"]/variablelist/varlistentry[term="remove KERNEL-VERSION"]/listitem/variablelist/varlistentry[term="90-uki-copy.install"]
loginctl.xml /refsect1[title="Options"]/variablelist/varlistentry[term="-p"]
loginctl.xml /refsect1[title="Options"]/variablelist/varlistentry[term="-a"]
loginctl.xml /refsect1[title="Options"]/variablelist/varlistentry[term="--no-ask-password"]