Samba 4.x package support thread

Sorry for delay.
I took sometime to re-do my config file since scratch using your extra feed.
Same results. All steps are done.

make[3]: Leaving directory '/home/lede/feeds/extra/e2fsprogs'
make[3]: Entering directory '/home/lede/feeds/extra/e2fsprogs'
install -d -m0755 /home/lede/staging_dir/hostpkg/share/et
cp -fpR /home/lede/build_dir/hostpkg/e2fsprogs-1.43.7/lib/et/et_[ch].awk /home/lede/staging_dir/hostpkg/share/et/
install -d -m0755 /home/lede/staging_dir/hostpkg/share/ss
cp -fpR /home/lede/build_dir/hostpkg/e2fsprogs-1.43.7/lib/ss/ct_c.{sed,awk} /home/lede/staging_dir/hostpkg/share/ss/
install -d -m0755 /home/lede/staging_dir/host/bin
cp -fpR /home/lede/build_dir/hostpkg/e2fsprogs-1.43.7/lib/et/compile_et /home/lede/build_dir/hostpkg/e2fsprogs-1.43.7/lib/ss/mk_cmds /home/lede/staging_dir/hostpkg/bin/
cp: target '/home/lede/staging_dir/hostpkg/bin/' is not a directory
Makefile:317: recipe for target '/home/lede/staging_dir/hostpkg/stamp/.e2fsprogs_installed' failed
make[3]: *** [/home/lede/staging_dir/hostpkg/stamp/.e2fsprogs_installed] Error 1
make[3]: Leaving directory '/home/lede/feeds/extra/e2fsprogs'
package/Makefile:107: recipe for target 'package/feeds/extra/e2fsprogs/host/compile' failed
make[2]: *** [package/feeds/extra/e2fsprogs/host/compile] Error 2
make[2]: Leaving directory '/home/lede'
package/Makefile:103: recipe for target '/home/lede/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/lede/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/lede'
/home/lede/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

The latest master should have the e2fsprogs patch, so you can try:
./scripts/feeds install -a -p extra
So we don't force the feeds version, alternative just delete the e2fsprogs dir.

I will try update the feed in a few days and also switch to the stable 4.8 version.

Feed updated to samba 4.8 stable and removed e2fsprogs fixes, since it was merged by upstream.

PS: We still need to use the local krb5 version, waiting for the pull request to get merged as well.

1 Like

Awesome Samba update, working well on WRT1900ACS router, thank you.

Few questions, with default config smbstatus reports;
SMB2_10 as protocol version and if I comment it out #max protocol = SMB2 smbstatus reports SMB3_02 as protocol version, so is that the highest available?

Also, regards vers= entries on client mounts, I tried many vers= but vers=2.0 seems to be the only one that works, possible to get 4.0 to work?

For now I have removed vers=2.0 because im under the impression autofs defaults to the highest available but I am still curious to know which specific vers= is in use, do you know by chance?

I have an issue to report, was getting a display charset error, saw that is was depreciated so I removed from smb.conf.template

display charset = UTF8

and added

unix charset = UTF8
display charset = UTF8

but I still get and error " Failed to add entry for user " when executing smbpasswd -a user1

How to add a new user?

quick notice:
I did refactor the makefile and the package now consists of (lib/server/client/admin/utils) to mimic the samba36 behavior. This means you have to check your config symbols (.config or diff) and adapt to the new names. Some dependencies did change, so check if there are any old that are not needed anymore or are optional now.

what is the easiest way to do that? just start with a clean config?
(i do that once every few months anyway)

Yes, that works ofc.
I use a diffconfig as base and extent it via "make defconfig", in this case you want to remove all old samba4 config entries and also track down all the old lib package deps. The new server package should build with just "zlib krb5libs libtirpc", anything else should be optional.
You can than just select the luci-app package and tweak your server package settings and optionally add "renice" if you want to enable the init-script priority change.

@Andy2244 samab4 improve performance?

@Ansuel Yes because it supports more modern SMB versions. this version also supports "previous versions" in explorers, which makes it easier for my family to restore deleted files, etc.
All in all this is a major improvement over the standard samba version

if you want i can test it :slight_smile:

can you give me also the luci app ?

problem of compilation for r7800

Would like to try Samba 4.8.2 or whatever is newest on my WRT32X. Will this run on davidc502's build from master branch? This is a big step up for the router which comes with Samba 3.0 on the stock firmware.

Build from a clean config, then it will work fine

Depends, while the newer smb 3+ protocol in samba4 is much improved over the older 2.0 in samba36, in reality many routers already struggle to deliver max io-speed.
I got 100MB/s with samba36 or even stock firmware on my Wrt-1200ac via esata on local LAN, which is kinda an exception and one major reason i bought the device, because it had outstanding io-performance for its time.

