diff --git a/packages/network/install b/packages/network/install index c44402096a..e5101d6dde 100755 --- a/packages/network/install +++ b/packages/network/install @@ -5,6 +5,7 @@ $SCRIPTS/install connman $SCRIPTS/install dropbear #$SCRIPTS/install wicd +$SCRIPTS/install netmount $SCRIPTS/install wireless_tools $SCRIPTS/install wpa_supplicant diff --git a/packages/network/netmount/config/netmount.conf.sample b/packages/network/netmount/config/netmount.conf.sample new file mode 100644 index 0000000000..0aab618844 --- /dev/null +++ b/packages/network/netmount/config/netmount.conf.sample @@ -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 + diff --git a/packages/network/netmount/init.d/43_netmount b/packages/network/netmount/init.d/43_netmount new file mode 100755 index 0000000000..5e86f53e43 --- /dev/null +++ b/packages/network/netmount/init.d/43_netmount @@ -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 diff --git a/packages/network/netmount/install b/packages/network/netmount/install new file mode 100755 index 0000000000..225f223d57 --- /dev/null +++ b/packages/network/netmount/install @@ -0,0 +1,6 @@ +#!/bin/sh + +. config/options $1 + + mkdir -p $INSTALL/usr/config + cp $PKG_DIR/config/netmount.conf.sample $INSTALL/usr/config diff --git a/packages/network/netmount/meta b/packages/network/netmount/meta new file mode 100644 index 0000000000..86c8dfebfe --- /dev/null +++ b/packages/network/netmount/meta @@ -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"