[Samba] The sad state of samba 4 adaption for home/small business routers.

Andy Walsh andy.walsh44 at gmail.com
Fri Mar 11 17:04:50 UTC 2016


Hi,

i would like to inspire a discussion on why samba4 has nearly no adaption on
home/small business routers firmware.

I recently switched from my old Asus-N16 running tomato to a WRT-1200AC and
was researching potential firmware's that i could run. We have a new
synology disk-station at work that runs Samba 4.x and it works great. So i
was surprised to notice that 3 years after the 4.0 release i could not find
a single home/small business oriented router firmware that was supporting
samba 4.x? I delved deeper into this and after several weeks toying around
with the tomato/dd-wrt/openWRT/buildroot/openembedded/optware2/entware
toolchains and the samba 4.3 source + waf, i understand why.


Some problems i encountered, while trying to build a samba 4 package for any
of the most popular router firmwares.

1) Waf's cross-compile approach/requirements are simply not feasible,
clearly understandable for most package maintainers.

The problem is that most maintainers can not test/create the required
qemu/crossanswer files for all the targets, that Waf relies on. As far as i
know samba4 is the only package in openWRT/buildroot that requires such a
special cross compile handling. So while i have a arm32 version running on
my AC1200, thats based on a fork of openWRT. We can not create/submit a
general package, since we lack the confidence to create crossanswer files
for all the different target platforms and creating a valid qemu host
package per target is also problematic, since no package did ever require
such a workflow.


2) The size of the final waf bin/lib install, even if stripped down to the
bare minimum of smbd/nmbd/smbpasswd is unsuitable for most older routers
that have just 8MB nvram and problematic for 16/32 MB more recent routers,
depending on what other packages are added to the firmware.

The smallest samba 4.3 package we could manage to build is around 9-12MB or
4.9MB lzma compressed using this makefile + some multicall/static linking
hacks/patches:
https://github.com/wongsyrone/openwrt-1/tree/master/package/external
/samba43related/samba43

In contrast Samba 3.6 can be stripped down to around 900kb (lzma), which is
not a problem for 8MB nvram targets.

I tried to base my build on the buildroot example and create a normal shared
lib package, since i don't like to maintain all the multicall patches and
the size gain over the shared version is just about 20%, which don't really
brings us this much closer.

So is there a way to further strip down samba4 to create a home environment
based "minimal fileserver" package? What most home users want is just a
working smb3 fileserver (s3fs) to reach windows8/10 clients and netbios so
they can browse, find the file-server. Most will not even go through the
hassle and setup user profiles/restrictions and use guest mode.
I personally also found it very intriguing to have the btrfs vfs module and
the associated transparent compression option.


Here is the current status of the big firmwares regarding samba 4:
Tomato: don't even try to get this working, since they are based on a old
kernel and lack the toolchain to even build samba 4
dd-wrt: follows openWRT
openWRT: no official package exists and the versions that where created in
forks can not be submitted, since only arm target crossanswers are used in
the makefile.
Buildroot: made some progress in the recent weeks to add more cross answer
files, but its basically a full install that is too big.
openembedded: seems to haven given up after the 4.0 experimental support
optware2/entware-ng2: no real efforts are made


So i welcome a discussion on how to help fixing this situation, so also
home/sbu can enjoy a up-to-date samba 4 version.

thx
Andy




More information about the samba mailing list