From 8d7a59952349bbd6234dabe5280b6204733f84eb Mon Sep 17 00:00:00 2001 From: Carsten Munk Date: Mon, 13 May 2024 14:36:00 +0200 Subject: [PATCH] feat: add create_machine_snapshot Signed-off-by: Carsten Munk --- .changeset/neat-items-impress.md | 5 ++ packages/sdk/Dockerfile | 1 + packages/sdk/create_machine_snapshot | 82 ++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 .changeset/neat-items-impress.md create mode 100755 packages/sdk/create_machine_snapshot diff --git a/.changeset/neat-items-impress.md b/.changeset/neat-items-impress.md new file mode 100644 index 00000000..4b5628ca --- /dev/null +++ b/.changeset/neat-items-impress.md @@ -0,0 +1,5 @@ +--- +"@cartesi/sdk": patch +--- + +feat: script to generate a machine diff --git a/packages/sdk/Dockerfile b/packages/sdk/Dockerfile index 9811f3c3..802c2493 100644 --- a/packages/sdk/Dockerfile +++ b/packages/sdk/Dockerfile @@ -105,6 +105,7 @@ COPY devnet /usr/local/bin COPY eth_isready /usr/local/bin COPY eth_dump /usr/local/bin COPY eth_load /usr/local/bin +COPY create_machine_snapshot /usr/local/bin COPY entrypoint.sh /usr/local/bin/ COPY --from=su-exec /usr/local/src/su-exec /usr/local/bin/ diff --git a/packages/sdk/create_machine_snapshot b/packages/sdk/create_machine_snapshot new file mode 100755 index 00000000..11e3a7d4 --- /dev/null +++ b/packages/sdk/create_machine_snapshot @@ -0,0 +1,82 @@ +#!/bin/bash +set -e + +# Define function to display usage +usage() { + echo "Usage: $0 [options]" + echo "Options:" + echo " -r, --ram-length Specify RAM size" + echo " -d, --drive-label