1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-12-27 00:23:49 +03:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Alasdair Kergon
a8778bbc5a Fix status overflow check in kernel patches. 2004-04-07 12:39:59 +00:00
Alasdair Kergon
a54e641f44 fix static selinux build 2004-04-06 20:32:02 +00:00
Alasdair Kergon
5c99efe87a 1.00.13 2004-04-06 18:57:13 +00:00
Alasdair Kergon
7da1d731ff add some selinux support 2004-04-06 18:54:00 +00:00
Alasdair Kergon
af9828e819 Fix sysfs filter to check fs type. 2004-04-06 16:47:59 +00:00
Alasdair Kergon
7a27136142 Update to 2.00.10 2004-04-06 15:17:53 +00:00
Alasdair Kergon
012ad2d423 More build fixes 2004-04-06 15:14:23 +00:00
Alasdair Kergon
ef3bdbf4da Fix dmsetup.static install. 2004-04-06 12:06:55 +00:00
Alasdair Kergon
b3bb698f7b Version 1.00.11 2004-04-05 20:51:42 +00:00
Alasdair Kergon
1ed5d1e4c1 Combine static/dynamic build. 2004-04-05 20:48:14 +00:00
Alasdair Kergon
bdee01a03d Fix shared format1 build. 2004-04-05 16:29:37 +00:00
Alasdair Kergon
458f7376d7 accept argv[0] lvm.static 2004-04-05 16:24:17 +00:00
Alasdair Kergon
cb3a00e027 Move library targets definition into template. 2004-04-05 16:20:50 +00:00
14 changed files with 143 additions and 39 deletions

View File

@@ -1 +1 @@
2.00.09-cvs (2004-03-31)
2.00.10-cvs (2004-04-06)

View File

@@ -1,3 +1,7 @@
Version 2.00.10 - 6 Apr 2004
============================
More fixes for static build.
Version 2.00.09 - 31 Mar 2004
=============================
Update copyright notices for Red Hat.

View File

@@ -1,3 +1,24 @@
Version 1.00.15 - 7 Apr 2004
============================
Fix status overflow check in kernel patches.
Version 1.00.14 - 6 Apr 2004
============================
Fix static selinux build.
Version 1.00.13 - 6 Apr 2004
============================
Add some basic selinux support.
Version 1.00.12 - 6 Apr 2004
============================
Fix dmsetup.static install.
Version 1.00.11 - 5 Apr 2004
============================
configure --enable-static_link does static build in addition to dynamic.
Moved Makefile library targets definition into template.
Version 1.00.10 - 2 Apr 2004
============================
Fix DESTDIR handling.

19
configure vendored
View File

