Skip to content

Commit

Permalink
Add dehash tool to the root filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
vfusco committed Nov 28, 2020
1 parent 28015e7 commit de850ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions configs/default-buildroot-config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions configs/min-buildroot-config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 22 additions & 5 deletions patches/0007-add-machine-emulator-tools.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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/
+
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
+
Expand Down

0 comments on commit de850ba

Please sign in to comment.