]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-blkid: add support for --hint offsets
authorKarel Zak <kzak@redhat.com>
Mon, 30 Nov 2020 10:38:21 +0000 (11:38 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Jan 2021 15:58:43 +0000 (00:58 +0900)
commit4fcc033b5476039a7a8030e1edc261d42cec028b
treeb05b198d690bb8b9a50600787c2e31f357e1eece
parent885598f36c48aa54431dc3f671f07f842fb9360c
udev-builtin-blkid: add support for --hint offsets

The next libblkid v2.37 is going to support session offsets for
multi-session CD/DVDs. This feature is implemented by "hint offsets".

These offsets are optional and prober specific (e.g., iso, udf, ...).
For this purpose, the library provides a new function
blkid_probe_set_hint(), and blkid(8) provides a new command-line
option --hint <name>=<offset>. For CD/DVD, the offset name is
"session_offset".

The difference between classic --offset and the new --hint is that
--offset is very restrictive and defines the probing area and the rest
of the device is invisible to the library. The new --hint works
like a suggestion, it provides a hint where the user assumes the
filesystem, but the rest of the device is still readable for the
library (for example, to get some additional superblock information
etc.).

If the --hint is without a value then it defaults to zero.

The option --hint implementation in udev-builtin-blkid.c is backwardly
compatible. If compiled against old libblkid, then the option is used in
the same way as --offset.

Addresses: https://github.com/karelzak/util-linux/issues/1161
Addresses: https://github.com/systemd/systemd/pull/17424
meson.build
rules.d/60-persistent-storage.rules
src/udev/udev-builtin-blkid.c
test/fuzz/fuzz-udev-rules/60-persistent-storage.rules