Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some people are beginning to use
cartesi-machine
to prototype and test new software directly. This PR adds new shorthands to make easier to use common prototyping commands:-m
shorthand for--ram-length
-k
shorthand for--ram-image
-q
shorthand for--quiet --no-init-splash
-r
/--rootfs
shorthand for--flash-drive=label:root,filename:<filename>
-S
/--shared-rootfs
shorthand for setting rootfs as sharedUse case example
This PR goal is to make the following prototyping use case less boilerplate (smaller commands).
Suppose I installed latest cartesi machine on my system, and I would like to try out new software just to check if it the machine would run it (I don't want to mess with Docker yet! I am not really creating a dapp neither! just a quick test!).
First thing I would do is to copy standard
rootfs.ext2
and resize it to be bigger, and I can use resize2fs inside cartesi machine to do this:$ cp $(cartesi-machine --version-json | jq -r .default_rootfs_image) rootfs.ext2 $ cartesi-machine -q -v=.:/mnt -u=root -- resize2fs -f /mnt/rootfs.ext2 512M
Now I would like to install new software in this custom rootfs, like
gcc
, I also want the changes to persist:$ cartesi-machine -q -n -S -r=rootfs.ext2 -u=root -- "apt-get update && apt-get install -y gcc"
Finally I could share host current directory and start compiling GCC and testing programs inside the cartesi machine:
Lastly I could even make this my rootfs with GCC the default on my machine, with: