diff options
author | Marek Wodzinski <majek@mamy.to> | 2017-09-18 01:45:44 +0100 |
---|---|---|
committer | David Spencer <idlemoor@slackbuilds.org> | 2017-09-18 01:45:44 +0100 |
commit | 8d62eb686e535693f7f325b0daaf6d85012ab86f (patch) | |
tree | 53bff31e8b90f0d15a3fe75e6ae3c3712f92318c /system/thin-provisioning-tools | |
parent | b7bb8d0fe3b605b68c558f1bb186d1dbe19161e8 (diff) |
system/thin-provisioning-tools: Added (manage LVM2 targets).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/thin-provisioning-tools')
-rw-r--r-- | system/thin-provisioning-tools/README | 12 | ||||
-rw-r--r-- | system/thin-provisioning-tools/mkinitrd-1.4.10.patch | 27 | ||||
-rw-r--r-- | system/thin-provisioning-tools/mkinitrd-1.4.8.patch | 27 | ||||
-rw-r--r-- | system/thin-provisioning-tools/slack-desc | 19 | ||||
-rw-r--r-- | system/thin-provisioning-tools/thin-provisioning-tools.SlackBuild | 110 | ||||
-rw-r--r-- | system/thin-provisioning-tools/thin-provisioning-tools.info | 10 |
6 files changed, 205 insertions, 0 deletions
diff --git a/system/thin-provisioning-tools/README b/system/thin-provisioning-tools/README new file mode 100644 index 000000000000..37d6d0e822f8 --- /dev/null +++ b/system/thin-provisioning-tools/README @@ -0,0 +1,12 @@ +A suite of tools for manipulating the metadata of the dm-thin, dm-era +and dm-cache device-mapper targets. + +Required by LVM2 to start and manage LVM volumes with above features. + +Package contains also patch for Slackware's mkinitrd. +It's required if you want to boot from cached root partition. +To apply the patch run: + + cd /sbin ; patch -p0 < /usr/doc/thin-provisioning-tools-*/mkinitrd-1.4.X.patch + +where X is the version of the currently installed mkinitrd. diff --git a/system/thin-provisioning-tools/mkinitrd-1.4.10.patch b/system/thin-provisioning-tools/mkinitrd-1.4.10.patch new file mode 100644 index 000000000000..b48b9bb4e6f9 --- /dev/null +++ b/system/thin-provisioning-tools/mkinitrd-1.4.10.patch @@ -0,0 +1,27 @@ +--- mkinitrd.dist 2017-06-29 19:11:26.000000000 +0200 ++++ mkinitrd 2017-09-14 17:06:37.162295307 +0200 +@@ -48,6 +48,9 @@ + # to add support for TRIM on LUKS root devs + # Modified by Patrick Volkerding <volkerdi@slackware.com> 29 June 2017 + # Add support for prepending a microcode update archive (-P). ++# Modified by Marek Wodzinski <majek@mamy.to> 14 September 2017 ++# Added copying of thin-provisioning-tools if available and LVM ++# support enabled. It's required to start root volume with dm-cache. + + MKINITRD_VERSION=1.4.10 + +@@ -562,6 +565,14 @@ + ( cd $SOURCE_TREE/sbin + ln -s lvm vgchange 2>/dev/null + ln -s lvm vgscan 2>/dev/null ) ++ # Include thin-provisioning-tools (dm-cache and dm-thin support) ++ if [ -f /usr/sbin/pdata_tools ]; then ++ PDATA_BASEDIR=/usr/sbin #it should be in /sbin, but default Slackware lvm2 is compiled with path to /usr/sbin :-( ++ mkdir -p $SOURCE_TREE/$PDATA_BASEDIR ++ cp $PDATA_BASEDIR/pdata_tools $SOURCE_TREE/$PDATA_BASEDIR/pdata_tools ++ ( cd $SOURCE_TREE/$PDATA_BASEDIR ++ find $PDATA_BASEDIR -lname pdata_tools | xargs -n1 basename | xargs -n1 ln -s pdata_tools 2>/dev/null ) ++ fi + else + echo "LVM binary is missing, LVM support isn't installed" + LVM="" diff --git a/system/thin-provisioning-tools/mkinitrd-1.4.8.patch b/system/thin-provisioning-tools/mkinitrd-1.4.8.patch new file mode 100644 index 000000000000..cc905a50cbda --- /dev/null +++ b/system/thin-provisioning-tools/mkinitrd-1.4.8.patch @@ -0,0 +1,27 @@ +--- mkinitrd.dist 2016-06-13 03:51:29.000000000 +0200 ++++ mkinitrd 2016-09-23 12:46:52.645297632 +0200 +@@ -44,6 +44,9 @@ + # Yada yada yada. + # Modified by Patrick Volkerding <volkerdi@slackware.com> 21 August 2012 + # Add Btrfs multi-device filesystem support option (-B). ++# Modified by Marek Wodzinski <majek@mamy.to> 12 March 2015 ++# Added copying of thin-provisioning-tools if available and LVM ++# support enabled. It's required to start root volume with dm-cache. + + MKINITRD_VERSION=1.4.8 + +@@ -537,6 +540,14 @@ + mkdir -p $SOURCE_TREE/lib/udev/rules.d + echo 'KERNEL=="dm-[0-9]*", OPTIONS+="db_persist"' > \ + $SOURCE_TREE/lib/udev/rules.d/95-dm-initrd.rules ++ # Include thin-provisioning-tools (dm-cache and dm-thin support) ++ if [ -f /usr/sbin/pdata_tools ]; then ++ PDATA_BASEDIR=/usr/sbin #it should be in /sbin, but default Slackware lvm2 is compiled with path to /usr/sbin :-( ++ mkdir -p $SOURCE_TREE/$PDATA_BASEDIR ++ cp $PDATA_BASEDIR/pdata_tools $SOURCE_TREE/$PDATA_BASEDIR/pdata_tools ++ ( cd $SOURCE_TREE/$PDATA_BASEDIR ++ find $PDATA_BASEDIR -lname pdata_tools | xargs -n1 basename | xargs -n1 ln -s pdata_tools 2>/dev/null ) ++ fi + else + echo "LVM binary is missing, LVM support isn't installed" + fi diff --git a/system/thin-provisioning-tools/slack-desc b/system/thin-provisioning-tools/slack-desc new file mode 100644 index 000000000000..3d3fb1f4fad1 --- /dev/null +++ b/system/thin-provisioning-tools/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +thin-provisioning-tools: thin-provisioning-tools (manage cache, thin and era LVM2 targets) +thin-provisioning-tools: +thin-provisioning-tools: A suite of tools for manipulating the metadata of the dm-thin, +thin-provisioning-tools: dm-era and dm-cache device-mapper targets. +thin-provisioning-tools: Required by LVM2 to start and manage LVM volumes with above features. +thin-provisioning-tools: Project URL: https://github.com/jthornber/thin-provisioning-tools +thin-provisioning-tools: +thin-provisioning-tools: In docs directory there are also patches for mkinitrd to include +thin-provisioning-tools: thin-provisioning-tools in initrd. +thin-provisioning-tools: +thin-provisioning-tools: diff --git a/system/thin-provisioning-tools/thin-provisioning-tools.SlackBuild b/system/thin-provisioning-tools/thin-provisioning-tools.SlackBuild new file mode 100644 index 000000000000..741d03459d37 --- /dev/null +++ b/system/thin-provisioning-tools/thin-provisioning-tools.SlackBuild @@ -0,0 +1,110 @@ +#!/bin/sh + +# Slackware build script for thin-provisioning-tools + +# Copyright 2016-2017 Marek Wodzinski +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PRGNAM=thin-provisioning-tools +VERSION=${VERSION:-0.7.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$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 \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +autoreconf +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +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 + +# Fix man page location (--mandir ignored) +mv $PKG/usr/share/man $PKG/usr/ +rm -rf $PKG/usr/share + +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.md CHANGES COPYING \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/mkinitrd-1.4.8.patch > $PKG/usr/doc/$PRGNAM-$VERSION/mkinitrd-1.4.8.patch +cat $CWD/mkinitrd-1.4.10.patch > $PKG/usr/doc/$PRGNAM-$VERSION/mkinitrd-1.4.10.patch +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/thin-provisioning-tools/thin-provisioning-tools.info b/system/thin-provisioning-tools/thin-provisioning-tools.info new file mode 100644 index 000000000000..2ff9ba7133c3 --- /dev/null +++ b/system/thin-provisioning-tools/thin-provisioning-tools.info @@ -0,0 +1,10 @@ +PRGNAM="thin-provisioning-tools" +VERSION="0.7.1" +HOMEPAGE="https://github.com/jthornber/thin-provisioning-tools" +DOWNLOAD="https://github.com/jthornber/thin-provisioning-tools/archive/v0.7.1/thin-provisioning-tools-0.7.1.tar.gz" +MD5SUM="44cc03dd39a55b2f0364b330850d63fd" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Marek Wodzinski" +EMAIL="majek@mamy.to" |