package/casync-nano: new package
PATCH 1/1 package/casync-nano: new package
casync-nano is an implementation of a subset of the features of casync, optimized for performing OTA updates on embedded systems.
--- DEVELOPERS | 3 +++ package/Config.in | 1 + package/Config.in.host | 1 + package/casync-nano/Config.in | 21 +++++++++++++++++++++ package/casync-nano/Config.in.host | 7 +++++++ package/casync-nano/casync-nano.hash | 3 +++ package/casync-nano/casync-nano.mk | 28 ++++++++++++++++++++++++++++ 7 files changed, 64 insertions(+) create mode 100644 package/casync-nano/Config.in create mode 100644 package/casync-nano/Config.in.host create mode 100644 package/casync-nano/casync-nano.hash create mode 100644 package/casync-nano/casync-nano.mk
DEVELOPERS +3 -0
@@ -1130,6 +1130,9 @@ F: package/rsyslog/ N: Florian Fainelli <[email protected]> F: package/cpulimit/ +N: Florian Larysch <[email protected]> +F: package/casync-nano/ + N: Floris Bos <[email protected]> F: package/ipmitool/ F: package/odhcploc/
package/Config.in +1 -0
@@ -2456,6 +2456,7 @@ endif source "package/can-utils/Config.in" source "package/cannelloni/Config.in" source "package/casync/Config.in" + source "package/casync-nano/Config.in" source "package/cfm/Config.in" source "package/chrony/Config.in" source "package/civetweb/Config.in"
package/Config.in.host +1 -0
@@ -13,6 +13,7 @@ menu "Host utilities" source "package/bmap-writer/Config.in.host" source "package/bootgen/Config.in.host" source "package/btrfs-progs/Config.in.host" + source "package/casync-nano/Config.in.host" source "package/cbootimage/Config.in.host" source "package/checkpolicy/Config.in.host" source "package/checksec/Config.in.host"
package/casync-nano/Config.in new file +21 -0
@@ -0,0 +1,21 @@ +config BR2_PACKAGE_CASYNC_NANO + bool "casync-nano" + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_ZSTD + select BR2_PACKAGE_LIBCURL + help + Tiny casync-like tool optimized for embedded systems. + + https://github.com/florolf/casync-nano + +if BR2_PACKAGE_CASYNC_NANO + +config BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIM + bool "install casync shim" + # only once package should provide the "casync" command + depends on !BR2_PACKAGE_CASYNC + help + Install a shim that provides basic compatibility with the + "extract" sub-command of casync to programs that expect it. + +endif
package/casync-nano/Config.in.host new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_HOST_CASYNC_NANO + bool "host casync-nano tool" + help + casync-nano host tool (csn-tool) for casync-nano specific + features like chunk encryption. + + https://github.com/florolf/casync-nano
package/casync-nano/casync-nano.hash new file +3 -0
@@ -0,0 +1,3 @@ +# locally calculated +sha256 29ed8a767304e7e3032e66feea3d2dada7cc7db73344231a54bf080cc6e65ecf casync-nano-1.1.1.tar.gz +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING
package/casync-nano/casync-nano.mk new file +28 -0
@@ -0,0 +1,28 @@ +################################################################################ +# +# casync-nano +# +################################################################################ + +CASYNC_NANO_VERSION = 1.1.1 +CASYNC_NANO_SITE = $(call github,florolf,casync-nano,v$(CASYNC_NANO_VERSION)) +CASYNC_NANO_LICENSE = LGPL-2.1 +CASYNC_NANO_LICENSE_FILES = COPYING +CASYNC_NANO_DEPENDENCIES = host-pkgconf openssl zstd libcurl + +ifeq ($(BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIM),y) +define CASYNC_NANO_INSTALL_CASYNC_SHIM + ln -sf csn $(TARGET_DIR)/usr/bin/casync +endef +endif + +define CASYNC_NANO_INSTALL_TARGET_CMDS + $(INSTALL) -D -m0755 $(@D)/csn $(TARGET_DIR)/usr/bin/csn + $(CASYNC_NANO_INSTALL_CASYNC_SHIM) +endef + +HOST_CASYNC_NANO_DEPENDENCIES = host-pkgconf host-openssl +HOST_CASYNC_NANO_CONF_OPTS = -DBUILD_CSN=Off -DBUILD_CSN_TOOL=On + +$(eval $(cmake-package)) +$(eval $(host-cmake-package))
Signature · 6 lines
2.49.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Florian,
Quoted 4 lines · On Sun, 20 Apr 2025 22:45:38 +0200 Florian Larysch <[email protected]> wrote:
casync-nano is an implementation of a subset of the features of casync, optimized for performing OTA updates on embedded systems.
Signed-off-by Florian Larysch <[email protected]>
Thanks for this contribution, this looks really good. I only have a few questions, below.
package/casync-nano/Config.in line 19
Quoted 7 lines
package/casync-nano/Config.in new file +7
-0+config BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIM + bool "install casync shim" + # only once package should provide the "casync" command + depends on !BR2_PACKAGE_CASYNC + help + Install a shim that provides basic compatibility with the + "extract" sub-command of casync to programs that expect it.
I am wondering if we really need this option. What about simply installing this shim automatically if BR2_PACKAGE_CASYNC is disabled?
Quoted 9 lines
package/casync-nano/casync-nano.mk new file +9
-0+CASYNC_NANO_VERSION = 1.1.1 +CASYNC_NANO_SITE = $(call github,florolf,casync-nano,v$(CASYNC_NANO_VERSION)) +CASYNC_NANO_LICENSE = LGPL-2.1 +CASYNC_NANO_LICENSE_FILES = COPYING +CASYNC_NANO_DEPENDENCIES = host-pkgconf openssl zstd libcurl + +ifeq ($(BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIM),y) +define CASYNC_NANO_INSTALL_CASYNC_SHIM + ln -sf csn $(TARGET_DIR)/usr/bin/casync
package/casync-nano/casync-nano.mk line 25
Quoted 10 lines
package/casync-nano/casync-nano.mk new file +10
-0+endef +endif + +define CASYNC_NANO_INSTALL_TARGET_CMDS + $(INSTALL) -D -m0755 $(@D)/csn $(TARGET_DIR)/usr/bin/csn + $(CASYNC_NANO_INSTALL_CASYNC_SHIM) +endef + +HOST_CASYNC_NANO_DEPENDENCIES = host-pkgconf host-openssl +HOST_CASYNC_NANO_CONF_OPTS = -DBUILD_CSN=Off -DBUILD_CSN_TOOL=On
Why aren't those same options set for the target variant? I'm not quite sure to understand why the host and target variant don't have the same dependencies. If zstd and libcurl are optional, then they should also be optional for the target variant.
Could you clarify this point?
Thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Thomas,
Quoted 3 lines · Thomas Petazzoni via buildroot
Quoted 1 line
+config
BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIMI am wondering if we really need this option. What about simply installing this shim automatically if
BR2_PACKAGE_CASYNCis disabled?
That would be an option too. Personally I'd err on the side of not cluttering /usr/bin unnecessarily, but if you think that makes more sense I can change it.
Quoted 17 lines
Quoted 17 lines
package/casync-nano/casync-nano.mk new file +16
-0+CASYNC_NANO_VERSION = 1.1.1 +CASYNC_NANO_SITE = $(call github,florolf,casync-nano,v$(CASYNC_NANO_VERSION)) +CASYNC_NANO_LICENSE = LGPL-2.1 +CASYNC_NANO_LICENSE_FILES = COPYING +CASYNC_NANO_DEPENDENCIES = host-pkgconf openssl zstd libcurl + +ifeq ($(BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIM),y) +define CASYNC_NANO_INSTALL_CASYNC_SHIM + ln -sf csn $(TARGET_DIR)/usr/bin/casync +endef +endif + +define CASYNC_NANO_INSTALL_TARGET_CMDS + $(INSTALL) -D -m0755 $(@D)/csn $(TARGET_DIR)/usr/bin/csn + $(CASYNC_NANO_INSTALL_CASYNC_SHIM) +endef
Quoted 8 lines
package/casync-nano/casync-nano.mk line 25
Quoted 3 lines
package/casync-nano/casync-nano.mk new file +3
-0+ +HOST_CASYNC_NANO_DEPENDENCIES = host-pkgconf host-openssl +HOST_CASYNC_NANO_CONF_OPTS = -DBUILD_CSN=Off -DBUILD_CSN_TOOL=OnWhy aren't those same options set for the target variant? I'm not quite sure to understand why the host and target variant don't have the same dependencies. If zstd and libcurl are optional, then they should also be optional for the target variant.
The host variant of the package is only building a different sub-program (csn-tool), which has different dependencies (namely it only needs libcrypto from OpenSSL).
The reasoning for the split here is similar to other OTA tools like RAUC where there is one component that is only really useful on the target for installing the update and another component that is only useful on the host for generating/manipulating that update.
Florian
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Florian,
Quoted 8 lines · On Sun, 20 Apr 2025 23:32:05 +0200 Florian Larysch <[email protected]> wrote:
Quoted 3 lines · Thomas Petazzoni via buildroot
Quoted 1 line
+config
BR2_PACKAGE_CASYNC_NANO_CASYNC_SHIMI am wondering if we really need this option. What about simply installing this shim automatically if
BR2_PACKAGE_CASYNCis disabled?That would be an option too. Personally I'd err on the side of not cluttering
/usr/binunnecessarily, but if you think that makes more sense I can change it.
OK, fair enough!
Quoted 5 lines
Quoted 4 lines
Why aren't those same options set for the target variant? I'm not quite sure to understand why the host and target variant don't have the same dependencies. If zstd and libcurl are optional, then they should also be optional for the target variant.
Quoted 8 lines
The host variant of the package is only building a different sub-program (csn-tool), which has different dependencies (namely it only needs libcrypto from OpenSSL).
The reasoning for the split here is similar to other OTA tools like RAUC where there is one component that is only really useful on the target for installing the update and another component that is only useful on the host for generating/manipulating that update.
Makes sense, thanks for the explanation!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni via buildroot
AppliedQuoted 4 lines · On Sun, 20 Apr 2025 22:45:38 +0200 Florian Larysch <[email protected]> wrote:
casync-nano is an implementation of a subset of the features of casync, optimized for performing OTA updates on embedded systems.
Signed-off-by Florian Larysch <[email protected]>
Quoted 13 lines
--- DEVELOPERS | 3 +++ package/Config.in | 1 + package/Config.in.host | 1 + package/casync-nano/Config.in | 21 +++++++++++++++++++++ package/casync-nano/Config.in.host | 7 +++++++ package/casync-nano/casync-nano.hash | 3 +++ package/casync-nano/casync-nano.mk | 28 ++++++++++++++++++++++++++++ 7 files changed, 64 insertions(+) create mode 100644 package/casync-nano/Config.in create mode 100644 package/casync-nano/Config.in.host create mode 100644 package/casync-nano/casync-nano.hash create mode 100644 package/casync-nano/casync-nano.mk
Applied to master, thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot