kernel-install: make version/kernel image parameters optional for "add"

Let's make kernel-install a bit easier to use:

If the kernel version is not specified, let's imply "uname -r", so that
we regnerate the entries for the current kernel.

If the kernel image is not specified let's imply using
/usr/lib/modules/$version/vmlinuz, i.e. the location distros like Fedora
drop the kernel into, which we generally recommend people to use.

If the kernel is not found there, don't try to automatically pick the
kernel path, and fail, as before.
This commit is contained in:
Lennart Poettering
2023-11-07 16:07:25 +01:00
parent 658e6cc4ae
commit 9d9e99a8f0
2 changed files with 52 additions and 12 deletions
+8 -6
View File
@@ -86,15 +86,17 @@
<variablelist>
<varlistentry>
<term>
<command>add</command>
<replaceable>KERNEL-VERSION</replaceable>
<replaceable>KERNEL-IMAGE</replaceable> [<replaceable>INITRD-FILE</replaceable> ...]
<command>add [[[<replaceable>KERNEL-VERSION</replaceable>] <replaceable>KERNEL-IMAGE</replaceable>] [<replaceable>INITRD-FILE</replaceable> ...]]</command>
</term>
<listitem>
<para>This command expects a kernel version string and a path to a kernel image file as arguments.
Optionally, one or more initrd images may be specified as well (note that plugins might generate
additional ones).</para>
<para>This command takes a kernel version string and a path to a kernel image file as arguments. If
the former is omitted, specified as an empty string or as "-" it defaults to the current kernel
version, i.e. the same string <command>uname -r</command> returns. If the latter is omitted,
specified as an empty string or as "-" defaults to
<filename>/usr/lib/modules/<replaceable>KERNEL_VERSION</replaceable>/vmlinuz</filename>. Optionally,
one or more initrd images may be specified as well (note that plugins might generate additional
ones).</para>
<para>The executable files from <filename>/usr/lib/kernel/install.d/*.install</filename> and
<filename>/etc/kernel/install.d/*.install</filename> (i.e. the plugins) are called with the