From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QGIRx-0001y4-Rd for garchives@archives.gentoo.org; Sat, 30 Apr 2011 22:15:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2BEDD1C010; Sat, 30 Apr 2011 22:15:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D7AC11C010 for ; Sat, 30 Apr 2011 22:15:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1A5511B4023 for ; Sat, 30 Apr 2011 22:15:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 30D4D80505 for ; Sat, 30 Apr 2011 22:15:30 +0000 (UTC) From: "Alexey Shvetsov" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexey Shvetsov" Message-ID: <766c554bcb19b062936d30a6404c082d50c6fa81.alexxy@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sys-devel/spl/, sys-fs/zfs/files/ X-VCS-Repository: proj/sci X-VCS-Files: sys-devel/spl/spl-0.6.0_rc3.ebuild sys-fs/zfs/files/zfs.initd X-VCS-Directories: sys-devel/spl/ sys-fs/zfs/files/ X-VCS-Committer: alexxy X-VCS-Committer-Name: Alexey Shvetsov X-VCS-Revision: 766c554bcb19b062936d30a6404c082d50c6fa81 Date: Sat, 30 Apr 2011 22:15:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 867388cfd1513cb3e92e07107e3ac458 commit: 766c554bcb19b062936d30a6404c082d50c6fa81 Author: Alexey Shvetsov gentoo org> AuthorDate: Sat Apr 30 22:14:43 2011 +0000 Commit: Alexey Shvetsov gentoo org> CommitDate: Sat Apr 30 22:14:43 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3D766c554b updates to zfs --- sys-devel/spl/spl-0.6.0_rc3.ebuild | 2 + sys-fs/zfs/files/zfs.initd | 134 ++++++++++++++++++++++++++++++= ++++++ 2 files changed, 136 insertions(+), 0 deletions(-) diff --git a/sys-devel/spl/spl-0.6.0_rc3.ebuild b/sys-devel/spl/spl-0.6.0= _rc3.ebuild index a59d99e..e680822 100644 --- a/sys-devel/spl/spl-0.6.0_rc3.ebuild +++ b/sys-devel/spl/spl-0.6.0_rc3.ebuild @@ -41,4 +41,6 @@ src_configure() { =20 src_install() { emake DESTDIR=3D"${D}" install || die 'emake install failed' + dosym /usr/include/spl/spl_config.h /usr/include/spl/module/spl_config.= h \ + || die } diff --git a/sys-fs/zfs/files/zfs.initd b/sys-fs/zfs/files/zfs.initd new file mode 100644 index 0000000..d8ec4ea --- /dev/null +++ b/sys-fs/zfs/files/zfs.initd @@ -0,0 +1,134 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/files/zfs,v 0.9 2011/04/30= 10:13:43 devsk Exp $ + +depend() { + before net + after udev +} + +CACHEFILE=3D/etc/zfs/zpool.cache +ZPOOL=3D/sbin/zpool +ZFS=3D/sbin/zfs +ZFS_MODULE=3Dzfs +LOCKFILE=3D/var/lock/zfs/zfs_lockfile + +checksystem() +{ + /sbin/modinfo $ZFS_MODULE &>/dev/null + if [[ $? -ne 0 ]] + then + eerror "$ZFS_MODULE not found. Is the ZFS package installed?" + return 1 + fi + if [[ ! -x $ZPOOL ]] + then + eerror "$ZPOOL binary not found." + return 1 + fi + if [[ ! -x $ZFS ]] + then + eerror "$ZFS binary not found." + return 1 + fi + return 0 +} + +start() +{ + if [[ -f $LOCKFILE ]] + then + einfo "ZFS already running, please stop it first. Delete $LOCKFILE if = its not so." + eend 3 + return 3 + fi + ebegin "Starting ZFS" + checksystem || return 1 + if ! grep -q $ZFS_MODULE /proc/modules + then + /sbin/modprobe $ZFS_MODULE &>/dev/null + rv=3D$? + if [[ $rv -ne 0 ]] + then + eerror "Failed to load the $ZFS_MODULE module, check 'dmesg|tail'." + eend $rv + return $rv + fi + fi + + # Import all pools described by the cache file, and then mount + # all filesystem based on their properties. + if [[ -f $CACHEFILE ]] + then + einfo "Importing ZFS pools" + + # as per fedora script, import can fail if all pools are already impor= ted + # The check for $rv makes no sense...but someday, it will work right. + $ZPOOL import -c $CACHEFILE -aN 2>/dev/null || true + rv=3D$? + if [[ $rv -ne 0 ]] + then + eerror "Failed to import not-yet imported pools." + eend $rv + return $rv + fi + fi + + einfo "Mounting ZFS filesystems" + $ZFS mount -a + rv=3D$? + if [[ $rv -ne 0 ]] + then + eerror "Failed to mount ZFS filesystems." + eend $rv + return $rv + fi + + # hack to read mounted file systems because otherwise + # zfs returns EPERM when a non-root user reads a mounted filesystem bef= ore root did + savepwd=3D"$PWD" + mount | grep " type zfs " | sed 's/.*on //' | sed 's/ type zfs.*$//' | = \ + while read line + do + cd "$line" &> /dev/null + ls &> /dev/null + done + cd "$savepwd" + + touch $LOCKFILE + eend 0 + return 0 +} + +stop() +{ + if [[ ! -f $LOCKFILE ]] + then + einfo "ZFS is not started, remove $LOCKFILE if its not so." + eend 3 + return 3 + fi + ebegin "Unmounting ZFS filesystems" + sync + $ZFS umount -a + if [[ $rv -ne 0 ]] + then + eerror "Failed to umount ZFS filesystems." + fi + rm -f $LOCKFILE + eend $rv +} + +status() +{ + if [[ ! -f $LOCKFILE ]] + then + einfo "ZFS is not started, remove $LOCKFILE if its not so." + eend 3 + return 3 + fi + + # show pool status and list + $ZPOOL status && echo && $ZPOOL list +}