tobiaswaldvogel / openwrt-addpack

Additional packages for OpenWRT, mainly NAS devices
70 stars 61 forks source link

SAMBA4 for OpenWRT Trunk? #6

Open qnology opened 9 years ago

qnology commented 9 years ago

Hello,

I'm wondering if SAMBA4 will compile under OpenWRT Trunk?

Also wanted to ask if you're willing to volunteer to maintain it so that we can get it added to the official OpenWRT build? https://forum.openwrt.org/viewtopic.php?id=52219

Thanks

Qnology

qnology commented 9 years ago

FYI - krb5-mit-client-libs/Makefile needs updating.

It's trying and failing to download from http://web.mit.edu/kerberos/dist/krb5/1.12.1/

The correct location is: http://web.mit.edu/kerberos/dist/krb5/1.12/krb5-1.12.1-signed.tar

[code] mkdir -p /home/','/ppv4/trunk/dl /home/','/ppv4/trunk/scripts/download.pl "/home/','/ppv4/trunk/dl" "krb5-1.12.1- signed.tar" "" "http://web.mit.edu/kerberos/dist/krb5/1.12.1/" --2015-02-04 21:46:52-- http://web.mit.edu/kerberos/dist/krb5/1.12.1/krb5-1.12. 1-signed.tar Resolving web.mit.edu (web.mit.edu)... 172.230.242.131 Connecting to web.mit.edu (web.mit.edu)|172.230.242.131|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2015-02-04 21:46:53 ERROR 404: Not Found.

Download failed. --2015-02-04 21:46:53-- http://mirror2.openwrt.org/sources/krb5-1.12.1-signed.t ar Resolving mirror2.openwrt.org (mirror2.openwrt.org)... 46.4.11.11 Connecting to mirror2.openwrt.org (mirror2.openwrt.org)|46.4.11.11|:80... connec ted. HTTP request sent, awaiting response... 404 Not Found 2015-02-04 21:46:53 ERROR 404: Not Found. [/code]

qnology commented 9 years ago

Can't get past this error. Any help is appreciated.

make[5]: Entering directory /home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3' Making all in src make[6]: Entering directory/home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3/src' /bin/bash ../libtool --tag=CC --mode=compile arm-openwrt-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I.. -I../tirpc -DPORTMAP -DINET 6 -DVERSION="\"0.2.3\"" -D_GNU_SOURCE -Wall -pipe -I/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/usr/inclu de -I/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/include -I/home/','/ppv4/trunk/staging_dir/toolchain-arm_xs cale_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/','/ppv4/trunk/staging_dir/toolchain-arm_xscale_gcc-4.8-linaro_uClibc-0.9.3 3.2_eabi/include -DHAVE_RPCSEC_GSS -I/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/usr/include/gssglue -Os - pipe -march=armv5te -mtune=xscale -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -MT libtirpc_la- getrpcent.lo -MD -MP -MF .deps/libtirpc_la-getrpcent.Tpo -c -o libtirpc_la-getrpcent.lo test -f 'getrpcent.c' || echo './'getrpcent.c OpenWrt-libtool: compile: arm-openwrt-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I.. -I../tirpc -DPORTMAP -DINET6 -DVERSION=\"0.2.3\" -D_GNU_SOURCE -Wall -pipe -I/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/usr/include -I/home/','/ppv4/trunk/ staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/include -I/home/','/ppv4/trunk/staging_dir/toolchain-arm_xscale_gcc-4.8-linaro_uClibc -0.9.33.2_eabi/usr/include -I/home/','/ppv4/trunk/staging_dir/toolchain-arm_xscale_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include -DHAVE_RP CSEC_GSS -I/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/usr/include/gssglue -Os -pipe -march=armv5te -mtune=x scale -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=soft -MT libtirpc_la-getrpcent.lo -MD -MP -MF .dep s/libtirpc_la-getrpcent.Tpo -c getrpcent.c -fPIC -DPIC -o .libs/libtirpc_la-getrpcent.o getrpcent.c:61:16: error: field 'rpc' has incomplete type struct rpcent rpc; ^ getrpcent.c: In function 'interpret': getrpcent.c:311:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[6]: * [libtirpc_la-getrpcent.lo] Error 1 make[6]: Leaving directory `/home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3/src' make[5]: * [all-recursive] Error 1 make[5]: Leaving directory/home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3' make[4]: **\* [all] Error 2 make[4]: Leaving directory/home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3' make[3]: [/home/','/ppv4/trunk/build_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/libtirpc-0.2.3/.built] Error 2 make[3]: Leaving directory`/home/','/ppv4/trunk/feeds/samba4/libtirpc' make[2]: \ [package/feeds/samba4/libtirpc/compile] Error 2 make[2]: Leaving directory /home/','/ppv4/trunk' make[1]: *** [/home/','/ppv4/trunk/staging_dir/target-arm_xscale_uClibc-0.9.33.2_eabi/stamp/.package_compile] Error 2 make[1]: Leaving directory/home/','/ppv4/trunk'

