Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAMBA4 for OpenWRT Trunk? #6

Open
qnology opened this issue Feb 6, 2015 · 16 comments
Open

SAMBA4 for OpenWRT Trunk? #6

qnology opened this issue Feb 6, 2015 · 16 comments

Comments

@qnology
Copy link

qnology commented Feb 6, 2015

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
Copy link
Author

qnology commented Feb 6, 2015

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
Copy link
Author

qnology commented Feb 6, 2015

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
Copy link

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
Copy link

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
Copy link

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

@leonghui
Copy link

@wongsyrone done, see #10

@wongsyrone
Copy link

@leonghui thx, I will try

@wongsyrone
Copy link

@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
Copy link

@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
Copy link

leonghui commented Jul 9, 2015

@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
Copy link

xuefer commented Aug 9, 2015

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
Copy link

mormts commented Sep 8, 2015

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
Copy link

boypt commented Oct 4, 2015

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:

4f10314

boypt@4f10314

@wongsyrone
Copy link

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: wongsyrone/openwrt-1@21f479d
related issue with some important info: wongsyrone/openwrt-1#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
Copy link

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
Copy link

Anyone who wants to compile samba 4.4 can refer to wongsyrone/openwrt-1#73 and the discussion wongsyrone/openwrt-1#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants