summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity
diff options
context:
space:
mode:
authorJoe Slater <jslater@windriver.com>2017-11-08 11:58:05 -0800
committerJoe MacDonald <joe_macdonald@mentor.com>2018-01-08 12:02:52 -0500
commit286eaa380fa8dce0f2b44f2b82ff7efcb3faf2d5 (patch)
tree6f7c088c2c7ab660611a0d405a66cd4e7f259b2c /meta-networking/recipes-connectivity
parent35080118f88e75f69ae9a0b0e497bcf743b158af (diff)
downloadmeta-openembedded-286eaa380fa8dce0f2b44f2b82ff7efcb3faf2d5.tar.gz
samba: move to version 4.7.0
ad-dc code is built and krb5 is used. If booting using systemd, 'nmb' and 'smb' are started. 'samba' is not. Signed-off-by: Joe Slater <jslater@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-connectivity')
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch19
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch25
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch19
-rw-r--r--meta-networking/recipes-connectivity/samba/samba_4.7.0.bb (renamed from meta-networking/recipes-connectivity/samba/samba_4.6.7.bb)67
4 files changed, 117 insertions, 13 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
new file mode 100644
index 000000000..0c7592f8e
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
@@ -0,0 +1,19 @@
1samba: build dnsserver_common code
2
3Just 'install' does not seem to do it.
4
5Upstream-Status: Pending
6
7Signed-off-by: Joe Slater <joe.slater@windriver.com>
8
9--- a/source4/dns_server/wscript_build
10+++ b/source4/dns_server/wscript_build
11@@ -4,7 +4,7 @@ bld.SAMBA_LIBRARY('dnsserver_common',
12 source='dnsserver_common.c',
13 deps='samba-util samba-errors ldbsamba clidns',
14 private_library=True,
15- install=bld.AD_DC_BUILD_IS_ENABLED()
16+ enabled=bld.AD_DC_BUILD_IS_ENABLED()
17 )
18
19 bld.SAMBA_MODULE('service_dns',
diff --git a/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
new file mode 100644
index 000000000..5ae8c5978
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
@@ -0,0 +1,25 @@
1samba: defeat iconv test
2
3A test was added when configuring samba which requires target code
4to be executed. In general, this will not work, so we eliminate it.
5
6Upstream-Status: Pending
7
8Signed-off-by: Joe Slater <joe.slater@windriver.com>
9
10--- a/lib/util/charset/wscript_configure
11+++ b/lib/util/charset/wscript_configure
12@@ -17,6 +17,8 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'i
13
14 conf.DEFINE('HAVE_NATIVE_ICONV', 1)
15
16+"""
17+[added for 4.7.0, but breaks cross-compilation]
18 conf.CHECK_CODE('''
19 uint8_t inbuf[2] = { 0x30, 0xdf };
20 uint8_t outbuf[4] = { 0 };
21@@ -36,3 +38,4 @@ conf.CHECK_CODE('''
22 msg='Checking errno of iconv for illegal multibyte sequence',
23 lib='iconv',
24 headers='errno.h iconv.h')
25+"""
diff --git a/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch b/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
new file mode 100644
index 000000000..77c8b3626
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
@@ -0,0 +1,19 @@
1samba: correct log files location
2
3We use /var/log/samba.
4
5Upstream-Status: Pending
6
7Signed-off-by: Joe Slater <joe.slater@windriver.com>
8
9--- a/packaging/RHEL/setup/smb.conf
10+++ b/packaging/RHEL/setup/smb.conf
11@@ -63,7 +63,7 @@
12
13 # this tells Samba to use a separate log file for each machine
14 # that connects
15- log file = /usr/local/samba/var/log.%m
16+ log file = /var/log/samba/log.%m
17
18 # Put a capping on the size of the log files (in Kb).
19 max log size = 50
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb b/meta-networking/recipes-connectivity/samba/samba_4.7.0.bb
index 59d7425c8..f33c1384b 100644
--- a/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
+++ b/meta-networking/recipes-connectivity/samba/samba_4.7.0.bb
@@ -20,6 +20,9 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
20 file://0006-avoid-using-colon-in-the-checking-msg.patch \ 20 file://0006-avoid-using-colon-in-the-checking-msg.patch \
21 file://netdb_defines.patch \ 21 file://netdb_defines.patch \
22 file://glibc_only.patch \ 22 file://glibc_only.patch \
23 file://iconv-4.7.0.patch \
24 file://dnsserver-4.7.0.patch \
25 file://smb_conf-4.7.0.patch \
23 file://volatiles.03_samba \ 26 file://volatiles.03_samba \
24 " 27 "
25SRC_URI_append_libc-musl = " \ 28SRC_URI_append_libc-musl = " \
@@ -27,14 +30,20 @@ SRC_URI_append_libc-musl = " \
27 file://samba-4.3.9-remove-getpwent_r.patch \ 30 file://samba-4.3.9-remove-getpwent_r.patch \
28 " 31 "
29 32
30SRC_URI[md5sum] = "c6ee5c766016d59908c8fb672fbbd445" 33SRC_URI[md5sum] = "cf5eaf34f510e3d5643c0dcfd49fcc40"
31SRC_URI[sha256sum] = "9ef24393de08390f236cabccd6a420b5cea304e959cbf1a99ff317325db3ddfa" 34SRC_URI[sha256sum] = "bd16d169988eb513e685a87e9964a5210482498fa9b3a22aaa8287a061e3c936"
35
36#SRC_URI[md5sum] = "c6ee5c766016d59908c8fb672fbbd445"
37#SRC_URI[sha256sum] = "9ef24393de08390f236cabccd6a420b5cea304e959cbf1a99ff317325db3ddfa"
32 38
33inherit systemd waf-samba cpan-base perlnative update-rc.d 39inherit systemd waf-samba cpan-base perlnative update-rc.d
34# remove default added RDEPENDS on perl 40# remove default added RDEPENDS on perl
35RDEPENDS_${PN}_remove = "perl" 41RDEPENDS_${PN}_remove = "perl"
36 42
37DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam" 43#DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libbsd libaio libpam"
44DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libbsd libaio libpam"
45DEPENDS += "libldb"
46
38DEPENDS_append_libc-musl = " libtirpc" 47DEPENDS_append_libc-musl = " libtirpc"
39CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" 48CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
40LDFLAGS_append_libc-musl = " -ltirpc" 49LDFLAGS_append_libc-musl = " -ltirpc"
@@ -45,12 +54,20 @@ LSB_linuxstdbase = "lsb"
45INITSCRIPT_NAME = "samba" 54INITSCRIPT_NAME = "samba"
46INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ." 55INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
47 56
48SYSTEMD_PACKAGES = "${PN}-base winbind" 57SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind"
49SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service" 58SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service"
59SYSTEMD_SERVICE_${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
50SYSTEMD_SERVICE_winbind = "winbind.service" 60SYSTEMD_SERVICE_winbind = "winbind.service"
51 61
62# There are prerequisite settings to enable ad-dc, so disable the service by default.
63# Reference:
64# https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
65SYSTEMD_AUTO_ENABLE_${PN}-ad-dc = "disable"
66
67# Use krb5. Build active domain controller.
68#
52PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \ 69PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
53 acl cups ldap \ 70 acl ad-dc cups gnutls ldap mitkrb5 \
54" 71"
55 72
56RDEPENDS_${PN}-base += "${LSB}" 73RDEPENDS_${PN}-base += "${LSB}"
@@ -68,13 +85,30 @@ PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
68PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust" 85PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
69PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive" 86PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
70 87
88# Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS,
89# And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to:
90# http://samba.2283325.n4.nabble.com/samba-4-6-6-Unknown-dependency-kdc-in-service-kdc-objlist-td4722096.html
91# So the working combination is:
92# 1) ad-dc: enable, gnutls: enable, mitkrb5: disable
93# 2) ad-dc: disable, gnutls: enable/disable, mitkrb5: enable
94#
95# We are now at 4.7.0, so take the above with a grain of salt. We do not need to know where
96# krb5kdc is unless ad-dc is enabled, but we tell configure anyhow.
97#
98PACKAGECONFIG[ad-dc] = ",--without-ad-dc,,"
99PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
100PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
71 101
72SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2" 102SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
73SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4" 103SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
74SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4" 104SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
75SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}" 105SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
76 106
77SAMBA4_LIBS="heimdal,!zlib,!popt,!talloc,!pytalloc,!pytalloc-util,!tevent,!pytevent,!tdb,!pytdb,!ldb,!pyldb" 107# These libraries are supposed to replace others supplied by packages, but decorate the names of
108# .so files so there will not be a conflict. This is not done consistantly, so be very careful
109# when adding to this list.
110#
111SAMBA4_LIBS="heimdal,cmocka,NONE"
78 112
79EXTRA_OECONF += "--enable-fhs \ 113EXTRA_OECONF += "--enable-fhs \
80 --with-piddir=/run \ 114 --with-piddir=/run \
@@ -82,12 +116,9 @@ EXTRA_OECONF += "--enable-fhs \
82 --with-modulesdir=${libdir}/samba \ 116 --with-modulesdir=${libdir}/samba \
83 --with-lockdir=${localstatedir}/lib/samba \ 117 --with-lockdir=${localstatedir}/lib/samba \
84 --with-cachedir=${localstatedir}/lib/samba \ 118 --with-cachedir=${localstatedir}/lib/samba \
85 --disable-gnutls \
86 --disable-rpath-install \ 119 --disable-rpath-install \
87 --with-shared-modules=${SAMBA4_MODULES} \ 120 --with-shared-modules=${SAMBA4_MODULES} \
88 --bundled-libraries=${SAMBA4_LIBS} \ 121 --bundled-libraries=${SAMBA4_LIBS} \
89 --with-system-mitkrb5 \
90 --without-ad-dc \
91 ${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \ 122 ${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
92 --with-cluster-support \ 123 --with-cluster-support \
93 --with-profiling-data \ 124 --with-profiling-data \
@@ -113,6 +144,10 @@ do_install_append() {
113 -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \ 144 -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
114 -i ${D}${systemd_system_unitdir}/*.service 145 -i ${D}${systemd_system_unitdir}/*.service
115 146
147 if [ "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'yes', 'no', d)}" = "no" ]; then
148 rm -f ${D}${systemd_system_unitdir}/samba.service
149 fi
150
116 install -d ${D}${sysconfdir}/tmpfiles.d 151 install -d ${D}${sysconfdir}/tmpfiles.d
117 install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf 152 install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
118 echo "d ${localstatedir}/log/samba 0755 root root -" \ 153 echo "d ${localstatedir}/log/samba 0755 root root -" \
@@ -133,7 +168,7 @@ do_install_append() {
133 168
134 install -d ${D}${sysconfdir}/samba 169 install -d ${D}${sysconfdir}/samba
135 echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts 170 echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
136 install -m644 packaging/LSB/smb.conf ${D}${sysconfdir}/samba/smb.conf 171 install -m644 packaging/RHEL/setup/smb.conf ${D}${sysconfdir}/samba/smb.conf
137 install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba 172 install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
138 173
139 install -d ${D}${sysconfdir}/default 174 install -d ${D}${sysconfdir}/default
@@ -161,7 +196,7 @@ do_install_append() {
161PACKAGES =+ "${PN}-python ${PN}-pidl \ 196PACKAGES =+ "${PN}-python ${PN}-pidl \
162 ${PN}-dsdb-modules ${PN}-testsuite registry-tools \ 197 ${PN}-dsdb-modules ${PN}-testsuite registry-tools \
163 winbind \ 198 winbind \
164 ${PN}-common ${PN}-base ${PN}-ctdb-tests \ 199 ${PN}-common ${PN}-base ${PN}-ad-dc ${PN}-ctdb-tests \
165 smbclient" 200 smbclient"
166 201
167python samba_populate_packages() { 202python samba_populate_packages() {
@@ -186,7 +221,8 @@ python samba_populate_packages() {
186 221
187PACKAGESPLITFUNCS_prepend = "samba_populate_packages " 222PACKAGESPLITFUNCS_prepend = "samba_populate_packages "
188 223
189RDEPENDS_${PN} += "${PN}-base" 224RDEPENDS_${PN} += "${PN}-base ${PN}-python ${PN}-dsdb-modules"
225RDEPENDS_${PN}-python += "pytalloc python-tdb"
190 226
191FILES_${PN}-base = "${sbindir}/nmbd \ 227FILES_${PN}-base = "${sbindir}/nmbd \
192 ${sbindir}/smbd \ 228 ${sbindir}/smbd \
@@ -195,9 +231,14 @@ FILES_${PN}-base = "${sbindir}/nmbd \
195 ${localstatedir}/nmbd \ 231 ${localstatedir}/nmbd \
196 ${localstatedir}/spool/samba \ 232 ${localstatedir}/spool/samba \
197 ${systemd_system_unitdir}/nmb.service \ 233 ${systemd_system_unitdir}/nmb.service \
198 ${systemd_system_unitdir}/samba.service \
199 ${systemd_system_unitdir}/smb.service" 234 ${systemd_system_unitdir}/smb.service"
200 235
236FILES_${PN}-ad-dc = "${sbindir}/samba \
237 ${systemd_system_unitdir}/samba.service \
238 ${libdir}/krb5/plugins/kdb/samba.so \
239 "
240RDEPENDS_${PN}-ad-dc = "krb5-kdc"
241
201FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \ 242FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
202 ${bindir}/ctdb_run_cluster_tests \ 243 ${bindir}/ctdb_run_cluster_tests \
203 ${sysconfdir}/ctdb/nodes \ 244 ${sysconfdir}/ctdb/nodes \