Bumping lvm2 from 2.02.51-r3 to 2.02.73-r1

Earlier version required a local patch to support devicekit-disks,
and therefore was placed in chromiumos-overlay.  This version doesn't
have that problem.

A separate change in chromiumos-overlay/chromeos-base/chromeos-initramfs
is required for initramfs to work.

BUG=none
TEST=made sure that devicekit-disks compiles (previously it required a patch)

Change-Id: Ice521216b2545d11a4380eb074a3eba80fc448a0
Reviewed-on: http://gerrit.chromium.org/gerrit/6679
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
This commit is contained in:
Luigi Semenzato 2011-08-25 14:58:16 -07:00
parent 35c5290631
commit 91783e1ed2
24 changed files with 2212 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
# CLVMD_CLUSTER_TIMEOUT -- amount of time to wait for cluster quorum.
CLVMD_CLUSTER_TIMEOUT=30
# CLVMD_NODES_TIMEOUT -- amount of time to wait for the other nodes to
# join the cluster.
CLVMD_NODES_TIMEOUT=60

View File

@ -0,0 +1,147 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/clvmd.rc-2.02.39,v 1.1 2009/05/19 00:08:35 robbat2 Exp $
[ -x /usr/sbin/clvmd ] && CLVMD_BIN="/usr/sbin/clvmd" || CLVMD_BIN="/sbin/clvmd"
[ -z "$CLVMD_CLUSTER_TIMEOUT" ] && CLVMD_CLUSTER_TIMEOUT=30
[ -n "$CLVMD_NODES_TIMEOUT" ] || CLVMD_NODES_TIMEOUT=60
VGCHANGE="/sbin/vgchange"
VGSCAN="/sbin/vgscan"
VGDISPLAY="/sbin/vgdisplay"
CLVMD_PIDFILE="/var/run/clvmd.pid"
depend() {
use dns logger
use net
need cman
}
load_modules() {
local module modules
modules=$1
for module in ${modules}; do
ebegin "Loading ${module} kernel module"
modprobe ${module}
eend $? "Failed to load ${module} kernel module"
done
}
unload_modules() {
local module modules
modules=$1
for module in ${modules}; do
ebegin "Unloading ${module} kernel module"
modprobe -r ${module}
eend $? "Failed to unload ${module} kernel module"
done
}
umount_gfs_filesystems() {
local sig retry
local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
if [ -n "${remaining}" ]
then
sig=
retry=3
while [ -n "${remaining}" -a "${retry}" -gt 0 ]
do
if [ "${retry}" -lt 3 ]
then
ebegin "Unmounting GFS filesystems (retry)"
umount ${remaining} &>/dev/null
eend $? "Failed to unmount GFS filesystems this retry"
else
ebegin "Unmounting GFS filesystems"
umount ${remaining} &>/dev/null
eend $? "Failed to unmount GFS filesystems"
fi
remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
[ -z "${remaining}" ] && break
/bin/fuser -k -m ${sig} ${remaining} &>/dev/null
sleep 5
retry=$((${retry} -1))
sig=-9
done
fi
}
start_volumes() {
ebegin "Scanning LVM volumes"
$VGSCAN > /dev/null 2>&1
eend $?
ret=$?
if [ "$ret" -eq 5 ]
then
einfo " Waiting for other nodes to join the cluster ($CLVMD_NODES_TIMEOUT seconds)"
fi
clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
for vg in $clustervgs; do
ebegin " Activating Clustered VG: ${vg} "
wait=0
while [ -n "$($VGCHANGE -a y ${vg} 2>&1 |grep "clvmd not running")" ]; do
if [ $wait -lt $CLVMD_NODES_TIMEOUT ]; then
sleep 3
wait=$(($wait + 3))
else
eend 1
fi
done
eend 0
done
}
stop_volumes() {
# Deactivate only clustered volumes
clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
for vg in $clustervgs; do
ebegin " Shutting Down Clustered VG: ${vg} "
$VGCHANGE -anl ${vg} >/dev/null
eend $?
done
}
start() {
local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices})
if [ -z "${module}" ]; then
load_modules "dm-mod"
sleep 1s
fi
ebegin "Starting clvmd ($CLVMD_CLUSTER_TIMEOUT seconds)"
start-stop-daemon --start --quiet --exec ${CLVMD_BIN} -- -T ${CLVMD_CLUSTER_TIMEOUT}
eend $?
start_volumes
}
stop() {
# umount GFS filesystems
umount_gfs_filesystems
#stop_volumes
ebegin "Stopping clvmd"
#start-stop-daemon --stop -s TERM --quiet --exec ${CLVMD_BIN} --name clvmd
killall -TERM ${CLVMD_BIN} >/dev/null
eend $?
#local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules)
#if [[ "$?" -eq 0 && ! -z "${module}" ]]; then
# unload_modules "dm-mod"
#fi
}

