system/lvm2-lockd: Fix 15.0 build.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2022-02-24 12:31:34 -05:00 committed by Willy Sudiarto Raharjo
parent d52079f9ea
commit 439c720542
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
3 changed files with 34 additions and 32 deletions

View File

@ -1,21 +1,22 @@
Logical Volume Management (LVM) commands use lvmlockd to coordinate access
to shared storage.
Logical Volume Management (LVM) commands use lvmlockd to coordinate
access to shared storage.
NOTE: lvm2 package that comes with Slackware includes lvmlockd
support. However, since neither sanlock or dlm were present at build time,
empty functions were compiled in. In order for lvm commands (such as lvmcreate,
etc) to discover and leverage lvmlockd support, stock lvm binary has to
be replaced:
support. However, since neither sanlock or dlm were present at build
time, empty functions were compiled in. In order for lvm commands
(such as lvmcreate, etc) to discover and leverage lvmlockd support,
stock lvm binary has to be replaced:
CLOBBER_STOCK_BINARY=yes ./lvm2-lockd.SlackBuild
The original binary can be restored by reinstalling the stock lvm2 package.
The original binary can be restored by reinstalling the stock lvm2
package.
By default, lock type is set to sanlock, dlm can be selected with:
LOCK_TYPE=dlm ./lvm2-lockd.SlackBuild
This will change package dependancy from sanlock to dlm (also found here
on SlackBuilds.org).
This will change package dependency from sanlock to dlm (also found
here on SlackBuilds.org).
More information post-install can be found in README.SLACKWARE

View File

@ -1,14 +1,11 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {

View File

@ -22,6 +22,10 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20220222 bkw: Modified by SlackBuilds.org: fix build on 15.0.
# This should probably be updated to match the version of lvm2 in
# Slackware 15.0, but I leave that up to the maintainer to decide.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lvm2-lockd
@ -40,9 +44,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -77,16 +78,20 @@ cd $SRCNAM.$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
sed -i '1i#include <sys/sysmacros.h>' lib/filters/filter-sysfs.c
# Copied from lvm2.SlackBuild
# 20220224 bkw: and modified a bit, dmeventd wouldn't compile and we
# don't need it in this build, so disable it.
CFLAGS="$SLKCFLAGS" \
./configure \
--disable-readline \
--enable-cmdlib \
--enable-dmeventd \
--disable-dmeventd \
--enable-applib \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--with-usrlibdir=/usr/lib${LIBDIRSUFFIX} \
@ -105,7 +110,6 @@ CFLAGS="$SLKCFLAGS" \
--with-default-dm-run-dir=/run/lvm \
--with-clvmd-pidfile=/run/lvm/clvmd.pid \
--with-cmirrord-pidfile=/run/lvm/cmirrord.pid \
--with-dmeventd-pidfile=/run/lvm/dmeventd.pid \
--enable-use-lvmlockd \
--enable-lockd-${LOCK_TYPE:-sanlock} \
--build=$ARCH-slackware-linux
@ -113,12 +117,18 @@ CFLAGS="$SLKCFLAGS" \
make daemons man tools
# Some assembly required
install -D -m0755 -oroot -groot daemons/lvmlockd/lvmlockd $PKG/usr/sbin/lvmlockd
install -D -m0755 -oroot -groot daemons/lvmlockd/lvmlockctl $PKG/usr/sbin/lvmlockctl
install -D -m0755 -oroot -groot daemons/lvmetad/lvmetad $PKG/usr/sbin/lvmetad
install -D -m0644 -oroot -groot man/lvmlockd.8 $PKG/usr/man/man8/lvmlockd.8
install -D -m0644 -oroot -groot man/lvmlockctl.8 $PKG/usr/man/man8/lvmlockctl.8
install -D -m0644 -oroot -groot man/lvmetad.8 $PKG/usr/man/man8/lvmetad.8
mkdir -p $PKG/usr/{sbin,man/man8}
install -s -m0755 -oroot -groot \
daemons/lvmlockd/lvmlock{d,ctl} \
daemons/lvmetad/lvmetad \
$PKG/usr/sbin/
install -m0644 -oroot -groot \
man/lvmlock{d,ctl}.8 \
man/lvmetad.8 \
$PKG/usr/man/man8/
gzip -9 $PKG/usr/man/man*/*
install -D -m0755 -oroot -groot scripts/lvm2_lvmetad_init_red_hat $PKG/etc/rc.d/rc.lvmetad.new
@ -129,15 +139,9 @@ sed -e "s|metadata|locking|g" \
-i $PKG/etc/rc.d/rc.lvmlockd.new
if [ "${CLOBBER_STOCK_BINARY:-no}" = "yes" ]; then
install -D -m0755 -oroot -groot tools/lvm $PKG/sbin/lvm
install -s -D -m0755 -oroot -groot tools/lvm $PKG/sbin/lvm
fi
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild