Add new custom build to run simple SAMBA server

$ sudo ODROID_STAMPER_CHECKOUT=$PWD ./odroid-stamper samba

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I326dd59e092c886d21c62201485cab13337b6d1a
This commit is contained in:
Dongjin Kim
2022-02-15 02:04:12 +09:00
parent 6d5140ccd7
commit c542c1ed68
5 changed files with 73 additions and 0 deletions

7
custom/samba/config Normal file
View File

@@ -0,0 +1,7 @@
BOARD=odroidxu4
ARCH=armhf
DISTRO=focal
FLAVOUR=server
DEFAULT_USER=odroid
DEFAULT_PASSWD=odroid
ALLOW_ROOT_LOGIN=false

View File

@@ -0,0 +1,7 @@
#!/bin/sh
TZ=Asia/Seoul
rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ > /etc/timezone

View File

@@ -0,0 +1,17 @@
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
security = USER
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
idmap config * : backend = tdb
cups options = raw
[public]
path = /srv
read only = No
guest ok = Yes
browseable = Yes
writable = yes
public = Yes

View File

@@ -0,0 +1,41 @@
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
rootdev=$(blkid -U @@UUID_ROOTFS@@)
if [ ! -z ${rootdev} ]; then
case ${rootdev} in
/dev/mmcblk* | /dev/nvme*)
dev=${rootdev%??} ;;
*) dev=${rootdev%?} ;;
esac
lba_start=`fdisk -l ${dev} | grep p2 | awk '{print $2}'`
lba_finish=$((`fdisk -l ${dev} | grep Disk | grep sectors | awk '{printf $7}'` - 2048))
echo -e "p\nd\n2\nn\np\n2\n${lba_start}\n${lba_finish}\np\nw\n" | \
fdisk ${dev} >/dev/null
partprobe
resize2fs ${rootdev}
fi
case $(cat /sys/firmware/devicetree/base/model) in
"Hardkernel Odroid XU4")
need_tweak="true"
;;
*)
need_tweak="false"
;;
esac
if [ "x${need_tweak}" = "xtrue" ]; then
service ssh restart
fi
mount /dev/sda1 /srv
exit 0

1
custom/samba/packages Normal file
View File

@@ -0,0 +1 @@
samba