diff options
-rw-r--r-- | net-fs/shfs/ChangeLog | 9 | ||||
-rw-r--r-- | net-fs/shfs/files/0.35/shfs-0.35-inode-and-fs.patch | 367 | ||||
-rw-r--r-- | net-fs/shfs/files/digest-shfs-0.35-r4 | 3 | ||||
-rw-r--r-- | net-fs/shfs/shfs-0.35-r4.ebuild | 118 |
4 files changed, 496 insertions, 1 deletions
diff --git a/net-fs/shfs/ChangeLog b/net-fs/shfs/ChangeLog index 4343c0b31412..f67054871f77 100644 --- a/net-fs/shfs/ChangeLog +++ b/net-fs/shfs/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/shfs # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/ChangeLog,v 1.39 2007/01/04 05:19:43 compnerd Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/ChangeLog,v 1.40 2007/01/04 05:28:14 compnerd Exp $ + +*shfs-0.35-r4 (04 Jan 2007) + + 04 Jan 2007; Saleem Abdulrasool <compnerd@gentoo.org> + +files/0.35/shfs-0.35-inode-and-fs.patch, +shfs-0.35-r4.ebuild: + Revbump to unstable, add a new patch to allow compiling with kernels <2.6.19 + (bug #157111). 04 Jan 2007; Saleem Abdulrasool <compnerd@gentoo.org> -shfs-0.35-r1.ebuild, -shfs-0.35-r2.ebuild: diff --git a/net-fs/shfs/files/0.35/shfs-0.35-inode-and-fs.patch b/net-fs/shfs/files/0.35/shfs-0.35-inode-and-fs.patch new file mode 100644 index 000000000000..7bdee206befd --- /dev/null +++ b/net-fs/shfs/files/0.35/shfs-0.35-inode-and-fs.patch @@ -0,0 +1,367 @@ +--- shfs/Linux-2.6/fcache.c 2007-01-03 22:29:26.000000000 -0600 ++++ shfs/Linux-2.6/fcache.c 2007-01-03 22:34:21.000000000 -0600 +@@ -100,7 +100,11 @@ + VERBOSE("dir in file cache?\n"); + return -EINVAL; + } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)inode->i_private; ++#else + p = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +@@ -127,7 +131,11 @@ + VERBOSE("dir in file cache?\n"); + return -EINVAL; + } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)inode->i_private; ++#else + p = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +@@ -160,7 +168,11 @@ + if (result == 0) { + struct shfs_inode_info *p; + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)f->f_dentry->d_inode->i_private; ++#else + p = (struct shfs_inode_info *)f->f_dentry->d_inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +@@ -184,7 +196,11 @@ + return -EINVAL; + } + DEBUG("ino: %lu\n", inode->i_ino); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)inode->i_private; ++#else + p = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +@@ -226,7 +242,11 @@ + VERBOSE("dir in file cache?\n"); + return -EINVAL; + } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)inode->i_private; ++#else + p = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +@@ -327,7 +347,11 @@ + VERBOSE("dir in file cache?\n"); + return -EINVAL; + } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ p = (struct shfs_inode_info *)inode->i_private; ++#else + p = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!p) { + VERBOSE("inode without info\n"); + return -EINVAL; +--- shfs/Linux-2.6/inode.c 2004-06-01 08:16:19.000000000 -0500 ++++ shfs/Linux-2.6/inode.c 2007-01-03 22:39:44.000000000 -0600 +@@ -35,7 +36,11 @@ + shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr) + { + struct shfs_sb_info *info = info_from_inode(inode); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ struct shfs_inode_info *i = inode->i_private; ++#else + struct shfs_inode_info *i = inode->u.generic_ip; ++#endif + struct timespec last_time = inode->i_mtime; + loff_t last_size = inode->i_size; + +@@ -52,7 +57,9 @@ + inode->i_ctime = fattr->f_ctime; + inode->i_atime = fattr->f_atime; + inode->i_mtime = fattr->f_mtime; ++#ifdef STRUCT_INODE_HAS_I_BLKSIZE + inode->i_blksize= fattr->f_blksize; ++#endif + inode->i_blocks = fattr->f_blocks; + inode->i_size = fattr->f_size; + +@@ -75,7 +82,11 @@ + if (!inode) + return NULL; + inode->i_ino = fattr->f_ino; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ i = inode->i_private = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL); ++#else + i = inode->u.generic_ip = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL); ++#endif + if (!i) + return NULL; + i->cache = NULL; +@@ -107,7 +118,11 @@ + struct shfs_inode_info *i; + + DEBUG("ino: %lu\n", inode->i_ino); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ i = (struct shfs_inode_info *)inode->i_private; ++#else + i = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + if (!i) { + VERBOSE("invalid inode\n"); + goto out; +@@ -172,7 +190,11 @@ + { + struct shfs_sb_info *info = info_from_dentry(dentry); + struct inode *inode = dentry->d_inode; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private; ++#else + struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + int result; + + DEBUG("%s\n", dentry->d_name.name); +--- shfs/Linux-2.6/dir.c 2007-01-03 22:38:23.000000000 -0600 ++++ shfs/Linux-2.6/dir.c 2007-01-03 22:39:06.000000000 -0600 +@@ -302,8 +302,13 @@ + + shfs_invalid_dir_cache(dir); + result = shfs_instantiate(dentry); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ if (forced_write && dentry->d_inode && dentry->d_inode->i_private) ++ ((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close = 1; ++#else + if (forced_write && dentry->d_inode && dentry->d_inode->u.generic_ip) + ((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close = 1; ++#endif + return result; + } + +--- shfs/Linux-2.6/file.c 2007-01-03 22:40:24.000000000 -0600 ++++ shfs/Linux-2.6/file.c 2007-01-03 22:45:11.000000000 -0600 +@@ -90,7 +90,11 @@ + struct dentry *dentry = f->f_dentry; + struct shfs_sb_info *info = info_from_dentry(dentry); + struct inode *inode = p->mapping->host; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private; ++#else + struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip; ++#endif + char *buffer = kmap(p) + offset; + int written = 0, result; + unsigned count = to - offset; +@@ -252,8 +256,13 @@ + } + } + /* if file was forced to be writeable, change attrs back on close */ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ if (dentry->d_inode && dentry->d_inode->i_private) { ++ if (((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close) { ++#else + if (dentry->d_inode && dentry->d_inode->u.generic_ip) { + if (((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close) { ++#endif + char name[SHFS_PATH_MAX]; + + if (get_name(dentry, name) < 0) +@@ -302,7 +311,8 @@ + goto error; + } + if (result != 0) { +- copy_to_user(buf, (char *)page, result); ++ if (copy_to_user(buf, (char *)page, result)) ++ goto error; + *ppos += result; + } + error: +@@ -315,11 +325,15 @@ + static ssize_t + shfs_slow_write(struct file *f, const char *buf, size_t count, loff_t *offset) + { +- int written = 0; ++ ssize_t written = 0; + int result; + + DEBUG("\n"); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ written = do_sync_write(f, buf, count, offset); ++#else + written = generic_file_write(f, buf, count, offset); ++#endif + if (written > 0) { + result = do_file_flush(f); + written = result < 0 ? result: written; +@@ -330,14 +344,23 @@ + + struct file_operations shfs_file_operations = { + .llseek = generic_file_llseek, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ .read = do_sync_read, ++ .write = do_sync_write, ++#else + .read = generic_file_read, + .write = generic_file_write, ++#endif + .ioctl = shfs_ioctl, + .mmap = generic_file_mmap, + .open = shfs_file_open, + .flush = shfs_file_flush, + .release = shfs_file_release, + .fsync = shfs_file_sync, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ .aio_read = generic_file_aio_read, ++ .aio_write = generic_file_aio_write, ++#endif + }; + + struct file_operations shfs_slow_operations = { +--- shfs/Linux-2.6/proc.c 2007-01-03 22:45:32.000000000 -0600 ++++ shfs/Linux-2.6/proc.c 2007-01-03 22:57:17.000000000 -0600 +@@ -149,7 +149,12 @@ + { + struct file *f = info->sock; + mm_segment_t fs; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ ssize_t result = 0; ++ loff_t begin; ++#else + int c, result = 0; ++#endif + unsigned long flags, sigpipe; + sigset_t old_set; + +@@ -161,7 +166,9 @@ + return result; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) + c = count; ++#endif + + fs = get_fs(); + set_fs(get_ds()); +@@ -173,6 +180,16 @@ + SIGRECALC; + SIGUNLOCK(flags); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ begin = f->f_pos; ++ result = do_sync_write(f, buffer, count, &f->f_pos); ++ ++ if (result < 0) { ++ DEBUG("error: %d\n", result); ++ fput(f); ++ info->sock = NULL; ++ } ++#else + do { + struct iovec vec[1]; + +@@ -190,6 +207,7 @@ + buffer += result; + c -= result; + } while (c > 0); ++#endif + + SIGLOCK(flags); + if (result == -EPIPE && !sigpipe) { +@@ -204,7 +222,11 @@ + + DEBUG(">%d\n", result); + if (result < 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ set_garbage(info, 1, count - (f->f_pos - begin)); ++#else + set_garbage(info, 1, c); ++#endif + else + result = count; + return result; +@@ -222,6 +244,9 @@ + int c, result = 0; + unsigned long flags, sigpipe; + sigset_t old_set; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ loff_t begin; ++#endif + + if (!f) + return -EIO; +@@ -256,6 +281,20 @@ + fs = get_fs(); + set_fs(get_ds()); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ begin = f->f_pos; ++ result = do_sync_read(f, buffer, c, &f->f_pos); ++ ++ if (!result) { ++ /* peer has closed socket */ ++ result = -EIO; ++ } ++ if (result < 0) { ++ DEBUG("error: %d\n", result); ++ fput(f); ++ info->sock = NULL; ++ } ++#else + do { + struct iovec vec[1]; + +@@ -277,6 +316,7 @@ + buffer += result; + c -= result; + } while (c > 0); ++#endif + + SIGLOCK(flags); + if (result == -EPIPE && !sigpipe) { +@@ -291,7 +331,11 @@ + + DEBUG("<%d\n", result); + if (result < 0) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ set_garbage(info, 0, count - (f->f_pos - begin)); ++#else + set_garbage(info, 0, c); ++#endif + else + result = count; + return result; +@@ -316,8 +360,10 @@ + return result; + } + while (1) { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) + struct iovec vec[1]; + ++#endif + nl = memchr(BUFFER, '\n', LEN); + if (nl) { + *nl = '\0'; +@@ -348,9 +394,13 @@ + fs = get_fs(); + set_fs(get_ds()); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) ++ result = do_sync_read(f, BUFFER+LEN, c, &f->f_pos); ++#else + vec[0].iov_base = BUFFER+LEN; + vec[0].iov_len = c; + result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos); ++#endif + SIGLOCK(flags); + if (result == -EPIPE && !sigpipe) { + sigdelset(¤t->pending.signal, SIGPIPE); diff --git a/net-fs/shfs/files/digest-shfs-0.35-r4 b/net-fs/shfs/files/digest-shfs-0.35-r4 new file mode 100644 index 000000000000..5d55d11b9c37 --- /dev/null +++ b/net-fs/shfs/files/digest-shfs-0.35-r4 @@ -0,0 +1,3 @@ +MD5 016f49d71bc32eee2b5d11fc1600cfbe shfs-0.35.tar.gz 128656 +RMD160 84bc1c1d6bf5bd722fe1e4b3a4055843b11eda7a shfs-0.35.tar.gz 128656 +SHA256 0d48ffe4d801180c15466f20aaa5802adb9d22067e8941e051dc3c64717ec3c2 shfs-0.35.tar.gz 128656 diff --git a/net-fs/shfs/shfs-0.35-r4.ebuild b/net-fs/shfs/shfs-0.35-r4.ebuild new file mode 100644 index 000000000000..2d031004eb53 --- /dev/null +++ b/net-fs/shfs/shfs-0.35-r4.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/shfs-0.35-r4.ebuild,v 1.1 2007/01/04 05:28:14 compnerd Exp $ + +inherit linux-mod eutils + +DESCRIPTION="Secure Shell File System" +HOMEPAGE="http://shfs.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~sparc ~x86" +IUSE="X amd doc" + +RDEPEND="virtual/modutils + net-misc/openssh + amd? ( net-fs/am-utils )" +DEPEND="virtual/linux-sources + sys-apps/sed + ${RDEPEND}" +PDEPEND="X? ( net-misc/x11-ssh-askpass )" + +CONFIG_CHECK="@SH_FS:shfs" +SH_FS_ERROR="SHFS is built into the kernel. Only userland utilities will be provided." + +pkg_setup() { + linux-mod_pkg_setup + + # Setup the Kernel module build + BUILD_PARAMS="-j1 KERNEL_SOURCES=${KV_DIR}" + + # List the kernel modules that will be built + MODULE_NAMES="shfs(misc/fs:${S}/shfs/Linux-${KV_MAJOR}.${KV_MINOR})" + + case "${KV_MAJOR}.${KV_MINOR}" in + "2.4") BUILD_TARGETS="all" ;; + "2.6") BUILD_TARGETS="default" ;; + esac +} + +src_unpack() { + unpack ${A} + cd ${S} + + epatch ${FILESDIR}/0.35/*.patch + + # Take care of 2.6 Kernels <= 2.6.6 + if [[ "${KV_MAJOR}.${KV_MINOR}" == "2.6" ]] ; then + convert_to_m ${S}/shfs/Linux-2.6/Makefile + fi + + # 2.6.16 has a modified dentry struct. Patch by Miroslav Spousta + # <qiq@ucw.cz>. Submitted by Torsten Krah (bug #127092). + if kernel_is ge 2 6 16 ; then + epatch ${FILESDIR}/${PN}-0.35-2.6.16-dentry.patch + fi +} + +src_compile() { + linux-mod_src_compile + + cd ${S}/shfsmount + emake || die "failed to build userland utilities" +} + +src_install() { + # Install kernel module + linux-mod_src_install + + # Install userland utilities + cd ${S}/shfsmount + dobin shfsmount + dobin shfsumount + + if use amd ; then + insinto /etc/amd + doins ${FILESDIR}/amd.conf + doins ${FILESDIR}/amd.shfs + + exeinto /etc/amd + doexe ${FILESDIR}/shfs.mount + dosym /etc/amd/shfs.mount /etc/amd/shfs.unmount + fi + + # Setup permissions + einfo "Setting SUID bit on /usr/bin executables..." + fperms 4511 /usr/bin/shfsmount + fperms 4511 /usr/bin/shfsumount + + # Create symlinks to support mount(8) + einfo "Adding /sbin/mount.shfs symlink..." + dodir /sbin + dosym /usr/bin/shfsmount /sbin/mount.shfs + + # Install docs + doman ${S}/docs/manpages/shfsmount.8 ${S}/docs/manpages/shfsumount.8 + use doc && dohtml -r ${S}/docs/html +} + +pkg_postinst() { + linux-mod_pkg_postinst + + echo + einfo "Use either 'shfsmount' or 'mount -t shfs' to mount remote" + einfo "filesystems into your local filesystem." + echo + einfo "Note the following:" + einfo + einfo " 1. The shfs kernel module has to be loaded first before you can" + einfo " start mounting filesystems." + einfo " Try: 'modprobe shfs' as root." + einfo + einfo " 2. When mouting, you must enter the absolute path of the remote" + einfo " filesystem without any special characters such as tilde (~)," + einfo " for example as they will not be evaluated." + echo +} |