View File

@ -0,0 +1 @@
RC_AFTER="lvm"

View File

@ -0,0 +1,30 @@
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
depend() {
# necessary for services when using baselayout-2
# but conflict for baselayout-1
if [ -e /etc/init.d/root ] ; then
before checkfs fsck
after modules
fi
# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
# means dmeventd is NOT notified, as it cannot be safely running
before dmeventd
}
start() {
if [ ! -e /etc/init.d/root ] ; then
eerror "The ${SVCNAME} init script is written for baselayout-2"
eerror "Please do not use it with baselayout-1"
return 1
fi
local f=/lib/rcscripts/addons/dm-start.sh
if [ -r "$f" ]; then
( . "$f" )
fi
}

View File

@ -0,0 +1,86 @@
# /lib/rcscripts/addons/dm-start.sh: Setup DM volumes at boot
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dm-start.sh,v 1.1 2009/04/09 23:00:10 caleb Exp $
# char **get_new_dm_volumes(void)
#
# Return dmsetup commands to setup volumes
get_new_dm_volumes() {
local volume params
# Filter comments and blank lines
grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
while read volume params ; do
# If it exists, skip it
dmvolume_exists "${volume%:}" && continue
# Assemble the command to run to create volume
echo "echo ${params} | /sbin/dmsetup create ${volume%:}"
done
return 0
}
# int dmvolume_exists(volume)
#
# Return true if volume exists in DM table
dmvolume_exists() {
local x line volume=$1
[ -z "${volume}" ] && return 1
/sbin/dmsetup ls 2>/dev/null | \
while read line ; do
for x in ${line} ; do
# the following conditonal return only breaks out
# of the while loop, as it is running in a pipe.
[ "${x}" = "${volume}" ] && return 1
# We only want to check the volume name
break
done
done
# if 1 was returned from the above loop, then indicate that
# volume exists
[ $? = 1 ] && return 0
# otherwise the loop exited normally and the volume does not
# exist
return 1
}
# int is_empty_dm_volume(volume)
#
# Return true if the volume exists in DM table, but is empty/non-valid
is_empty_dm_volume() {
local table volume=$1
set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
[ "${volume}" = "$1" -a -z "$2" ]
}
local x volume
if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
[ -n "$(get_new_dm_volumes)" ] && \
einfo " Setting up device-mapper volumes:"
get_new_dm_volumes | \
while read x ; do
[ -n "${x}" ] || continue
volume="${x##* }"
ebegin " Creating volume: ${volume}"
if ! eval "${x}" >/dev/null 2>/dev/null ; then
eend 1 " Error creating volume: ${volume}"
# dmsetup still adds an empty volume in some cases,
# so lets remove it
is_empty_dm_volume "${volume}" && \
/sbin/dmsetup remove "${volume}" 2>/dev/null
else
eend 0
fi
done
fi
# vim:ts=4

View File

@ -0,0 +1,23 @@
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
depend() {
# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
# means dmeventd is NOT notified, as it cannot be safely running
after lvm device-mapper
}
start() {
ebegin "Starting dmeventd"
start-stop-daemon --start --exec /sbin/dmeventd --pidfile /var/run/dmeventd.pid
eend $?
}
stop() {
ebegin "Stopping dmeventd"
start-stop-daemon --stop --exec /sbin/dmeventd --pidfile /var/run/dmeventd.pid
eend $?
}

View File

@ -0,0 +1,12 @@
#/etc/dmraid: config file for adding device-mapper volumes at boot
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmtab,v 1.1 2009/04/09 23:00:10 caleb Exp $
# Format: <volume name>: <table>
# Example: isw0: 0 312602976 striped 2 128 /dev/sda 0 /dev/sdb 0
#
# Alternatively you can create all your volumes the first time, and just run:
#
# dmsetup table >> /etc/dmtab
#
# and verify that they are correct.

View File

@ -0,0 +1,46 @@
#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2,v 1.3 2010/08/20 19:18:29 robbat2 Exp $
# This script is based on upstream file
# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
depend() {
# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
# means dmeventd is NOT notified, as it cannot be safely running
need lvm dmeventd
}
VGCHANGE=/sbin/vgchange
VGS=/sbin/vgs
start() {
ret=0
# TODO do we want to separate out already active groups only?
VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
for vg in $VGSLIST
do
ebegin "Starting LVM monitoring for VG $vg:"
$VGCHANGE --monitor y --poll y $vg
ret2=$?
eend $ret2
[ $ret2 -ne 0 ] && ret=$ret2
done
return $ret
}
stop() {
ret=0
# TODO do we want to separate out already active groups only?
VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
for vg in $VGSLIST
do
ebegin "Stopping LVM monitoring for VG $vg:"
$VGCHANGE --monitor n $vg
ret2=$?
eend $ret2
[ $ret2 -ne 0 ] && ret=$ret2
done
return $ret
}

View File

@ -0,0 +1,48 @@
diff -Nuar LVM2.2.02.67.orig//doc/example.conf.in LVM2.2.02.67//doc/example.conf.in
--- LVM2.2.02.67.orig//doc/example.conf.in 2010-05-20 13:47:21.000000000 +0000
+++ LVM2.2.02.67//doc/example.conf.in 2010-06-07 18:43:34.099693472 +0000
@@ -50,7 +50,9 @@
# By default we accept every block device:
- filter = [ "a/.*/" ]
+ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
+ # noise when you probed while not available.
+ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
# Exclude the cdrom drive
# filter = [ "r|/dev/cdrom|" ]
@@ -259,6 +261,8 @@
# the new lvm2 on-disk metadata format.
# The default value is set when the tools are built.
# fallback_to_lvm1 = 0
+ # Gentoo: the LVM tools are a seperate package.
+ fallback_to_lvm1 = 0
# The default metadata format that commands should use - "lvm1" or "lvm2".
# The command line override is -M1 or -M2.
@@ -449,12 +453,12 @@
# Metadata settings
#
-# metadata {
+metadata {
# Default number of copies of metadata to hold on each PV. 0, 1 or 2.
# You might want to override it from the command line with 0
# when running pvcreate on new PVs which are to be added to large VGs.
-
- # pvmetadatacopies = 1
+ # Gentoo: enable for data safety, but PV resize is then disabled.
+ #pvmetadatacopies = 2
# Approximate default size of on-disk metadata areas in sectors.
# You should increase this if you have large volume groups or
@@ -476,7 +480,7 @@
# the supplied toolset to make changes (e.g. vgcfgrestore).
# dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
-#}
+}
# Event daemon
#

View File

@ -0,0 +1,5 @@
# LVM should normally only be started after mdraid is available
# this is because LVM physical volumes are very often MD devices.
RC_AFTER="mdraid"
# vim: ft=gentoo-conf-d

View File

@ -0,0 +1,39 @@
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
depend() {
if [ -f /etc/init.d/sysfs ]; then
# on baselayout-1 this causes
# dependency-cycles with checkroot (before *)
before checkfs fsck
after modules device-mapper
fi
# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
# means dmeventd is NOT notified, as it cannot be safely running
before dmeventd
}
run_addon() {
local f=/lib/rcscripts/addons/$1.sh
if [ -r "$f" ]; then
( . "$f" )
fi
}
start() {
if [ ! -f /etc/init.d/sysfs ]; then
eerror "The $SVCNAME init-script is written for baselayout-2!"
eerror "Please do not use it with baselayout-1!".
return 1
fi
run_addon lvm-start
}
stop() {
run_addon lvm-stop
}
# vim:ts=4

View File

