Compare commits

...

9 Commits

Author SHA1 Message Date
Toon Caeyers
edc6f03121 Use amxb dev branch 2025-01-10 22:39:01 +01:00
Matthias Franck
0caaef5dd0 Merge branch 'dev_bump_libamxn' into 'mainline-3.2'
libamxb: bump to mainline-3.2_v0.1.0

See merge request prpl-foundation/prplos/feeds/feed_amx!6
2025-01-10 08:22:08 +00:00
Matthias Franck
28342711ad libamxb: bump to mainline-3.2_v0.1.0
Fixes issue on sometimes missing app:start events on ubus.

References: PPW-62, HOP-7528

Signed-off-by: Matthias Franck <matthias.franck@softathome.com>
2025-01-10 09:19:37 +01:00
Matthias FRANCK
6ea4756b34 libamxrt: include fixes for prplos-3.2
1266d7c ("Allow forcing components to run as root (PPW-185)", 2024-12-18)
a4aa414 ("baf: introduce the baf.yml file", 2024-12-19)
e1d06fd ("ci: use new gitlab-ci templates", 2024-12-19)
922620d ("baf: fix libcap-ng issues on various filesystems", 2024-12-20)

Signed-off-by: Matthias FRANCK <matthias.franck@softathome.com>
2024-12-20 11:13:52 +01:00
Petr Štetiar
fcf51b9865 libamxrt: fix libcap-ng issues on F2FS, JFFS2 and UBIFS based overlays
Commit 3dc4681f9b ("Integrating libamxp to master_v2.1.1") added
handling of subprocess capabilities via libcap-ng, which on targets
utilizing ext4 filesystem needs EXT4_FS_SECURITY kernel config symbol
enabled for proper support of extended filesystem attributes via
fsetxattr():

 amxp_subproc_start()
 `-amxp_subproc_vstart()
   `-amxp_subproc_exec_child()
     `-amxp_subproc_set_capabilities()
       `-capng_apply_caps_fd()
         `-fsetxattr()

 open("/usr/sbin/unbound", O_RDWR|O_LARGEFILE) = 3
 ...
 fsetxattr(3, "security.capability", "\1\0\0\2\0\0\0\0*$\0\200\0\0\0\0\0\0\0", 20, 0) = -1 EOPNOTSUPP (Not supported)

This failure then leads to missing CAP_NET_BIND_SERVICE capability and thus
unbound can't start:

 [1726337363] unbound[30984:0] error: can't bind socket: Permission denied for 0.0.0.0 port 53
 [1726337363] unbound[30984:0] error: can't bind socket: Permission denied for :: port 53
 [1726337363] unbound[30984:0] fatal error: could not open ports
 ...
 tr181-dns: dns     - [i]Started Unbound (1 times) - (start_unbound@modunbound_main.c:455)
 tr181-dns: dns     - [i]wait for wait:done - (start_unbound@modunbound_main.c:457)
 tr181-dns: dns     - [x]Unbound stopped! - (unbound_stopped@modunbound_main.c:373)

That was fixed in commit 995891f8ca ("libamxrt: fix libcap-ng issues
on ext4 by enabling EXT4_FS_SECURITY").

Lately it was found out, that on some targets, like RPI the same issue
appeared again. It was found out, that it was due to the fact, that RPI
is using f2fs based rootfs_data overlay, because procd/fstools creates
f2fs based rootfs_data overlays if the available storage space is bigger
then 100MiB, in other cases its going to use ext4 filesystem.

So lets fix it for good for all the targets supported by underlying
OpenWrt system, by selecting the corresponding KERNEL_*_FS_SECURITY
config symbols. Unfortunatelly for f2fs we can't use target's specific
USES_F2FS as its not available, but we could probably use mkf2fs for
that purpose as every target seems to include it, so it should work.

Cc: stable-3.1
Fixes: PCF-1456
References: PCF-1411, PPW-74
Fixes: 3dc4681f9b ("Integrating libamxp to master_v2.1.1")
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-12-18 11:56:38 +01:00
Yüce Kürüm
d2857bb993 libamxp: upstep to 2.3.0
This upstep includes following fixes:
- Issue: PPW-65 - [USP][CDRouter][Random] Some datamodel path are 
   missing in USP hl-api tests

Signed-off-by: Yüce Kürüm <yuce.kurum@mind.be>
Signed-off-by: Yüce Kürüm <yuce.kurum_ext@softathome.com>
2024-09-23 12:33:02 +02:00
Yüce Kürüm
b528eebbca libamxrt: upstep to 0.6.3
This upstep includes following fixes:
- Issue: PPW-65 - [USP][CDRouter][Random] Some datamodel path are 
   missing in USP hl-api tests
- Issue: NET-6038 Avoid double USP connections to the same sockets

Signed-off-by: Yüce Kürüm <yuce.kurum@mind.be>
Signed-off-by: Yüce Kürüm <yuce.kurum_ext@softathome.com>
2024-09-23 12:32:48 +02:00
Petr Štetiar
35a1122c88 libamxrt: fix libcap-ng issues on ext4 by enabling EXT4_FS_SECURITY
Commit 3dc4681f9b ("Integrating libamxp to master_v2.1.1") added
handling of subprocess capabilities via libcap-ng, which on targets
utilizing ext4 filesystem needs EXT4_FS_SECURITY kernel config symbol
enabled for proper support of extended filesystem attributes via
fsetxattr():

 amxp_subproc_start()
 `-amxp_subproc_vstart()
   `-amxp_subproc_exec_child()
     `-amxp_subproc_set_capabilities()
       `-capng_apply_caps_fd()
         `-fsetxattr()

 open("/usr/sbin/unbound", O_RDWR|O_LARGEFILE) = 3
 ...
 fsetxattr(3, "security.capability", "\1\0\0\2\0\0\0\0*$\0\200\0\0\0\0\0\0\0", 20, 0) = -1 EOPNOTSUPP (Not supported)