maartenjd commented 9 years ago

I am experiencing the same problem "getrpcent.c:61:16: error: field 'rpc' has incomplete type", using uClibc..

In the SAMBA4-Makefile I see this line in the "define Package/samba4-server"-section: DEPENDS:=+USE_EGLIBC:librt +libpopt +libuuid +libopenldap-sasl +krb5-mit-libs +krb5-mit-client +libiconv +libacl +libreadline +libaio +libtirpc +wsdd

Elsewhere on the internet I find this issue: "https://github.com/maximeh/buildroot/blob/master/package/libtirpc/libtirpc-0002-uClibc-without-RPC-support-does-not-install-rpcent.h.patch".

https://dev.openwrt.org/browser/packages/devel/dmalloc/Makefile : Last change on this file was 44702, checked in by blogic, 6 weeks ago. global: change all instances of USE_EGLIBC to USE_GLIBC

And lots of other posts about uClibc and eglibc not supporting/defining certain functions. So either a good patch is needed, or a switch to the full glibc, with bigger space requirements. I hope this brings us closer to a solution.

leonghui commented 9 years ago

I managed to compile libtirpc by bumping the version to 0.3.1 in makefile and replacing the patches with those from buildroot. Issues with uClibc were fixed in the newer versions.

I also managed to compile the samba4 package by disabling krb5, ldap and ads as stated here . Performance is slightly better with SMB3 and Windows 8.1 client but smbd crashes if aio is enabled in smb.conf.

Let me know if a pull request is preferable.

wongsyrone commented 9 years ago

@leonghui maybe you should add aio support in kernel configuration, BTW, can you push your changes to github?

leonghui commented 9 years ago

@wongsyrone done, see https://github.com/tobiaswaldvogel/openwrt-addpack/pull/10

wongsyrone commented 9 years ago

@leonghui thx, I will try

wongsyrone commented 9 years ago

@leonghui
hi, I managed to enable aio support, you need enable KERNEL_AIO when compiling your kernel, I changed default setting to enable AIO for ARM, what I changed like:

--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -146,7 +146,7 @@ config KERNEL_KPROBE_EVENT

 config KERNEL_AIO
    bool "Compile the kernel with asynchronous IO support"
-   default n
+   default y if TARGET_arm

 config KERNEL_DIRECT_IO
    bool "Compile the kernel with direct IO support"
maartenjd commented 9 years ago

@leonghui : Thanks. I used your fork to compile samba4 for my netgear WNDR3700 and it worked, using musl in stead of ulibc.I will try your suggestion for AIO as well.

leonghui commented 9 years ago

@wongsyrone I disabled AIO because file transfer was slower with it on my RT-N56U. Perhaps I can add it back as a config option in makefile.

xuefer commented 9 years ago

actually the current dependency sucks under trunk trunk has a script to check built binary have all necessary dependency (other .so it depends on)

