Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate ISO types: dev or release #295

Merged
merged 2 commits into from
Jan 21, 2021

Conversation

syncom
Copy link
Contributor

@syncom syncom commented Jan 15, 2021

Release build: '/vagrant/build.sh' or '/vagrant/build.sh release'.
Development build: '/vagrant/build.sh dev'.

A release image is to be used by cold storage operators who do not need to
have access to an interactive shell. For a release image to boot into a
root shell successfully, an SCSI/ATA hard drive needs to be available, with
a partition '/dev/sda1' used as persistent storage for the cold wallet. The
partition can be formatted in ext3 or vfat for example. The device node
'/dev/sda1' is required to give the operators a seamless experience when
booting up the system. A few other files, including the HSM world and
encrypted secrets, and compiled subzero code (in .jar and signed .sar), are
not checked in to the project repository, and need to be added to their
appropriate locations (please refer to README.md) before building a release
image that will work out of the box.

A development image is to be used by subzero developers for HSM and cold
wallet development. A developer can boot into an interactive root shell
without performing the above mentioned steps. The HSM software is
automatically installed in the development image, but a developer needs to
manually set up persistent storage for the cold wallet, put .jar and
.sar files to appropriate filesystem locations, and execute them
accordingly, for development and testing.

Release build: '/vagrant/build.sh' or '/vagrant/build.sh release'.
Development build: '/vagrant/build.sh dev'.

A release image is to be used by cold storage operators who do not need to
have access to an interactive shell.  For a release image to boot into a
root shell successfully, an SCSI/ATA hard drive needs to be available, with
a partition '/dev/sda1' used as persistent storage for the cold wallet. The
partition can be formatted in ext3 or vfat for example. The device node
'/dev/sda1' is required to give the operators a seamless experience when
booting up the system. A few other files, including the HSM world and
encrypted secrets, and compiled subzero code (in .jar and signed .sar), are
not checked in to the project repository, and need to be added to their
appropriate locations (please refer to README.md) before building a release
image that will work out of the box.

A development image is to be used by subzero developers for HSM and cold
wallet development. A developer can boot into an interactive root shell
without performing the above mentioned steps. The HSM software is
automatically installed in the development image, but a developer needs to
manually set up persistent storage for the cold wallet, put .jar and
.sar files to appropriate filesystem locations, and execute them
accordingly, for development and testing.
@syncom syncom requested a review from oreparaz January 15, 2021 19:06

## Writing image to USB drive

1. Identify device path to disk (such as `/dev/disk3`) with `diskutil list external physical`
2. Unmount all volumes on that disk with `diskutil unmountDisk /dev/disk3`
3. Identify the “raw” device path by replacing `disk` with `rdisk` in the device path. (E.g. `/dev/disk3` becomes `/dev/rdisk3`.) This speeds up writes by 3–4× in very informal testing.
3. Write ISO to that “raw” device path with `sudo dd bs=1m if=boot.iso of=/dev/rdisk5`. Remember that on MacOS you can check in on progress by sending SIGINFO with Ctrl+T. (Takes about 30 minutes in one test.)
3. Write ISO to that “raw” device path with `sudo dd bs=1m if=boot.iso of=/dev/rdisk3`. Remember that on MacOS you can check in on progress by sending SIGINFO with Ctrl+T. (Takes about 3 minutes in one test.)
Copy link
Contributor

@alokmenghrajani alokmenghrajani Jan 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this as /dev/rdiskN, since the N is going to be different for everyone / on each run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good idea. (I was intending to keep the changes to README small with this PR, and disk3 is a more consistent name in the context. But I think it's good to be more rigorous here.)

be added to their appropriate locations before building a release image
that will work out of the box.

* `data_app_subzero/` should contain `subzero-cli.jar`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this is written, it sounds like you need to put data_app_subzero on /dev/sda1, which isn't true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good feedback. I will re-write the paragraph in a (hopefully) clearer way.

without performing the above mentioned steps. The HSM software is
automatically installed in the development image, but a developer needs
to manually set up persistent storage for the cold wallet, put .jar and
.sar files to appropriate filesystem locations, and execute them
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't need to move any .jar or .sar files around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

* Release build: `build.sh` or `build.sh release`.

A release image is to be used by cold storage operators who do not need
to have access to an interactive shell. For a release image to boot into
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't remove the interactive shell (#239). Might be worth clarifying here that the interactive shell is available for debugging purpose, but the default behavior is different between release and dev.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a great point.

oreparaz
oreparaz previously approved these changes Jan 15, 2021
Thank alokmenghrajani and oreparaz for their feedback.
@oreparaz
Copy link
Collaborator

Nice, hopefully this makes development easier. Thanks @syncom

@syncom syncom merged commit b39c623 into master Jan 21, 2021
@syncom syncom deleted the syncom/live-usb-creator-two-build-types branch January 21, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants