udev-builtin-blkid: add support for --hint offsets

System Internals / systemd - Karel Zak [redhat.com] - 12 January 2021 15:58 UTC

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 =. 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

4fcc033b54 udev-builtin-blkid: add support for --hint offsets
meson.build | 3 ++
rules.d/60-persistent-storage.rules | 2 +-
src/udev/udev-builtin-blkid.c | 33 ++++++++++++++++------
.../fuzz-udev-rules/60-persistent-storage.rules | 2 +-
4 files changed, 30 insertions(+), 10 deletions(-)

Upstream: github.com

  • Share