@ -0,0 +1,72 @@
--- LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd.orig 2006-11-21 22:41:56.000000000 +0000
+++ LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd 2009-12-26 01:47:08.025224602 +0000
@@ -54,7 +54,9 @@
DEVRAM=/tmp/initrd.$$
# set defaults
-BINFILES=${BINFILES:-"`which lvm` `which bash` `which busybox` `which pivot_root`"}
+LVM=`which lvm.static`
+LVM=${LVM:-"`which lvm`"}
+BINFILES=${BINFILES:-"${LVM} `which bash` `which busybox` `which pivot_root`"}
BASICDEVICES=${BASICDEVICES:-"std consoleonly fd"}
BLOCKDEVICES=${BLOCKDEVICES:-"md hda hdb hdc hdd sda sdb sdc sdd"}
MAKEDEV=${MAKEDEV:-"debian"}
@@ -119,6 +121,10 @@
echo "$PRE Mounting /proc"
mount -t proc none /proc
+# We need /sys for lvm
+echo "$PRE Mounting /sys"
+mount -t sysfs sysfs /sys
+
# plug in modules listed in /etc/modules
if [ -f /etc/modules ]; then
echo -n "$PRE plugging in kernel modules:"
@@ -179,26 +185,29 @@
# run a shell if we're passed lvm2rescue on commandline
grep lvm2rescue /proc/cmdline 1>/dev/null 2>&1
if [ $? -eq 0 ]; then
- lvm vgchange --ignorelockingfailure -P -a y
+ $LVM vgchange --ignorelockingfailure -P -a y
do_shell
else
- lvm vgchange --ignorelockingfailure -a y
+ $LVM vgchange --ignorelockingfailure -a y
fi
echo "$PRE Mounting root filesystem $rootvol ro"
mkdir /rootvol
if ! mount -t auto -o ro $rootvol /rootvol; then
- echo "\t*FAILED*";
+ echo "\t*FAILED TRYING TO MOUNT ROOTVOL*";
do_shell
fi
echo "$PRE Umounting /proc"
umount /proc
+echo "$PRE Umounting /sys"
+umount /sys
+
echo "$PRE Changing roots"
cd /rootvol
if ! pivot_root . initrd ; then
- echo "\t*FAILED*"
+ echo "\t*FAILED PIVOT TO NEW ROOT*"
do_shell
fi
@@ -356,7 +365,7 @@
fi
verbose "creating basic set of directories in $TMPMNT"
-(cd $TMPMNT; mkdir bin dev etc lib proc sbin var)
+(cd $TMPMNT; mkdir bin dev etc lib proc sbin sys var)
if [ $? -ne 0 ]; then
echo "$cmd -- ERROR creating directories in $TMPMNT"
cleanup 1
@@ -499,4 +508,3 @@
FINALTXT
cleanup 0
-

View File

@ -0,0 +1,42 @@
diff -Nuar --exclude '*~' LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in LVM2.2.02.63/daemons/dmeventd/Makefile.in
--- LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in 2010-04-09 14:42:48.000000000 -0700
+++ LVM2.2.02.63/daemons/dmeventd/Makefile.in 2010-04-19 11:53:27.000000000 -0700
@@ -28,11 +28,12 @@
INSTALL_LIB_TARGETS = install_lib_dynamic
LIB_NAME = libdevmapper-event
+LIB_STATIC = $(LIB_NAME).a
+INSTALL_LIB_TARGETS += install_lib_static
+TARGETS += $(LIB_STATIC)
ifeq ("@STATIC_LINK@", "yes")
- LIB_STATIC = $(LIB_NAME).a
- TARGETS += $(LIB_STATIC) dmeventd.static
+ TARGETS += dmeventd.static
INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
- INSTALL_LIB_TARGETS += install_lib_static
endif
LIB_VERSION = $(LIB_VERSION_DM)
diff -Nuar --exclude '*~' LVM2.2.02.63.orig/libdm/Makefile.in LVM2.2.02.63/libdm/Makefile.in
--- LVM2.2.02.63.orig/libdm/Makefile.in 2010-04-09 14:42:51.000000000 -0700
+++ LVM2.2.02.63/libdm/Makefile.in 2010-04-19 11:52:20.000000000 -0700
@@ -34,8 +34,8 @@
INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
-ifeq ("@STATIC_LINK@", "yes")
LIB_STATIC = $(interface)/libdevmapper.a
+ifeq ("@STATIC_LINK@", "yes")
endif
LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
@@ -63,8 +63,8 @@
INSTALL_TYPE = install_dynamic
-ifeq ("@STATIC_LINK@", "yes")
INSTALL_TYPE += install_static
+ifeq ("@STATIC_LINK@", "yes")
endif
ifeq ("@PKGCONFIG@", "yes")

View File

@ -0,0 +1,15 @@
X-Gentoo-Bug: 318513
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=318513
diff -ur LVM2.2.02.64/daemons/dmeventd/plugins/lvm2/Makefile.in LVM2.2.02.64.new/daemons/dmeventd/plugins/lvm2/Makefile.in
--- LVM2.2.02.64/daemons/dmeventd/plugins/lvm2/Makefile.in 2010-04-09 23:42:49.000000000 +0200
+++ LVM2.2.02.64.new/daemons/dmeventd/plugins/lvm2/Makefile.in 2010-05-04 13:18:07.886389742 +0200
@@ -24,7 +24,7 @@
include $(top_builddir)/make.tmpl
-LIBS += @LVM2CMD_LIB@ -ldevmapper $(PTHREAD_LIBS)
+LIBS += @LVM2CMD_LIB@ -ldevmapper -ldevmapper-event $(PTHREAD_LIBS)
install_lvm2: install_lib_shared

View File

@ -0,0 +1,18 @@
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=301331
X-Gentoo-Bug: 301331
diff -Nuar LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd
--- LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:44:34.182980475 +0000
+++ LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:51:27.636312899 +0000
@@ -469,9 +469,9 @@
rmdir $TMPMNT/lost+found
echo "$cmd -- ummounting ram disk"
-umount $DEVRAM
+umount $TMPMNT
if [ $? -ne 0 ]; then
- echo "$cmd -- ERROR umounting $DEVRAM"
+ echo "$cmd -- ERROR umounting $TMPMNT"
cleanup 1
fi

View File

@ -0,0 +1,15 @@
http://bugs.gentoo.org/330255
liblvm2app.so: undefined reference to `floor'
--- liblvm/Makefile.in
+++ liblvm/Makefile.in
@@ -39,7 +39,7 @@
include $(top_builddir)/make.tmpl
-LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
+LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -lm
ifeq ("@DMEVENTD@", "yes")
LIBS += -ldevmapper-event

View File

@ -0,0 +1,67 @@
X-Gentoo-Bug: 332905
X-Patch-URL: https://bugs.gentoo.org/attachment.cgi?id=243283&action=view
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=332905
diff -ur LVM2.2.02.72.orig/configure.in LVM2.2.02.72/configure.in
--- LVM2.2.02.72.orig/configure.in 2010-07-28 16:55:42.000000000 +0300
+++ LVM2.2.02.72/configure.in 2010-08-17 03:00:24.000000000 +0300
@@ -35,6 +35,7 @@
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ STATIC_LDFLAGS="-Wl,--no-export-dynamic"
LIB_SUFFIX=so
DEVMAPPER=yes
ODIRECT=yes
@@ -1282,6 +1283,7 @@
AC_SUBST(SELINUX_PC)
AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
+AC_SUBST(STATIC_LDFLAGS)
AC_SUBST(STATIC_LINK)
AC_SUBST(TESTING)
AC_SUBST(UDEV_LIBS)
diff -ur LVM2.2.02.72.orig/daemons/dmeventd/Makefile.in LVM2.2.02.72/daemons/dmeventd/Makefile.in
--- LVM2.2.02.72.orig/daemons/dmeventd/Makefile.in 2010-05-14 16:36:56.000000000 +0300
+++ LVM2.2.02.72/daemons/dmeventd/Makefile.in 2010-08-17 03:00:24.000000000 +0300
@@ -61,7 +61,7 @@
$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
- $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
ifeq ("@PKGCONFIG@", "yes")
diff -ur LVM2.2.02.72.orig/make.tmpl.in LVM2.2.02.72/make.tmpl.in
--- LVM2.2.02.72.orig/make.tmpl.in 2010-07-20 17:38:44.000000000 +0300
+++ LVM2.2.02.72/make.tmpl.in 2010-08-17 03:00:24.000000000 +0300
@@ -38,6 +38,7 @@
CLDFLAGS += @CLDFLAGS@
LDDEPS += @LDDEPS@
LDFLAGS += @LDFLAGS@
+STATIC_LDFLAGS += @STATIC_LDFLAGS@
LIB_SUFFIX = @LIB_SUFFIX@
LVMINTERNAL_LIBS = -llvm-internal $(DL_LIBS)
DL_LIBS = @DL_LIBS@
diff -ur LVM2.2.02.72.orig/tools/Makefile.in LVM2.2.02.72/tools/Makefile.in
--- LVM2.2.02.72.orig/tools/Makefile.in 2010-06-25 21:23:10.000000000 +0300
+++ LVM2.2.02.72/tools/Makefile.in 2010-08-17 03:01:07.000000000 +0300
@@ -126,7 +126,7 @@
-o $@ dmsetup.o -ldevmapper $(LIBS)
dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
+ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
-o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS)
all: device-mapper
@@ -136,7 +136,7 @@
$(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic
lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a
- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
$(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

View File

@ -0,0 +1,15 @@
Index: LVM2.2.02.73/tools/Makefile.in
===================================================================
--- LVM2.2.02.73.orig/tools/Makefile.in
+++ LVM2.2.02.73/tools/Makefile.in
@@ -149,8 +149,8 @@ liblvm2cmd-static.a: $(top_builddir)/lib
liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
$(CC) -shared -Wl,-soname,$@.$(LIB_VERSION) \
- $(CFLAGS) $(CLDFLAGS) -o $@ $(LVMLIBS) $(LIBS) \
- @CLDWHOLEARCHIVE@ liblvm2cmd.a @CLDNOWHOLEARCHIVE@
+ $(CFLAGS) $(CLDFLAGS) -o $@ \
+ @CLDWHOLEARCHIVE@ liblvm2cmd.a @CLDNOWHOLEARCHIVE@ $(LVMLIBS) $(LIBS)
liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX)
$(LN_S) -f $< $@

View File

@ -0,0 +1,12 @@
diff -Nuar LVM2.2.02.73.orig//make.tmpl.in LVM2.2.02.73//make.tmpl.in
--- LVM2.2.02.73.orig//make.tmpl.in 2010-08-16 17:49:26.000000000 +0000
+++ LVM2.2.02.73//make.tmpl.in 2010-08-20 19:20:43.237413988 +0000
@@ -362,7 +362,7 @@
( cat $(srcdir)/.exported_symbols; \
if test x$(EXPORTED_HEADER) != x; then \
$(CC) -E -P $(INCLUDES) $(DEFS) $(CFLAGS) $(EXPORTED_HEADER) | \
- $(SED) -ne "/^typedef|}/!s/.*[ \*]\(\$(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
+ LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ \*]\(\$(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
fi \
) > $@

View File

@ -0,0 +1,42 @@
# /lib/rcscripts/addons/lvm-start.sh
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
config='global { locking_dir = "/dev/.lvm" }'
dm_in_proc() {
local retval=0
for x in devices misc ; do
grep -qs 'device-mapper' /proc/${x}
retval=$((${retval} + $?))
done
return ${retval}
}
# LVM support for /usr, /home, /opt ....
# This should be done *before* checking local
# volumes, or they never get checked.
# NOTE: Add needed modules for LVM or RAID, etc
# to /etc/modules.autoload if needed
if [ -z "${CDBOOT}" -a -x /sbin/vgscan ] ; then
if [ -e /proc/modules ] && ! dm_in_proc ; then
modprobe dm-mod 2>/dev/null
fi
if [ -d /proc/lvm ] || dm_in_proc ; then
ebegin "Setting up the Logical Volume Manager"
#still echo stderr for debugging
# Extra PV find pass because some devices might not have been available until very recently
/sbin/pvscan --config "${config}" >/dev/null
# Now make the nodes
/sbin/vgscan --mknodes --config "${config}" >/dev/null
if [ -x /sbin/vgchange ] && \
[ -f /etc/lvmtab -o -d /etc/lvm ]
then
/sbin/vgchange --sysinit --config "${config}" -a ly >/dev/null
fi
eend $? "Failed to setup the LVM"
fi
fi
# vim:ts=4

View File

@ -0,0 +1,31 @@
# /lib/rcscripts/addons/lvm-stop.sh
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-stop.sh-2.02.67-r1,v 1.1 2010/06/09 22:41:45 robbat2 Exp $
config='global { locking_dir = "/dev/.lvm" }'
# Stop LVM2
if [ -x /sbin/vgs ] && \
[ -x /sbin/vgchange ] && \
[ -x /sbin/lvchange ] && \
[ -f /etc/lvmtab -o -d /etc/lvm ] && \
[ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
then
einfo "Shutting down the Logical Volume Manager"
VGS=$(/sbin/vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
if [ "$VGS" ]
then
ebegin " Shutting Down logical volumes "
/sbin/lvchange --config "${config}" --sysinit -a ln ${VGS}
eend $?
ebegin " Shutting Down volume groups "
/sbin/vgchange --config "${config}" --sysinit -a ln
eend $?
fi
einfo "Finished Shutting down the Logical Volume Manager"
fi
# vim:ts=4

View File

@ -0,0 +1,270 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.73-r1.ebuild,v 1.7 2010/11/25 15:32:02 ranger Exp $
EAPI=2
inherit eutils multilib toolchain-funcs autotools linux-info
DESCRIPTION="User-land utilities for LVM2 (device-mapper) software."
HOMEPAGE="http://sources.redhat.com/lvm2/"
SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ppc64 s390 sh sparc x86"
IUSE="readline +static clvm cman +lvm1 selinux"
DEPEND_COMMON="!!sys-fs/device-mapper
clvm? ( =sys-cluster/dlm-2*
cman? ( =sys-cluster/cman-2* ) )
>=sys-fs/udev-151-r4"
RDEPEND="${DEPEND_COMMON}
!<sys-apps/openrc-0.4
!!sys-fs/lvm-user
!!sys-fs/clvm
>=sys-apps/util-linux-2.16"
# Upgrading to this LVM will break older cryptsetup
RDEPEND="${RDEPEND}
!<sys-fs/cryptsetup-1.1.2"
DEPEND="${DEPEND_COMMON}
dev-util/pkgconfig
>=sys-devel/binutils-2.20.1-r1"
S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
pkg_setup() {
local CONFIG_CHECK="~SYSVIPC"
local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
check_extra_config
# 1. Genkernel no longer copies /sbin/lvm blindly.
# 2. There are no longer any linking deps in /usr.
if use static; then
elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
elog "their static versions. If you need the static binaries,"
elog "you must append .static the filename!"
fi
}
src_unpack() {
unpack ${A}
}
src_prepare() {
epatch "${FILESDIR}"/lvm.conf-2.02.67.patch
# Should not be needed due to upstream re-arrangement of build
#epatch "${FILESDIR}"/${PN}-2.02.56-dmeventd.patch
# Should not be need with new upstream udev rules
#epatch "${FILESDIR}"/${PN}-2.02.56-device-mapper-export-format.patch
# Merged upstream:
#epatch "${FILESDIR}"/${PN}-2.02.51-as-needed.patch
# Merged upstream:
#epatch "${FILESDIR}"/${PN}-2.02.48-fix-pkgconfig.patch
# Merged upstream:
#epatch "${FILESDIR}"/${PN}-2.02.51-fix-pvcreate.patch
# Fixed differently upstream:
#epatch "${FILESDIR}"/${PN}-2.02.51-dmsetup-selinux-linking-fix-r3.patch
epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
epatch "${FILESDIR}"/lvm2-2.02.56-lvm2create_initrd.patch
# bug 318513
epatch "${FILESDIR}"/${PN}-2.02.64-dmeventd-libs.patch
# bug 301331
epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch
# bug 330373
epatch "${FILESDIR}"/${PN}-2.02.73-locale-muck.patch
# --as-needed
epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch
# bug 332905
epatch "${FILESDIR}"/${PN}-2.02.72-dynamic-static-ldflags.patch
epatch "${FILESDIR}"/${PN}-2.02.73-asneeded.patch
eautoreconf
}
src_configure() {
local myconf
local buildmode
myconf="${myconf} --enable-dmeventd"
myconf="${myconf} --enable-cmdlib"
myconf="${myconf} --enable-applib"
myconf="${myconf} --enable-fsadm"
# Most of this package does weird stuff.
# The build options are tristate, and --without is NOT supported
# options: 'none', 'internal', 'shared'
if use static ; then
einfo "Building static LVM, for usage inside genkernel"
buildmode="internal"
# This only causes the .static versions to become available
# For recent systems, there are no linkages against anything in /usr anyway.
# We explicitly provide the .static versions so that they can be included in
# initramfs environments.
myconf="${myconf} --enable-static_link"
else
ewarn "Building shared LVM, it will not work inside genkernel!"
buildmode="shared"
fi
# dmeventd requires mirrors to be internal, and snapshot available
# so we cannot disable them
myconf="${myconf} --with-mirrors=internal"
myconf="${myconf} --with-snapshots=internal"
if use lvm1 ; then
myconf="${myconf} --with-lvm1=${buildmode}"
else
myconf="${myconf} --with-lvm1=none"
fi
# disable O_DIRECT support on hppa, breaks pv detection (#99532)
use hppa && myconf="${myconf} --disable-o_direct"
if use clvm; then
myconf="${myconf} --with-cluster=${buildmode}"
# 4-state! Make sure we get it right, per bug 210879
# Valid options are: none, cman, gulm, all
#
# 2009/02:
# gulm is removed now, now dual-state:
# cman, none
# all still exists, but is not needed
#
# 2009/07:
# TODO: add corosync and re-enable ALL
local clvmd=""
use cman && clvmd="cman"
#clvmd="${clvmd/cmangulm/all}"
[ -z "${clvmd}" ] && clvmd="none"
myconf="${myconf} --with-clvmd=${clvmd}"
myconf="${myconf} --with-pool=${buildmode}"
else
myconf="${myconf} --with-clvmd=none --with-cluster=none"
fi
myconf="${myconf}
--sbindir=/sbin
--with-staticdir=/sbin
--with-dmeventd-path=/sbin/dmeventd"
econf $(use_enable readline) \
$(use_enable selinux) \
--enable-pkgconfig \
--libdir=/$(get_libdir) \
--with-usrlibdir=/usr/$(get_libdir) \
--enable-udev_rules \
--enable-udev_sync \
--with-udevdir=/$(get_libdir)/udev/rules.d/ \
${myconf} \
CLDFLAGS="${LDFLAGS}" || die
}
src_compile() {
einfo "Doing symlinks"
pushd include
emake || die "Failed to prepare symlinks"
popd
einfo "Starting main build"
emake || die "compile fail"
}
src_install() {
emake DESTDIR="${D}" install || die "Failed to emake install"
# All of this was change by upstream, and if we don't get any problems, we
# can probably drop it in .65
#X## Revamp all of our library handling for bug #316571
#X## Upstream build script puts a lot of this stuff into /usr/lib regardless of
#X## libdir variable.
#X#dodir /$(get_libdir)
#X## .so -> /$(get_libdir)
#X#mv -f "${D}"/usr/lib/lib*.so* "${D}"/$(get_libdir)
#X#[[ "$(get_libdir)" != "lib" ]] && \
#X# mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)
#X## .a -> /usr/$(get_libdir)
#X#[[ "$(get_libdir)" != "lib" ]] && \
#X# mv -f "${D}"/usr/lib/lib*.a "${D}"/usr/$(get_libdir)
#X## The upstream symlinks are borked. lets rebuild them instead.
#X#find "${D}"/{usr,}/{lib,$(get_libdir)} -type l \
#X# | xargs rm -f 2>/dev/null
#X#for i in "${D}"/$(get_libdir)/*.so.* ; do
#X# b="${i//*\/}" o="${b/.so.*/.so}"
#X# ln -s "${b}" "${D}/$(get_libdir)/${o}"
#X#done
#X## Now enable building properly
#X#for i in \
#X# libdevmapper-event{,-lvm2{,mirror,snapshot}} \
#X# libdevmapper \
#X# liblvm2{format1,snapshot,cmd,app} \
#X# ; do
#X# gen_usr_ldscript ${i}.so || die
#X#done
dodoc README VERSION WHATS_NEW doc/*.{conf,c,txt}
insinto /$(get_libdir)/rcscripts/addons
newins "${FILESDIR}"/lvm2-start.sh-2.02.67-r1 lvm-start.sh || die
newins "${FILESDIR}"/lvm2-stop.sh-2.02.67-r1 lvm-stop.sh || die
newinitd "${FILESDIR}"/lvm.rc-2.02.67-r1 lvm || die
newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring || die
newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die
if use clvm; then
newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd || die
newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd || die
fi
# move shared libs to /lib(64)
dolib.a libdm/ioctl/libdevmapper.a || die "dolib.a libdevmapper.a"
#gen_usr_ldscript libdevmapper.so
dosbin "${S}"/scripts/lvm2create_initrd/lvm2create_initrd
doman "${S}"/scripts/lvm2create_initrd/lvm2create_initrd.8
newdoc "${S}"/scripts/lvm2create_initrd/README README.lvm2create_initrd
insinto /etc
doins "${FILESDIR}"/dmtab
insinto /$(get_libdir)/rcscripts/addons
doins "${FILESDIR}"/dm-start.sh
# Device mapper stuff
newinitd "${FILESDIR}"/device-mapper.rc-2.02.67-r1 device-mapper || die
newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper || die
newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd || die
dolib.a daemons/dmeventd/libdevmapper-event.a \
|| die "dolib.a libdevmapper-event.a"
#gen_usr_ldscript libdevmapper-event.so
#insinto /etc/udev/rules.d/
#newins "${FILESDIR}"/64-device-mapper.rules-2.02.56-r3 64-device-mapper.rules || die
# do not rely on /lib -> /libXX link
sed -e "s-/lib/rcscripts/-/$(get_libdir)/rcscripts/-" -i "${D}"/etc/init.d/*
elog "USE flag nocman is deprecated and replaced"
elog "with the cman USE flag."
elog ""
elog "USE flags clvm and cman are masked"
elog "by default and need to be unmasked to use them"
elog ""
elog "If you are using genkernel and root-on-LVM, rebuild the initramfs."
}
pkg_postinst() {
elog "lvm volumes are no longer automatically created for"
elog "baselayout-2 users. If you are using baselayout-2, be sure to"
elog "run: # rc-update add lvm boot"
elog "Do NOT add it if you are using baselayout-1 still."
}
src_test() {
einfo "Testcases disabled because of device-node mucking"
einfo "If you want them, compile the package and see ${S}/tests"
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
<maintainer>
<email>cardoe@gentoo.org</email>
<name>Doug Goldstein</name>
</maintainer>
<maintainer>
<email>agk@redhat.com</email>
<name>Alasdair Kergon</name>
<description>Upstream Maintainer (please CC on bugs)</description>
</maintainer>
<use>
<flag name='clvm'>Allow users to build clustered lvm2</flag>
<flag name='cman'>Cman support for clustered lvm</flag>
<flag name='lvm1'>Allow users to build lvm2 with lvm1 support</flag>
<flag name='nolvmstatic'>Allow users to build lvm2 dynamically</flag>
</use>
</pkgmetadata>