Commit graph

20 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek a3f758b310 man/ukify: add structure to describe verbs, document genkey
This just adds two paragraphs of text, but moves a lot of the text
one level down into a subsection.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek 27140fc7d1 man: add example how to configure automatic signing
Fixes #978.
2023-06-14 13:18:00 +02:00
Zbigniew Jędrzejewski-Szmek a1c80efddc ukify: add 'genkey' verb
The idea is to make it easy to generate all the signing key and certs
that can be used for local signing. The verb is the modeled after
'mkosi genkey', but there are some important differences: we generate
the keys to the paths where they will be read from, both pcr signing
keys and the SecureBoot certificate+key.

If any of the outputs exist, operation is refused. Maybe we could add a
--force option in the future, but this operation should be rare, so I think
it's better to refuse to overwrite anything initially.

I'm only doing a token man page change here.
https://github.com/systemd/systemd/pull/27621 reworks the man page,
and the changes done here would conflict heavily with that work. I'll
submit a follow-up patch later.
2023-06-14 13:17:33 +02:00
Zbigniew Jędrzejewski-Szmek 24f4ff8a09 man,test: root or hardware is not needed for ukify 2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek a3b227d28a ukify: add 'build' verb
The old syntax with linux + initrds as positional arguments is still accepted,
but a warning is emitted. We should remove the support for this after the
next release or so.

Adding a single verb by itself is not very useful, but opens the door to adding
other verbs.
2023-06-06 15:45:57 +02:00
Luca Boccassi c67d5a027d ukify: add default .sbat section for addons
In order to ensure addons can always be revoked via SBAT, and it is not
left out by mistake, have a default metadata entry if none is specified
by the caller.
https://github.com/rhboot/shim/blob/main/SBAT.md
2023-05-24 11:09:03 +01:00
Zbigniew Jędrzejewski-Szmek 8fb350049b man: fixes for assorted issues reported by the manpage-l10n project
Fixes #26761.
2023-05-17 12:25:01 +02:00
Emanuele Giuseppe Esposito c1e8d1727b ukify: support pesign as alternative to sbsign
sbsign is not available everywhere, for example RHEL does not have it.
Add pesign as alternative to it.

pesign will use options "--secureboot-certificate-name" (mandatory) and
"--secureboot-certificate-dir" (optional), while sbsign will use
"--secureboot-private-key" and "--secureboot-certificate".

By default, use sbsign. If no key/cert is provided or sbsign is not found,
try pesign.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
2023-05-10 09:18:27 -04:00
Emanuele Giuseppe Esposito e673c5c2d9 ukify: typo in doc and print when package is missing
If a package is missing, a subprocess is started with None as
command argument. Error raised by subprocess is therefore not helpful
at all to understand what needs to be done to fix that error.

Also fix doc since systemd-stub will look for .cmdline files, and not
.cmdline.efi files.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
2023-05-10 09:18:25 -04:00
Zbigniew Jędrzejewski-Szmek 248be6ef37 man: describe all the changes to ukify
As in mkosi(1), let's describe the config file and commandline options
together. This is nice for us, because we don't need to duplicate descriptions
and we're less likely to forget to update one place or the other. This is also
nice for users, because they can easily figure out what can be configured
where.

The options are now ordered by config file section.

--summary was not described before.

More examples are added.
2023-05-05 18:43:20 +02:00
Zbigniew Jędrzejewski-Szmek 048bcb9d1f man: use ukify more in systemd-measure examples
ukify supports signing with multiple keys, so show an example of this, and just
let ukify print the calls to systemd-measure that will be done.

This also does other small cleanups:
- Use more realistic names in examples
- Use $ as the prompt for commands that don't require root (most don't).
  Once we switch to operations that don't require a TPM, we should be able to get
  rid of the remaining calls that require root.
- Ellipsize or linebreak various parts
- Use --uname. We warn if it is not specified and we have to do autodetection, so
  let's nudge people towards including it rather than not.

Follow-up for e069c57f06.
2023-04-27 00:25:09 +01:00
Luca Boccassi 00e5933f57 ukify: allow building PE addon
Make the kernel optional too, so that we can easily build and sign a PE addon,
that can be used to carry extra command line options.
2023-04-26 16:55:26 +02:00
Jan Janssen 3fc5eed470 ukify: Use pefile to add sections to EFI stub 2023-03-24 13:01:45 +01:00
Morten Linderud 9e60dc0daf
man: Fix pcrphase.service manvolnum from 1 to 8 2023-03-10 20:29:56 +01:00
Jeidnx 2208d96623 man: fix typo in ukify page 2023-03-09 14:49:37 +01:00
Zbigniew Jędrzejewski-Szmek f37f0f35cd man: fix links to man pages
Done using linkchecker as usual.
2023-02-09 14:30:43 +01:00
Frantisek Sumsal 9c45bfb2ac ukify: don't install ukify man page if ukify is not enabled
Checking for gnu-efi is not enough, since ukify can be explicitly
disabled.

Resolves: #26274
2023-01-31 23:57:28 +00:00
Daan De Meyer 22ad038ac6 ukify: Allow passing multiple directories to --tools 2022-12-22 12:19:55 +01:00
Zbigniew Jędrzejewski-Szmek 54c84c8a7a ukify: allow multiple initrds
If given, multiple initrds are concatenated into a temporary file which then
becomes the .initrd section.

It is also possible to give no initrd. After all, some machines boot without an
initrd, and it should be possible to use the stub without requiring an initrd.
(The stub might not like this, but this is something to fix there.)
2022-12-07 17:22:05 +01:00
Zbigniew Jędrzejewski-Szmek 0fdf4e1810 man: add man page for ukify 2022-12-07 15:53:47 +01:00