From 9b6be78b0c13a61c14d5278f1363eaf9c6388e4c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Oct 2012 00:42:10 -0700 Subject: Mon Oct 1 00:42:09 PDT 2012 --- testing/hdparm/PKGBUILD | 42 ++++++++++++++ testing/hdparm/wiper.sh.2_6.max-ranges.patch | 84 ++++++++++++++++++++++++++++ testing/libusbx/PKGBUILD | 8 +-- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 testing/hdparm/PKGBUILD create mode 100644 testing/hdparm/wiper.sh.2_6.max-ranges.patch (limited to 'testing') diff --git a/testing/hdparm/PKGBUILD b/testing/hdparm/PKGBUILD new file mode 100644 index 000000000..062bd6008 --- /dev/null +++ b/testing/hdparm/PKGBUILD @@ -0,0 +1,42 @@ +# $Id: PKGBUILD 167301 2012-09-30 19:26:10Z tpowa $ +# Maintainer: Paul Mattal + +pkgname=hdparm +pkgver=9.42 +pkgrel=1 +pkgdesc="A shell utility for manipulating Linux IDE drive/driver parameters" +arch=(i686 x86_64) +depends=('glibc') +optdepends=('sh: required by idectl and ultrabayd') +source=(http://downloads.sourceforge.net/sourceforge/hdparm/${pkgname}-${pkgver}.tar.gz + wiper.sh.2_6.max-ranges.patch) +license=('BSD') +url="http://sourceforge.net/projects/hdparm/" +optdepends=('bash: for wiper.sh script') +options=('emptydirs') +md5sums=('0af5a38b212fe08f5afbe5e37f34b40b' + '74e368f384166a7710b447573cda120a') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + # Fix Range input/output error when wiping Intel G2 and OCZ drives + patch -Np1 -i $srcdir/wiper.sh.2_6.max-ranges.patch + + # build + make +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + # install + mkdir -p ${pkgdir}/{usr,sbin} + make DESTDIR=${pkgdir} install + install -m755 contrib/idectl ${pkgdir}/sbin + install -m755 contrib/ultrabayd ${pkgdir}/sbin + + install -D -m 0644 $srcdir/$pkgname-$pkgver/wiper/README.txt $pkgdir/usr/share/doc/wiper/README.txt + install -D -m 0755 $srcdir/$pkgname-$pkgver/wiper/wiper.sh $pkgdir/usr/sbin/wiper.sh + + #install license file + install -D -m 644 LICENSE.TXT $pkgdir/usr/share/licenses/hdparm/LICENSE.TXT +} diff --git a/testing/hdparm/wiper.sh.2_6.max-ranges.patch b/testing/hdparm/wiper.sh.2_6.max-ranges.patch new file mode 100644 index 000000000..c55f7b149 --- /dev/null +++ b/testing/hdparm/wiper.sh.2_6.max-ranges.patch @@ -0,0 +1,84 @@ +--- hdparm-9.28/wiper/wiper.sh.orig 2010-03-09 06:17:37.000000000 -0800 +--- hdparm-9.28/wiper/wiper.sh 2010-05-15 03:08:02.182856971 -0700 +@@ -29,7 +29,7 @@ + function usage_error(){ + echo >&2 + echo "Linux tune-up (TRIM) utility for SATA SSDs" +- echo "Usage: $0 [--verbose] [--commit] " >&2 ++ echo "Usage: $0 [--max-ranges ] [--verbose] [--commit] " >&2 + echo " Eg: $0 /dev/sda1" >&2 + echo >&2 + exit 1 +@@ -44,6 +44,7 @@ + + export verbose=0 + commit="" ++max_ranges=-1 + destroy_me="" + argc=$# + arg="" +@@ -51,6 +52,10 @@ + commit=yes + elif [ "$1" = "--verbose" ]; then + verbose=$((verbose + 1)) ++ elif [ "$1" = "--max-ranges" -a $argc -gt 1 ]; then ++ max_ranges=$2 ++ argc=$((argc - 1)) ++ shift + elif [ "$1" = "" ]; then + usage_error + else +@@ -499,6 +550,18 @@ + fi + fi + ++## Different SSD's have a different maximum number of ranges they'll accept ++## in a single TRIM command. ++if [ $max_ranges -le 0 ] ; then ++ model=`$HDPARM -I $rawdev | $GAWK '/Model Number/ { print $NF }'` ++ case "$model" in ++ SSDSA[12]*) max_ranges=512 ;; # Intel X18-M/X25-M ++ OCZ-VERTEX2) max_ranges=64 ;; # OCZ Vertex2 ++ *) max_ranges=65535 ++ esac ++fi ++[ $verbose -gt 0 ] && echo "max-ranges = $max_ranges" ++ + ## All ready. Now let the user know exactly what we intend to do: + ## + mountstatus="$fstype non-mounted" +@@ -608,7 +671,7 @@ + nsectors += count; + while (count > 0) { + this_count = (count > 65535) ? 65535 : count +- printf "%u:%u ", lba, this_count ++ printf "%u:%u \n", lba, this_count + if (verbose > 1) + printf "%u:%u ", lba, this_count > "/dev/stderr" + lba += this_count +@@ -695,6 +758,22 @@ + -v verbose="$verbose" \ + -v xfs_blksects="$xfs_blksects" \ + -v xfs_agoffsets="$xfs_agoffsets" \ +- "$GAWKPROG" | $TRIM ++ "$GAWKPROG" | ( ++ i=0 ++ while read range ; do ++ ranges=$ranges" "$range ++ ((i++)) ++ if [ $i -ge $max_ranges ] ; then ++ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n" ++ echo $ranges | $TRIM ++ ranges="" ++ i=0 ++ fi ++ done ++ if [ $i -gt 0 ] ; then ++ [ $verbose -gt 0 ] && echo -e "Trim ranges:"$ranges"\n" ++ echo $ranges | $TRIM ++ fi ++ ) + + do_cleanup $? + + diff --git a/testing/libusbx/PKGBUILD b/testing/libusbx/PKGBUILD index 3ebee8465..dd36b151c 100644 --- a/testing/libusbx/PKGBUILD +++ b/testing/libusbx/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 162718 2012-06-28 20:58:52Z tpowa $ +# $Id: PKGBUILD 167303 2012-09-30 19:31:57Z tpowa $ # Maintainer: Tobias Powalowski pkgname=libusbx -pkgver=1.0.12 -pkgrel=2 +pkgver=1.0.14 +pkgrel=1 depends=('glibc') pkgdesc="Library that provides generic access to USB device" arch=(i686 x86_64) @@ -13,7 +13,7 @@ options=(!libtool) replaces=('libusb1' 'libusb') provides=("libusb=$pkgver") conflicts=("libusb") -md5sums=('c41352ac755c7992edfcbb2ea4ad1349') +md5sums=('0a6a75edb4b4eae7dc82c1dd71ddc470') build() { cd "${srcdir}/${pkgname}-${pkgver}" -- cgit v1.2.3-54-g00ecf