Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Hard Drives as Samba share directory under path \\buildroot #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ config BR2_BZCAT
Default is "bzcat"
Other possible values include "bunzip2 -c" or "bzip2 -d -c".

config BR2_XZCAT
string "xzcat command"
default "xzcat"
help
Command to be used to extract a xz'ed file to stdout.
Default is "xzcat"

config BR2_TAR_OPTIONS
string "Tar options"
default ""
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ KERNEL_ARCH:=$(shell echo "$(ARCH)" | sed -e "s/-.*//" \

ZCAT:=$(call qstrip,$(BR2_ZCAT))
BZCAT:=$(call qstrip,$(BR2_BZCAT))
XZCAT:=$(call qstrip,$(BR2_XZCAT))
TAR_OPTIONS=$(call qstrip,$(BR2_TAR_OPTIONS)) -xf

GNU_TARGET_SUFFIX:=-$(call qstrip,$(BR2_GNU_TARGET_SUFFIX))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ to python 2.7. Earlier pythons (or python3) will not work.
# Set up a key to sign the image

```shell
% mkdir ~/.android
% keytool -genkey -keystore ~/.android/debug.keystore -v -alias \
androiddebugkey -dname "CN=Android Debug,O=Android,C=US" -keypass \
android -storepass android -keyalg RSA -keysize 2048 -validity 10000
Expand Down
1 change: 1 addition & 0 deletions package/Makefile.package.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ INFLATE.gz = $(ZCAT)
INFLATE.tbz = $(BZCAT)
INFLATE.tbz2 = $(BZCAT)
INFLATE.tgz = $(ZCAT)
INFLATE.xz = $(XZCAT)
INFLATE.tar = cat

# MESSAGE Macro -- display a message in bold type
Expand Down
80 changes: 80 additions & 0 deletions package/thirdparty/samba30/S91smb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/sh
#
# Stolen from RedHat FC5.
#

# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0

# Make directories.
mkdir -p /var/cache/samba
mkdir -p /var/log/samba
mkdir -p /var/lock/subsys

RETVAL=0

start() {
echo -n "Starting SMB services: "
smbd -D
RETVAL=$?
echo "done"

echo -n "Starting NMB services: "
nmbd -D
RETVAL2=$?
echo "done"

[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
RETVAL=1
return $RETVAL
}

stop() {
echo -n "Shutting down SMB services: "
kill -9 `pidof smbd`
RETVAL=$?
rm -f /var/run/smbd.pid
echo "done"

echo -n "Shutting down NMB services: "
kill -9 `pidof nmbd`
RETVAL2=$?
rm -f /var/run/nmbd.pid

[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
echo "done"
return $RETVAL
}

restart() {
stop
start
}

reload() {
echo -n "Reloading smb.conf file: "
kill -HUP `pidof smbd`
RETVAL=$?
echo "done"
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

exit $?
54 changes: 52 additions & 2 deletions package/thirdparty/samba30/samba30.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ SAMBA30_CONF_OPT = \

SAMBA30_INSTALL_TARGET_OPT = \
DESTDIR=$(TARGET_DIR) -C $(SAMBA30_DIR)/$(SAMBA30_SUBDIR) \
installclientlib
installclientlib installservers installbin

SAMBA30_INSTALL_STAGING_OPT = \
DESTDIR=$(STAGING_DIR) -C $(SAMBA30_DIR)/$(SAMBA30_SUBDIR) \
installclientlib

SAMBA30_UNINSTALL_TARGET_OPT = \
DESTDIR=$(TARGET_DIR) -C $(SAMBA30_DIR)/$(SAMBA30_SUBDIR) \
uninstallclientlib
uninstallclientlibs uninstallservers uninstallbin

SAMBA30_UNINSTALL_STAGING_OPT = \
DESTDIR=$(STAGING_DIR) -C $(SAMBA30_DIR)/$(SAMBA30_SUBDIR) \
Expand All @@ -102,11 +102,61 @@ SAMBA30_TXTTARGETS_ = \
usr/include/tdb.h \
usr/include/wbclient.h

# binaries to keep
SAMBA30_BINTARGETS_y = \
usr/sbin/smbd \
usr/bin/smbpasswd \
usr/lib/libsmbclient.so*

# binaries to remove
SAMBA30_BINTARGETS_ = \
usr/lib/libsmbsharemodes* \
usr/bin/eventlogadm \
usr/bin/net \
usr/bin/nmblookup \
usr/bin/ntlm_auth \
usr/bin/pdbedit \
usr/bin/profiles \
usr/bin/rpcclient \
usr/bin/smbcacls \
usr/bin/smbclient \
usr/bin/smbcontrol \
usr/bin/smbcquotas \
usr/bin/smbget \
usr/bin/smbspool \
usr/bin/smbstatus \
usr/bin/smbtree \
usr/sbin/swat \
usr/bin/tdbbackup \
usr/bin/tdbdump \
usr/bin/tdbtool \
usr/bin/testparm

define SAMBA30_REMOVE_UNNEEDED_HEADERS
rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA30_TXTTARGETS_))
endef

define SAMBA30_REMOVE_UNNEEDED_BINARIES
rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA30_BINTARGETS_))
endef

define SAMBA30_INSTALL_INITSCRIPTS_CONFIG

# install start/stop script
@if [ ! -f $(TARGET_DIR)/etc/init.d/S91smb ]; then \
$(INSTALL) -m 0755 -D package/thirdparty/samba30/S91smb $(TARGET_DIR)/etc/init.d/S91smb; \
fi

# install config
@if [ ! -f $(TARGET_DIR)/etc/samba/smb.conf ]; then \
$(INSTALL) -m 0755 -D package/thirdparty/samba30/simple.conf $(TARGET_DIR)/etc/samba/smb.conf; \
fi
endef


SAMBA30_POST_INSTALL_TARGET_HOOKS += SAMBA30_REMOVE_UNNEEDED_HEADERS
SAMBA30_POST_INSTALL_TARGET_HOOKS += SAMBA30_REMOVE_UNNEEDED_BINARIES
SAMBA30_POST_INSTALL_TARGET_HOOKS += SAMBA30_INSTALL_INITSCRIPTS_CONFIG

define SAMBA30_AUTOGEN
@$(call MESSAGE,"Reconfiguring")
Expand Down
30 changes: 30 additions & 0 deletions package/thirdparty/samba30/simple.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#======================= Global Settings =====================================
[global]
workgroup = MYGROUP
server string = MYDATA
max log size = 50
security = share
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
log file = /var/log/samba/log.smbd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes

#============================ Share Definitions ==============================
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /bin/false
winbind use default domain = no

[HardDrives]
path = /media
public = yes
only guest = yes
writable = yes
printable = no
force user = root