kernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i
341890de86made "bootctl install" create ESP\MID, in preparation ofcf73f65089that followed it and created 00-entry-directory.install to make ESP\MID\KVER if ESP\MID existed ‒ this meant that "bootctl install" followed by "kernel-install $(uname -r) /boot/vml*$(uname -r) /boot/ini*$(uname -r)" actually installed the kernel correctly. Later,31e57550b5reverted the first commit, meaning, that now running those two commands first installs sd-boot, but then does nothing. Everything appears to work right, nothing errors out, but no changes are actually done. To the untrained eye (all of them), even running with -v appears to work: all the hooks are run, as is depmod, but, again, nothing happens. This is horrible. Nothing in either manpage suggests what to do (nor should it, really), but the user is left with a bootloader that appears fully funxional, since nothing suggests a failure in the output, but with an unbootable machine, /no way to boot it/, even if they drop to an EFI shell, since the boot bundle isn't present on the ESP, and no real recourse even if they boot into a recovery system, apart from installing like GRUB or whatever. 00- is purely instrumentation for 90-, and separating one from the other has led to downstream dissatisfaxion (indeed, the last mentioned commit cited cited exactly that as the reversion reason), while creating $ENTRY_DIR_ABS is only required for bootloaders using the BLS, and shouldn't itself toggle anything. To that end, introduce an /{e,l}/k/install.conf file that allows overriding the detected layout, and detect it as "bls" if $BOOT_ROOT/$MACHINE_ID ($ENTRY_DIR_ABS/..) exists, otherwise "other" ‒ if a user wishes to select a different bootloader, like GRUB, they (or, indeed, the postinst script) can specify layout=grub. This disables 90- and $ENTRY_DIR_ABS manipulation.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
ba679b8d56
commit
641e2124de
+48
-14
@@ -71,23 +71,21 @@
|
||||
<programlisting>add <replaceable>KERNEL-VERSION</replaceable> <filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename> <replaceable>KERNEL-IMAGE</replaceable> [<replaceable>INITRD-FILE</replaceable> ...]</programlisting>
|
||||
</para>
|
||||
|
||||
<para>Three default plugins execute the following operations in this case:</para>
|
||||
<para>Two default plugins execute the following operations in this case:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para><filename>00-entry-directory.install</filename> creates the directory
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
|
||||
if <filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/</filename> already exists.
|
||||
</para></listitem>
|
||||
<listitem><para><command>kernel-install</command> creates
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable></filename>,
|
||||
if enabled (see <varname>$KERNEL_INSTALL_LAYOUT=</varname>).</para></listitem>
|
||||
|
||||
<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>
|
||||
|
||||
<listitem><para><filename>90-loaderentry.install</filename> copies <replaceable>KERNEL-IMAGE</replaceable>
|
||||
to
|
||||
<listitem><para><filename>90-loaderentry.install</filename>
|
||||
copies <replaceable>KERNEL-IMAGE</replaceable> to
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/linux</filename>.
|
||||
If an <replaceable>INITRD-FILE</replaceable> is provided, it also copies <replaceable>INITRD-FILE</replaceable>
|
||||
to
|
||||
If <replaceable>INITRD-FILE</replaceable>s are provided, it also copies them to
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL_VERSION</replaceable>/<replaceable>INITRD-FILE</replaceable></filename>.
|
||||
It also creates a boot loader entry according to the <ulink
|
||||
url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink> in
|
||||
@@ -96,9 +94,7 @@
|
||||
<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 the entry directory
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
|
||||
does not exist, this plugin does nothing.</para></listitem>
|
||||
<para>If <varname>$KERNEL_INSTALL_LAYOUT=</varname> is not "bls", this plugin does nothing.</para></listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -119,13 +115,15 @@
|
||||
<para>Two 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>
|
||||
|
||||
<listitem><para><filename>90-loaderentry.install</filename> removes the file
|
||||
<filename>$BOOT/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<listitem><para><command>kernel-install</command> removes
|
||||
<filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable></filename>,
|
||||
if enabled (see <varname>$KERNEL_INSTALL_LAYOUT=</varname>).</para></listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -172,6 +170,30 @@
|
||||
either 32 hexadecimal characters or the special value <literal>Default</literal>.</para>
|
||||
<para><varname>KERNEL_INSTALL_BOOT_ROOT=</varname> is set for the plugins to the root directory (mount point, usually) of the hierarchy
|
||||
where boot-loader entries, kernel images, and associated resources should be placed. Can be overridden by setting <varname>BOOT_ROOT=</varname>.</para>
|
||||
|
||||
<para><varname>KERNEL_INSTALL_LAYOUT=bls|other|...</varname> specifies the installation layout.
|
||||
Defaults to <option>bls</option> if <filename>$BOOT/<replaceable>MACHINE-ID</replaceable></filename> exists, or <option>other</option> otherwise.
|
||||
Additional layout names may be defined by convention. If a plugin uses a special layout,
|
||||
it's encouraged to declare its own layout name and configure <varname>layout=</varname> in <filename>install.conf</filename> upon initial installation.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>bls</term>
|
||||
<listitem>
|
||||
<para>Standard <ulink url="https://systemd.io/BOOT_LOADER_SPECIFICATION">Boot Loader Specification</ulink> layout,
|
||||
compatible with <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry>: entries in
|
||||
<filename>$BOOT/loader/entries/<replaceable>MACHINE-ID</replaceable>-<replaceable>KERNEL-VERSION</replaceable>[+<replaceable>TRIES</replaceable>].conf</filename>,
|
||||
kernel and initrds under <filename>$BOOT/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></para>
|
||||
<para>Provided by <filename>90-loaderentry.install</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>other</term>
|
||||
<listitem>
|
||||
<para>Some other layout not understood natively by <command>kernel-install</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
@@ -251,6 +273,18 @@
|
||||
Otherwise, <literal>Linux <replaceable>KERNEL-VERSION</replaceable></literal> will be used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/usr/lib/kernel/install.conf</filename>
|
||||
<filename>/etc/kernel/install.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Configuration options for <command>kernel-install</command>,
|
||||
as a series of <varname>KEY=</varname><replaceable>VALUE</replaceable> assignments,
|
||||
compatible with shell syntax.
|
||||
See the Environment variables section for supported keys.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user