mormts commented 9 years ago

ubuntu-2015-09-08-20-49-04

I really don't have the file directory But the host has python_config inside I try to [ln -s] ... OK Could not find the python development headers I try to [apt - get the install python - dev] The results still won't do.

boypt commented 9 years ago

I remove some dependencies and have samba4 compile and run as a file server, works good. If u also just need samba4 as a better performance file server, try this Makefile:

4f103148f54b5563ae47f474123e26b8516db40d

https://github.com/pentie/openwrt-addpack/commit/4f103148f54b5563ae47f474123e26b8516db40d

wongsyrone commented 9 years ago

HI everyone, I managed to compile samba 4.3.0 for openwrt trunk with some hacks, but OpenWrt's buildsystem complains about missing dependencies when packing ipk file. Can someone help to look into it?

the main commit: https://github.com/wongsyrone/openwrt-1/commit/21f479d7aad14354c9a0ac7c977f4a37215e21c8 related issue with some important info: https://github.com/wongsyrone/openwrt-1/issues/73

Also, here goes samba 4.0.26, works well on trunk: https://github.com/wongsyrone/openwrt-1/tree/master/package/external/samba40related

UPDATE: samba 4.3 builds successfully but the ipk is too big to fit embedded system's need.

hbl0307106015 commented 8 years ago

Hi all, I am also porting samba-4.4.0 to OpenWRT, Now I meet the below issue: @qnology @wongsyrone

make[3]: Entering directory /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0' WAF_MAKE=1 python ./buildtools/bin/waf build Waf: Entering directory/mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/bin' Selected embedded Heimdal build [ 232/3514] Compiling IDL librpc/idl/atsvc.idl /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/librpc/idl/atsvc.idl:7:8: error: expected '=', ',', ';', 'asm' or 'attribute' before string constant import "misc.idl"; ^ /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/librpc/idl/atsvc.idl:9:1: error: expected identifier or '(' before '[' token [ uuid("1ff70682-0a51-30e8-076d-740be8cee98b"), ^ Failed to parse /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/librpc/idl/atsvc.idl at /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/pidl/pidl line 610. Waf: Leaving directory /mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/bin' Build failed: -> task failed (err #1): {task: PIDL_ATSVC atsvc.idl,CUtil.pm,Compat.pm,Dump.pm,Expr.pm,IDL.pm,NDR.pm,ODL.pm,ClientNDR.pm,ServerNDR.pm,Template.pm,Header.pm,Proxy.pm,Stub.pm,Header.pm,Client.pm,Parser.pm,Server.pm,Python.pm,TDR.pm,Template.pm,Samba4.pm,Typelist.pm,Util.pm,Conformance.pm,NDR.pm,Pidl.pm,Driver.pm -> atsvc.h,ndr_atsvc.c,ndr_atsvc.h,srv_atsvc.c,srv_atsvc.h,ndr_atsvc_s.c,ndr_atsvc_c.c,ndr_atsvc_c.h,py_atsvc.c} make[3]: *** [all] Error 1 make[3]: Leaving directory/mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0' make[2]: * [/mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/build_dir/target-mipsel_1004kc+dsp_uClibc-1.0.12/samba-4.4.0/.built] Error 2 make[2]: Leaving directory `/mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184/package/network/services/samba4' make[1]: * [package/network/services/samba4/compile] Error 2 make[1]: Leaving directory`/mnt/sdb/home/tymon/openwrt/svn/pandorabox/14.09/mtk/aps-r2184' make: *\ [package/network/services/samba4/compile] Error 2

wongsyrone commented 8 years ago

Anyone who wants to compile samba 4.4 can refer to https://github.com/wongsyrone/openwrt-1/issues/73 and the discussion https://github.com/wongsyrone/openwrt-1/issues/85.

This works on ARM/mvebu WRT1900ac v1 and other similar devices.

try using external compile_et and asn1_compile, both of them are located in heimdal.