main - gcc: archive reoder struct vars
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=14cf579263cb9121a8f...
Commit: 14cf579263cb9121a8f06396c6257453492e043b
Parent: 438408de7dc3be6daed240ec52f0e0a09ae9b2f6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 23:41:47 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 00:09:07 2021 +0200
gcc: archive reoder struct vars
Easier for automatic struct initialization = { 0 } without warns
from older gcc.
---
lib/format_text/archive.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/format_text/archive.c b/lib/format_text/archive.c
index c9c4f2265..09a472b4c 100644
--- a/lib/format_text/archive.c
+++ b/lib/format_text/archive.c
@@ -47,9 +47,8 @@
* with the least recent at the head.
*/
struct archive_file {
- struct dm_list list;
-
const char *name;
+ struct dm_list list;
uint32_t index;
};
2 years, 6 months
main - configure: missed braces
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=438408de7dc3be6daed...
Commit: 438408de7dc3be6daed240ec52f0e0a09ae9b2f6
Parent: 8784211958ee0ea663171e186bd5217b1c7b52c7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 15 00:02:11 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 00:08:29 2021 +0200
configure: missed braces
Missed [] around AS_IF internals,
Also missed to call pkg_config_init prior PKG_CHECK_MODULES().
---
configure | 10 ++++++----
configure.ac | 5 +++--
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 1b3fe7080..7f55569b0 100755
--- a/configure
+++ b/configure
@@ -1856,6 +1856,10 @@ Some influential environment variables:
BLKID_CFLAGS
C compiler flags for BLKID, overriding pkg-config
BLKID_LIBS linker flags for BLKID, overriding pkg-config
+ SYSTEMD_CFLAGS
+ C compiler flags for SYSTEMD, overriding pkg-config
+ SYSTEMD_LIBS
+ linker flags for SYSTEMD, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
PYTHON the Python interpreter
@@ -11643,10 +11647,8 @@ $as_echo "#define APP_MACHINEID_SUPPORT 1" >>confdefs.h
fi
if test -n "SYSTEMD_MIN_VERSION"; then :
- SYSTEMD_CFLAGS
- C compiler flags for SYSTEMD, overriding pkg-config
- SYSTEMD_LIBS
- linker flags for SYSTEMD, overriding pkg-config
+
+ pkg_config_init
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
diff --git a/configure.ac b/configure.ac
index 2cff45fdc..0ec8d6b7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1145,9 +1145,10 @@ AS_IF([test "$APP_MACHINEID_SUPPORT" = yes],
SYSTEMD_MIN_VERSION=234)
dnl -- Look for libsystemd libraries
-AS_IF([test -n "SYSTEMD_MIN_VERSION"],
+AS_IF([test -n "SYSTEMD_MIN_VERSION"],[
+ pkg_config_init
PKG_CHECK_MODULES(SYSTEMD, systemd >= "$SYSTEMD_MIN_VERSION", [], $bailout)
- SYSTEMD_LIBS="-lsystemd")
+ SYSTEMD_LIBS="-lsystemd"])
################################################################################
2 years, 6 months
main - debug: reduce some debugging noise
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8784211958ee0ea6631...
Commit: 8784211958ee0ea663171e186bd5217b1c7b52c7
Parent: ae92888a7baf3f1882168a6084eca23c9b85b998
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 18:16:49 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
debug: reduce some debugging noise
Resolve event_activation configure option just once.
Do not print debug_devs about 'bad' filtering, when
actually filter already printed reason for skipping
Do not trace more then once about backup being disabled.
No debug when unlinked file does not exists in pvscan.
---
lib/commands/toolcontext.c | 1 +
lib/commands/toolcontext.h | 2 ++
lib/filters/filter-persistent.c | 3 ++-
lib/format_text/archiver.c | 5 ++++-
tools/pvscan.c | 8 ++++----
tools/toollib.c | 2 +-
6 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 5144a9a6e..ab574fb55 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -765,6 +765,7 @@ static int _process_config(struct cmd_context *cmd)
init_pv_min_size((uint64_t)pv_min_kb * (1024 >> SECTOR_SHIFT));
cmd->check_pv_dev_sizes = find_config_tree_bool(cmd, metadata_check_pv_device_sizes_CFG, NULL);
+ cmd->event_activation = find_config_tree_bool(cmd, global_event_activation_CFG, NULL);
if (!process_profilable_config(cmd))
return_0;
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 7ccee4571..701b7a739 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -199,6 +199,8 @@ struct cmd_context {
unsigned check_devs_used:1; /* check devs used by LVs */
unsigned print_device_id_not_found:1; /* print devices file entries not found */
unsigned ignore_device_name_mismatch:1; /* skip updating devices file names */
+ unsigned backup_disabled:1; /* skip repeated debug message */
+ unsigned event_activation:1; /* whether event_activation is set */
/*
* Devices and filtering.
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index 3f7007e4d..494a38ece 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -137,7 +137,8 @@ static int _lookup_p(struct cmd_context *cmd, struct dev_filter *f, struct devic
l = PF_GOOD_DEVICE;
}
- log_debug_devs("filter caching %s %s", pass ? "good" : "bad", dev_name(dev));
+ if (!dev->filtered_flags) /* skipping reason already logged by filter */
+ log_debug_devs("filter caching %s %s", pass ? "good" : "bad", dev_name(dev));
dm_list_iterate_items(sl, &dev->aliases)
if (!dm_hash_insert(pf->devices, sl->str, l)) {
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index 87e4edc40..165c029aa 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -626,7 +626,10 @@ void check_current_backup(struct volume_group *vg)
int old_suppress;
if (!vg->cmd->backup_params->enabled || !vg->cmd->backup_params->dir) {
- log_debug("Skipping check for current backup, since backup is disabled.");
+ if (!vg->cmd->backup_disabled) {
+ log_debug("Skipping check for current backup, since backup is disabled.");
+ vg->cmd->backup_disabled = 1;
+ }
return;
}
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 75a08d325..6ea7a77e5 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -271,7 +271,7 @@ static void _lookup_file_remove(char *vgname)
log_debug("Unlink pvs_lookup: %s", path);
- if (unlink(path))
+ if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
@@ -292,7 +292,7 @@ void online_vg_file_remove(const char *vgname)
log_debug("Unlink vg online: %s", path);
- if (unlink(path))
+ if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
@@ -332,7 +332,7 @@ static void _online_pvid_file_remove_devno(int major, int minor)
if ((file_major == major) && (file_minor == minor)) {
log_debug("Unlink pv online %s", path);
- if (unlink(path))
+ if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
if (file_vgname[0]) {
@@ -360,7 +360,7 @@ static void _online_files_remove(const char *dirpath)
memset(path, 0, sizeof(path));
snprintf(path, sizeof(path), "%s/%s", dirpath, de->d_name);
- if (unlink(path))
+ if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
if (closedir(dir))
diff --git a/tools/toollib.c b/tools/toollib.c
index 5b67669e1..d6f48aad2 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -828,7 +828,7 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
* user may want to take charge of activation changes to the VG
* and not have the system autoactivation interfere.
*/
- if (!is_change_activating(activate) && find_config_tree_bool(cmd, global_event_activation_CFG, NULL))
+ if (!is_change_activating(activate) && cmd->event_activation)
online_vg_file_remove(lv->vg->name);
set_lv_notify(lv->vg->cmd);
2 years, 6 months
main - make: generate
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ae92888a7baf3f18821...
Commit: ae92888a7baf3f1882168a6084eca23c9b85b998
Parent: 0bd5388b16e2a14285ecd91ebf9f5537b5b303cc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 22:41:48 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
make: generate
---
conf/example.conf.in | 10 ++--------
man/pvscan.8_pregen | 2 ++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 1f7c449bf..a78ed7333 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -126,7 +126,7 @@ devices {
# be used, regardless of this setting, when the --devicesfile
# option is set to a specific file name.
# This configuration option has an automatic default value.
- # use_devicesfile = 1
+ # use_devicesfile = 0
# Configuration option devices/devicesfile.
# The name of the system devices file, listing devices that LVM should use.
@@ -236,12 +236,6 @@ devices {
# This configuration option has an automatic default value.
# multipath_wwids_file = "/etc/multipath/wwids"
- # Configuration option devices/multipath_wwids_file.
- # The path to the multipath wwids file used for multipath component detection.
- # Set this to an empty string to disable the use of the multipath wwids file.
- # This configuration option has an automatic default value.
- # multipath_wwids_file = "/etc/multipath/wwids"
-
# Configuration option devices/md_component_detection.
# Enable detection and exclusion of MD component devices.
# An MD component device is a block device that MD uses as part
@@ -842,7 +836,7 @@ log {
# Configuration option log/syslog.
# Send log messages through syslog.
# This configuration option has an automatic default value.
- # syslog = 1
+ # syslog = 0
# Configuration option log/file.
# Write error and debug log messages to a file specified here.
diff --git a/man/pvscan.8_pregen b/man/pvscan.8_pregen
index a15138d8b..9eb6b5bf9 100644
--- a/man/pvscan.8_pregen
+++ b/man/pvscan.8_pregen
@@ -51,6 +51,8 @@ pvscan \(em List all physical volumes
\fB-j\fP|\fB--major\fP \fINumber\fP
.br
\fB--minor\fP \fINumber\fP
+.br
+ \fB--nohints\fP
.br
\fB--nolocking\fP
.br
2 years, 6 months
main - log: also build without systemd_journal_support
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0bd5388b16e2a14285e...
Commit: 0bd5388b16e2a14285ecd91ebf9f5537b5b303cc
Parent: b73e1cd4b3edb5dabc631cca78f780012beb93fa
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 20:50:01 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
log: also build without systemd_journal_support
---
lib/log/log.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/log/log.c b/lib/log/log.c
index f9568792f..7b4d537b3 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -25,7 +25,10 @@
#include <syslog.h>
#include <ctype.h>
#include <time.h>
+
+#ifdef SYSTEMD_JOURNAL_SUPPORT
#include <systemd/sd-journal.h>
+#endif
static FILE *_log_file;
static char _log_file_path[PATH_MAX];
@@ -622,6 +625,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c
log_it:
+#ifdef SYSTEMD_JOURNAL_SUPPORT
if (_log_journal) {
int to_journal = 0;
@@ -647,6 +651,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c
va_end(ap);
}
}
+#endif
if (!logged_via_report && ((verbose_level() >= level) && !_log_suppress)) {
if (verbose_level() > _LOG_DEBUG) {
@@ -858,6 +863,7 @@ void log_set_report_object_name_and_id(const char *name, const char *id)
void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id)
{
+#ifdef SYSTEMD_JOURNAL_SUPPORT
if (_log_journal & LOG_JOURNAL_COMMAND) {
/*
@@ -875,6 +881,7 @@ void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id)
"PRIORITY=%i", LOG_INFO,
NULL);
}
+#endif
}
uint32_t log_journal_str_to_val(const char *str)
2 years, 6 months
main - configure: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b73e1cd4b3edb5dabc6...
Commit: b73e1cd4b3edb5dabc631cca78f780012beb93fa
Parent: 6635ff77e3680290c464a90ba9b2ee0170a2dc84
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 22:41:09 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
configure: updates
---
configure | 292 +++++++++++++++++++++++--------------------------
include/configure.h.in | 6 +
lib/config/defaults.h | 1 -
make.tmpl.in | 19 +++-
4 files changed, 155 insertions(+), 163 deletions(-)
diff --git a/configure b/configure
index 1f333a6f2..1b3fe7080 100755
--- a/configure
+++ b/configure
@@ -668,7 +668,6 @@ SALCK_CFLAGS
SACKPT_LIBS
SACKPT_CFLAGS
REPLICATORS
-READLINE_LIBS
RT_LIBS
QUORUM_LIBS
QUORUM_CFLAGS
@@ -755,6 +754,8 @@ BUILD_LVMDBUSD
BUILD_DMEVENTD
BUILD_CMIRRORD
BLKID_PC
+READLINE_LIBS
+READLINE_CFLAGS
MODPROBE_CMD
MSGFMT
EDITLINE_LIBS
@@ -776,12 +777,6 @@ SYSTEMD_LIBS
SYSTEMD_CFLAGS
BLKID_LIBS
BLKID_CFLAGS
-APP_MACHINEID_LIBS
-APP_MACHINEID_CFLAGS
-NOTIFY_DBUS_LIBS
-NOTIFY_DBUS_CFLAGS
-BLKID_LIBS
-BLKID_CFLAGS
LOCKD_IDM_LIBS
LOCKD_IDM_CFLAGS
LOCKD_DLM_CONTROL_LIBS
@@ -912,6 +907,7 @@ with_device_uid
with_device_gid
with_device_mode
with_device_nodes_on
+with_default_use_devices_file
with_default_name_mangling
with_snapshots
with_mirrors
@@ -961,6 +957,7 @@ enable_use_lvmpolld
with_lvmpolld_pidfile
enable_dmfilemapd
enable_notify_dbus
+enable_systemd_journal
enable_app_machineid
enable_blkid_wiping
enable_udev_systemd_background_jobs
@@ -1032,21 +1029,17 @@ LOCKD_DLM_CONTROL_CFLAGS
LOCKD_DLM_CONTROL_LIBS
LOCKD_IDM_CFLAGS
LOCKD_IDM_LIBS
-NOTIFY_DBUS_CFLAGS
-NOTIFY_DBUS_LIBS
-APP_MACHINEID_CFLAGS
-APP_MACHINEID_LIBS
BLKID_CFLAGS
BLKID_LIBS
-NOTIFY_DBUS_CFLAGS
-NOTIFY_DBUS_LIBS
SYSTEMD_CFLAGS
SYSTEMD_LIBS
UDEV_CFLAGS
UDEV_LIBS
PYTHON
EDITLINE_CFLAGS
-EDITLINE_LIBS'
+EDITLINE_LIBS
+READLINE_CFLAGS
+READLINE_LIBS'
# Initialize some variables set by options.
@@ -1700,7 +1693,9 @@ Optional Features:
--disable-use-lvmpolld disable usage of LVM Poll Daemon
--enable-dmfilemapd enable the dmstats filemap daemon
--enable-notify-dbus enable LVM notification using dbus
- --enable-app-machineid enable LVM system ID using app-specific machine-id
+ --disable-systemd-journal
+ disable LVM systemd journaling
+ --disable-app-machineid disable LVM system ID using app-specific machine-id
--disable-blkid_wiping disable libblkid detection of signatures when wiping
and use native code instead
--disable-udev-systemd-background-jobs
@@ -1737,6 +1732,8 @@ Optional Packages:
--with-device-mode=MODE set the mode used for new device nodes [MODE=0600]
--with-device-nodes-on=ON
create nodes on resume or create [ON=resume]
+ --with-default-use-devices-file
+ default for lvm.conf devices/use_devicesfile = [0]
--with-default-name-mangling=MANGLING
default name mangling: auto/none/hex [auto]
--with-snapshots=TYPE snapshot support: internal/none [internal]
@@ -1859,21 +1856,6 @@ Some influential environment variables:
BLKID_CFLAGS
C compiler flags for BLKID, overriding pkg-config
BLKID_LIBS linker flags for BLKID, overriding pkg-config
- NOTIFY_DBUS_CFLAGS
- C compiler flags for NOTIFY_DBUS, overriding pkg-config
- NOTIFY_DBUS_LIBS
- linker flags for NOTIFY_DBUS, overriding pkg-config
- APP_MACHINEID_CFLAGS
- C compiler flags for APP_MACHINEID, overriding pkg-config
- APP_MACHINEID_LIBS
- linker flags for APP_MACHINEID, overriding pkg-config
- BLKID_CFLAGS
- C compiler flags for BLKID, overriding pkg-config
- BLKID_LIBS linker flags for BLKID, overriding pkg-config
- SYSTEMD_CFLAGS
- C compiler flags for SYSTEMD, overriding pkg-config
- SYSTEMD_LIBS
- linker flags for SYSTEMD, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
PYTHON the Python interpreter
@@ -1881,6 +1863,10 @@ Some influential environment variables:
C compiler flags for EDITLINE, overriding pkg-config
EDITLINE_LIBS
linker flags for EDITLINE, overriding pkg-config
+ READLINE_CFLAGS
+ C compiler flags for readline
+ READLINE_LIBS
+ linker flags for readline
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -6718,18 +6704,17 @@ fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_ffs" >&5
-printf %s "checking for __builtin_ffs... " >&6; }
-if test ${ax_cv_have___builtin_ffs+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_ffs" >&5
+$as_echo_n "checking for __builtin_ffs... " >&6; }
+if ${ax_cv_have___builtin_ffs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main (void)
+main ()
{
__builtin_ffs(0)
@@ -6738,26 +6723,31 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+if ac_fn_c_try_link "$LINENO"; then :
ax_cv_have___builtin_ffs=yes
-else $as_nop
+else
ax_cv_have___builtin_ffs=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
+rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_ffs" >&5
-printf "%s\n" "$ax_cv_have___builtin_ffs" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_ffs" >&5
+$as_echo "$ax_cv_have___builtin_ffs" >&6; }
- if test yes = $ax_cv_have___builtin_ffs
-then :
+ if test yes = $ax_cv_have___builtin_ffs; then :
-printf "%s\n" "#define HAVE___BUILTIN_FFS 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE___BUILTIN_FFS 1
+_ACEOF
fi
+
+
+
+
+
$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
@@ -6783,25 +6773,17 @@ else
fi
done
-ac_fn_c_check_func "$LINENO" "ffs" "ac_cv_func_ffs"
-if test "x$ac_cv_func_ffs" = xyes
-then :
- printf "%s\n" "#define HAVE_FFS 1" >>confdefs.h
-
-fi
-ac_fn_c_check_func "$LINENO" "prlimit" "ac_cv_func_prlimit"
-if test "x$ac_cv_func_prlimit" = xyes
-then :
- printf "%s\n" "#define HAVE_PRLIMIT 1" >>confdefs.h
-
-fi
-ac_fn_c_check_func "$LINENO" "versionsort" "ac_cv_func_versionsort"
-if test "x$ac_cv_func_versionsort" = xyes
-then :
- printf "%s\n" "#define HAVE_VERSIONSORT 1" >>confdefs.h
+for ac_func in ffs prlimit versionsort
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
-
+done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
@@ -8366,7 +8348,6 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking file owner" >&5
$as_echo_n "checking file owner... " >&6; }
@@ -8476,6 +8457,29 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default for use_devicesfile" >&5
+$as_echo_n "checking default for use_devicesfile... " >&6; }
+
+# Check whether --with-default-use-devices-file was given.
+if test "${with_default_use_devices_file+set}" = set; then :
+ withval=$with_default_use_devices_file; DEFAULT_USE_DEVICES_FILE=$enableval
+else
+ DEFAULT_USE_DEVICES_FILE=0
+fi
+
+case "$DEFAULT_USE_DEVICES_FILE" in
+ 0|1);;
+ *) as_fn_error $? "--with-default-use-devices-file parameter invalid" "$LINENO" 5;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_USE_DEVICES_FILE" >&5
+$as_echo "$DEFAULT_USE_DEVICES_FILE" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_USE_DEVICES_FILE $DEFAULT_USE_DEVICES_FILE
+_ACEOF
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default name mangling" >&5
$as_echo_n "checking default name mangling... " >&6; }
@@ -9856,13 +9860,13 @@ _ACEOF
# Do we want to link lvm2 with a big library for vdoformating ?
#
#AC_ARG_WITH(vdo-include,
-# AC_HELP_STRING([--with-vdo-include=PATH],
+# AS_HELP_STRING([--with-vdo-include=PATH],
# [vdo support: Path to utils headers: [/usr/include/vdo/utils]]),
# VDO_INCLUDE=$withval, VDO_INCLUDE="/usr/include/vdo/utils")
#AC_MSG_RESULT($VDO_INCLUDE)
#
#AC_ARG_WITH(vdo-lib,
-# AC_HELP_STRING([--with-vdo-lib=PATH],
+# AS_HELP_STRING([--with-vdo-lib=PATH],
# [vdo support: Path to utils lib: [/usr/lib]]),
# VDO_LIB=$withval, VDO_LIB="/usr/lib")
#AC_MSG_RESULT($VDO_LIB)
@@ -11559,6 +11563,7 @@ fi
fi
+SYSTEMD_MIN_VERSION=
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build notifydbus" >&5
$as_echo_n "checking whether to build notifydbus... " >&6; }
@@ -11572,125 +11577,91 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NOTIFYDBUS_SUPPORT" >&5
$as_echo "$NOTIFYDBUS_SUPPORT" >&6; }
-if test "$NOTIFYDBUS_SUPPORT" = yes; then
+if test "$NOTIFYDBUS_SUPPORT" = yes; then :
$as_echo "#define NOTIFYDBUS_SUPPORT 1" >>confdefs.h
- SYSTEMD_LIBS="-lsystemd"
+ SYSTEMD_MIN_VERSION=221
fi
################################################################################
-if test "$NOTIFYDBUS_SUPPORT" = yes; then
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NOTIFY_DBUS" >&5
-$as_echo_n "checking for NOTIFY_DBUS... " >&6; }
-
-if test -n "$NOTIFY_DBUS_CFLAGS"; then
- pkg_cv_NOTIFY_DBUS_CFLAGS="$NOTIFY_DBUS_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 221\""; } >&5
- ($PKG_CONFIG --exists --print-errors "systemd >= 221") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_NOTIFY_DBUS_CFLAGS=`$PKG_CONFIG --cflags "systemd >= 221" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-journal.h" "ac_cv_header_systemd_sd_journal_h" "$ac_includes_default"
+if test "x$ac_cv_header_systemd_sd_journal_h" = xyes; then :
+ SYSTEMD_JOURNAL_SUPPORT=yes
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
+ SYSTEMD_JOURNAL_SUPPORT=no
fi
-if test -n "$NOTIFY_DBUS_LIBS"; then
- pkg_cv_NOTIFY_DBUS_LIBS="$NOTIFY_DBUS_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 221\""; } >&5
- ($PKG_CONFIG --exists --print-errors "systemd >= 221") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_NOTIFY_DBUS_LIBS=`$PKG_CONFIG --libs "systemd >= 221" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to log to systemd journal" >&5
+$as_echo_n "checking whether to log to systemd journal... " >&6; }
+# Check whether --enable-systemd-journal was given.
+if test "${enable_systemd_journal+set}" = set; then :
+ enableval=$enable_systemd_journal; if test "$enableval" = yes && test "$SYSTEMD_JOURNAL_SUPPORT" = no; then :
+ as_fn_error $? "Enabling systemd journaling requires systemd/sd-journal.h." "$LINENO" 5
fi
- else
- pkg_failed=untried
+ SYSTEMD_JOURNAL_SUPPORT=$enableval
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEMD_JOURNAL_SUPPORT" >&5
+$as_echo "$SYSTEMD_JOURNAL_SUPPORT" >&6; }
+if test "$SYSTEMD_JOURNAL_SUPPORT" = yes; then :
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+$as_echo "#define SYSTEMD_JOURNAL_SUPPORT 1" >>confdefs.h
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
+ SYSTEMD_MIN_VERSION=221
fi
- if test $_pkg_short_errors_supported = yes; then
- NOTIFY_DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd >= 221" 2>&1`
- else
- NOTIFY_DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd >= 221" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$NOTIFY_DBUS_PKG_ERRORS" >&5
- $bailout
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- $bailout
+################################################################################
+ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-id128.h" "ac_cv_header_systemd_sd_id128_h" "$ac_includes_default"
+if test "x$ac_cv_header_systemd_sd_id128_h" = xyes; then :
+ APP_MACHINEID_SUPPORT=yes
else
- NOTIFY_DBUS_CFLAGS=$pkg_cv_NOTIFY_DBUS_CFLAGS
- NOTIFY_DBUS_LIBS=$pkg_cv_NOTIFY_DBUS_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- HAVE_NOTIFY_DBUS=yes
-fi
+ APP_MACHINEID_SUPPORT=no
fi
-################################################################################
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build appmachineid" >&5
$as_echo_n "checking whether to build appmachineid... " >&6; }
# Check whether --enable-app-machineid was given.
if test "${enable_app_machineid+set}" = set; then :
- enableval=$enable_app_machineid; APP_MACHINEID_SUPPORT=$enableval
-else
- APP_MACHINEID_SUPPORT=no
+ enableval=$enable_app_machineid; if test "$enableval" = yes && test "$APP_MACHINEID_SUPPORT" = no; then :
+ as_fn_error $? "Enabling app machineid requires systemd/sd-id128.h." "$LINENO" 5
+fi
+ APP_MACHINEID_SUPPORT=$enableval
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $APP_MACHINEID_SUPPORT" >&5
$as_echo "$APP_MACHINEID_SUPPORT" >&6; }
-if test "$APP_MACHINEID_SUPPORT" = yes; then
+if test "$APP_MACHINEID_SUPPORT" = yes; then :
$as_echo "#define APP_MACHINEID_SUPPORT 1" >>confdefs.h
- SYSTEMD_LIBS="-lsystemd"
+ SYSTEMD_MIN_VERSION=234
fi
-################################################################################
-if test "$APP_MACHINEID_SUPPORT" = yes; then
+if test -n "SYSTEMD_MIN_VERSION"; then :
+ SYSTEMD_CFLAGS
+ C compiler flags for SYSTEMD, overriding pkg-config
+ SYSTEMD_LIBS
+ linker flags for SYSTEMD, overriding pkg-config
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APP_MACHINEID" >&5
-$as_echo_n "checking for APP_MACHINEID... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
-if test -n "$APP_MACHINEID_CFLAGS"; then
- pkg_cv_APP_MACHINEID_CFLAGS="$APP_MACHINEID_CFLAGS"
+if test -n "$SYSTEMD_CFLAGS"; then
+ pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 234\""; } >&5
- ($PKG_CONFIG --exists --print-errors "systemd >= 234") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= \"\$SYSTEMD_MIN_VERSION\"\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "systemd >= "$SYSTEMD_MIN_VERSION"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_APP_MACHINEID_CFLAGS=`$PKG_CONFIG --cflags "systemd >= 234" 2>/dev/null`
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "systemd >= "$SYSTEMD_MIN_VERSION"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -11698,16 +11669,16 @@ fi
else
pkg_failed=untried
fi
-if test -n "$APP_MACHINEID_LIBS"; then
- pkg_cv_APP_MACHINEID_LIBS="$APP_MACHINEID_LIBS"
+if test -n "$SYSTEMD_LIBS"; then
+ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 234\""; } >&5
- ($PKG_CONFIG --exists --print-errors "systemd >= 234") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= \"\$SYSTEMD_MIN_VERSION\"\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "systemd >= "$SYSTEMD_MIN_VERSION"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_APP_MACHINEID_LIBS=`$PKG_CONFIG --libs "systemd >= 234" 2>/dev/null`
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "systemd >= "$SYSTEMD_MIN_VERSION"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -11728,12 +11699,12 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- APP_MACHINEID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd >= 234" 2>&1`
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd >= "$SYSTEMD_MIN_VERSION"" 2>&1`
else
- APP_MACHINEID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd >= 234" 2>&1`
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd >= "$SYSTEMD_MIN_VERSION"" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
- echo "$APP_MACHINEID_PKG_ERRORS" >&5
+ echo "$SYSTEMD_PKG_ERRORS" >&5
$bailout
elif test $pkg_failed = untried; then
@@ -11741,12 +11712,13 @@ elif test $pkg_failed = untried; then
$as_echo "no" >&6; }
$bailout
else
- APP_MACHINEID_CFLAGS=$pkg_cv_APP_MACHINEID_CFLAGS
- APP_MACHINEID_LIBS=$pkg_cv_APP_MACHINEID_LIBS
+ SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+ SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- HAVE_APP_MACHINEID=yes
+
fi
+ SYSTEMD_LIBS="-lsystemd"
fi
################################################################################
@@ -14386,7 +14358,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-################################################################################
@@ -14400,6 +14371,15 @@ _ACEOF
+################################################################################
+
+
+
+
+
+
+
+
diff --git a/include/configure.h.in b/include/configure.h.in
index 703ac0432..7efa83661 100644
--- a/include/configure.h.in
+++ b/include/configure.h.in
@@ -90,6 +90,9 @@
/* Use blkid wiping by default. */
#undef DEFAULT_USE_BLKID_WIPING
+/* Default for lvm.conf use_devicefile. */
+#undef DEFAULT_USE_DEVICES_FILE
+
/* Use lvmlockd by default. */
#undef DEFAULT_USE_LVMLOCKD
@@ -668,6 +671,9 @@
/* Define to 1 if strerror_r returns char *. */
#undef STRERROR_R_CHAR_P
+/* Define to 1 to include code that uses systemd journal. */
+#undef SYSTEMD_JOURNAL_SUPPORT
+
/* Path to testsuite data */
#undef TESTSUITE_DATA
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 54eba3723..1b1568a7b 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -322,7 +322,6 @@
#define DEFAULT_MD_COMPONENT_CHECKS "auto"
-#define DEFAULT_USE_DEVICES_FILE 1
#define DEFAULT_DEVICES_FILE "system.devices"
#define DEFAULT_SEARCH_FOR_DEVNAMES "auto"
diff --git a/make.tmpl.in b/make.tmpl.in
index 1e6393a7b..cccda10d6 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -73,22 +73,29 @@ CLDFLAGS += @CLDFLAGS@
ELDFLAGS += @ELDFLAGS@
LDDEPS += @LDDEPS@
LIB_SUFFIX = @LIB_SUFFIX@
+USE_TRACKING = @USE_TRACKING@
+
DL_LIBS = @DL_LIBS@
RT_LIBS = @RT_LIBS@
M_LIBS = @M_LIBS@
-AIO_LIBS = @AIO_LIBS@
AIO_CFLAGS = @AIO_CFLAGS@
+AIO_LIBS = @AIO_LIBS@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+CPG_CFLAGS = @CPG_CFLAGS@
+CPG_LIBS = @CPG_LIBS@
+EDITLINE_CFLAGS = @EDITLINE_CFLAGS@
+EDITLINE_LIBS = @EDITLINE_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
+READLINE_CFLAGS = @READLINE_CFLAGS@
READLINE_LIBS = @READLINE_LIBS@
-EDITLINE_LIBS = @EDITLINE_LIBS@
SELINUX_LIBS = @SELINUX_LIBS@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
-BLKID_CFLAGS = @BLKID_CFLAGS@
-BLKID_LIBS = @BLKID_LIBS@
-SYSTEMD_LIBS = @SYSTEMD_LIBS@
VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-USE_TRACKING = @USE_TRACKING@
+VALGRIND_LIBS = @VALGRIND_LIBS@
# Setup directory variables
prefix = @prefix@
2 years, 6 months
main - configure.ac: improvement
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6635ff77e3680290c46...
Commit: 6635ff77e3680290c464a90ba9b2ee0170a2dc84
Parent: 32cb1c4cdde64ea8f2e0a9ff77ae95e9821904de
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 22:36:33 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
configure.ac: improvement
Handle automatically new setttings
--disable-systemd-journal
--disable-appmachineid
Both setting will check presence of apropriate header files.
In case they are present, build will try to automatically build with
them (adding systemd dependency)
User can anytime disabled them and drop systemd dependency.
Also add --with-default-use-devices-file configure option to
select automatically default value for this option.
For this moment keep default upstream as 0
---
configure.ac | 84 +++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 58 insertions(+), 26 deletions(-)
diff --git a/configure.ac b/configure.ac
index 31196d96c..2cff45fdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,7 +219,6 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
################################################################################
dnl -- Setup the ownership of the files
AC_MSG_CHECKING(file owner)
@@ -286,6 +285,20 @@ esac
AC_MSG_RESULT(on $ADD_NODE)
AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
+
+dnl -- Default settings for lvm.conf { devices/use_devicesfile }
+AC_MSG_CHECKING(default for use_devicesfile)
+AC_ARG_WITH(default-use-devices-file,
+ AS_HELP_STRING([--with-default-use-devices-file], [default for lvm.conf devices/use_devicesfile = [0]]),
+ DEFAULT_USE_DEVICES_FILE=$enableval, DEFAULT_USE_DEVICES_FILE=0)
+case "$DEFAULT_USE_DEVICES_FILE" in
+ 0|1);;
+ *) AC_MSG_ERROR([--with-default-use-devices-file parameter invalid]);;
+esac
+AC_MSG_RESULT($DEFAULT_USE_DEVICES_FILE)
+AC_DEFINE_UNQUOTED(DEFAULT_USE_DEVICES_FILE, [$DEFAULT_USE_DEVICES_FILE],
+ [Default for lvm.conf use_devicefile.])
+
AC_MSG_CHECKING(default name mangling)
AC_ARG_WITH(default-name-mangling,
AS_HELP_STRING([--with-default-name-mangling=MANGLING],
@@ -1085,6 +1098,7 @@ if test "$BUILD_DMFILEMAPD" = yes; then
AC_CHECK_HEADER([linux/fiemap.h], , [AC_MSG_ERROR(--enable-dmfilemapd requires fiemap.h)])
fi
+SYSTEMD_MIN_VERSION=
################################################################################
dnl -- Build notifydbus
AC_MSG_CHECKING(whether to build notifydbus)
@@ -1094,36 +1108,46 @@ AC_ARG_ENABLE(notify-dbus,
NOTIFYDBUS_SUPPORT=$enableval, NOTIFYDBUS_SUPPORT=no)
AC_MSG_RESULT($NOTIFYDBUS_SUPPORT)
-if test "$NOTIFYDBUS_SUPPORT" = yes; then
- AC_DEFINE([NOTIFYDBUS_SUPPORT], 1, [Define to 1 to include code that uses dbus notification.])
- SYSTEMD_LIBS="-lsystemd"
-fi
+AS_IF([test "$NOTIFYDBUS_SUPPORT" = yes],
+ AC_DEFINE([NOTIFYDBUS_SUPPORT], 1, [Define to 1 to include code that uses dbus notification.])
+ SYSTEMD_MIN_VERSION=221)
################################################################################
-dnl -- Look for dbus libraries
-if test "$NOTIFYDBUS_SUPPORT" = yes; then
- PKG_CHECK_MODULES(NOTIFY_DBUS, systemd >= 221, [HAVE_NOTIFY_DBUS=yes], $bailout)
-fi
+dnl -- Build with systemd journaling when the header file is present
+AC_CHECK_HEADER([systemd/sd-journal.h], [SYSTEMD_JOURNAL_SUPPORT=yes], [SYSTEMD_JOURNAL_SUPPORT=no])
+AC_MSG_CHECKING(whether to log to systemd journal)
+AC_ARG_ENABLE(systemd-journal,
+ AS_HELP_STRING([--disable-systemd-journal],
+ [disable LVM systemd journaling]),
+ AS_IF([test "$enableval" = yes && test "$SYSTEMD_JOURNAL_SUPPORT" = no],
+ [AC_MSG_ERROR([Enabling systemd journaling requires systemd/sd-journal.h.])])
+ SYSTEMD_JOURNAL_SUPPORT=$enableval, [])
+AC_MSG_RESULT($SYSTEMD_JOURNAL_SUPPORT)
+
+AS_IF([test "$SYSTEMD_JOURNAL_SUPPORT" = yes],
+ AC_DEFINE([SYSTEMD_JOURNAL_SUPPORT], 1, [Define to 1 to include code that uses systemd journal.])
+ SYSTEMD_MIN_VERSION=221)
################################################################################
-dnl -- Build appmachineid
+dnl -- Build appmachineid when header file sd-id128.h is present
+AC_CHECK_HEADER([systemd/sd-id128.h], [APP_MACHINEID_SUPPORT=yes], [APP_MACHINEID_SUPPORT=no])
AC_MSG_CHECKING(whether to build appmachineid)
AC_ARG_ENABLE(app-machineid,
- AC_HELP_STRING([--enable-app-machineid],
- [enable LVM system ID using app-specific machine-id]),
- APP_MACHINEID_SUPPORT=$enableval, APP_MACHINEID_SUPPORT=no)
+ AC_HELP_STRING([--disable-app-machineid],
+ [disable LVM system ID using app-specific machine-id]),
+ AS_IF([test "$enableval" = yes && test "$APP_MACHINEID_SUPPORT" = no],
+ [AC_MSG_ERROR([Enabling app machineid requires systemd/sd-id128.h.])])
+ APP_MACHINEID_SUPPORT=$enableval, [])
AC_MSG_RESULT($APP_MACHINEID_SUPPORT)
-if test "$APP_MACHINEID_SUPPORT" = yes; then
- AC_DEFINE([APP_MACHINEID_SUPPORT], 1, [Define to 1 to include code that uses libsystemd machine-id apis.])
- SYSTEMD_LIBS="-lsystemd"
-fi
+AS_IF([test "$APP_MACHINEID_SUPPORT" = yes],
+ AC_DEFINE([APP_MACHINEID_SUPPORT], 1, [Define to 1 to include code that uses libsystemd machine-id apis.])
+ SYSTEMD_MIN_VERSION=234)
-################################################################################
dnl -- Look for libsystemd libraries
-if test "$APP_MACHINEID_SUPPORT" = yes; then
- PKG_CHECK_MODULES(APP_MACHINEID, systemd >= 234, [HAVE_APP_MACHINEID=yes], $bailout)
-fi
+AS_IF([test -n "SYSTEMD_MIN_VERSION"],
+ PKG_CHECK_MODULES(SYSTEMD, systemd >= "$SYSTEMD_MIN_VERSION", [], $bailout)
+ SYSTEMD_LIBS="-lsystemd")
################################################################################
@@ -1805,6 +1829,19 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
AC_DEFINE_UNQUOTED(LVM_CONFIGURE_LINE, "$CONFIGURE_LINE", [configure command line used])
+AC_ARG_VAR([BLKID_CFLAGS], [C compiler flags for blkid])
+AC_ARG_VAR([BLKID_LIBS], [linker flags for blkid])
+AC_ARG_VAR([CPG_CFLAGS], [C compiler flags for cpg])
+AC_ARG_VAR([CPG_LIBS], [linker flags for cpg])
+AC_ARG_VAR([EDITLINE_CFLAGS], [C compiler flags for editline])
+AC_ARG_VAR([EDITLINE_LIBS], [linker flags for editline])
+AC_ARG_VAR([READLINE_CFLAGS], [C compiler flags for readline])
+AC_ARG_VAR([READLINE_LIBS], [linker flags for readline])
+AC_ARG_VAR([SYSTEMD_CFLAGS], [C compiler flags for systemd])
+AC_ARG_VAR([SYSTEMD_LIBS], [linker flags for systemd])
+AC_ARG_VAR([UDEV_CFLAGS], [C compiler flags for udev])
+AC_ARG_VAR([UDEV_LIBS], [linker flags for udev])
+
################################################################################
AC_SUBST(AWK)
AC_SUBST(BLKID_PC)
@@ -1829,8 +1866,6 @@ AC_SUBST(CONFDB_CFLAGS)
AC_SUBST(CONFDB_LIBS)
AC_SUBST(CONFDIR)
AC_SUBST(COPTIMISE_FLAG)
-AC_SUBST(CPG_CFLAGS)
-AC_SUBST(CPG_LIBS)
AC_SUBST(CSCOPE_CMD)
AC_SUBST(DEBUG)
AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
@@ -1902,8 +1937,6 @@ AC_SUBST(PYTHON3DIR)
AC_SUBST(QUORUM_CFLAGS)
AC_SUBST(QUORUM_LIBS)
AC_SUBST(RT_LIBS)
-AC_SUBST(READLINE_LIBS)
-AC_SUBST(EDITLINE_LIBS)
AC_SUBST(REPLICATORS)
AC_SUBST(SACKPT_CFLAGS)
AC_SUBST(SACKPT_LIBS)
@@ -1913,7 +1946,6 @@ AC_SUBST(SBINDIR)
AC_SUBST(SELINUX_LIBS)
AC_SUBST(SELINUX_PC)
AC_SUBST(SYSCONFDIR)
-AC_SUBST(SYSTEMD_LIBS)
AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
AC_SUBST(STATIC_LINK)
2 years, 6 months
main - makefiles: use proper install prefix for python dbus
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=32cb1c4cdde64ea8f2e...
Commit: 32cb1c4cdde64ea8f2e0a9ff77ae95e9821904de
Parent: af0ce203e9f78e307bfb9524dc8377ebbc53e8f1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 21:39:14 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
makefiles: use proper install prefix for python dbus
For non-standard prefix dir use correct installation path
(so the python files are not installed into user's system).
---
make.tmpl.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index 200ea2e05..1e6393a7b 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -121,7 +121,7 @@ systemd_generator_dir = $(DESTDIR)$(SYSTEMD_GENERATOR_DIR)
systemd_dir = $(DESTDIR)@systemdutildir@
tmpfiles_dir = $(DESTDIR)@tmpfilesdir@
ocf_scriptdir = $(DESTDIR)@OCFDIR@
-pythonprefix = $(DESTDIR)$(prefix)
+PYTHON_PREFIX = $(DESTDIR)$(prefix)
# N.B. No $(DESTDIR) prefix here.
python2dir = @PYTHON2DIR@
2 years, 6 months
main - debug: better error message
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=af0ce203e9f78e307bf...
Commit: af0ce203e9f78e307bfb9524dc8377ebbc53e8f1
Parent: 7e346ee2a5cd520fc038dda7451360bbe67e629f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 18:44:55 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200
debug: better error message
Add more details about size difference.
---
lib/format_text/format-text.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 654c387bf..941a34944 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -1922,7 +1922,9 @@ static int _text_pv_initialise(const struct format_type *fmt,
pv->pe_count = pva->extent_count;
if ((pv->pe_start + pv->pe_count * (uint64_t)pv->pe_size - 1) > pv->size) {
- log_error("Physical extents end beyond end of device %s.",
+ log_error("Physical extents (%s) end beyond end of device (%s) %s.",
+ display_size(pv->fmt->cmd, pv->pe_start + pv->pe_count * (uint64_t)pv->pe_size - 1),
+ display_size(pv->fmt->cmd, pv->size),
pv_dev_name(pv));
return 0;
}
2 years, 6 months
main - archiving: update refactoring
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7e346ee2a5cd520fc03...
Commit: 7e346ee2a5cd520fc038dda7451360bbe67e629f
Parent: c38473548e546c8e94d41587714f350a11362c84
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 14 23:31:21 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 14 23:33:26 2021 +0200
archiving: update refactoring
Commit 5ea426e65628218569ede461312d80ba5d1c50fb handled case with
file path without '/' incorrectly - there is valid use-case so
switch 'log_error()' to valid code branch.
---
lib/format_text/archive.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/format_text/archive.c b/lib/format_text/archive.c
index 740129df0..c9c4f2265 100644
--- a/lib/format_text/archive.c
+++ b/lib/format_text/archive.c
@@ -373,21 +373,21 @@ int archive_list_file(struct cmd_context *cmd, const char *file)
}
if (!(af.name = strrchr(file, '/'))) {
- log_error("No '/' in file path %s found.", file);
- return 0;
- }
+ af.name = file;
+ path[0] = 0;
+ } else {
+ len = (size_t)(af.name - file);
- len = (size_t)(af.name - file);
+ if (len >= sizeof(path)) {
+ log_error(INTERNAL_ERROR "Passed file path name %s is too long.", file);
+ return 0;
+ }
- if (len >= sizeof(path)) {
- log_error(INTERNAL_ERROR "Passed file path name %s is too long.", file);
- return 0;
+ memcpy(path, file, len);
+ path[len] = 0;
+ af.name++; /* jump over '/' */
}
- memcpy(path, file, len);
- path[len] = 0;
- af.name++; /* jump over '/' */
-
_display_archive(cmd, path, &af);
return 1;
2 years, 6 months