101 Commits

Author SHA1 Message Date
Lennart Poettering
fc3adbbbcb man: always prefix links to uapi specs with their UAPI.XY spec number
Let's try to establish the spec numbers, by mentioning them in most doc
links.

Follow-up for: https://github.com/uapi-group/specifications/pull/187
2025-11-23 18:09:11 +01:00
Lennart Poettering
0a03092cb5 repart: avoid label string clashes between LUKS superblocks and the filesystems on them
Let's make sure that by default /dev/disk/by-label/ symlinks avoid
ambiguities, and the LUKS volume carries a different one than the file
system inside it.

Alternative-to: #39536
2025-11-17 15:37:14 +01:00
Alberto Planas
ab1f4e506f repart: support "nodatacow" in btrfs subvolumes
In btrfs-progs 6.15 it is planned to add a new parameter in mkfs.btrfs
--inode-flags, that can set attributes for subvolumes, directories, and
files.

The current supported attributes are "nodatacow", to disable CoW, and
"nodatasum", to disable the checksum.

This commit extend the "Subvolunes=" option to understand the
"nodatacow" flag for subvolums only.

If RepartOffline is enabled it will build the image without loopback
devices, using the correct --inode-flags parameters.

If RepartOffline is disabled it will use loopback devices and set the
btrfs attributes accordingly.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2025-11-02 17:13:31 +09:00
Yu Watanabe
cbdbf68a72 man/repart: fix typo
Follow-up for 49dcc89ddc.
2025-09-19 20:24:09 +09:00
Yu Watanabe
f871c20bad systemd-repart: add encryption configs into repart.d/* (#38052)
As explained in https://github.com/systemd/systemd/issues/37892, it
would be nice to define per-partition PCRs/key file to use.

The global default config will be still defined as cmdline options, and
`TPM2PCRs=` and `KeyFile=` will be overriden by them.
2025-09-18 11:02:38 +09:00
Yu Watanabe
a1eb53e934 man/repart.d: mention each field of MountPoint= needs to be quoted when contains colon
Closes #38749.
2025-09-04 01:46:11 +09:00
Emanuele Giuseppe Esposito
eb44fa4d19 repart: make --key-file also configurable in repart.d/*
Add repart.d KeyFile= option with the same syntax as --key-file.
This allows a per-partition key file encryption, and not rely on a global key
applicable to all partitions.

The global --key-file overrides KeyFile config. If none of them is
defined, rely on default.
2025-08-26 07:17:12 -04:00
Emanuele Giuseppe Esposito
49dcc89ddc repart: make --tpm2-pcrs also configurable in repart.d/*
Add repart.d TPM2PCRs= option with the same syntax as --tpm2-pcrs.
This allows a per-partition pcr binding, and not rely on a global config
applicable to all partitions.

The global --tpm2-pcrs overrides TPM2PCRs config. If none of them
is defined, rely on default.
2025-08-26 07:17:01 -04:00
Yu Watanabe
e9eaa66ed8 man/repart: fix the required btrfs-progs version
Follow-up for 12c29e5b3a.

Prompted by #38355.
2025-07-27 00:56:28 +01:00
Michael Ferrari
381304a209 repart: add support for Format=empty
This is a new meta value for the `Format=` option, which is equivalent
as specifying `Label=_empty` and `NoAuto=1` for compatibility with
sd-sysupdate.

Closes: https://github.com/systemd/systemd/issues/34596
2025-06-30 10:11:16 +02:00
Lennart Poettering
c343f0ee13 repart: respect minimum sector size for ESP/VFAT partitions
Fixes: #37801
2025-06-26 14:52:20 +02:00
Lennart Poettering
e7b4b2968e repart: make file system sector size configurable
Let's make the fs sector size configurable. This also adds
infrastructure so that we can pick different sector sizes as defaults
eventually, but doesn't actually do that.

(Background: I think we should probably default to native sector size
for the ESP, but Daan disagrees, so I'll leave this out for now).
2025-06-26 14:36:33 +02:00
Zbigniew Jędrzejewski-Szmek
b082968d19 man: better tags, more links, minor grammar and formatting improvements
Closes https://github.com/systemd/systemd/issues/35751.
2025-05-28 15:35:53 +02:00
Allison Karlitskaya
eef63efcc3 repart: add 'fsverity' flag for CopyFiles= lines
We currently pass the CopyFlags that we use to populate the temporary
directory in the form of a constant at each of the copy_tree_at() call
sites.  De-duplicate that and move it into the `CopyFilesLine` struct,
initializing it from the parser.

Add our first non-constant flag: `fsverity=`.  This can be set to `off`
(the default) or `copy`, in which case we copy the fs-verity state from
the source files.

This arrangement is amenable to the introduction of more flags to
`CopyFiles=` lines, if we want to add them in the future.

Update the `repart.d(5)` manpage.

Closes #35352

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-05-27 09:26:02 +02:00
Lennart Poettering
778cfac5fb man: document that gpt-label/gpt-type uuid xattrs are now lists 2025-05-14 15:44:54 +02:00
Lennart Poettering
85afe4760b repart: automatically generate validatefs xattrs
Let's automatically generate validatefs xattrs by default, that encode
the intended use of partitions.

This defaults to on, since the structure of repart definition files
tells us enough on use for this to be safe. There's an option however,
to turn this off.
2025-03-31 15:14:45 +02:00
Daan De Meyer
42839efb10 mkfs-util: Add support for btrfs compression
Corresponding PR in btrfs-progs: https://github.com/kdave/btrfs-progs/pull/882
2025-02-17 14:11:04 +01:00
Jan Engelhardt
c592ebdf4f man: grammar fixes for introductory adverbs/phrases 2024-12-25 17:24:38 +01:00
Jan Engelhardt
44855c77a1 man: expand word contractions
For written text, contractions are not normally used.
2024-12-25 17:00:31 +01:00
Yu Watanabe
4ebbb5bfe8 man: asorted fixes
Closes #35307.
2024-11-24 01:11:42 +09:00
Antonio Alvarez Feijoo
bf39626d61 man/repart: use <varname> instead of <variable>
Otherwise, `<variable>$BOOT</variable>` is rendered:

```
[2548/2992] Generating man/repart.d.5 with a custom command
Element variable in namespace '' encountered in para, but no template matches.
Element variable in namespace '' encountered in para, but no template matches.
```
2024-09-18 16:03:56 +02:00
Daan De Meyer
81af8f998e repart: Support specifying multiple directories to ExcludeFiles= 2024-09-18 10:22:33 +02:00
Adrian Vovk
2cb9c68c3a repart: Add SupplementFor= logic
This was designed to deal with $BOOT, as defined by the Boot Loader
Specification, but it was made a generic mechanism because it is useful
elsewhere too. See the updated man page for usage examples, motivation,
and an explanation of how this works.
2024-09-17 14:06:50 -04:00
Daan De Meyer
c64ddefd5c repart: Add MakeSymlinks=
Similar to MakeDirectories=, but creates symlinks in the filesystem.
2024-09-11 18:45:05 +02:00
Daan De Meyer
27cacec939 repart: Add compression support
Now that mkfs.btrfs is adding support for compressing the generated
filesystem (https://github.com/kdave/btrfs-progs/pull/882), let's
add general support for specifying the compression algorithm and
compression level to use.

We opt to not parse the specified compression algorithm and instead
pass it on as is to the mkfs tool. This has a few benefits:

- We support every compression algorithm supported by every tool
  automatically.
- Users don't need to modify systemd-repart if a mkfs tool learns a
  new compression algorithm in the future
- We don't need to maintain a bunch of tables for filesystem to map
  from our generic compression algorithm enum to the filesystem specific
  names.

We don't add support for btrfs just yet until the corresponding PR
in btrfs-progs is merged.
2024-09-03 08:49:49 +02:00
Daan De Meyer
562881c178 repart: Switch to new mkfs.btrfs subvolume API
In https://github.com/kdave/btrfs-progs/pull/877 the API is changing
to "--subvol <path>:ro,default" so let's adapt our usage to match.

This also adds support for read-only subvolumes.

Fixes #34134
2024-08-30 12:18:10 +02:00
Daan De Meyer
eca3d07dd1 repart: Allow Subvolumes= and DefaultSubvolume= when running offline
mkfs.btrfs has recently learned new options --subvol and --default-subvol
so let's stop failing when Subvolumes= and DefaultSubvolume= are used offline
and use the new --subvol and --default-subvol options instead to create subvolumes
in the generated root filesystem without root privileges or loop devices.
2024-08-21 11:29:47 +02:00
Thorsten Scherer
932cc94436 repart: Fix misleading typo in GPT partition flag
Bit 60 is the one corresponding to ReadOnly, not 50.  Fix this.
2024-08-15 05:59:58 +09:00
Matthias Lisin
999a661d1e man: Add %q specifier to repart.d, sysusers.d 2024-06-26 04:18:14 +02:00
Lennart Poettering
468d09c319 repart: allow reading from char device for CopyBlocks=
Sometimes it is useful to allow initializing a partition with randomized
data, hence allow reading from a char device as source for CopyBlocks=
2024-06-25 10:05:07 +02:00
Jörg Behrmann
02f35b1c90 man: document /usr/local/lib in search paths 2024-06-06 12:07:08 +02:00
Daan De Meyer
3799fa803e repart: Add DefaultSubvolume= setting
We already have Subvolumes= to create subvolumes, let's add
DefaultSubvolume= as well to set the default subvolume.
2024-03-30 00:08:12 +00:00
Gaël Donval
7b123f8186 Document SYSTEMD_REPART_MKFS_* in repart.d manual 2024-03-26 03:08:38 +09:00
Matthias Lisin
245bd4af99 man: fix minor issues 2024-03-21 02:49:38 +01:00
Daan De Meyer
1a0541d44c repart: Add --generate-fstab= and --generate-crypttab= options
These can be used along with two new settings MountPoint= and
EncryptedVolume= to write fstab and crypttab entries to the given
paths respectively in the root directory that repart is operating on.

This is useful to cover scenarios that aren't covered by the
Discoverable Partitions Spec. For example when one wants to mount
/home as a separate btrfs subvolume. Because multiple btrfs subvolumes
can be mounted from the same partition, we allow specifying MountPoint=
multiple times to add multiple entries for the same partition.
2024-02-10 13:07:02 +01:00
David Tardon
eea10b26f7 man: use same version in public and system ident. 2023-12-25 15:51:47 +01:00
David Tardon
13a69c120b man: use <simplelist> for 'See also' sections
This is just a slight markup improvement; there should be no difference
in rendering.
2023-12-23 08:28:57 +01:00
Zbigniew Jędrzejewski-Szmek
73e97bb064 man: use <simplelist> for file lists in synopsis
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.)
2023-12-15 14:27:28 +01:00
Lennart Poettering
607343a1ac repart: add new --copy-source= switch
This specifies a directory to which CopyFiles= is considered relative.
If unset defaults to the --root=/--image= setting, or host / otherwise.

This is very similar to --root= but is much more focussed: it is really
and exclusively about CopyFiles= (and related settings such as
ExcludeFiles=) and does not affect any of the settings, i.e. it doesn't
affect CopyBlocks=, the machine ID/seed handling, or where definitions
are read from.

In fact, --root= and --copy-source= may be combined for example to
use the machine ID and similar from one tree, but the copy the files
from another.
2023-10-05 19:07:19 +02:00
Daan De Meyer
0e70150be3 repart: Mention that xattrs are not copied when populating XFS with protofile 2023-10-05 12:54:02 +02:00
Joerg Behrmann
7227dd816f treewide: fix typos
- mostly: usecase -> use case
- continously -> continuously
- single typos in docs/FILE_DESCRIPTOR_STORE.md
2023-09-19 10:05:38 +02:00
Abderrahim Kitouni
ec07c3c80b man: add version info
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.
2023-08-29 14:07:24 +01:00
Zbigniew Jędrzejewski-Szmek
6d9829e724 man/repart: use <filename> and add missing <para> 2023-08-24 15:45:24 +02:00
Daan De Meyer
799cd3100b repart: Make verity example more useful
Add Minimize= so the size gets calculated correctly and add a verity
signature partition as well for completeness.
2023-08-24 10:43:11 +02:00
Michael A Cassaniti
c380047bf4 repart: Add verity configuration section and options 2023-08-15 15:32:09 +01:00
Daan De Meyer
440f805c17 repart: Add Subvolumes= setting
This setting indicates which directories in the target partition
should be btrfs subvolumes. If set, we'll try to create these
directories as subvolumes.

Note that this only works when running as root without --offline,
as mkfs.btrfs does not support creating subvolumes.
2023-08-14 18:46:08 +02:00
Daan De Meyer
86320e626c Revert "repart: Allow combining CopyBlocks= and CopyFiles="
This reverts commit dea0dc7ba2.
2023-08-01 15:12:24 +02:00
Daan De Meyer
7e81a84448 Revert "repart: Add --oem and OEM="
This reverts commit 47c7805579.
2023-08-01 15:10:24 +02:00
Daan De Meyer
47c7805579 repart: Add --oem and OEM=
--oem can be used to only install OEM partitions (usr, verity,
verity-sig, ...). OEM= is used to indicate OEM partitions. If unset,
defaults to !FactoryReset. We also add a credential repart.oem to
allow configuring --oem via a credential.
2023-08-01 07:53:50 +02:00
Daan De Meyer
dea0dc7ba2 repart: Allow combining CopyBlocks= and CopyFiles=
Let's allow the combination of these two options. When used, repart
will first try to apply the CopyBlocks= behavior. If that's not possible,
it falls back to the CopyFiles= behavior.

This is a first step in being able to also use the partition definition
files shipped in the image to build the image in mkosi instead of having
a separate set of repart definition files to build the image.
2023-08-01 07:53:34 +02:00