@@ -309,7 +309,7 @@ ac_includes_default="\
#endif"
ac_default_prefix=/usr
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MSGFMT JOBS STATIC_LINK LVM1 OWNER GROUP CLDFLAGS CLDWHOLEARCHIVE CLDNOWHOLEARCHIVE LD_DEPS SOFLAG LVM_VERSION DEBUG DEVMAPPER HAVE_LIBDL CMDLIB LOCALEDIR INTL_PACKAGE INTL LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MSGFMT JOBS STATIC_LINK LVM1 OWNER GROUP CLDFLAGS CLDWHOLEARCHIVE CLDNOWHOLEARCHIVE LD_DEPS LD_FLAGS SOFLAG LVM_VERSION DEBUG DEVMAPPER HAVE_LIBDL CMDLIB LOCALEDIR INTL_PACKAGE INTL LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -3885,6 +3885,7 @@ case "$host_os" in
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LD_DEPS=".export.sym"
LD_FLAGS="-Wl,--export-dynamic"
SOFLAG="-shared"
DEVMAPPER=yes
ODIRECT=yes ;;
@@ -3894,6 +3895,7 @@ case "$host_os" in
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LD_DEPS=
LD_FLAGS=
SOFLAG="-dynamiclib"
DEVMAPPER=no
ODIRECT=no ;;
@@ -4582,11 +4584,22 @@ else
fi
if test x$HAVE_LIBDL = xyes; then
if [ "x$HAVE_LIBDL" = xyes -a "xSTATIC_LINK" = xno ]; then
CFLAGS="$CFLAGS -DHAVE_LIBDL"
LIBS="-ldl $LIBS"
else
HAVE_LIBDL=no
fi
if [ "x$LVM1" = xshared -a "x$STATIC_LINK" = xyes ];
then { { echo "$as_me:$LINENO: error: Features cannot be \"shared\" when building statically
" >&5
echo "$as_me: error: Features cannot be \"shared\" when building statically
" >&2;}
{ (exit 1); exit 1; }; }
exit
fi;
for ac_header in getopt.h
do
@@ -4989,6 +5002,7 @@ fi
ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile lib/Makefile lib/format1/Makefile man/Makefile po/Makefile tools/Makefile tools/version.h test/mm/Makefile test/device/Makefile test/format1/Makefile test/regex/Makefile test/filters/Makefile"
@@ -5678,6 +5692,7 @@ s,@CLDFLAGS@,$CLDFLAGS,;t t
s,@CLDWHOLEARCHIVE@,$CLDWHOLEARCHIVE,;t t
s,@CLDNOWHOLEARCHIVE@,$CLDNOWHOLEARCHIVE,;t t
s,@LD_DEPS@,$LD_DEPS,;t t
s,@LD_FLAGS@,$LD_FLAGS,;t t
s,@SOFLAG@,$SOFLAG,;t t
s,@LVM_VERSION@,$LVM_VERSION,;t t
s,@DEBUG@,$DEBUG,;t t

View File

@@ -55,6 +55,7 @@ case "$host_os" in
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LD_DEPS=".export.sym"
LD_FLAGS="-Wl,--export-dynamic"
SOFLAG="-shared"
DEVMAPPER=yes
ODIRECT=yes ;;
@@ -64,6 +65,7 @@ case "$host_os" in
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LD_DEPS=
LD_FLAGS=
SOFLAG="-dynamiclib"
DEVMAPPER=no
ODIRECT=no ;;
@@ -183,11 +185,21 @@ fi
dnl Check for dlopen
AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
if test x$HAVE_LIBDL = xyes; then
if [[ "x$HAVE_LIBDL" = xyes -a "xSTATIC_LINK" = xno ]]; then
CFLAGS="$CFLAGS -DHAVE_LIBDL"
LIBS="-ldl $LIBS"
else
HAVE_LIBDL=no
fi
dnl Check for shared/static conflicts
if [[ "x$LVM1" = xshared -a "x$STATIC_LINK" = xyes ]];
then AC_MSG_ERROR(
Features cannot be \"shared\" when building statically
)
exit
fi;
dnl Check for getopt
AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
@@ -246,6 +258,7 @@ AC_SUBST(CLDFLAGS)
AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CLDNOWHOLEARCHIVE)
AC_SUBST(LD_DEPS)
AC_SUBST(LD_FLAGS)
AC_SUBST(SOFLAG)
AC_SUBST(LIBS)
AC_SUBST(LVM_VERSION)

View File

@@ -97,7 +97,7 @@ endif
LIB_STATIC = liblvm.a
TARGETS = $(LIB_STATIC)
$(SUBDIRS): $(LIB_STATIC)
include ../make.tmpl

View File

