Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerging shfs without kernel modules
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Nimo
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2003
Posts: 111

PostPosted: Sat Jul 23, 2005 10:43 pm    Post subject: Emerging shfs without kernel modules Reply with quote

I'm using a kernel that's directly patched with shfs (secure SHell FileSystem). This makes portage fail when emerging the shfs-package, therefore I was forced too rewrite the ebuild a little and add a USE-flag that makes it possibly to disable compiling and installing of the kernel module. To use it, save it as /usr/local/portage/net-fs/shfs- 0.35.ebuild, change to the same directory, and then do:
Code:
ebuild shfs-0.35.ebuild digest
then emerge with:
Code:
USE="-kernelmodule" emerge -va =shfs-0.35




shfs-0.35.ebuild
Code:
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/ shfs-0.35.ebuild,v 1.3 2005/07/09 17:12:23 swegener Exp $

inherit eutils

IUSE="amd doc kernelmodule"

DESCRIPTION="Secure Shell File System"
HOMEPAGE="http://shfs.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ~ppc ~amd64"
DEPEND="virtual/linux-sources
                net-misc/openssh
                amd? ( net-fs/am-utils )"

src_unpack() {
        unpack ${A}
        cd ${S}
        # epatch ${FILESDIR}/shfs-gentoo-${PV}-makefile- debug.diff
}

src_compile() {

        cd ${S}/shfsmount
        emake ROOT=${D} MODULESDIR=${D}/lib/modules/${KV} \
        KERNEL_SOURCES=/usr/src/linux || die

        if use kernelmodule ; then
                if [ "`echo ${KV}|grep 2.6`" ] ; then
                        cd ${S}/shfs/Linux-2.6/
                        GENTOO_ARCH=${ARCH}
                        unset ARCH
                        addwrite "/usr/src/${FK}"
                        export _POSIX2_VERSION=199209
                        emake -j1 -C /usr/src/linux SUBDIRS="`pwd`" modules     || die
                        export ARCH=GENTOO_ARCH
                else
                        cd ${S}/shfs/Linux-2.4/
                        emake ROOT=${D} MODULESDIR=${D}/lib/modules/${KV} \
                        KERNEL_SOURCES=/usr/src/linux || die
                fi
        fi
        cd ${S}
        emake docs || die
}

src_install() {
        if use amd ; then
                # Install kernel module
                cd ${S}/shfs/Linux-`echo ${KV}|sed "s/^\([0-9]*\.[0-9]*\).*//"`

                dodir /lib/modules/${KV}/kernel/fs/shfs/
                insinto /lib/modules/${KV}/kernel/fs/shfs/

                if [ "`echo ${KV}|grep 2.6`" ] ; then
                doins shfs.ko || die
                else
                doins shfs.o || die
                fi
        fi
# Install binaries
        cd ${S}/shfsmount
        dobin shfsmount
        dobin shfsumount

        # Allows users to mount/umount
        einfo " Setting suid bit on /usr/bin executables..."
        fperms 4511 /usr/bin/shfsmount
        fperms 4511 /usr/bin/shfsumount

        # Performs symlink to support use of mount(8)
        dodir /sbin
        einfo " Adding /sbin/mount.shfs symlink..."
        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

        # Install automount support (if desired)
 if use amd ; then
                einfo " Installing am-utils config files..."
                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
}

pkg_postinst() {
        echo "running depmod...."
        depmod -aq || die

        echo
        einfo " Use either 'shfsmount' or 'mount -t shfs' to mount remote"
        einfo " filesystems to into your local filesystem."
        echo
        echo
        einfo " Note the following:"
        einfo
        einfo "   1.  The shfs kernel module has to be loaded first"
        einfo "       before you can start mounting filesystems."
        einfo "       Try: 'modprobe shfs' as root."
        einfo
        einfo "   2.  When mounting, you must enter the absolute path of"
        einfo "       the remote filesystem without any special chars,"
        einfo "       such as tilde (~), for example."
        echo
}

_________________
//Nimo
Back to top
View user's profile Send private message
loswillios
n00b
n00b


Joined: 17 Nov 2004
Posts: 10

PostPosted: Sun Jul 24, 2005 10:55 am    Post subject: Reply with quote

hm.. nice!

where did you get the shfs-patches?


greets
jan
Back to top
View user's profile Send private message
Nimo
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2003
Posts: 111

PostPosted: Sun Jul 24, 2005 1:38 pm    Post subject: Reply with quote

cko-sources at http://kem.p.lodz.pl/~peter/cko/
_________________
//Nimo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum