mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
new package:
- add samba
This commit is contained in:
parent
4b81e20c10
commit
4f856044b7
47
packages/sysutils/samba/build
Executable file
47
packages/sysutils/samba/build
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/build toolchain
|
||||
$SCRIPTS/build libiconv
|
||||
|
||||
export samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
|
||||
export samba_cv_USE_SETEUID=yes
|
||||
export samba_cv_HAVE_IFACE_IFCONF=yes
|
||||
export SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no
|
||||
export samba_cv_have_longlong=yes
|
||||
|
||||
cd $PKG_BUILD/source
|
||||
./configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--localstatedir=/var \
|
||||
--with-configdir=/etc \
|
||||
--with-privatedir=/etc \
|
||||
--disable-pie \
|
||||
--disable-cups \
|
||||
--without-smbmount \
|
||||
--with-cifsmount \
|
||||
--without-ldap \
|
||||
--without-winbind \
|
||||
--with-included-popt \
|
||||
--with-libsmbclient \
|
||||
--without-ads \
|
||||
--without-quotas \
|
||||
--without-sys-quotas \
|
||||
--with-syslog \
|
||||
--with-libiconv=$LIB_PREFIX \
|
||||
|
||||
make include/proto.h
|
||||
make bin/mount.cifs \
|
||||
bin/smbtree \
|
||||
bin/libsmbclient.so
|
||||
[ "$SAMBA_SERVER" = yes ] && make \
|
||||
bin/smbd
|
||||
|
||||
mkdir -p $SYSROOT_PREFIX/usr/lib
|
||||
cp bin/libsmbclient.so $SYSROOT_PREFIX/usr/lib
|
||||
|
||||
mkdir -p $SYSROOT_PREFIX/usr/include
|
||||
cp include/libsmbclient.h $SYSROOT_PREFIX/usr/include
|
||||
cp include/libmsrpc.h $SYSROOT_PREFIX/usr/include
|
26
packages/sysutils/samba/config/smb.conf
Normal file
26
packages/sysutils/samba/config/smb.conf
Normal file
@ -0,0 +1,26 @@
|
||||
[global]
|
||||
server string = GeeXboX(%i)
|
||||
security = share
|
||||
guest account = root
|
||||
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
|
||||
wins support = no
|
||||
syslog only = yes
|
||||
|
||||
[root]
|
||||
path = /
|
||||
available = yes
|
||||
browsable = yes
|
||||
public = yes
|
||||
writable = yes
|
||||
|
||||
# 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]
|
||||
; path = /mnt/mydisk
|
||||
; available = yes
|
||||
; browsable = yes
|
||||
; public = yes
|
||||
; writable = yes
|
||||
; root preexec = /usr/bin/rw /mnt/mydisk
|
||||
; root postexec = /usr/bin/ro /mnt/mydisk
|
26
packages/sysutils/samba/init.d/58_samba
Executable file
26
packages/sysutils/samba/init.d/58_samba
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# mount samba shares
|
||||
#
|
||||
#
|
||||
# runlevels: geexbox, debug, configure
|
||||
|
||||
if test -x /usr/bin/mount.cifs -a -f /etc/network; then
|
||||
echo "### Mounting Samba shares ###"
|
||||
|
||||
. /etc/network
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
exit 0
|
20
packages/sysutils/samba/install
Executable file
20
packages/sysutils/samba/install
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/install libiconv
|
||||
|
||||
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
|
71
packages/sysutils/samba/patches/10_debug-no-msg.diff
Normal file
71
packages/sysutils/samba/patches/10_debug-no-msg.diff
Normal file
@ -0,0 +1,71 @@
|
||||
diff -Naur samba-3.0.25.orig/source/include/debug.h samba-3.0.25/source/include/debug.h
|
||||
--- samba-3.0.25.orig/source/include/debug.h 2007-05-17 12:28:16.000000000 +0200
|
||||
+++ samba-3.0.25/source/include/debug.h 2007-05-17 12:31:32.000000000 +0200
|
||||
@@ -162,54 +162,18 @@
|
||||
* will remove the extra conditional test.
|
||||
*/
|
||||
|
||||
-#define DEBUGLVL( level ) \
|
||||
- ( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
|
||||
-
|
||||
-
|
||||
-#define DEBUGLVLC( dbgc_class, level ) \
|
||||
- ( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
|
||||
-
|
||||
-
|
||||
-#define DEBUG( level, body ) \
|
||||
- (void)( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && (dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
|
||||
- && (dbgtext body) )
|
||||
-
|
||||
-#define DEBUGC( dbgc_class, level, body ) \
|
||||
- (void)( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && (dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
|
||||
- && (dbgtext body) )
|
||||
-
|
||||
-#define DEBUGADD( level, body ) \
|
||||
- (void)( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && (dbgtext body) )
|
||||
-
|
||||
-#define DEBUGADDC( dbgc_class, level, body ) \
|
||||
- (void)( ((level) <= MAX_DEBUG_LEVEL) && \
|
||||
- ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
|
||||
- (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
|
||||
- DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
|
||||
- && (dbgtext body) )
|
||||
-
|
||||
-/* Print a separator to the debug log. */
|
||||
-#define DEBUGSEP(level)\
|
||||
- DEBUG((level),("===============================================================\n"))
|
||||
+#define DEBUGLVL( level ) (0)
|
||||
+
|
||||
+#define DEBUGLVLC( dbgc_class, level ) (0)
|
||||
+
|
||||
+#define DEBUG( level, body ) ((void)0)
|
||||
+
|
||||
+#define DEBUGC( dbgc_class, level, body ) ((void)0)
|
||||
+
|
||||
+#define DEBUGADD( level, body ) ((void)0)
|
||||
+
|
||||
+#define DEBUGADDC( dbgc_class, level, body ) ((void)0)
|
||||
+
|
||||
+#define DEBUGSEP( level ) ((void)0)
|
||||
|
||||
#endif
|
12
packages/sysutils/samba/patches/11_error-msg.diff
Normal file
12
packages/sysutils/samba/patches/11_error-msg.diff
Normal file
@ -0,0 +1,12 @@
|
||||
diff -Naur samba-3.0.25.orig/source/libsmb/clierror.c samba-3.0.25/source/libsmb/clierror.c
|
||||
--- samba-3.0.25.orig/source/libsmb/clierror.c 2007-05-17 12:28:16.000000000 +0200
|
||||
+++ samba-3.0.25/source/libsmb/clierror.c 2007-05-17 12:32:35.000000000 +0200
|
||||
@@ -159,7 +159,7 @@
|
||||
if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) {
|
||||
NTSTATUS status = NT_STATUS(IVAL(cli->inbuf,smb_rcls));
|
||||
|
||||
- return nt_errstr(status);
|
||||
+ return "NT_STATUS_UNSUCCESSFUL";
|
||||
}
|
||||
|
||||
cli_dos_error(cli, &errclass, &errnum);
|
16
packages/sysutils/samba/patches/20_crosscompile.diff
Normal file
16
packages/sysutils/samba/patches/20_crosscompile.diff
Normal file
@ -0,0 +1,16 @@
|
||||
diff -Naur samba-3.0.20.orig/source/configure samba-3.0.20/source/configure
|
||||
--- samba-3.0.20.orig/source/configure 2005-08-19 22:09:01.000000000 +0300
|
||||
+++ samba-3.0.20/source/configure 2005-08-23 13:51:06.000000000 +0300
|
||||
@@ -18731,11 +18731,7 @@
|
||||
*linux*)
|
||||
# glibc <= 2.3.2 has a broken getgrouplist
|
||||
if test "$cross_compiling" = yes; then
|
||||
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
|
||||
-See \`config.log' for more details." >&5
|
||||
-echo "$as_me: error: cannot run test program while cross compiling
|
||||
-See \`config.log' for more details." >&2;}
|
||||
- { (exit 1); exit 1; }; }
|
||||
+ linux_getgrouplist_ok=no
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
73
packages/sysutils/samba/patches/30_smbtree-diskonly.diff
Normal file
73
packages/sysutils/samba/patches/30_smbtree-diskonly.diff
Normal file
@ -0,0 +1,73 @@
|
||||
diff -Naur samba-3.0.28a/source/utils/smbtree.c samba-3.0.28a.edit/source/utils/smbtree.c
|
||||
--- samba-3.0.28a/source/utils/smbtree.c 2008-04-05 16:11:02.000000000 +0200
|
||||
+++ samba-3.0.28a.edit/source/utils/smbtree.c 2008-04-05 16:10:17.000000000 +0200
|
||||
@@ -181,16 +181,18 @@
|
||||
}
|
||||
|
||||
|
||||
-static BOOL get_shares(char *server_name, struct user_auth_info *user_info)
|
||||
+static BOOL get_shares(char *server_name, struct in_addr *server_ip, struct user_auth_info *user_info)
|
||||
{
|
||||
struct cli_state *cli;
|
||||
|
||||
if (!(cli = get_ipc_connect(server_name, NULL, user_info)))
|
||||
return False;
|
||||
|
||||
+ *server_ip = cli->dest_ip;
|
||||
+
|
||||
if (get_rpc_shares(cli, add_name, &shares))
|
||||
return True;
|
||||
-
|
||||
+
|
||||
if (!cli_RNetShareEnum(cli, add_name, &shares))
|
||||
return False;
|
||||
|
||||
@@ -200,7 +202,8 @@
|
||||
static BOOL print_tree(struct user_auth_info *user_info)
|
||||
{
|
||||
struct name_list *wg, *sv, *sh;
|
||||
-
|
||||
+ struct in_addr server_ip;
|
||||
+
|
||||
/* List workgroups */
|
||||
|
||||
if (!get_workgroups(user_info))
|
||||
@@ -208,8 +211,6 @@
|
||||
|
||||
for (wg = workgroups; wg; wg = wg->next) {
|
||||
|
||||
- printf("%s\n", wg->name);
|
||||
-
|
||||
/* List servers */
|
||||
|
||||
free_name_list(servers);
|
||||
@@ -221,21 +222,23 @@
|
||||
|
||||
for (sv = servers; sv; sv = sv->next) {
|
||||
|
||||
- printf("\t\\\\%-15s\t\t%s\n",
|
||||
- sv->name, sv->comment);
|
||||
-
|
||||
/* List shares */
|
||||
|
||||
free_name_list(shares);
|
||||
shares = NULL;
|
||||
|
||||
if (level == LEV_SERVER ||
|
||||
- !get_shares(sv->name, user_info))
|
||||
+ !get_shares(sv->name, &server_ip, user_info))
|
||||
continue;
|
||||
|
||||
for (sh = shares; sh; sh = sh->next) {
|
||||
- printf("\t\t\\\\%s\\%-15s\t%s\n",
|
||||
- sv->name, sh->name, sh->comment);
|
||||
+ if (sh->server_type == STYPE_DISKTREE &&
|
||||
+ sh->name[strlen(sh->name)-1] != '$') {
|
||||
+ printf("%s/%s/%s\n",
|
||||
+ sv->name, inet_ntoa(server_ip),
|
||||
+ sh->name);
|
||||
+ fflush(stdout);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
17
packages/sysutils/samba/patches/40_oplocks.diff
Normal file
17
packages/sysutils/samba/patches/40_oplocks.diff
Normal file
@ -0,0 +1,17 @@
|
||||
--- SAMBA_3_2/source/modules/vfs_default.c (revision 23961)
|
||||
+++ SAMBA_3_2/source/modules/vfs_default.c (revision 23962)
|
||||
@@ -826,10 +826,11 @@
|
||||
|
||||
START_PROFILE(syscall_linux_setlease);
|
||||
|
||||
-#ifdef LINUX
|
||||
+#ifdef HAVE_KERNEL_OPLOCKS_LINUX
|
||||
/* first set the signal handler */
|
||||
- if(linux_set_lease_sighandler(fd) == -1)
|
||||
+ if(linux_set_lease_sighandler(fd) == -1) {
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
result = linux_setlease(fd, leasetype);
|
||||
#else
|
||||
|
62
packages/sysutils/samba/scripts/automount_samba
Executable file
62
packages/sysutils/samba/scripts/automount_samba
Executable file
@ -0,0 +1,62 @@
|
||||
#!/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
|
6
packages/sysutils/samba/unpack
Executable file
6
packages/sysutils/samba/unpack
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/fixconfigtools $PKG_BUILD/source
|
||||
mkdir "`ls -d $PKG_BUILD/source`/bin"
|
1
packages/sysutils/samba/url
Normal file
1
packages/sysutils/samba/url
Normal file
@ -0,0 +1 @@
|
||||
http://us1.samba.org/samba/ftp/stable/samba-3.0.33.tar.gz
|
Loading…
x
Reference in New Issue
Block a user