summaryrefslogtreecommitdiffstats
path: root/man/systemd-stub.xml (follow)
Commit message (Collapse)AuthorAgeFilesLines
* man: fix typoYu Watanabe2024-09-161-1/+1
| | | | Follow-up for a632d8dd9f6cd5cf8e43862f0ea896cc571b1cab.
* man: fix advertised filename of the PCR public keyLennart Poettering2024-09-121-1/+1
|
* stub: add StubDevicePartUUID/StubImageIdentifierLennart Poettering2024-09-111-0/+12
| | | | | | | | | | | | These variables closely mirror the existing LoaderDevicePartUUID/LoaderImageIdentifier variables. But the Stub… variables indicate the location of the stub/UKI (i.e. of systemd-stub), while the Loader… variables indicate the location of the boot loader (i.e. of systemd-boot). (Except of course, there is no boot loader used, in which case both sets point to the stub/UKI, as a special case). This actually matters, as we support that sd-boot runs off the ESP, while a UKI then runs off XBOOTLDR, i.e. two distinct partitions.
* man: fix documentation for LoaderDevicePathUUID + LoaderImageIdentifier, in ↵Lennart Poettering2024-09-111-6/+13
| | | | | | | systemd-stub man page too Let's fix the version here too, and also clarify that this is usually not necessarily the ESP.
* stub: add ability to place multiple alternative PE sections of a specific ↵Lennart Poettering2024-09-101-23/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type in the same UKI ("Multi-Profile UKIs") This adds a ability to add alternative sections of a specific type in the same UKI. The primary usecase is for supporting multiple different kernel cmdlines that are baked into a UKI. The mechanism is relatively simple (I think), in order to make it robust. 1. A new PE section ".profile" is introduced, that is a lot like ".osrel", but contains information about a specific "profile" to boot. The ".profile" section can appear multiple times in the same PE, and acts as delimiter indicating where a new profile starts. Everything before the first ".profile" is called the "base profile", and is shared among all other profiles, which can then override or add addition PE sections on top. 2. An UKI's command line can be prefixed with an argument such as "@0" or "@1" or "@2" which indicates the "profile" to boot. If no argument is specified the default is profile 0. Also, a UKI that lacks any .profile section is treated like one with only a profile 0, but with no data in that profile section. 3. The stub will first search for its usual set of PE sections (hereafter called "base sections"), and stop at the first .profile PE section if any. It will then find the .profile matching the selected profile by its index, and any sections found as part of that profile on top of the base sections. And that's already it. Example: let's say a distro wants to provide a single UKI that can be invoked in one of three ways: 1. The regular profile that just boots the system 2. A profile that boots into storagetm 3. A profile that initiates factory reset and reboots. For this it would define a classic UKI with sections .linux, .initrd, .cmdline, and whatever else it needs. The .cmdline section would contain the kernel command line for the regular profile. It would then insert one ".profile" section, with a contents like the following: ID=regular This is the profile for profile 0. It would immediately afterwards add another ".profile" section: ID=storagetm TITLE=Boot into Storage Target Mode This would then followed with a .cmdline section that is just like the basic one, but with "rd.systemd.unit=storage-target-mode.target" suffixed. Then, another .profile section would be added: ID=factory-reset TITLE=Factory Reset Which is then followed by one last PE section: a .cmdline one with "systemd.unit=factory-reset.target" suffixed to te regular command line. i.e. expressed in tabular form the above would be: The base profile: .linux .initrd .cmdline .osrel The regular boot profile: .profile The storagetm profile: .profile .cmdline The factory reset profile: .profile .cmdline You might wonder why the first .cmdline in the list above is placed in the base profile rather than in the regular boot profile, given that it is overriden in all other profiles anyway. And you are right. The only reason I'd place it in the base profile is that it makes the UKI more nicely extensible if later profiles are added that want to replace something else instead of the .cmdline, for example .ucode or so. But it really doesn't matter much. While the primary usecase is of course multiple alternative command lines, the concept is more powerful than that: for various usecases it might be valuable to offer multiple choices of devicetree, ucode or initrds. The .profile contents is also passed to the invoked kernel as a file in /.extra/profile (via a synthetic initrd). Thus, this functionality can even be useful without overriding any section at all, simply by means of reading that file from userspace. Design choices: 1. On purposes I used a special command line marker (i.e. the "@" thing, which maybe we should call the "profile selector"), that doesn't look like a regular kernel command line option. This is because this is really not a regular kernel command line option – we process it in the stub, then remove it as prefix, and measure the unprefixed command line only after that. The kernel will not see the profile selector either. I think these special semantics are best communicated by making it look substantially different from regular options. 2. This moves around measurements a bit. Previously we measured our UKI sections right after finding them. Now we first parse the profile number from the command line, then search for the profile's sections, and only then measure the sections we actually end up using for this profile. I think that this logic makes most sense: measure what we are using, not what we are overriding. Or in other words, if you boot profile @3, then we'll measure .cmdline (assuming it exists) of profile 3, and *not* measure .cmdline of the base profile. Also note that if the user passes in a custom kernel command line via command line arguments we'll strip off the profile selector (i.e. the initial "@X" thing) before we pass it on. 3. The .profile stuff is supposed to be generic and extensible. For example we could use it in future to mark "dangerous" options such as factory reset, so that boot menus can ask for confirmation before booting into it. Or we could introduce match expressions against SMBIOS or other system identifiers, to filter out profiles on specific hw. Note btw, that PE allows defining multiple sections that point to the same offsets in the file. This allows sharing payload under different names. For example, if profile @4 and @7 shall carry the same .ucode section, they can define .ucode in each profile and then make it point to the same offset. Also note that that one can even "mask" a base section in a profile, by inserting an empty section. For example, if the base .dtb section should not be used for profile @4, then add a section .dtb right after the fourth .profile with a zero size to the UKI, and you will get your wish fulfilled. This code only contains changes to sd-stub. A follow-up commit will teach sd-boot to also find this profile PE sections to synthesize additional menu entries from a single UKI. A later commit will add support for gnerating this via ukify. Fixes: #24539
* stub: Add support for .ucode EFI addonsTobias Fleig2024-07-081-8/+11
| | | | This extends #31872 to also load microcode from addon files.
* treewide: fix a few typos in NEWS, docs, comments, and log messagesDmitry V. Levin2024-04-271-1/+1
|
* Merge pull request #31872 from tfg13/mainLennart Poettering2024-04-191-1/+9
|\ | | | | stub+ukify: Add support for UKI .ucode section
| * stub: Add support for .ucode UKI sectionTobias Fleig2024-04-191-1/+9
| | | | | | | | | | | | This commit adds support for loading, measuring and handling a ".ucode" UKI section. This section is functionally an initrd, intended for microcode updates. As such it will always be passed to the kernel first.
* | man/systemd-stub: fix typoAntonio Alvarez Feijoo2024-04-181-1/+1
|/
* man: Mention that SMBIOS type 11 strings are ignored inside CVMDaan De Meyer2024-03-101-1/+2
|
* stub: pick up confexts from the ESP as wellLennart Poettering2024-01-031-12/+54
| | | | | | | | | | | | | | | | | | | | | | | | | This does what we do for system extension also for configuration extension. This is complicated by the fact that we previously looked for <uki-binary>.d/*.raw for system extensions. We want to measure sysexts and confexts to different PCRs (13 vs. 12) hence we must distinguish them, but *.raw would match both kinds. This commit solves this via the following mechanism: we'll load confexts from *.confext.raw and sysexts from *.raw but will then enclude *.confext.raw from the latter. This preserves compatibility but allows us to somewhat reasonable distinguish both types of images. The documentation is updated not going into this detail though, and instead now claims that sysexts shall be *.sysext.raw and confexts *.confext.raw even though we actually are more lenient than this. This is simply to push people towards using the longer, more descriptive suffixes. I added an XML comment (<!-- … -->) about this to the docs, so that whenever somebody notices the difference between code and docs understands why and leaves it that way.
* man: use same version in public and system ident.David Tardon2023-12-251-1/+1
|
* man: use <simplelist> for 'See also' sectionsDavid Tardon2023-12-231-11/+11
| | | | | This is just a slight markup improvement; there should be no difference in rendering.
* man: use <simplelist> for file lists in synopsisZbigniew Jędrzejewski-Szmek2023-12-151-8/+10
| | | | | | | | | | | | | | | | | | With <para><filename>…</filename></para>, we get a separate "paragraph" for each line, i.e. entries separated by empty lines. This uses up a lot of space and was only done because docbook makes it hard to insert a newline. In some other places, <literallayout> was used, but then we cannot indent the source text (because the whitespace would end up in the final page). We can get the desired result with <simplelist>. With <simplelist> the items are indented in roff output, but not in html output. In some places this looks better then no indentation, and in others it would probably be better to have no indent. But this is a minor issue and we cannot control that. (I didn't convert all spots. There's a bunch of other man pages which have two lines, e.g. an executable and service file, and it doesn't matter there so much.)
* man: reword the list of PE sections in systemd-stubZbigniew Jędrzejewski-Szmek2023-11-241-36/+34
| | | | | | | | | | Let's put the section name at the beginning of each sentence. This way we can avoid awkward constructs like "kernel is looked for in the .linux section". Also, since the paragraph above says that this is a list of "PE sections", we can just say "section". In other places, it is often useful to say "PE section" to avoid ambiguity. Also fix the off-by-one in the count of sections.
* man/systemd-stub: split and simplify a wall'o'text paragraphZbigniew Jędrzejewski-Szmek2023-11-061-22/+24
|
* stub: Ignore the boot counter when looking for .extra.d directoryValentin David2023-10-201-1/+6
| | | | | | | | | | If `foo+3-0.efi` is booted when there are some files in `foo.efi.extra.d`, those files are ignored. But after the boot is blessed and the system rebooted, those file are taken into account, and the boot is different from first boot. This behavior is a bit puzzling. Instead we now ignore the counter and always look for the extra files in `foo.efi.extra.d` and always boot the same way.
* stub: add support for dtb addonsLuca Boccassi2023-10-091-16/+17
| | | | Same as kernel command line addons.
* markdown: add document listing TPM2 PCR measurements we make comprehensivelyLennart Poettering2023-10-041-1/+2
| | | | This is useful to write TPM event log decoders.
* man: fix counting of resource typesLennart Poettering2023-09-181-1/+1
|
* man: link UKI spec from sd-stubLennart Poettering2023-09-181-0/+3
|
* man: drop duplicate .uname documentation, add .sbat documentationLennart Poettering2023-09-181-9/+12
| | | | | | | | | | | | | | This fixes the PE section documentation in the systemd-stub man page: for some reason .uname was listed twice, and .sbat was still missing. Address that. Also, let's reorder things to to match the "canonical" ordering we also use for measurement in sd-stub. The order makes sense and there's really no reason to depart from that here. Minor other tweaks. Reverts b6f2e6860220aa89550f690b12246c4e8eb6e908, among other things
* man: add version infoAbderrahim Kitouni2023-08-291-14/+42
| | | | | | | | This tries to add information about when each option was added. It goes back to version 183. The version info is included from a separate file to allow generating it, which would allow more control on the formatting of the final output.
* man: missing/misplaced periodsZbigniew Jędrzejewski-Szmek2023-06-191-2/+2
|
* stub: allow loading and verifying cmdline addonsLuca Boccassi2023-05-241-0/+32
| | | | | | | | | | | | | | | | | | | | Files placed in /EFI/Linux/UKI.efi.extra.d/ and /loader/addons/ are opened and verified using the LoadImage protocol, and will thus get verified via shim/firmware. If they are valid signed PE files, the .cmdline section will be extracted and appended. If there are multiple addons in each directory, they will be parsed in alphanumerical order. Optionally the .uname sections are also matched if present, so that they can be used to filter out addons as well if needed, and only addons that correspond exactly to the UKI being loaded are used. It is recommended to also always add a .sbat section to addons, so that they can be mass-revoked with just a policy update. The files must have a .addon.efi suffix. Files in the per-UKI directory are parsed, sorted, measured and appended first. Then, files in the generic directory are processed.
* stub/measure: document and measure .uname UKI sectionLuca Boccassi2023-05-241-0/+3
|
* stub: measure SMBIOS kernel-cmdline-extra in PCR12Luca Boccassi2023-05-241-1/+4
| | | | | | | PCR1, where SMBIOS strings are measured, is filled with data that is not under the control of the machine owner. Measure cmdline extensions in PCR12 too, where we measure other optional addons that are loaded by sd-stub.
* tree-wide: Drop gnu-efiJan Janssen2023-03-101-1/+1
| | | | | | | This drops all mentions of gnu-efi and its manual build machinery. A future commit will bring bootloader builds back. A new bootloader meson option is now used to control whether to build sd-boot and its userspace tooling.
* stub: Read extra kernel command line items from SMBIOSDaan De Meyer2023-02-231-0/+17
| | | | | | | Let's read more kernel command line arguments from SMBIOS OEM string io.systemd.stub.kernel-cmdline-extra. This allows adding debug kernel command line arguments when booting in qemy without having to modify the UKI.
* man: Use ukify instead of objcopy in examplesJan Janssen2023-01-111-41/+3
| | | | | These hardcoded VMA section offsets are a terrible thing and should vanish from earth.
* tree-wide: BLS and DPS are now on uapi-group websiteZbigniew Jędrzejewski-Szmek2022-11-211-1/+1
|
* NEWS: Clarify overlapping UKI PE section offsetsJan Janssen2022-10-311-0/+4
|
* man: "the initial RAM disk" → "the initrd"Zbigniew Jędrzejewski-Szmek2022-09-201-11/+11
| | | | | | | | | | | | | | | In many places we spelled out the phrase behind "initrd" in full, but this isn't terribly useful. In fact, no "RAM disk" is used, so emphasizing this is just confusing to the reader. Let's just say "initrd" everywhere, people understand what this refers to, and that it's in fact an initramfs image. Also, s/i.e./e.g./ where appropriate. Also, don't say "in RAM", when in fact it's virtual memory, whose pages may or may not be loaded in page frames in RAM, and we have no control over this. Also, add <filename></filename> and other minor cleanups.
* man: say early what a unified kernel image/UKI isLennart Poettering2022-09-091-3/+3
|
* man: be more careful regarding TPM vs. TPM2Lennart Poettering2022-09-091-1/+1
| | | | | | | | We support PCR measurements for both classic TPM1.2 and TPM2, hence just say "TPM" generically in that context. But the signed policies are exclusive to TPM2, hence always say TPM2 there. We mostly got that right, except at one place. Fix that.
* man: document the new .pcrsig/.pcrpkey sections for unified kernel imagesLennart Poettering2022-09-091-5/+110
|
* sd-stub: measure sysext images picked up by sd-stub into PCR 13Lennart Poettering2022-08-021-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's grab another so far unused PCR, and measure all sysext images into it that we load from the ESP. Note that this is possibly partly redundant, since sysext images should have dm-verity enabled, and that is hooked up to IMA. However, measuring this explicitly has the benefit that we can measure filenames too, easily, and that all without need for IMA or anything like that. This means: when booting a unified sd-stub kernel through sd-boot we'll now have: 1. PCR 11: unified kernel image payload (i.e. kernel, initrd, boot splash, dtb, osrelease) 2. PCR 12: kernel command line (i.e. the one embedded in the image, plus optionally an overriden one) + any credential files picked up by sd-stub 3. PCR 13: sysext images picked up by sd-stub And each of these three PCRs should carry just the above, and start from zero, thus be pre-calculatable. Thus, all components and parameters of the OS boot process (i.e. everything after the boot loader) is now nicely pre-calculable. NOTE: this actually replaces previous measuring of the syext images into PCR 4. I added this back in 845707aae23b3129db635604edb95c4048a5922a, following the train of thought, that sysext images for the initrd should be measured like the initrd itself they are for, and according to my thinking that would be a unified kernel which is measured by firmware into PCR 4 like any other UEFI executables. However, I think we should depart from that idea. First and foremost that makes it harder to pre-calculate PCR 4 (since we actually measured quite incompatible records to the TPM event log), but also I think there's great value in being able to write policies that bind to the used sysexts independently of the earlier boot chain (i.e. shim, boot loader, unified kernel), hence a separate PCR makes more sense. Strictly speaking, this is a compatibility break, but I think one we can get away with, simply because the initrd sysext images are currently not picked up by systemd-sysext yet in the initrd, and because of that we can be reasonably sure noone uses this yet, and hence relies on the PCR register used. Hence, let's clean this up before people actually do start relying on this.
* efi: from the stub measure the ELF kernel + built-in initrd and so on into ↵Lennart Poettering2022-08-021-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PCR 11 Here we grab a new – on Linux so far unused (by my Googling skills, that is) – and measure all static components of the PE kernel image into. This is useful since for the first time we'll have a PCR that contains only a PCR of the booted kernel, nothing else. That allows putting together TPM policies that bind to a specific kernel (+ builtin initrd), without having to have booted that kernel first. PCRs can be pre-calculated. Yay! You might wonder, why we measure just the discovered PE sections we are about to use, instead of the whole PE image. That's because of the next step I have in mind: PE images should also be able to carry an additional section that contains a signature for its own expected, pre-calculated PCR values. This signature data should then be passed into the booted kernel and can be used there in TPM policies. Benefit: TPM policies can now be bound to *signatures* of PCRs, instead of the raw hash values themselves. This makes update management a *lot* easier, as policies don't need to be updated whenever a kernel is updated, as long as the signature is available. Now, if the PCR signature is embedded in the kernel PE image it cannot be of a PCR hash of the kernel PE image itself, because that would be a chicken-and-egg problem. Hence, by only measuring the relavent payload sections (and that means excluding the future section that will contain the PCR hash signature) we avoid this problem, naturally.
* efi: tell userspace where the stub measured the kernel command ↵Lennart Poettering2022-08-021-1/+9
| | | | | | | line/credentials into This is useful for userspace to know, so that policies can be put together safely, matching what the stub actually measured.
* tree-wide: Fix typoYu Watanabe2022-04-251-1/+1
|
* man: update TPM2 PCR documentationLennart Poettering2022-04-201-4/+76
| | | | | | | | | | | | The assignments were partly simply incorrectly documented, partly changed with 4d32507f5186a89e98093659fbbe386787a97b9f and partly missing. Moreover kernel 5.17 now measures all initrds to PCR 9 on its own (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f046fff8bc4c4d8f8a478022e76e40b818f692df) Let's correct all this and bring it up-to-date. And while we are at it extend the docs about this in systemd-stub, with a new table that indicates which OS resource is protected by which PCR.
* Fix man page linksZbigniew Jędrzejewski-Szmek2022-04-121-4/+4
| | | | Based on linkchecker as usual.
* man: also install systemd-stub man page as sd-stubLennart Poettering2022-03-221-0/+1
| | | | | | | | | So, typically systemd-boot is referenced as sd-boot, due to te usual shorter naming in ESP resources. systemd-stub didnt do that so far, since it never appears as separate files in the ESP. However it's super annoying that you can find "man sd-boot", but not the very closely related "man sd-stub". Let's fix that, and also add an "sd-stub" alias to the "systemd-stub" man page.
* man: various issues reported in #22432Zbigniew Jędrzejewski-Szmek2022-02-231-2/+5
| | | | Fixes #22432.
* man: do not install sd-boot man pages when -Dgnu-efi=false is setDavide Cavalca2021-12-141-1/+1
|
* stub: Load credentials from \loader\credentials\*.credAdrian Vovk2021-12-101-7/+17
| | | | | | | | | Some types of credentials that a user would want to pass into the initrd do not depend on the specific kernel/initrd version. For instance, this can include SSH keys, rootfs encryption keys, dm-integrity keys, and so on. This introduces a directory where such credentials can be placed so that any kernel image will load them
* [st-stub] documenting the .dtb sectionMax Resch2021-10-161-1/+9
|
* man: add man page for the systemd UEFI stubLennart Poettering2021-09-231-0/+204
Fixes: #17215