- various cleanups
- dont install samba client
This commit is contained in:
Stephan Raue 2009-10-22 14:43:22 +02:00
parent 314b698af0
commit 90f059b6ef
4 changed files with 20 additions and 93 deletions

View File

@ -1,5 +1,5 @@
[global]
server string = GeeXboX(%i)
server string = OpenELEC(%i)
security = share
guest account = root
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
@ -7,7 +7,7 @@
syslog only = yes
[root]
path = /
path = /storage
available = yes
browsable = yes
public = yes
@ -15,7 +15,7 @@
# To add a writable share of a disk under /mnt uncomment and edit the
# following share declaration
# 'mydisk' is the disk name as seen by GeeXboX
# 'mydisk' is the disk name as seen by OpenELEC
;[mydisk]
; path = /mnt/mydisk
; available = yes

View File

@ -1,26 +1,16 @@
#!/bin/sh
#
# mount samba shares
# start Samba Server
#
#
# runlevels: geexbox, debug, configure
# runlevels: openelec, text, debug
if test -x /usr/bin/mount.cifs -a -f /etc/network; then
echo "### Mounting Samba shares ###"
. /etc/sysconfig
. /etc/network
if test -x /usr/bin/smbd; then
automount_samba static >/dev/null 2>&1 &
automount_samba dynamic >/dev/null 2>&1 &
if [ -n "$NET_RESCAN_DELAY" -a $NET_RESCAN_DELAY -gt 0 ]; then
echo -e "*/$NET_RESCAN_DELAY * * * *\t/usr/bin/automount_samba dynamic > /dev/null 2>&1" >> /var/spool/cron/crontabs/root
fi
fi
if test -x /usr/bin/smbd -a "$SAMBA_SERVER" = yes; then
echo "### Starting Samba server ###"
/usr/bin/smbd
progress "Starting Samba server"
/usr/bin/smbd > /dev/null 2>&1
fi
exit 0

View File

@ -4,17 +4,16 @@
$SCRIPTS/install libiconv
mkdir -p $INSTALL/usr/lib
PKG_DIR=`find $PACKAGES -type d -name $1`
mkdir -p $INSTALL/usr/lib
cp $PKG_BUILD/source/bin/libsmbclient.so $INSTALL/usr/lib/libsmbclient.so.0
ln -s libsmbclient.so.0 $INSTALL/usr/lib/libsmbclient.so
# mkdir -p $INSTALL/usr/bin
# cp $BUILD/$1*/source/bin/mount.cifs $INSTALL/usr/bin
# cp $BUILD/$1*/source/bin/smbtree $INSTALL/usr/bin
# cp $PACKAGES/$1/scripts/automount_samba $INSTALL/usr/bin
# if [ "$SAMBA_SERVER" = yes ]; then
# mkdir -p $INSTALL/usr/bin
# cp $BUILD/$1*/source/bin/smbd $INSTALL/usr/bin
# mkdir -p $INSTALL/etc
# cp $PACKAGES/$1/config/smb.conf $INSTALL/etc/
# fi
if [ "$SAMBA_SERVER" = yes ]; then
mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/source/bin/smbd $INSTALL/usr/bin
mkdir -p $INSTALL/etc
cp $PKG_DIR/config/smb.conf $INSTALL/etc/
fi

View File

@ -1,62 +0,0 @@
#!/bin/sh
#
# Samba AutoMounter
#
MOUNT_POINT=/mnt/shares
mount_samba () {
user=$1
pass=$2
name=$3
ip=$4
shift 4
while [ $# -gt 0 ]; do
dir="$MOUNT_POINT/$name/$1"
if [ ! -e "$dir" ]; then
mkdir -p "$dir"
mount "//$ip/$1" "$dir" -t cifs -o "ro,iocharset=utf8,user=$user,pass=$pass" || mount.cifs "//$name/$1" "$dir" -o "ro,iocharset=utf8,ip=$ip,username=$user,passwd=$pass" || rmdir -p "$dir"
fi
shift
done
}
do_static_mount () {
for STATIC_SMB in `sed -n "s/^STATIC_SMB=\"\(.*\)\"/\1/p" /etc/network`; do
(
USER=`echo $STATIC_SMB | sed "s/<%>.*//"`
PASS=`echo $STATIC_SMB | sed -e "s/.*<%>//" -e "s/<@>.*//"`
IP=`echo $STATIC_SMB | sed -e "s/.*<@>//" -e "s/<&>.*//"`
NAME=`echo $STATIC_SMB | sed -e "s/.*<&>//" -e "s/<#>.*//"`
MOUNTS="`echo $STATIC_SMB | sed "s/.*$NAME<#>//" | sed "s/<#>/ /g"`"
mount_samba "$USER" "$PASS" "$NAME" "$IP" $MOUNTS
)&
done
}
do_dynamic_mount () {
. /etc/network
OPT="-N"
test -n "$SMB_USER" && OPT="-U$SMB_USER%$SMB_PWD"
saveifs=$IFS
smbtree "$OPT" | while read mounts; do
(
IFS=/
mount_samba "$SMB_USER" "$SMB_PWD" $mounts
IFS=$saveifs
)&
done
}
. /etc/network.scripts
wait_for_network
if [ "$1" = static ]; then
do_static_mount
else
do_dynamic_mount
fi
exit 0