From 9c4f052eb789a9c2078028249feb0128bc64c331 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 5 Apr 2010 02:18:08 +0200 Subject: [PATCH] samba: - adding support for user created samba.conf - cleanups & cosmetics - adding sample samba.conf - start only system smb.conf if user samba.conf not exist --- .../network/samba/config/samba.conf.sample | 75 +++++++++++++++++++ packages/network/samba/init.d/42_samba | 13 +++- packages/network/samba/install | 13 ++-- 3 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 packages/network/samba/config/samba.conf.sample diff --git a/packages/network/samba/config/samba.conf.sample b/packages/network/samba/config/samba.conf.sample new file mode 100644 index 0000000000..ad9069f081 --- /dev/null +++ b/packages/network/samba/config/samba.conf.sample @@ -0,0 +1,75 @@ +[global] + server string = OpenELEC.tv Mediacenter(%i) + workgroup = WORKGROUP + netbios name = openelec + security = share + guest account = root + socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 + wins support = no + syslog only = yes + +# here you can add a writable share of a disk under /storage + +[Update] + path = /storage/.update + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/.update + +[Videos] + path = /storage/videos + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/videos + +[Music] + path = /storage/music + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/music + +[TV Shows] + path = /storage/tvshows + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/tvshows + +[Downloads] + path = /storage/downloads + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/downloads + +[Pictures] + path = /storage/pictures + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/pictures + +[Configfiles] + path = /storage/.config + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/.config + +[Screenshots] + path = /storage/screenshots + available = yes + browsable = yes + public = yes + writable = yes + root preexec = mkdir -p /storage/screenshots diff --git a/packages/network/samba/init.d/42_samba b/packages/network/samba/init.d/42_samba index 1623b35822..9497d86a56 100755 --- a/packages/network/samba/init.d/42_samba +++ b/packages/network/samba/init.d/42_samba @@ -5,5 +5,16 @@ ( progress "Starting Samba server" - smbd -D > /dev/null 2>&1 + SMB_USERCONF="/storage/.config/samba.conf" + SMB_DEFCONF="/etc/samba/smb.conf" + SMB_ARG="--daemon" + + if [ -f $SMB_USERCONF ]; then + SMB_ARG="$SMB_ARG --configfile=$SMB_USERCONF" + else + SMB_ARG="$SMB_ARG --configfile=$SMB_DEFCONF" + fi + + smbd $SMB_ARG > /dev/null 2>&1 + )& diff --git a/packages/network/samba/install b/packages/network/samba/install index 4802894c37..832675f90e 100755 --- a/packages/network/samba/install +++ b/packages/network/samba/install @@ -8,14 +8,17 @@ $SCRIPTS/install avahi PKG_DIR=`find $PACKAGES -type d -name $1` mkdir -p $INSTALL/usr/lib - cp -PR $PKG_BUILD/source3/bin/libsmbclient.so* $INSTALL/usr/lib - cp -PR $PKG_BUILD/source3/bin/libtalloc.so* $INSTALL/usr/lib - cp -PR $PKG_BUILD/source3/bin/libtdb.so* $INSTALL/usr/lib + cp -P $PKG_BUILD/source3/bin/libsmbclient.so* $INSTALL/usr/lib + cp -P $PKG_BUILD/source3/bin/libtalloc.so* $INSTALL/usr/lib + cp -P $PKG_BUILD/source3/bin/libtdb.so* $INSTALL/usr/lib + +mkdir -p $INSTALL/usr/config + cp -P $PKG_DIR/config/samba.conf.sample $INSTALL/usr/config if [ "$SAMBA_SERVER" = yes ]; then mkdir -p $INSTALL/usr/bin - cp $PKG_BUILD/source3/bin/smbd $INSTALL/usr/bin + cp -P $PKG_BUILD/source3/bin/smbd $INSTALL/usr/bin mkdir -p $INSTALL/etc/samba - cp $PKG_DIR/config/smb.conf $INSTALL/etc/samba + cp -P $PKG_DIR/config/smb.conf $INSTALL/etc/samba fi