This failure then leads to missing CAP_NET_BIND_SERVICE capability and thus
unbound can't start:

 [1726337363] unbound[30984:0] error: can't bind socket: Permission denied for 0.0.0.0 port 53
 [1726337363] unbound[30984:0] error: can't bind socket: Permission denied for :: port 53
 [1726337363] unbound[30984:0] fatal error: could not open ports
 ...
 tr181-dns: dns     - [i]Started Unbound (1 times) - (start_unbound@modunbound_main.c:455)
 tr181-dns: dns     - [i]wait for wait:done - (start_unbound@modunbound_main.c:457)
 tr181-dns: dns     - [x]Unbound stopped! - (unbound_stopped@modunbound_main.c:373)

So lets fix it by selecting KERNEL_EXT4_FS_SECURITY config symbol if
either target uses ext4 filesystem or kmod-fs-ext4 package is selected.

Fixes: PPW-74
References: PCF-1411
Fixes: 3dc4681f9b ("Integrating libamxp to master_v2.1.1")
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
GitOrigin-RevId: 85e0e6f92a8112ba9c3e102fc9f39341f17de3ae
(cherry picked from commit 825c023cd8)
2024-09-18 18:48:35 +00:00
sahbot
a685e3c251 Integrating libamxa to master_v0.11.1
Issue: SOFA-435 amxa resolver go into  infinite loop if a invalid path is used

Signed-off-by: sahbot                 <sahbot@softathome.com>
GitOrigin-RevId: 05f478ed2cedfe60595dcecc78674c2aff59bb2a
(cherry picked from commit 1729efedca)
2024-09-18 18:48:34 +00:00
5 changed files with 35 additions and 23 deletions

View File

@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libamxa
PKG_VERSION:=v0.11.0
PKG_VERSION:=v0.11.1
SHORT_DESCRIPTION:=Access control verification
PKG_SOURCE:=libamxa-v0.11.0.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxa/-/archive/v0.11.0
PKG_HASH:=18bdeaf99a56530c7b2725cc3bced0eb92e04e54c57ae0f3aa98ac4c005588a9
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxa-v0.11.0
PKG_SOURCE:=libamxa-v0.11.1.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxa/-/archive/v0.11.1
PKG_HASH:=c4ce80b236e2e6bef000e6c90df0b4be995e8ce689f88bbbbc1a3dcf6199d664
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxa-v0.11.1
PKG_MAINTAINER:=Soft At Home <support.opensource@softathome.com>
PKG_LICENSE:=BSD-2-Clause-Patent
PKG_LICENSE_FILES:=LICENSE

View File

@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libamxb
PKG_VERSION:=v4.11.1
PKG_VERSION:=dev_skip_version_check
SHORT_DESCRIPTION:=Bus agnostic C API (mediator)
PKG_SOURCE:=libamxb-v4.11.1.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxb/-/archive/v4.11.1
PKG_HASH:=882f20d994eead107b16d1f191d6b0f9b837206364b9835d1ff523219f80d405
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxb-v4.11.1
PKG_SOURCE:=libamxb-dev_skip_version_check.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxb/-/archive/dev_skip_version_check
PKG_HASH:=88cd03307a798f740b67df1e039468781017cb183bda9117264f659065c70f1d
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxb-dev_skip_version_check
PKG_MAINTAINER:=Soft At Home <support.opensource@softathome.com>
PKG_LICENSE:=BSD-2-Clause-Patent
PKG_LICENSE_FILES:=LICENSE

View File

@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libamxp
PKG_VERSION:=v2.2.0
PKG_VERSION:=v2.3.0
SHORT_DESCRIPTION:=Common patterns implementation
PKG_SOURCE:=libamxp-v2.2.0.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxp/-/archive/v2.2.0
PKG_HASH:=9bdcd0848e665ee5565d2a1228d77f7bd05405d7927e3d435ccf1e5c8561d8f6
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxp-v2.2.0
PKG_SOURCE:=libamxp-v2.3.0.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxp/-/archive/v2.3.0
PKG_HASH:=c207832d9bea0c5149dab16afa6f13bcd7d4b85efa20ad5592cec1a32465930d
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxp-v2.3.0
PKG_MAINTAINER:=Soft At Home <support.opensource@softathome.com>
PKG_LICENSE:=BSD-2-Clause-Patent
PKG_LICENSE_FILES:=LICENSE

View File

@@ -10,11 +10,23 @@ menu "Select libamxrt build options"
config SAH_LIB_AMXRT
bool "Build libamxrt"
default y
select KERNEL_EXT4_FS_SECURITY if USES_EXT4 || PACKAGE_kmod-fs-ext4
select KERNEL_JFFS2_FS_SECURITY if USES_JFFS2 || USES_JFFS2_NAND
select KERNEL_UBIFS_FS_SECURITY if USES_UBIFS
select KERNEL_F2FS_FS_SECURITY if PACKAGE_mkf2fs
config SAH_AMXRT_RWDATAPATH
string "Persistent storage location"
default "/etc/config"
config FORCE_RUNNING_AS_ROOT
bool "INSECURE: This options forces ambiorix components to run as the root user, even if they request to run as a different user"
default y
config REMOVE_CAPS_ODLS
bool "INSECURE: This option removes all the capability ODLs (*_caps.odl) from /etc/amx and subdirectories during first boot. This will also force all components to run as root"
default y
endmenu
endif

View File

@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libamxrt
PKG_VERSION:=v0.6.1
PKG_VERSION:=mainline-3.2_v0.1.1
SHORT_DESCRIPTION:=Ambiorix Run Time API
PKG_SOURCE:=libamxrt-v0.6.1.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxrt/-/archive/v0.6.1
PKG_HASH:=5d2d4ea14511812f938ecb40d05949c13ae30740e65e9cb049632307d2dc00ef
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxrt-v0.6.1
PKG_SOURCE:=libamxrt-mainline-3.2_v0.1.1.tar.gz
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/components/ambiorix/libraries/libamxrt/-/archive/mainline-3.2_v0.1.1
PKG_HASH:=28c6aa7ede9b1e2686be9d61000f80189b194312c50b482d7b0073b2ed6e2fde
PKG_BUILD_DIR:=$(BUILD_DIR)/libamxrt-mainline-3.2_v0.1.1
PKG_MAINTAINER:=Soft At Home <support.opensource@softathome.com>
PKG_LICENSE:=BSD-2-Clause-Patent
PKG_LICENSE_FILES:=LICENSE
@@ -38,15 +38,15 @@ define Package/$(PKG_NAME)/description
endef
define Build/Compile
$(call Build/Compile/Default, STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH))
$(call Build/Compile/Default, STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH) CONFIG_FORCE_RUNNING_AS_ROOT=$(CONFIG_FORCE_RUNNING_AS_ROOT) CONFIG_REMOVE_CAPS_ODLS=$(CONFIG_REMOVE_CAPS_ODLS))
endef
define Build/Install
$(call Build/Install/Default, install INSTALL=install D=$(PKG_INSTALL_DIR) DEST=$(PKG_INSTALL_DIR) STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PV=$(PKG_VERSION) PKG_CONFIG_LIBDIR=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH))
$(call Build/Install/Default, install INSTALL=install D=$(PKG_INSTALL_DIR) DEST=$(PKG_INSTALL_DIR) STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PV=$(PKG_VERSION) PKG_CONFIG_LIBDIR=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH) CONFIG_FORCE_RUNNING_AS_ROOT=$(CONFIG_FORCE_RUNNING_AS_ROOT) CONFIG_REMOVE_CAPS_ODLS=$(CONFIG_REMOVE_CAPS_ODLS))
endef
define Build/InstallDev
$(call Build/Install/Default, install INSTALL=install D=$(STAGING_DIR) DEST=$(STAGING_DIR) STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PV=$(PKG_VERSION) PKG_CONFIG_LIBDIR=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH))
$(call Build/Install/Default, install INSTALL=install D=$(STAGING_DIR) DEST=$(STAGING_DIR) STAGINGDIR=$(STAGING_DIR) CONFIGDIR=$(STAGING_DIR) PV=$(PKG_VERSION) PKG_CONFIG_LIBDIR=$(STAGING_DIR)/usr/lib/pkgconfig LIBDIR=/usr/lib INSTALL_LIB_DIR=/lib INSTALL_BIN_DIR=/bin RAW_VERSION=$(PKG_VERSION) HARDCO_HAL_DIR=$(STAGING_DIR)/usr/include CONFIG_SAH_AMXRT_RWDATAPATH=$(CONFIG_SAH_AMXRT_RWDATAPATH) CONFIG_FORCE_RUNNING_AS_ROOT=$(CONFIG_FORCE_RUNNING_AS_ROOT) CONFIG_REMOVE_CAPS_ODLS=$(CONFIG_REMOVE_CAPS_ODLS))
endef
define Package/$(PKG_NAME)/install