Merge pull request #29361 from keszybz/kernel-install-work

Advertise installkernel ↔ kernel-install duality
This commit is contained in:
Luca Boccassi
2023-09-28 17:16:15 +01:00
committed by GitHub
3 changed files with 40 additions and 6 deletions

View File

@@ -185,10 +185,29 @@
<xi:include href="version-info.xml" xpointer="v251"/>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Compatibility with the kernel build system</title>
<cmdsynopsis>
<command>installkernel</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
<arg choice="plain">VERSION</arg>
<arg choice="plain">VMLINUZ</arg>
<arg choice="opt">MAP</arg>
<arg choice="opt">INSTALLATION-DIR</arg>
</cmdsynopsis>
<para>When invoked as <command>installkernel</command>, this program accepts arguments as specified by
the kernel build system's <command>make install</command> command. The <parameter>VERSION</parameter> and
<parameter>VMLINUZ</parameter> parameters specify the kernel version and the kernel binary. The other two
parameters (<parameter>MAP</parameter> and <parameter>INSTALLATION-DIR</parameter>) are currently
ignored.
</para>
</refsect1>
<refsect1>
<title>The <varname>$BOOT</varname> partition</title>

View File

@@ -1127,10 +1127,11 @@ static int help(void) {
printf("%1$s [OPTIONS...] COMMAND ...\n\n"
"%2$sAdd and remove kernel and initrd images to and from /boot%3$s\n"
"\nUsage:\n"
" %1$s [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]\n"
" %1$s [OPTIONS...] remove KERNEL-VERSION\n"
" %1$s [OPTIONS...] inspect [KERNEL-IMAGE]\n"
"\nOptions:\n"
" kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]\n"
" kernel-install [OPTIONS...] remove KERNEL-VERSION\n"
" kernel-install [OPTIONS...] inspect [KERNEL-IMAGE]\n"
"\n"
"Options:\n"
" -h --help Show this help\n"
" --version Show package version\n"
" -v --verbose Increase verbosity\n"
@@ -1140,7 +1141,12 @@ static int help(void) {
" Create $BOOT/ENTRY-TOKEN/ directory\n"
" --entry-token=machine-id|os-id|os-image-id|auto|literal:…\n"
" Entry token to use for this installation\n"
"\nSee the %4$s for details.\n",
"\n"
"This program may also be invoked as 'installkernel':\n"
" installkernel [OPTIONS...] VERSION VMLINUZ [MAP] [INSTALLATION-DIR]\n"
"(The optional arguments are passed by kernel build system, but ignored.)\n"
"\n"
"See the %4$s for details.\n",
program_invocation_short_name,
ansi_highlight(),
ansi_normal(),

View File

@@ -12,6 +12,7 @@
#include "env-file.h"
#include "env-util.h"
#include "errno-util.h"
#include "escape.h"
#include "exec-util.h"
#include "fd-util.h"
#include "fileio.h"
@@ -138,6 +139,14 @@ static int do_execute(
return log_error_errno(fd, "Failed to open serialization file: %m");
}
if (DEBUG_LOGGING) {
_cleanup_free_ char *args = NULL;
if (argv)
args = quote_command_line(strv_skip(argv, 1), SHELL_ESCAPE_EMPTY);
log_debug("About to execute %s%s%s", t, argv ? " " : "", argv ? strnull(args) : "");
}
r = do_spawn(t, argv, fd, &pid, FLAGS_SET(flags, EXEC_DIR_SET_SYSTEMD_EXEC_PID));
if (r <= 0)
continue;