Yet i also use a VPN to access my smb shares remotely and in this scenario i noticed much better response time and performance, compared to samba36. The other aspect is that samba4 has much better file locking behavior, as a example i start my portable apps collections directly from the network share, which works much better compared to samba36. The last aspect is the support for VFS modules to add extra features, like special shadow_copy, recycle, btrfs, mac-os support.
See: https://wiki.samba.org/index.php/Virtual_File_System_Modules

tldr; In a LAN situation as simple fileserver, samba36 should work as fast as samba4 if configured properly.

I do not provide ipk's, so you need to compile the firmware/package from the feed, but yes the resulting packages should be compatible with other pre-build firmwares, if it was compiled against master branch and can be installed manually.

1 Like

Thanks will give this a shot. I got the WRT32X recently for similar reasons, very good samba performance nearly 100MB/s rw on my USB 3.0 drive. Similar hardware of course so it makes sense.

I just tried to compile Samba 4.8.x for my TP-Link Archer C7 v2 (mips, ath79), and I got the following:

Checking for program gcc or cc           : mips-openwrt-linux-musl-gcc
Checking for program ar                  : mips-openwrt-linux-musl-gcc-ar
Checking for program ranlib              : mips-openwrt-linux-musl-gcc-ranlib
Checking for gcc                         : ok
Checking for program git                 : /home/anton/openwrt/archerc7/source/staging_dir/host/bin/git
Check for -MD                            : yes
Checking for program gdb                 : /usr/bin/gdb
Checking for header sys/utsname.h        : yes
Checking uname sysname type              : not found
Checking uname machine type              : not found
Checking uname release type              : not found
Checking uname version type              : not found
Checking for header stdio.h              : yes
Checking simple C program                : /home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/lib/replace/../../buildtools/wafsamba/wscript:324: error: the configuration failed (see '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/config.log')
Makefile:385: recipe for target '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/.configured_45ef96603b894f8dac7c7c73ed2652b0' failed
make[3]: *** [/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/.configured_45ef96603b894f8dac7c7c73ed2652b0] Error 1
make[3]: Leaving directory '/home/anton/openwrt/archerc7/source/feeds/extra/samba4'
Command exited with non-zero status 2
time: package/feeds/extra/samba4/compile#1.12#0.29#2.32
package/Makefile:107: recipe for target 'package/feeds/extra/samba4/compile' failed
make[2]: *** [package/feeds/extra/samba4/compile] Error 2

When checking "source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/config.log" I found this:


Checking simple C program
==>
#define CONFIG_H_IS_FROM_SAMBA 1
#define _SAMBA_BUILD_ 4
#define HAVE_CONFIG_H 1
#define SRCDIR "/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3"
#define HAVE_SYS_UTSNAME_H 1
/* #undef SYSTEM_UNAME_SYSNAME */
/* #undef SYSTEM_UNAME_MACHINE */
/* #undef SYSTEM_UNAME_RELEASE */
/* #undef SYSTEM_UNAME_VERSION */
#define HAVE_STDIO_H 1
#include <stdio.h>

 int main(void) { printf("hello world"); return 0; }

<==
[1/2] Compiling test.c
['mips-openwrt-linux-musl-gcc', '-Os', '-pipe', '-mno-branch-likely', '-march=74kc', '-mtune=74kc', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-Wno-error=unused-but-set-variable', '-Wno-error=unused-result', '-msoft-float', '-mips16', '-minterlink-mips16', '-iremap/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3:samba-4.8.3', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-ffunction-sections', '-fdata-sections', '-I/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/lib/replace/../../buildtools/wafsamba', '-MD', '-I/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/usr/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/fortify', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include', '-Idefault', '-I..', '-Idefault', '-I..', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '../test.c', '-c', '-o', 'default/test_1.o']
[2/2] Linking default/testprog
['mips-openwrt-linux-musl-gcc', 'default/test_1.o', '-o', '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/.conf_check_0/testbuild/default/testprog', '-L/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/usr/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib', '-znow', '-zrelro', '-Wl,--gc-sections']

qemu: uncaught target signal 4 (Illegal instruction) - core dumped

returncode -4

My build system is a 32-bit Ubuntu 18.04 (running as a Virtualbox VM under Windows 10) and I compile OpenWRT using gcc 7.3. And yes, this was a clean build (make dirclean) Any suggestions?

mhh looks like qemu does not like the generated code, will try to reproduce this with the given compile flags for the target.

thanks for the report

I tried to do a build without mips16 ("PKG_USE_MIPS16:=0" in the Makefile) but it makes no difference. Same core dump.

@avbohemen i tried replicating this bug, but neither my x64 host or my ubuntu 16.04 32bit host had any problems cross-compiling the package. I picked the TP-Link Archer C7 v2 as target and only the samba4 luci package from a clean master branch sdk.

Can you try switch qemu to the latest rc and report back if this helps?
change the .\feeds\extra\qemu-userspace\makefile

PKG_VERSION:=3.0.0-rc0
PKG_HASH:=bba4aa338eef03f16a9ffebb80fc783614bc1e09e5fde51a23d2159032a32566