From e4fd21a77722a27c5b073184acd79b28edb8aa30 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 17 Aug 2025 22:05:53 +0900 Subject: [PATCH] Bump required minimum version of blkid to 2.37 Major distributions already have blkid >= 2.37. Let's bump the minimal required version. Note, util-linux (which provides blkid) 2.37 was released on 2021-06-01. See also #38608. --- README | 2 +- meson.build | 3 +-- src/udev/udev-builtin-blkid.c | 12 +----------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README b/README index 4fcd111777..2985d5c4fa 100644 --- a/README +++ b/README @@ -216,7 +216,7 @@ REQUIREMENTS: libmount >= 2.30 (from util-linux) (util-linux *must* be built without --enable-libmount-support-mtab) libseccomp >= 2.3.1 (optional) - libblkid >= 2.24 (from util-linux) (optional) + libblkid >= 2.37 (from util-linux) (optional) libkmod >= 15 (optional) PAM >= 1.1.2 (optional) libcryptsetup >= 2.0.1 (optional), diff --git a/meson.build b/meson.build index 3b179d64e0..90604e4191 100644 --- a/meson.build +++ b/meson.build @@ -1229,10 +1229,9 @@ conf.set10('HAVE_AUDIT', libaudit.found()) libaudit_cflags = libaudit.partial_dependency(includes: true, compile_args: true) libblkid = dependency('blkid', + version : '>=2.37.0', required : get_option('blkid')) conf.set10('HAVE_BLKID', libblkid.found()) -conf.set10('HAVE_BLKID_PROBE_SET_HINT', - libblkid.found() and cc.has_function('blkid_probe_set_hint', dependencies : libblkid)) libblkid_cflags = libblkid.partial_dependency(includes: true, compile_args: true) libkmod = dependency('libkmod', diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index 5e7f78eebc..6ec02674b9 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -458,21 +458,11 @@ static int builtin_blkid(UdevEvent *event, int argc, char *argv[]) { switch (option) { case 'H': -#if HAVE_BLKID_PROBE_SET_HINT errno = 0; r = sym_blkid_probe_set_hint(pr, optarg, 0); if (r < 0) return log_device_error_errno(dev, errno_or_else(ENOMEM), "Failed to use '%s' probing hint: %m", optarg); break; -#else - /* Use the hint = as probing offset for old versions */ - optarg = strchr(optarg, '='); - if (!optarg) - /* no value means 0, do nothing for old versions */ - break; - ++optarg; - _fallthrough_; -#endif case 'o': r = safe_atoi64(optarg, &offset); if (r < 0) @@ -489,7 +479,7 @@ static int builtin_blkid(UdevEvent *event, int argc, char *argv[]) { sym_blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE | -#ifdef BLKID_SUBLKS_FSINFO +#ifdef BLKID_SUBLKS_FSINFO /* since util-linux 2.39 */ BLKID_SUBLKS_FSINFO | #endif BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION);