Commit graph

68 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek db9eabd675 man: fix tag syntax
Strangely enough, having <varlistenetry>s outside of <variablelist> wasn't
causing visual problems. But having two <listitem>s in one <varlistentry>
resulted in the paragraphs running together in the rendered man page.
2022-04-04 21:19:20 +02:00
Lennart Poettering 0d1506d4a8 bootctl: optionally, output entries in JSON format
Replaces: #18387
Fixes: #18094
2022-03-28 16:00:25 +02:00
Lennart Poettering f337f903df bootctl: update to new kernel-install semantics
This makes a bunch of closely related changes:

1. The "entry-token" concept already introduced in kernel-install is now
   made use of. i.e. specifically there's a new option --entry-token=
   that can be used to explicitly select by which ID to identify boot
   loader entries: the machine ID, or some OS ID (ID= or IMAGE_ID= from
   /etc/os-release, or even some completely different string. The
   selected string is then persisted to /etc/kernel/entry-token, so that
   kernel-install can find it there.

2. The --make-machine-id-directory= switch is renamed to
   --make-entry-directory= since after all it's not necessarily the
   machine ID the dir is named after, but can be any other string as
   selected by the entry token.

3. This drops all code to make automatic changes to /etc/machine-info.
   Specifically, the KERNEL_INSTALL_MACHINE_ID= field is now more
   generically implemented in /etc/kernel/entry-token described above,
   hence no need to place it at two locations. And the
   KERNEL_INSTALL_LAYOUT= field is not configurable by user switch or
   similar anyway in bootctl, but only read from
   /etc/kernel/install.conf, and hence copying it from one configuration
   file to another appears unnecessary, the second copy is fully
   redundant. Note that this just drops writing these fields, they'll
   still be honoured when already set.
2022-03-11 11:39:34 +01:00
Zbigniew Jędrzejewski-Szmek 1ff493d5c1 bootctl: deprecate --make-machine-id-directory=auto
Now that kernel-install creates the machine-id directory, we don't need to do
this is 'bootctl install', and in fact it's better not to do this since it
might never be necessary. So let's change the default behaviour to 'no'.

I kept support for 'auto' to maintain backwards compatibility, even though the
default was changed. Previous behaviour can be requested by specifying
--make-machine-id-directory=auto.
2021-12-17 18:48:08 +01:00
Davide Cavalca ba38a24de3 man: do not install sd-boot man pages when -Dgnu-efi=false is set 2021-12-14 00:08:55 +00:00
Дамјан Георгиевски 12caf72716 bootctl: optionally install .signed efi file
if /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed exists
install that instead of /usr/lib/systemd/boot/efi/systemd-bootx64.efi

the idea is that SecureBoot tooling can create the efi.signed file
whenever /usr/lib/systemd/boot/efi/systemd-bootx64.efi from the package
is updated.
2021-12-08 22:21:34 +01:00
Jan Janssen ee4fd9cbd4 sd-boot: Add support to boot last selected entry
Fixes: #18994
2021-10-29 13:57:24 +02:00
Jan Janssen 0c674ce5f2 sd-boot: Allow glob patterns for default and oneshot EFI vars too 2021-10-29 13:57:24 +02:00
Jan Janssen 39ddc32a86 bootctl: Add set-timeout verb
Fixes: #18766
2021-10-08 15:32:50 +02:00
Lennart Poettering e5a8b4b593 bootctl: tweak "bootctl update" to be a NOP when boot loader is already current and --graceful is given
Previously, the "bootctl update" logic would refrain from downrgading a
boot loader, but if the boot loader that is installed already matched
the version we could install we'd install it anyway, under the
assumption this was effectively without effect. This behaviour was handy
while developing boot loaders, since installing a modified boot loader
didn't require a version bump.

However, outside of the systems of boot loader developers I don't think
this behaviour makes much sense: we should always emphasize doing
minimal changes to the ESP, hence when an update is supposedly not
necessary, then don't do it. Only update if it really makes sense, to
minimize writes to the ESP. Updating the boot loader is a good thing
after all, but doing so redundantly is not.

Also, downgrade the message about this to LOG_NOTICE, given this
shouldn't be a reason to log.

Finally, exit cleanly in this cases (or if another boot loader is
detected)
2021-07-30 16:48:24 +02:00
Zbigniew Jędrzejewski-Szmek be0d27ee0c man: fix assorted issues reported by the manpage-l10n project
Fixes #20297.
2021-07-27 09:43:29 +02:00
Christian Hesse 9fff026d60 man: fix tag type
This is an option, not a command.
2021-05-27 12:50:57 +09:00
Lennart Poettering 7eea910d24 bootctl: extend --make-machine-id-directory= documentation a bit
The directory might not be created in the ESP but in the extended boot
loader partition, hence don#t claim otherwise.

Also, give a brief reason why the concept exists at all.

Link up machine-id man page.

Follow-up for: 6a3fff75ba
2021-05-11 14:32:42 +09:00
наб 6a3fff75ba
bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
auto resolves to yes if /etc/machine-id resides on non-tmpfs

This effectively reverts commit 31e57550b5
2021-05-05 14:35:00 +02:00
Yu Watanabe 48e0abb535 tree-wide: fix typo 2020-11-25 09:48:17 +01:00
Yu Watanabe ca91ce3a33 man: bootctl set-default/oneshot accept an empty string 2020-11-24 11:17:37 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Дамјан Георгиевски c4b843473a bootctl: add @current/@oneshot/@default targets to set-default/set-oneshot
Using `bootctl set-default @current` will set the default loader entry
to the currently booted entry as read from the `LoaderEntrySelected` EFI
variable.

Also `bootctl set-oneshot @current` will set the oneshot loader entry to
the current booted entry.

Correspondingly `@default` and `@oneshot` can be used to read from the
LoaderEntryDefault and LoaderEntryOneshot EFI variables.
2020-10-20 15:02:58 +02:00
Lennart Poettering 64a7fcc5cd bootctl: separate boot loader specific commands in man and --help
bootctl implements three types of operation: those that work with an EFI
boot loader, those which work with any EFI boot loader that implements
the boot loader spec + interface, and finally those specific to sd-boot.
Previously the --help text and the man page mixed them all up. Let's put
them clearly in three separate sections however, to communicate clearly
what is supposed to work everywhere, and what is specific to
systemd-boot or boot loaders implementing the two specs.

This adjusts wording here and there, but is mostly just about
re-ordering existing docs, and putting them under new sections.
2020-10-14 19:40:39 +02:00
Lennart Poettering 002914e688 bootctl: add simple, low-level reboot-to-firmware verb for controlling the flag 2020-05-29 15:41:50 +02:00
Lennart Poettering 351de38e4b bootctl: make 'random-seed' handle inability to write system token EFI variable gracefully
Apparently some firmwares don't allow us to write this token, and refuse
it with EINVAL. We should normally consider that a fatal error, but not
really in the case of "bootctl random-seed" when called from the
systemd-boot-system-token.service since it's called as "best effort"
service after boot on various systems, and hence we shouldn't fail
loudly.

Similar, when we cannot find the ESP don't fail either, since there are
systems (arch install ISOs) that carry a boot loader capable of the
random seed logic but don't mount it after boot.

Fixes: #13603
2019-11-21 19:55:17 +01:00
Zbigniew Jędrzejewski-Szmek 2536752dda Rename "system-options" to "systemd-efi-options"
This makes the naming more consistent: we now have
bootctl systemd-efi-options,
$SYSTEMD_EFI_OPTIONS
and the SystemdOptions EFI variable.

(SystemdEFIOptions would be redundant, because it is only used in the context
of efivars, and users don't interact with that name directly.)

bootctl is adjusted to use 2sp indentation, similarly to systemctl and other
programs.

Remove the prefix with the old name from 'bootctl systemd-efi-options' output,
since it's redundant and we don't want the old name anyway.
2019-11-18 20:20:58 +01:00
Zbigniew Jędrzejewski-Szmek e1fac8a68a Move the Commands section above Options section
For executables which take a verb, we should list the verbs first, and
then options which modify those verbs second. The general layout of
the man page is from general description to specific details, usually
Overview, Commands, Options, Return Value, Examples, References.
2019-10-08 18:21:26 +02:00
Zbigniew Jędrzejewski-Szmek 4e5aa79185 bootctl: add "system-options" verb 2019-09-16 18:08:54 +02:00
Lennart Poettering 93f5910078 docs: add longer document about systemd and random number seeds 2019-07-25 18:31:20 +02:00
Lennart Poettering 7fb0c61580 man: extend on the --print-boot-path description a bit 2019-07-25 18:31:20 +02:00
Lennart Poettering a2aa605d22 bootctl: add is-installed verb
Fixes: #9428
2019-07-25 18:31:20 +02:00
Lennart Poettering 39867bb9fb man: document the systemd-random-seed rework 2019-07-25 18:31:20 +02:00
Zbigniew Jędrzejewski-Szmek aa467bcae1 bootctl: do not allow -x and -p to be used together
-x already prints the path to ESP in some circumstances, and allowing
both to be printed seems confusing.
2019-05-19 12:01:32 +02:00
Zbigniew Jędrzejewski-Szmek fba4e94506 bootctl: add -x shortcut for --print-boot-path
It's a quite useful option, let's match -p.
2019-05-19 11:55:36 +02:00
Zbigniew Jędrzejewski-Szmek 3a54a15760 man: use same header for all files
The "include" files had type "book" for some raeason. I don't think this
is meaningful. Let's just use the same everywhere.

$ perl -i -0pe 's^..DOCTYPE (book|refentry) PUBLIC "-//OASIS//DTD DocBook XML V4.[25]//EN"\s+"http^<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"\n  "http^gms' man/*.xml
2019-03-14 14:42:05 +01:00
Zbigniew Jędrzejewski-Szmek 0307f79171 man: standarize on one-line license header
No need to waste space, and uniformity is good.

$ perl -i -0pe 's|\n+<!--\s*SPDX-License-Identifier: LGPL-2.1..\s*-->|\n<!-- SPDX-License-Identifier: LGPL-2.1+ -->|gms' man/*.xml
2019-03-14 14:29:37 +01:00
Lennart Poettering 3da2b703d9 man: document XBOOTLDR partition logic in bootctl's man page 2019-03-01 12:41:32 +01:00
Lennart Poettering 2fe8213230 docs: migrate boot loader interface from fdo wiki to git
This imports
https://www.freedesktop.org/wiki/Software/systemd/BootLoaderInterface/
into our sources, and extends it substantially with various variables
now supported.
2018-11-16 17:43:59 +01:00
Lennart Poettering a0848495f3 man: change all github links to use systemd.io domain instead
We shouldn't push people towards the git UI, but instead just refernce
the public version on the systemd.io domain.
2018-10-12 14:07:11 +02:00
Lennart Poettering bd2865caf6 bootctl: include boot entries discovered by the boot loader but not in $BOOT in the "list" output
Let's use the new LoaderEntries efi var for this, and show all entries
we couldn't find via the config snippets.
2018-10-08 21:40:44 +02:00
Lennart Poettering d88c96ffe5 bootctl: add new verbs for setting the default boot/oneshot entry
Fixes: #5739 #8574
2018-10-08 21:40:44 +02:00
Lennart Poettering 8cbb7d8783 efi: allow ESP validity checks to be turned off
let's add an env var for this, as this really shouldn't be a top-level
feature, as it turning off the validity checks certainly isn't
advisable.

Fixes: #4925
2018-10-08 21:40:44 +02:00
Lennart Poettering 4eb5636b6c man: various updates to the bootctl man page 2018-10-08 21:40:44 +02:00
Lennart Poettering dcb4fe7401 man: document the new --no-pager switch of bootctl
Also, let's move the --help and --version items to the end of the list.
2018-10-08 21:40:44 +02:00
killermoehre a8a273743f replace https://github.com/systemd/systemd/blob/master/doc/* with https://github.com/systemd/systemd/blob/master/docs/* to point to proper documentation 2018-09-13 22:12:38 +02:00
Lennart Poettering 41e3f73dc2 man: fix URL to BLS
Let's refer to our own version now.
2018-06-20 16:56:01 +02:00
Yu Watanabe c779b82a50 man: re-format man page for bootctl 2018-06-15 15:40:12 +09:00
Yu Watanabe 70c8db7555 man: use systemd-boot instead of sd-boot 2018-06-15 14:27:37 +09:00
Zbigniew Jędrzejewski-Szmek fdbbee37d5 man: drop unused <authorgroup> tags from man sources
Docbook styles required those to be present, even though the templates that we
use did not show those names anywhere. But something changed semi-recently (I
would suspect docbook templates, but there was only a minor version bump in
recent years, and the changelog does not suggest anything related), and builds
now work without those entries. Let's drop this dead weight.

Tested with F26-F29, debian unstable.

$ perl -i -0pe 's/\s*<authorgroup>.*<.authorgroup>//gms' man/*xml
2018-06-14 12:22:18 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Zbigniew Jędrzejewski-Szmek f37d383582 man: add some basic documentation for sd-boot (#8379)
I'm sure this can be improved in various ways, but I think
it's a good start.
2018-03-11 19:22:09 +09:00
Lennart Poettering f95b0be742 man: "systemd" is to be written in all lower-case, even at beginnings of sentences
This very important commit is very important.
2017-12-13 17:42:04 +01:00
Lennart Poettering 4ff183d419
Merge pull request #7154 from keszybz/bootspec
List bootspec entries in bootctl and use the default for kexec
2017-11-20 13:06:33 +01:00