Commit graph

12 commits

Author SHA1 Message Date
Lennart Poettering bf7b6d28c3 kernel-install: teach bot loader spec entry generator to generate entries with "tries"
This makes two changes:

1. When called for "remove" any drop-ins with "+" suffix are removed
   too, so that the logic works for entries with boot counting enabled
   too and we don't lose track of configuration snippets created that
   way.

2. When called for "add" we optionally generate a "+" suffix, based on
   the data in /etc/kernel/tries if it exists.

   This basically means after "echo 5 > /etc/kernel/tries" any installed
   kernels will automatically set up for 5 boot tries before older
   kernels will be tried.
2018-10-19 22:34:50 +02:00
Javier Martinez Canillas 81818461c6 kernel-install: Don't install BLS kernel images if dest dir doesn't exist (#8306)
The script shouldn't rely on a previous script exiting with a status code
that prevents it to be executed. Instead, should check if the destination
directory for the BLS kernel image exists and exit otherwise.
2018-02-28 10:25:19 +01:00
Yu Watanabe 9d8813b3b4 kernel-install: support the case /etc/machine-id is missing or empty (#5975)
Some .install plugins does not require that machine ID is set such as
20-grubby.install for Fedora and 50-depmod.install.
To support such plugins to run without valid machine-id, this commit
makes the following change:
* if /etc/machine-id is missing or empty, create temporary directory
  and set its path to BOOT_DIR_ABS,
* run the .install helpers with KERNEL_INSTALL_MACHINE_ID environment
  variable that'd be empty if /etc/machine-id is missing or empty.
This may be useful for installing kernel for e.g. stateless systems
which initialize machine-id while booting the systems.
2017-05-30 09:45:10 -04:00
Harald Hoyer 340defcd06 kernel-install: recognize /boot/efi mountpoint (#3751)
install everything in /boot/efi, if this is a mountpoint
2016-07-19 12:10:09 +02:00
Harald Hoyer 6fd2ccc957 90-loaderentry.install: fixup BOOT_OPTIONS
better use "read -r -d '' -a" to read in the array. It handles multiple
lines and missing newline at the EOF.
2015-06-02 16:10:06 +02:00
Michael Chapman c008f6ee8d kernel-install/90-loaderentry.install: fix cmdline parsing
A recent commit (2f3a215) changed the parsing of /proc/cmdline to use a
shell array. Unfortunately, this introduced a bug: "read -ar line"
populates the shell variable $r, not $line. This breaks installation of
new loader entries:

  # kernel-install add 3.17.1-304.fc21.x86_64 \
      /boot/vmlinuz-3.17.1-304.fc21.x86_64
  Could not determine the kernel command line parameters.
  Please specify the kernel command line in /etc/kernel/cmdline!

This commit alters the read command to correctly populate the $line
array instead.
2014-11-01 14:39:48 -04:00
Harald Hoyer 2f3a215f61 kernel-install/90-loaderentry.install: fixed cmdline parsing
If /etc/kernel/cmdline is missing or empty, we read /proc/cmdline and
want to filter out the initrd line. Due to a bug, the whole contents was
filtered out.
2014-08-15 14:41:50 +02:00
Lennart Poettering 5ae4d543cb os-release: define /usr/lib/os-release as fallback for /etc/os-release
The file should have been in /usr/lib/ in the first place, since it
describes the OS container in /usr (and not the configuration in /etc),
hence, let's support os-release files in /usr/lib as fallback if no
version in /etc exists, following the usual override logic.

A prior commit already enabled tmpfiles to create /etc/os-release as a
symlink to /usr/lib/os-release should it be missing, thus providing nice
compatibility with applications only checking in /etc.

While it's probably a good idea if all apps check both locations via a
fallback logic, it is only necessary in the early boot process, as long
as the /etc/os-release symlink has not been restored, in case we boot
with an empty /etc.
2014-06-13 20:11:59 +02:00
Tom Gundersen 8b179a830a kernel-install: avoid using 'cp --preserve'
Force 0644 and root:root instead, to avoid problems with fat filesystems.
2013-09-27 15:56:54 +02:00
Harald Hoyer 852752fca2 kernel-install/90-loaderentry.install: do not fail for missing initrd 2013-07-11 13:43:35 +02:00
Harald Hoyer 6c10d39970 kernel-install: filter out "initrd=" from /proc/cmdline 2013-06-20 15:47:19 +02:00
Harald Hoyer 8f51399e75 kernel-install: add default install scripts
Do the depmod in the kernel-install hooks, so hooks can produce/install
kernel modules and be part of the depmod.

Also move the basic boot loader entry creation and removal to a
plugin script.

If PRETTY_NAME is not defined in /etc/os-release, fallback to
PRETTY_NAME="Linux $KERNEL_VERSION".

Add documentation for everything in the man page.
2013-05-06 16:19:02 +02:00