Skip to contentSkip to conversation

master - config: remove duplication of settings

PATCH David Teigland 1 participant 1 message Apr 21, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47ed4cdc35d3ce6d0923ce05765f08fa7e85a6f9
Commit:        47ed4cdc35d3ce6d0923ce05765f08fa7e85a6f9
Parent:        9b86e8e8f4a3c429f8e5632103fbef6eb1f8dc7d
Author:        David Teigland <[email protected]>
AuthorDate:    Wed Apr 15 16:15:30 2015 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Apr 21 14:55:03 2015 -0500

config: remove duplication of settings

The specific config settings have been removed
from the lvm.conf(5) man page, and replaced with
a description of how to use lvm dumpconfig to
view the settings.

The sample lvm.conf and lvmlocal.conf files are now generated:

example.conf.base  - initial ungenerated part of the file
example.conf.gen   - generated portion from dumpconfig
example.conf.in    - combination of .base and .gen files
example.conf       - result of configure processing .in file

lvmlocal.conf.base - initial ungenerated part of the file

lvmlocal.conf.gen  - generated portion from dumpconfig
lvmlocal.conf.in   - combination of .base and .gen files
lvmlocal.conf      - result of configure processing .in file

Do not edit the .in files, but edit config_settings.h or the .base files, and then use 'make generate' to create the new .in files.

- configure
with options

- make
creates tools/lvm

- make generate
uses tools/lvm to create example.conf.in and lvmlocal.conf.in by combining .base files with dumpconfig output.

- configure
with same options as above
creates example.conf and lvmlocal.conf from .in files

---
 Makefile.in             |    5 +
 conf/Makefile.in        |    8 +
 conf/example.conf.base  |   12 +
 conf/example.conf.in    | 1384 -----------------------------------------------
 conf/lvmlocal.conf.base |   19 +
 conf/lvmlocal.conf.in   |   54 --
 make.tmpl.in            |    4 +
 man/lvm.conf.5.in       |  538 ++-----------------
 8 files changed, 90 insertions(+), 1934 deletions(-)
Makefile.in +5 -0
index a7bed8e..bce7bee 100644
@@ -95,6 +95,11 @@ DISTCLEAN_TARGETS += cscope.out
 check check_system check_cluster check_local check_lvmetad unit: all
 	$(MAKE) -C test $(@)
 
+conf.generate: tools
+
+generate: conf.generate
+	$(MAKE) -C conf generate
+
 install_system_dirs:
 	$(INSTALL_DIR) $(DESTDIR)$(DEFAULT_SYS_DIR)
 	$(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_ARCHIVE_DIR)
conf/Makefile.in +8 -0
index 2d48fb9..33f91c4 100644
@@ -26,6 +26,14 @@ include $(top_builddir)/make.tmpl
 
 .PHONY: install_conf install_localconf install_profiles
 
+generate:
+	$(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withfullcomments --ignorelocal > example.conf.gen
+	cat example.conf.base example.conf.gen > example.conf.in
+	rm example.conf.gen
+	$(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withfullcomments local > lvmlocal.conf.gen
+	cat lvmlocal.conf.base lvmlocal.conf.gen > lvmlocal.conf.in
+	rm lvmlocal.conf.gen
+
 install_conf: $(CONFSRC)
 	@if [ ! -e $(confdir)/$(CONFDEST) ]; then \
 		echo "$(INSTALL_WDATA) -D $< $(confdir)/$(CONFDEST)"; \
conf/example.conf.base new file +12 -0
new file mode 100644
index 0000000..e4f4761
@@ -0,0 +1,12 @@
+# This is an example configuration file for the LVM2 system.
+# It contains the default settings that would be used if there was no
+# @DEFAULT_SYS_DIR@/lvm.conf file.
+#
+# Refer to 'man lvm.conf' for further information including the file layout.
+#
+# To put this file in a different directory and override @DEFAULT_SYS_DIR@ set
+# the environment variable LVM_SYSTEM_DIR before running the tools.
+#
+# N.B. Take care that each setting only appears once if uncommenting
+# example settings in this file.
+
conf/example.conf.in +0 -1384

1,384 lines not on this page · raw message

conf/lvmlocal.conf.base new file +19 -0
new file mode 100644
index 0000000..e2a9e2f
@@ -0,0 +1,19 @@
+# This is a local configuration file template for the LVM2 system
+# which should be installed as @DEFAULT_SYS_DIR@/lvmlocal.conf .
+#
+# Refer to 'man lvm.conf' for information about the file layout.
+#
+# To put this file in a different directory and override
+# @DEFAULT_SYS_DIR@ set the environment variable LVM_SYSTEM_DIR before
+# running the tools.
+#
+# The lvmlocal.conf file is normally expected to contain only the
+# "local" section which contains settings that should not be shared or
+# repeated among different hosts.  (But if other sections are present,
+# they *will* get processed.  Settings in this file override equivalent
+# ones in lvm.conf and are in turn overridden by ones in any enabled
+# lvm_<tag>.conf files.)
+#
+# Please take care that each setting only appears once if uncommenting
+# example settings in this file and never copy this file between hosts.
+
conf/lvmlocal.conf.in +0 -54

54 lines not on this page · raw message

make.tmpl.in +4 -0
index 322e33b..ed6b522 100644
@@ -282,6 +282,7 @@ POTFILES = $(SOURCES:%.c=%.pot)
 .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
 .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
 .PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper)
+.PHONY: $(SUBDIRS.generate) generate
 
 SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper)
 SUBDIRS.install := $(SUBDIRS:=.install)
@@ -342,6 +343,9 @@ $(SUBDIRS.pofile):
 	$(MAKE) -C $(@:.pofile=) pofile
 endif
 
+$(SUBDIRS.generate):
+	$(MAKE) -C $(@:.generate=) generate
+
 ifneq ("$(CFLOW_LIST_TARGET)", "")
 CLEAN_CFLOW += $(CFLOW_LIST_TARGET)
 $(CFLOW_LIST_TARGET): $(CFLOW_LIST)
man/lvm.conf.5.in +42 -496

554 lines not on this page · raw message