mirror of
git://sourceware.org/git/lvm2.git
synced 2025-12-24 16:23:50 +03:00
Compare commits
8 Commits
old-dm_v1_
...
old-dm_v1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8778bbc5a | ||
|
|
a54e641f44 | ||
|
|
5c99efe87a | ||
|
|
7da1d731ff | ||
|
|
af9828e819 | ||
|
|
7a27136142 | ||
|
|
012ad2d423 | ||
|
|
ef3bdbf4da |
@@ -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.
|
||||
|
||||
18
WHATS_NEW_DM
18
WHATS_NEW_DM
@@ -1,5 +1,21 @@
|
||||
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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -27,7 +27,7 @@ LIB_SHARED = $(interface)/libdevmapper.so
|
||||
include ../make.tmpl
|
||||
|
||||
.PHONY: install_dynamic install_static \
|
||||
install_@interface@ install_@interface@_static
|
||||
install_fs install_ioctl install_ioctl_static
|
||||
|
||||
INSTALL_TYPE = install_dynamic
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
12
make.tmpl.in
12
make.tmpl.in
@@ -72,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
|
||||
|
||||
@@ -140,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 $@
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user