Samba 4.x package support thread

I removed your feed just to be sure it doesn't clash and building a fresh build now. If i see any issues i'll report them here.

You are great, thanks. I can wait for once you get it backported to 18.06 and have the package-builder ready then too.

hmm...
This is a totally clean build from scratch, and it seems you forgot to add libcap as a dependency for samba4.
after i manually selected libcap in libraries, the compile worked.

find /home/johnnysl/wrt1900ac/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/samba-4.8.3/ipkg-arm                                                                                                    _cortex-a9_vfpv3/samba4-libs -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r r                                                                                                    m -rf
Package samba4-libs is missing dependencies for the following libraries:
libcap.so.2
Makefile:395: recipe for target '/home/johnnysl/wrt1900ac/bin/packages/arm_cortex-a9_vfpv3/packag                                                                                                    es/samba4-libs_4.8.3-3_arm_cortex-a9_vfpv3.ipk' failed
make[3]: *** [/home/johnnysl/wrt1900ac/bin/packages/arm_cortex-a9_vfpv3/packages/samba4-libs_4.8.                                                                                                    3-3_arm_cortex-a9_vfpv3.ipk] Error 1
make[3]: Leaving directory '/home/johnnysl/wrt1900ac/feeds/packages/net/samba4'
time: package/feeds/packages/samba4/compile#1.00#1.95#5.02
package/Makefile:107: recipe for target 'package/feeds/packages/samba4/compile' failed
make[2]: *** [package/feeds/packages/samba4/compile] Error 2
make[2]: Leaving directory '/home/johnnysl/wrt1900ac'
package/Makefile:103: recipe for target '/home/johnnysl/wrt1900ac/staging_dir/target-arm_cortex-a                                                                                                    9+vfpv3_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/johnnysl/wrt1900ac/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.pa                                                                                                    ckage_compile] Error 2

@johnnysl Thats strange the version worked for me locally for several targets and the buildbot was also able to create nearly all targets.
Can you post/link your distro and config seed/diff file, it seems samba still pulls in stuff from somewhere.
Can you verify that with a clean defconfig and just selecting your target + samba4 the build works or not?

1 Like

quick info for timemachine users:
Remove the /etc/avahi/services/samba.service file, i just found out that from samba 4.8+ on, this is handled internally by samba and no external files are needed anymore.

1 Like

oki i enabled AVAHI support by default so Linux/Mac clients can see the shares out of the box. In Windows only environments, disable the avahi build option or just stop the avahi-daemon service via luci, since we use the wsdd2-daemon on Windows.

This also allows Timemachine support out of the box, with a single option field under luci. Just enable this for your backup share and it "should" work, without the need to add any vfs modules or extra options.

PS: If you need different options, copy the per share options to the template and make manual changes, than delete your luci share entries. This way all is contained in your template file.

1 Like

I'm trying to download the build ipk's for the Snapshot SDK, but I notice the only ones its built for is mips_24kc, x86_64, and arm_coretex-a5_neon-vfpv4.

I have a wrt1900acs, any chance the ipk could be built for arm_cortex-a9_vfpv3?

Oh i see for some reason they are missing, let me check the faillogs.

@yaravawiba It seems on some targets samba4 pulls in libbsd, which should not be required. Will take some time to investigate and fix this, sorry.

Btw the https://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/packages/ versions should also run on arm_cortex-a9_vfpv3.

PS: Maybe i can finish my "package builder", with it you can build your own packages from custom feeds automatically, while only needing to get Docker installed and will run on Linux/Windows 10. Still need to fix some bugs.

1 Like

@Andy2244: i'm building from snap now and switched from using an external netatalk and avahi solution to the build-in solution for TimeMachine. To circumvent some annoyances, i fully configured the Timemachine share in the smb.conf template, but otherwise it works just great.

@yaravawiba PR https://github.com/openwrt/packages/pull/6859 should solve this hopefully.

@johnnysl If PR https://github.com/openwrt/packages/pull/6772 gets merged, maybe you can report back if the luci/timemachine option also works out of the box, without needing a custom smb.conf template?

1 Like

Am trying to read the pullrequest, but it seems to miss adding fruit:aapl = yes to the global section (massive performance increase according to the man page), and i assume you only inject the remaining settings for the share that has the timemachine checkmark in Luci? Else all configured shares would show up as timemachine capable (messy).

Some other settings that i use differently personally:
Added fruit:time machine max size = 500G (Else it will keep filling up the drive until it is out of space before removing old backups.) i guess you’ll want that to be configurable from Luci.
And i don’t change the encoding, metadata or veto options, as i simply rely on the defaults. For me this works, don’t understand the solution well enough to see why your settings would really be better.

@Andy2244
To my knowledege it's a race condition where libbsd simply happens to be available when Samba is being built.

@johnnysl fruit:aapl = yes is the default, so no need to add this manually. Will try to add the max size as luci field, thanks for the tip.

The ad-dc support is interesting to me.
Does it require changing DNS to bind or will it work with the default installation packages?

Why the share is not present in the network page of windows? I can manually access it with \192.168...

To-be honest, i just made sure all required components are build for it (samba daemon, ldap support, python + samba-tool) and pre-setup the krb5 bin location. So the AD-DC setup is not supported by luci-ui and you will need to setup this manually via krb5 and samba.conf.template. I probably should rename it to "untested" instead of "experimental".
If you want to give it a try feel free to report back, what is missing, not working and i can try add the components or adapt the startup scripts. Especially the whole krb5 realm setup and running the AD-DC with fileserver support seemed complicated. I added links to the related samba wiki, which have instructions to-do the whole setup.
https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller

What windows version? If its 8/10 make sure the wsdd2 package is installed and running.
You can also use testparm on the router and see if there are config errors, since wsdd2 uses this too to parse your shares.

i use win 10

If wsdd2 is running on the router, did you also follow the guide under Problems regarding the two windows services that need to-be running, they should be enabled by default, maybe you disabled them or some tool did? https://github.com/Andy2244/openwrt-extra#problems

If all is running and still no luck, paste the output of testparm here, maybe i can spot a problem.

i think i don't have the wsdd2 package... i read that for win10 we didn't need netbios additional package so what does wsdd2 is for?

Thats strange wsdd2 is normally auto selected if you select the samba4-server package and yes since Win10 ditched netbios for workgroups/explorer view, wsdd2 aka "windows service discovery" is what replaces it and thats the wsdd2 daemon on the router side and the two services on the windows side.

Just check luci/startup if you can find wsdd2 and if not install it, its a official package for snapshots.

We need this extra package, since samba4 only supports avahi/mdns otherwise, which windows 10 still don't fully and samba4 has no plans supporting wsd, so we need this extra daemon atm for windows 8/10 client discovery.

PS: Ah and try disable the windows firewall, again normally wsd traffic has a entry in the firewall, but this could be still disabled/removed by tools.