@@ -26,7 +26,7 @@ static int _locate_sysfs_blocks(const char *proc, char *path, size_t len)
char proc_mounts[PATH_MAX];
int r = 0;
FILE *fp;
char *split[2], buffer[PATH_MAX + 16];
char *split[4], buffer[PATH_MAX + 16];
if (!*proc) {
log_verbose("No proc filesystem found: skipping sysfs filter");
@@ -45,8 +45,8 @@ static int _locate_sysfs_blocks(const char *proc, char *path, size_t len)
}
while (fgets(buffer, sizeof(buffer), fp)) {
if (split_words(buffer, 2, split) == 2 &&
!strcmp(split[0], "sysfs")) {
if (split_words(buffer, 4, split) == 4 &&
!strcmp(split[2], "sysfs")) {
if (lvm_snprintf(path, len, "%s/%s", split[1],
"block") >= 0) {
r = 1;

View File

@@ -25,7 +25,7 @@ SOURCES =\
lvm1-label.c \
vg_number.c
TARGETS = liblvm2format1.so
LIB_SHARED = liblvm2format1.so
include ../../make.tmpl

View File

@@ -24,17 +24,15 @@ INCLUDES = -I$(interface)
LIB_STATIC = $(interface)/libdevmapper.a
LIB_SHARED = $(interface)/libdevmapper.so
TARGETS = $(LIB_STATIC) $(LIB_SHARED)
include ../make.tmpl
.PHONY: install_dynamic install_static \
install_@interface@ install_@interface@_static
install_fs install_ioctl install_ioctl_static
INSTALL_TYPE = install_dynamic
ifeq ("@STATIC_LINK@", "yes")
INSTALL_TYPE = install_static
else
INSTALL_TYPE = install_dynamic
INSTALL_TYPE += install_static
endif
install: $(INSTALL_TYPE)

View File

@@ -29,6 +29,10 @@
#include <linux/dm-ioctl.h>
#include <linux/kdev_t.h>
#ifdef HAVE_SELINUX
# include <selinux/selinux.h>
#endif
#define DEV_DIR "/dev/"
static char _dm_dir[PATH_MAX] = DEV_DIR DM_DIR;
@@ -197,6 +201,31 @@ int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size,
return 1;
}
#ifdef HAVE_SELINUX
static int _set_selinux_context(const char *path)
{
security_context_t scontext;
log_debug("Setting SELinux context for %s", path);
if (is_selinux_enabled() <= 0)
return 0;
if (matchpathcon(path, 0, &scontext) < 0) {
log_error("%s: matchpathcon failed: %s", path, strerror(errno));
return 0;
}
if (lsetfilecon(path, scontext) < 0) {
log_error("%s: lsetfilecon failed: %s", path, strerror(errno));
free(scontext);
return 0;
}
free(scontext);
return 1;
}
#endif
static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor)
{
char path[PATH_MAX];
@@ -226,6 +255,10 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor)
log_error("Unable to make device node for '%s'", dev_name);
return 0;
}
#ifdef HAVE_SELINUX
if (!_set_selinux_context(path))
return 0;
#endif
return 1;
}

View File

@@ -29,6 +29,7 @@ CLDFLAGS += @CLDFLAGS@
CLDWHOLEARCHIVE += @CLDWHOLEARCHIVE@
CLDNOWHOLEARCHIVE += @CLDNOWHOLEARCHIVE@
LD_DEPS += @LD_DEPS@
LD_FLAGS += @LD_FLAGS@
SOFLAG += @SOFLAG@
# Setup directory variables
@@ -71,10 +72,6 @@ endif
LD_FLAGS += -L$(top_srcdir)/lib -L$(libdir)
ifeq ("@STATIC_LINK@", "yes")
LD_FLAGS += -static
endif
#CFLAGS += -DDEBUG_POOL
#CFLAGS += -DBOUNDS_CHECK
@@ -109,6 +106,8 @@ SUBDIRS.distclean := $(SUBDIRS:=.distclean)
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
.PHONY: $(SUBDIRS.pofile)
TARGETS += $(LIB_SHARED) $(LIB_STATIC)
all: $(SUBDIRS) $(TARGETS)
install: all $(SUBDIRS.install)
@@ -137,16 +136,14 @@ $(TARGETS): $(OBJECTS)
%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
%.pot: %.c
%.pot: %.c Makefile
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
$(CFLAGS) $< > $@
%.pot: Makefile
%.so: %.o
$(CC) -c $(INCLUDES) $(CFLAGS) %< -o $@
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
%.so: $(OBJECTS) $(LD_DEPS)
$(LIB_SHARED): $(OBJECTS) $(LD_DEPS)
$(CC) $(SOFLAG) -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
$(CLDFLAGS) $(OBJECTS) -o $@

View File

@@ -16,7 +16,7 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
SOURCES=\
SOURCES =\
archiver.c \
dumpconfig.c \
lvchange.c \
@@ -57,20 +57,26 @@ SOURCES=\
vgscan.c \
vgsplit.c
TARGETS=\
TARGETS =\
.commands \
lvm
LVMLIBS=-llvm
INSTALL_TARGETS = install_tools_dynamic
INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic
INSTALL_TARGETS=\
install_lvm_tools
ifeq ("@STATIC_LINK@", "yes")
TARGETS += lvm.static
INSTALL_TARGETS += install_tools_static
INSTALL_CMDLIB_TARGETS += install_cmdlib_static
endif
CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a
LVMLIBS = -llvm
CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a lvm lvm.static
ifeq ("@CMDLIB@", "yes")
TARGETS += liblvm2cmd.so
INSTALL_TARGETS += install_cmdlib
INSTALL_TARGETS += $(INSTALL_CMDLIB_TARGETS)
endif
ifeq ("@DEVMAPPER@", "yes")
@@ -80,7 +86,11 @@ endif
include ../make.tmpl
lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
$(CC) -o lvm $(OBJECTS) lvm.o $(LD_FLAGS) $(LVMLIBS) $(LIBS)
$(CC) -o $@ $(OBJECTS) lvm.o $(LD_FLAGS) $(LVMLIBS) $(LIBS) -rdynamic
lvm.static: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
$(CC) -o $@ $(OBJECTS) lvm.o -static $(LD_FLAGS) $(LVMLIBS) $(LIBS) \
-rdynamic
liblvm2cmd.a: $(top_srcdir)/lib/liblvm.a $(OBJECTS)
cat $(top_srcdir)/lib/liblvm.a > $@
@@ -94,16 +104,24 @@ liblvm2cmd.so: liblvm2cmd.a $(LD_DEPS)
$(CC) -E -P cmdnames.h 2> /dev/null | \
egrep -v '^ *(|#.*|dumpconfig|help|pvdata|version) *$$' > .commands
.PHONY: install_lvm_tools install_cmdlib
.PHONY: install_cmdlib_dynamic install_cmdlib_static \
install_tools_dynamic install_tools_static
install_cmdlib: $(TARGETS)
install_cmdlib_dynamic: liblvm2cmd.so
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) liblvm2cmd.so \
$(libdir)/liblvm2cmd.so.$(LIB_VERSION)
$(LN_S) -f liblvm2cmd.so.$(LIB_VERSION) $(libdir)/liblvm2cmd.so
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 444 lvm2cmd.h \
$(includedir)/lvm2cmd.h
install_lvm_tools: $(TARGETS)
install_cmdlib_static: liblvm2cmd.a
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) liblvm2cmd.a \
$(libdir)/liblvm2cmd.a.$(LIB_VERSION)
$(LN_S) -f liblvm2cmd.a.$(LIB_VERSION) $(libdir)/liblvm2cmd.a
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 444 lvm2cmd.h \
$(includedir)/lvm2cmd.h
install_tools_dynamic: lvm .commands
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) lvm \
$(sbindir)/lvm
@echo Creating symbolic links for individual commands in $(sbindir)
@@ -114,5 +132,9 @@ install_lvm_tools: $(TARGETS)
done; \
)
install_tools_static: lvm.static
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) lvm.static \
$(sbindir)/lvm.static
install: $(INSTALL_TARGETS)

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
@@ -1299,7 +1299,7 @@ int lvm2_main(int argc, char **argv)
base = basename(namebase);
while (*base == '/')
base++;
if (strcmp(base, "lvm"))
if (strcmp(base, "lvm") && strcmp(base, "lvm.static"))
alias = 1;
free(namebase);