-
Notifications
You must be signed in to change notification settings - Fork 3.8k
libteam: new package #28045
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
base: master
Are you sure you want to change the base?
libteam: new package #28045
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=libteam | ||
| PKG_VERSION:=1.32 | ||
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
| PKG_SOURCE_URL:=https://codeload.github.com/jpirko/libteam/tar.gz/refs/tags/v$(PKG_VERSION)? | ||
| PKG_HASH:=7ad90555db8aecdcaf002f543d330408501600edf7065e0ca398fce9b1e64820 | ||
|
|
||
| PKG_FIXUP:=autoreconf | ||
| PKG_INSTALL:=1 | ||
| PKG_BUILD_PARALLEL:=1 | ||
| PKG_BUILD_FLAGS:=lto | ||
|
|
||
| PKG_MAINTAINER:=Qingfang Deng <[email protected]> | ||
| PKG_LICENSE:=LGPL-2.1-only | ||
| PKG_LICENSE_FILES:=COPYING | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
|
|
||
| CONFIGURE_ARGS+=--disable-static | ||
|
|
||
| define Package/libteam/default | ||
| SECTION:=libs | ||
| CATEGORY:=Libraries | ||
| URL:=https://github.com/jpirko/libteam | ||
| endef | ||
|
|
||
| define Package/libteam | ||
| $(Package/libteam/default) | ||
| TITLE:=Team common library | ||
| DEPENDS:=+kmod-team +libnl-cli | ||
| ABI_VERSION:=5 | ||
LGA1150 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| endef | ||
|
|
||
| define Package/libteam/description | ||
| Libteam lib is a userspace wrapper of Team Netlink communication. | ||
| endef | ||
|
|
||
| define Package/libteamdctl | ||
| $(Package/libteam/default) | ||
| TITLE:=Team daemon control library | ||
| ABI_VERSION:=0 | ||
| endef | ||
|
|
||
| define Package/libteamdctl/description | ||
| Common library for teamdctl. | ||
| endef | ||
|
|
||
| define Package/teamd/default | ||
| SECTION:=net | ||
| CATEGORY:=Network | ||
| URL:=https://github.com/jpirko/libteam | ||
| endef | ||
|
|
||
| define Package/teamd | ||
| $(Package/teamd/default) | ||
| TITLE:=Team daemon | ||
| DEPENDS:=+libteam +libdaemon +jansson | ||
| endef | ||
|
|
||
| define Package/teamd/description | ||
| teamd is a daemon to control a given team network device, during runtime, | ||
| as a puppeteer controls a puppet. It uses libteam to communicate with the | ||
| kernel team device instance via Netlink sockets. The behaviour depends on | ||
| the selected runner and its configuration. | ||
| endef | ||
|
|
||
| define Package/teamdctl | ||
| $(Package/teamd/default) | ||
| TITLE:=Team daemon control tool | ||
| DEPENDS:=+teamd +libteamdctl | ||
| endef | ||
|
|
||
| define Package/teamdctl/description | ||
| teamdctl is a tool that allows a user to interact with a running teamd instance. | ||
| endef | ||
|
|
||
| define Package/teamnl | ||
| $(Package/teamd/default) | ||
| TITLE:=Team Netlink interface tool | ||
| DEPENDS:=+libteam | ||
| endef | ||
|
|
||
| define Package/teamnl/description | ||
| teamnl is a tool enabling interaction with a team device via the team driver | ||
| Netlink interface. This tools serves mainly for debugging purposes. Note that | ||
| it makes no sense to use this tool to change options on team device controlled | ||
| by a teamd instance. | ||
| endef | ||
|
|
||
| define Build/InstallDev | ||
| $(INSTALL_DIR) $(1)/usr | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr | ||
| endef | ||
|
|
||
| define Package/libteam/install | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libteam.so.$(ABI_VERSION)* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| define Package/libteamdctl/install | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libteamdctl.so.$(ABI_VERSION)* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| define Package/teamd/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamd $(1)/usr/bin/ | ||
| endef | ||
|
|
||
| define Package/teamdctl/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamdctl $(1)/usr/bin/ | ||
| endef | ||
|
|
||
| define Package/teamnl/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/teamnl $(1)/usr/bin/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,libteam)) | ||
| $(eval $(call BuildPackage,libteamdctl)) | ||
| $(eval $(call BuildPackage,teamd)) | ||
| $(eval $(call BuildPackage,teamdctl)) | ||
| $(eval $(call BuildPackage,teamnl)) | ||
|
Comment on lines
+124
to
+128
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You added 5 packages, but in the commit description and in the commit itself, you mentioned only one. Please try to describe a little bit more in your commit why do we need to have 5 packages, what is the size, etc. I think (maybe...) you splitted it into so many packages and it is not necessary.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From Project Wiki and HOWTO
apk size on cortex-a53: Then I noticed all uncompressed ELF sizes (not just libteam, but other packages also) are multiple of 64KiB. Is that normal?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there has been a misunderstanding here. I was asking why we actually need 5 different packages, because when I look at https://repology.org/, I only see the libteam package there, not the others. For example, in Debian, some of these tools are packaged as libteam-utils, while elsewhere they appear as libteam-tools. I would prefer not to reinvent the wheel here; I think we should follow what is done in other GNU/Linux distributions so we don't fragment it further or create something non-standard. :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debian is a desktop distro, while OpenWrt is not. We have size constraints. teamd and teamnl are mutually exclusive, so I think it's better to split them. ALT Linux does that too.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these two are mutually exclusive, they should be marked as such either through |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| From 4eb54a811bef43da2be9cc84009567e5d6ca9741 Mon Sep 17 00:00:00 2001 | ||
| From: Khem Raj <[email protected]> | ||
| Date: Sat, 11 May 2024 23:15:59 -0700 | ||
| Subject: [PATCH] teamd: Pass correct parameter type to accept API | ||
|
|
||
| accept() expects sockaddr as second parameter | ||
|
|
||
| int accept (int, struct sockaddr *__restrict, socklen_t *__restrict); | ||
|
|
||
| Fixes build with gcc-16 on musl systems | ||
| | ../../git/teamd/teamd_usock.c: In function 'callback_usock': | ||
| | ../../git/teamd/teamd_usock.c:280:40: error: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types] | ||
| | 280 | sock = accept(ctx->usock.sock, &addr, &alen); | ||
| | | ^~~~~ | ||
| | | | | ||
| | | struct sockaddr_un * | ||
|
|
||
| Signed-off-by: Khem Raj <[email protected]> | ||
| Signed-off-by: Jiri Pirko <[email protected]> | ||
| --- | ||
| teamd/teamd_usock.c | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| --- a/teamd/teamd_usock.c | ||
| +++ b/teamd/teamd_usock.c | ||
| @@ -277,7 +277,7 @@ static int callback_usock(struct teamd_c | ||
| int err; | ||
|
|
||
| alen = sizeof(addr); | ||
| - sock = accept(ctx->usock.sock, &addr, &alen); | ||
| + sock = accept(ctx->usock.sock, (struct sockaddr *)&addr, &alen); | ||
| if (sock == -1) { | ||
| teamd_log_err("usock: Failed to accept connection."); | ||
| return -errno; |
Uh oh!
There was an error while loading. Please reload this page.