new package: add package 'netmount' for mounting network shares

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-07-23 02:33:44 +02:00
parent 0fe89f6eae
commit 274250e5ec
5 changed files with 104 additions and 0 deletions

View File

@ -5,6 +5,7 @@
$SCRIPTS/install connman
$SCRIPTS/install dropbear
#$SCRIPTS/install wicd
$SCRIPTS/install netmount
$SCRIPTS/install wireless_tools
$SCRIPTS/install wpa_supplicant

View File

@ -0,0 +1,19 @@
# Mounting Network shares on boot
# This configuration file allows to setup Network mounts via CIFS (Samba) or NFS
# (not yet included)
# This is an sample file, please rename or copy this file to netmount.conf
# (location /storage/.config/ or inside the samba share "Configfiles"
#
# Usage:
# service | share on server | local mountpoint | mount options
#
# - please use an "|" as delimiter
# - dont use spaces in sharenames, local mountpounts, usernames, passwords
# and options.
# - local mountpoints can be only on /storage and /media (not recommended!).
# - you can use any dir inside the XBMC home /storage/.xbmc/... for local
# mountpoints if you need this for some reasons.
#
# Example:
# cifs | //192.168.1.44/videos | /storage/mount/videos | username=user,password=secret

View File

@ -0,0 +1,64 @@
#!/bin/sh
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# Mounting Network shares
#
# runlevels: openelec, textmode
. /etc/profile
NETMOUNT_USERCONF="/storage/.config/netmount.conf"
if [ -f $NETMOUNT_USERCONF ]; then
progress "Mounting Network shares"
if [ -f /usr/bin/mount.cifs ]; then
IFS="
"
for i in `cat $NETMOUNT_USERCONF |grep -v "^#"`; do
SERVICE=`echo $i | sed -e "s@ @@g" | cut -f1 -d "|"`
SHARE=`echo $i | sed -e "s@ @@g" | cut -f2 -d "|"`
MOUNTPOINT=`echo $i | sed -e "s@ @@g" | cut -f3 -d "|"`
OPTIONS=`echo $i | sed -e "s@ @@g" | cut -f4 -d "|"`
progress "... mounting $SHARE to $MOUNTPOINT ..."
mkdir -p $MOUNTPOINT
case "$SERVICE" in
cifs)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
;;
samba)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
;;
smb)
mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS"
;;
# nfs)
# mount.nfs $SHARE $MOUNTPOINT -o $OPTIONS
# ;;
esac
done
fi
fi

View File

@ -0,0 +1,6 @@
#!/bin/sh
. config/options $1
mkdir -p $INSTALL/usr/config
cp $PKG_DIR/config/netmount.conf.sample $INSTALL/usr/config

View File

@ -0,0 +1,14 @@
PKG_NAME="netmount"
PKG_VERSION="0.1"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.openelec.tv"
PKG_URL=""
PKG_DEPENDS="samba"
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="tools"
PKG_SHORTDESC="netmount: scripts for mounting network shares on boottime"
PKG_LONGDESC="netmount: scripts for mounting network shares on boottime"
PKG_IS_ADDON="no"