ksmbd-tools: update to 3.4.6
Switch to git tarball as the meson files did not get added to the official one. Backport busybox style binaries. Saves on size. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
2b84c2f09f
commit
de64b43e3c
5 changed files with 9279 additions and 190 deletions
|
@ -1,12 +1,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ksmbd-tools
|
||||
PKG_VERSION:=3.4.5
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/cifsd-team/ksmbd-tools/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=e22e5bef29ffa2670fc82c490ad4dc6eb00963b4f963dd1852c811b437c77ee1
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/cifsd-team/ksmbd-tools
|
||||
PKG_SOURCE_VERSION:=3.4.6
|
||||
PKG_MIRROR_HASH:=c78dace3320cf8a273738b8f3e67bed24c812695f2fab2fbaeae06ec8a15cb77
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
@ -17,9 +17,6 @@ include $(INCLUDE_DIR)/package.mk
|
|||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TAR_OPTIONS+= --strip-components 1
|
||||
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
define Package/ksmbd-tools/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
|
@ -50,27 +47,6 @@ define Package/ksmbd-server/config
|
|||
select PACKAGE_wsdd2
|
||||
endef
|
||||
|
||||
define Package/ksmbd-utils
|
||||
$(call Package/ksmbd-tools/Default)
|
||||
TITLE+= user management-util
|
||||
endef
|
||||
|
||||
define Package/ksmbd-utils/description
|
||||
installs: ksmbd.adduser (ksmbd.addshare)
|
||||
|
||||
Tool needed to create the ksmbdpwd.db, to manage per user share passwords.
|
||||
NOTE: Not needed for 'guest only' shares.
|
||||
endef
|
||||
|
||||
define Package/ksmbd-utils/config
|
||||
config KSMBD_UTILS_SHAREADD
|
||||
bool "Add ksmbd.addshare util"
|
||||
depends on PACKAGE_ksmbd-utils
|
||||
help
|
||||
Add the ksmbd.addshare tool, to directly manipulate the /etc/ksmbd/smb.conf.
|
||||
default n
|
||||
endef
|
||||
|
||||
define Package/ksmbd-avahi-service
|
||||
$(call Package/ksmbd-tools/Default)
|
||||
TITLE+= (Avahi service)
|
||||
|
@ -98,23 +74,19 @@ TARGET_CFLAGS += -ffunction-sections -fdata-sections
|
|||
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
|
||||
|
||||
define Package/ksmbd-server/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/ksmbd.tools $(1)/usr/libexec/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.mountd $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.addshare $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.adduser $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.control $(1)/usr/sbin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.mountd $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/ksmbd $(1)/etc/init.d
|
||||
$(INSTALL_CONF) ./files/ksmbd.config $(1)/etc/config/ksmbd
|
||||
$(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/ksmbd/
|
||||
$(INSTALL_BIN) ./files/ksmbd.init $(1)/etc/init.d/ksmbd
|
||||
# copy examples until we have a wiki page
|
||||
$(INSTALL_DATA) ./files/ksmbd.config.example $(1)/etc/ksmbd/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/Documentation/configuration.txt $(1)/etc/ksmbd/
|
||||
endef
|
||||
|
||||
define Package/ksmbd-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.adduser $(1)/usr/sbin/
|
||||
ifeq ($(CONFIG_KSMBD_UTILS_SHAREADD),y)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.addshare $(1)/usr/sbin/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/ksmbd-avahi-service/install
|
||||
|
@ -139,6 +111,5 @@ define Package/ksmbd-avahi-service/conffiles
|
|||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ksmbd-server))
|
||||
$(eval $(call BuildPackage,ksmbd-utils))
|
||||
$(eval $(call BuildPackage,ksmbd-avahi-service))
|
||||
$(eval $(call BuildPackage,ksmbd-hotplug))
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
From dc80281ba0d325e71ff6cd2c1d7d525c889b3996 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 2 Jan 2021 21:05:53 -0800
|
||||
Subject: [PATCH] add meson build
|
||||
|
||||
meson compiles faster and is simpler than autotools.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
addshare/meson.build | 11 +++++++++++
|
||||
adduser/meson.build | 13 +++++++++++++
|
||||
control/meson.build | 9 +++++++++
|
||||
lib/meson.build | 18 ++++++++++++++++++
|
||||
meson.build | 33 +++++++++++++++++++++++++++++++++
|
||||
meson_options.txt | 4 ++++
|
||||
mountd/meson.build | 17 +++++++++++++++++
|
||||
7 files changed, 105 insertions(+)
|
||||
create mode 100644 addshare/meson.build
|
||||
create mode 100644 adduser/meson.build
|
||||
create mode 100644 control/meson.build
|
||||
create mode 100644 lib/meson.build
|
||||
create mode 100644 meson.build
|
||||
create mode 100644 meson_options.txt
|
||||
create mode 100644 mountd/meson.build
|
||||
|
||||
--- /dev/null
|
||||
+++ b/addshare/meson.build
|
||||
@@ -0,0 +1,11 @@
|
||||
+addshare = executable(
|
||||
+ 'ksmbd.addshare',
|
||||
+ 'share_admin.c',
|
||||
+ 'addshare.c',
|
||||
+ 'share_admin.h',
|
||||
+ dependencies: [glib_dep, netlink_dep],
|
||||
+ include_directories: tools_incdir,
|
||||
+ link_with: libksmbdtools,
|
||||
+ install: true,
|
||||
+ install_dir: get_option('sbindir'),
|
||||
+)
|
||||
--- /dev/null
|
||||
+++ b/adduser/meson.build
|
||||
@@ -0,0 +1,13 @@
|
||||
+adduser = executable(
|
||||
+ 'ksmbd.adduser',
|
||||
+ 'md4_hash.c',
|
||||
+ 'user_admin.c',
|
||||
+ 'adduser.c',
|
||||
+ 'md4_hash.h',
|
||||
+ 'user_admin.h',
|
||||
+ dependencies: [glib_dep, netlink_dep],
|
||||
+ include_directories: tools_incdir,
|
||||
+ link_with: libksmbdtools,
|
||||
+ install: true,
|
||||
+ install_dir: get_option('sbindir'),
|
||||
+)
|
||||
--- /dev/null
|
||||
+++ b/control/meson.build
|
||||
@@ -0,0 +1,9 @@
|
||||
+control = executable(
|
||||
+ 'ksmbd.control',
|
||||
+ 'control.c',
|
||||
+ dependencies: [glib_dep, netlink_dep],
|
||||
+ include_directories: tools_incdir,
|
||||
+ link_with: libksmbdtools,
|
||||
+ install: true,
|
||||
+ install_dir: get_option('sbindir'),
|
||||
+)
|
||||
--- /dev/null
|
||||
+++ b/lib/meson.build
|
||||
@@ -0,0 +1,18 @@
|
||||
+core_files = [
|
||||
+ 'management/tree_conn.c',
|
||||
+ 'management/user.c',
|
||||
+ 'management/share.c',
|
||||
+ 'management/session.c',
|
||||
+ 'config_parser.c',
|
||||
+ 'ksmbdtools.c',
|
||||
+]
|
||||
+
|
||||
+if krb5_dep.found()
|
||||
+ core_files += [
|
||||
+ 'management/spnego.c',
|
||||
+ 'asn1.c',
|
||||
+ 'management/spnego_krb5.c',
|
||||
+ ]
|
||||
+endif
|
||||
+
|
||||
+libksmbdtools = static_library('ksmbdtools', core_files, include_directories: tools_incdir, dependencies: [glib_dep, krb5_dep])
|
||||
--- /dev/null
|
||||
+++ b/meson.build
|
||||
@@ -0,0 +1,33 @@
|
||||
+project('ksmbsd-tools', 'c',
|
||||
+ version: run_command(find_program('awk'), '''/define KSMBD_TOOLS_VERSION / \
|
||||
+ { gsub(/"/,"",$3); printf "%s", $3 }''', 'include/version.h', check: true).stdout(),
|
||||
+ default_options: 'c_std=gnu99')
|
||||
+
|
||||
+tools_incdir = include_directories(['include', '.'])
|
||||
+
|
||||
+glib_dep = dependency('glib-2.0', static: true)
|
||||
+netlink_dep = dependency('libnl-genl-3.0')
|
||||
+krb5_dep = dependency('krb5', required: get_option('krb5'))
|
||||
+
|
||||
+cc = meson.get_compiler('c')
|
||||
+
|
||||
+cdata = configuration_data()
|
||||
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
|
||||
+if krb5_dep.found()
|
||||
+ cdata.set('CONFIG_KRB5', krb5_dep.found())
|
||||
+ cdata.set('HAVE_KRB5_KEYBLOCK_KEYVALUE', cc.has_member('krb5_keyblock', 'keyvalue', prefix: '#include <krb5.h>'))
|
||||
+ cdata.set('HAVE_KRB5_AUTHENTICATOR_CLIENT', cc.has_member('krb5_authenticator', 'client', prefix: '#include <krb5.h>'))
|
||||
+ cdata.set('HAVE_KRB5_AUTH_CON_GETRECVSUBKEY', cc.has_function('krb5_auth_con_getrecvsubkey', dependencies: krb5_dep))
|
||||
+ cdata.set('HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER', cc.compiles('''#include <krb5.h>
|
||||
+ krb5_error_code krb5_auth_con_getauthenticator(krb5_context, krb5_auth_context, krb5_authenticator**);''', dependencies: krb5_dep))
|
||||
+endif
|
||||
+cfile = configure_file(
|
||||
+ output: 'config.h',
|
||||
+ configuration: cdata,
|
||||
+)
|
||||
+
|
||||
+subdir('lib')
|
||||
+subdir('addshare')
|
||||
+subdir('adduser')
|
||||
+subdir('control')
|
||||
+subdir('mountd')
|
||||
--- /dev/null
|
||||
+++ b/meson_options.txt
|
||||
@@ -0,0 +1,4 @@
|
||||
+option('krb5', type : 'feature',
|
||||
+ description : 'Build with Kerberos support',
|
||||
+ value : 'disabled',
|
||||
+)
|
||||
--- /dev/null
|
||||
+++ b/mountd/meson.build
|
||||
@@ -0,0 +1,17 @@
|
||||
+mountd = executable(
|
||||
+ 'ksmbd.mountd',
|
||||
+ 'worker.c',
|
||||
+ 'ipc.c',
|
||||
+ 'rpc.c',
|
||||
+ 'rpc_srvsvc.c',
|
||||
+ 'rpc_wkssvc.c',
|
||||
+ 'mountd.c',
|
||||
+ 'smbacl.c',
|
||||
+ 'rpc_samr.c',
|
||||
+ 'rpc_lsarpc.c',
|
||||
+ dependencies: [glib_dep, netlink_dep],
|
||||
+ include_directories: tools_incdir,
|
||||
+ link_with: libksmbdtools,
|
||||
+ install: true,
|
||||
+ install_dir: get_option('sbindir'),
|
||||
+)
|
69
net/ksmbd-tools/patches/010-muon.patch
Normal file
69
net/ksmbd-tools/patches/010-muon.patch
Normal file
|
@ -0,0 +1,69 @@
|
|||
From 3281f325c820a72057ea639e0d11ad68d5703b43 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Thu, 6 Oct 2022 18:07:01 -0700
|
||||
Subject: [PATCH] ksmbd-tools: run meson through muon analyze
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Mostly unused variable removals. Removed pointless [] in
|
||||
include_directories.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
Acked-by: Atte Heikkilä <atteh.mailbox@gmail.com>
|
||||
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
|
||||
---
|
||||
addshare/meson.build | 2 +-
|
||||
adduser/meson.build | 2 +-
|
||||
control/meson.build | 2 +-
|
||||
meson.build | 4 ++--
|
||||
mountd/meson.build | 2 +-
|
||||
5 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/addshare/meson.build
|
||||
+++ b/addshare/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-addshare = executable(
|
||||
+executable(
|
||||
'ksmbd.addshare',
|
||||
'share_admin.c',
|
||||
'addshare.c',
|
||||
--- a/adduser/meson.build
|
||||
+++ b/adduser/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-adduser = executable(
|
||||
+executable(
|
||||
'ksmbd.adduser',
|
||||
'md4_hash.c',
|
||||
'user_admin.c',
|
||||
--- a/control/meson.build
|
||||
+++ b/control/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-control = executable(
|
||||
+executable(
|
||||
'ksmbd.control',
|
||||
'control.c',
|
||||
dependencies: [
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -13,10 +13,10 @@ exec awk '/define KSMBD_TOOLS_VERSION /
|
||||
meson_version: '>= 0.51.0',
|
||||
)
|
||||
|
||||
-tools_incdir = include_directories([
|
||||
+tools_incdir = include_directories(
|
||||
'.',
|
||||
'include',
|
||||
-])
|
||||
+)
|
||||
|
||||
glib_dep = dependency(
|
||||
'glib-2.0',
|
||||
--- a/mountd/meson.build
|
||||
+++ b/mountd/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-mountd = executable(
|
||||
+executable(
|
||||
'ksmbd.mountd',
|
||||
'worker.c',
|
||||
'ipc.c',
|
9190
net/ksmbd-tools/patches/020-meson.patch
Normal file
9190
net/ksmbd-tools/patches/020-meson.patch
Normal file
File diff suppressed because it is too large
Load diff
10
net/ksmbd-tools/patches/030-glib.patch
Normal file
10
net/ksmbd-tools/patches/030-glib.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -21,6 +21,7 @@ include_dirs = include_directories(
|
||||
glib_dep = dependency(
|
||||
'glib-2.0',
|
||||
version: '>= 2.40',
|
||||
+ static: true,
|
||||
)
|
||||
libnl_dep = dependency(
|
||||
'libnl-genl-3.0',
|
Loading…
Reference in a new issue