diff --git a/configs/default-buildroot-config b/configs/default-buildroot-config index ff4a7c0..6f72a79 100644 --- a/configs/default-buildroot-config +++ b/configs/default-buildroot-config @@ -2439,6 +2439,7 @@ BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y # BR2_PACKAGE_XDG_DBUS_PROXY is not set BR2_PACKAGE_MACHINE_EMULATOR_TOOLS=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_YIELD=y +BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_DEHASH=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_FLASHDRIVE=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_READBE64=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_WRITEBE64=y diff --git a/configs/min-buildroot-config b/configs/min-buildroot-config index 8dfaece..bb1dc49 100644 --- a/configs/min-buildroot-config +++ b/configs/min-buildroot-config @@ -2437,6 +2437,7 @@ BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y # BR2_PACKAGE_XDG_DBUS_PROXY is not set BR2_PACKAGE_MACHINE_EMULATOR_TOOLS=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_YIELD=y +BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_DEHASH=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_FLASHDRIVE=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_READBE64=y BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_WRITEBE64=y diff --git a/patches/0007-add-machine-emulator-tools.patch b/patches/0007-add-machine-emulator-tools.patch index bd0b340..6685ce9 100644 --- a/patches/0007-add-machine-emulator-tools.patch +++ b/patches/0007-add-machine-emulator-tools.patch @@ -13,13 +13,13 @@ diff --git a/package/machine-emulator-tools/Config.in b/package/machine-emulator new file mode 100644 --- /dev/null +++ b/package/machine-emulator-tools/Config.in -@@ -0,0 +1,35 @@ +@@ -0,0 +1,41 @@ +menuconfig BR2_PACKAGE_MACHINE_EMULATOR_TOOLS + bool "Cartesi machine-emulator-tools" + help + Various useful Cartesi machine libraries and utilities. + -+ Things like yield, flashdrive, readbe64, writebe64, etc... ++ Things like yield, dehash, flashdrive, readbe64, writebe64, etc... + + https://github.com/cartesi/machine-emulator-tools/ + @@ -31,6 +31,12 @@ new file mode 100644 + help + Install yield command line utility. + ++config BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_DEHASH ++ bool "dehash" ++ depends on BR2_TOOLCHAIN_EXTERNAL_HAS_CARTESI_KERNEL_HEADERS ++ help ++ Install dehash command line utility. ++ +config BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_FLASHDRIVE + bool "flashdrive" + help @@ -54,19 +60,19 @@ new file mode 100644 --- /dev/null +++ b/package/machine-emulator-tools/machine-emulator-tools.hash @@ -0,0 +1 @@ -+sha256 11d50c4cffe8e1191ca0427e3fde62a79dc8df93cce2048312690d7c484f7111 v0.2.0.tar.gz ++sha256 ba9f3d3916219ea266d96ba1b01021762f986fdca3277a331912b755dc89f091 v0.3.0.tar.gz diff --git a/package/machine-emulator-tools/machine-emulator-tools.mk b/package/machine-emulator-tools/machine-emulator-tools.mk new file mode 100644 --- /dev/null +++ b/package/machine-emulator-tools/machine-emulator-tools.mk -@@ -0,0 +1,54 @@ +@@ -0,0 +1,65 @@ +################################################################################ +# +# machine-emulator-tools +# +################################################################################ + -+MACHINE_EMULATOR_TOOLS_VERSION = v0.2.0 ++MACHINE_EMULATOR_TOOLS_VERSION = v0.3.0 +MACHINE_EMULATOR_TOOLS_SOURCE = $(MACHINE_EMULATOR_TOOLS_VERSION).tar.gz +MACHINE_EMULATOR_TOOLS_SITE = https://github.com/cartesi/machine-emulator-tools/archive +MACHINE_EMULATOR_TOOLS_LICENSE = Apache-2.0 @@ -82,6 +88,15 @@ new file mode 100644 +endef +endif + ++ifeq ($(BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_DEHASH),y) ++define BUILD_MACHINE_EMULATOR_TOOLS_DEHASH ++ $(MAKE) RVCC=$(TARGET_CC) -C $(@D)/linux/dehash dehash.toolchain ++endef ++define INSTALL_MACHINE_EMULATOR_TOOLS_DEHASH ++ $(INSTALL) -D -m 0755 $(@D)/linux/dehash/dehash $(TARGET_DIR)/opt/cartesi/bin/dehash ++endef ++endif ++ +MACHINE_EMULATOR_TOOLS_UTILS = + +ifeq ($(BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_FLASHDRIVE),y) @@ -106,10 +121,12 @@ new file mode 100644 + +define MACHINE_EMULATOR_TOOLS_BUILD_CMDS + $(BUILD_MACHINE_EMULATOR_TOOLS_YIELD) ++ $(BUILD_MACHINE_EMULATOR_TOOLS_DEHASH) +endef + +define MACHINE_EMULATOR_TOOLS_INSTALL_TARGET_CMDS + $(INSTALL_MACHINE_EMULATOR_TOOLS_YIELD) ++ $(INSTALL_MACHINE_EMULATOR_TOOLS_DEHASH) + $(INSTALL_MACHINE_EMULATOR_UTILS) +endef +