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

Add instruction partials to etcher supported device types #236

Merged
1 commit merged into from
May 27, 2022

Conversation

mehalter
Copy link
Contributor

@mehalter mehalter commented Jun 22, 2021

This PR replaces the deprecated instruction generation approach that was being implemented in #173.

Change-type: major
See: https://www.flowdock.com/app/rulemotion/pub/threads/AE_IXh9Xs_I7MYOHS98oLb0xaya
Signed-off-by: Micah Halter micah@balena.io

@mehalter mehalter added enhancement versionbot/pr-draft Draft PR - Don't merge this PR automatically labels Jun 22, 2021
@mehalter mehalter self-assigned this Jun 22, 2021
@@ -22,8 +22,14 @@
"internal": true
},
"media": {
"installation": "dfu"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to investigate this device type more. It was listing the installation media as internal storage, but the instructions in the Dashboard indicate that it boots from an SD card. If anyone knows which is correct please drop a comment

Copy link
Member

Choose a reason for hiding this comment

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

Looks like it depends on the revision... which makes things harder...

JN30B Revision 4 (38346-4)

  • removed eMMC and add micro SD card

See: https://auvidea.eu/download/manual/JN30/JN30_manual.pdf
See: https://auvidea.eu/product/70787/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see, this is definitely where contact versions will be able to handle this very nicely I think. Basically we can have different contracts for different versions of the board which should all be stored historically so we can change the instructions for a specific version change of the hardware and track these changes.

@mehalter
Copy link
Contributor Author

@balena-ci rebase

@ghost ghost force-pushed the add-device-type-partials branch from ccc1caa to 397f6f6 Compare August 20, 2021 16:45
@mehalter mehalter force-pushed the add-device-type-partials branch 2 times, most recently from 5e2ef11 to b270f6c Compare April 21, 2022 18:23
@mehalter
Copy link
Contributor Author

mehalter commented Apr 21, 2022

After long discussions we have decided to move from identifying an "installation method" to identifying default boot methods and alternative boot methods and being able to identify what boot method is being used. For example:

If there is a flashProtocol defined then we know that we need to flash directly to the device. We can identify which protocols etcher supports to decide how the flashing needs to happen. In this case jetsonFlash is not supported by etcher so we will need to give jetson flashing specific instructions:

    "flashProtocol": "jetsonFlash",
    "media": {
      "defaultBoot": "internal",
      "altBoot": []
    },

Another example of a flashProtocol that Etcher does support would be RPIBOOT which is a flash protocol utilized by the Balena Fin:

    "flashProtocol": "RPIBOOT",
    "media": {
      "defaultBoot": "internal",
      "altBoot": []
    },

If the defaultBoot is internal and there is an alternative boot method like sdcard and no flashProtocol defined, then we know this is an installation where we need to flash to the sdcard with etcher and that sd card will have a flasher image to write to the internal storage

    "media": {
      "defaultBoot": "internal",
      "altBoot": ["sdcard"]
    },

If the defaultBoot is something not internal and there is no flashProtocol then we know the device will need to boot off of an external media in which we flash BalenaOS onto directly like a raspberry pi might have this definition:

    "media": {
      "defaultBoot": "sdcard",
      "altBoot": []
    },

So far I have gone through and updated all of the non-discontinued device types to have the necessary partials for the instructions as well as updated media and flashProtocol definitions in their contracts. I did not include definitions for the generic device types as we are planning on deprecating and removing these (to my knowledge).

Lastly there is one more lingering question regarding the raspberrypicm4-ioboard contract where it supports both the "CM4 Lite" and "CM4 eMMC" boards. The former boots off an SD card and the latter does a direct flash to the eMMC with RPIBOOT flash protocol. We need to decide how we want to represent this in a contract. I think the best approach would be to split these device types into separate contracts.

Edit: The raspberrypicm4-ioboard comment has been resolved.

@thgreasi
Copy link
Member

thgreasi commented May 4, 2022

@mehalter WRT raspberrypicm4-ioboard, wouldn't the following work v ?

    "flashProtocol": "RPIBOOT",
    "media": {
      "defaultBoot": "internal",
      "altBoot": ["sdcard"]
    },

@mehalter mehalter force-pushed the add-device-type-partials branch from b270f6c to 742b808 Compare May 12, 2022 16:56
Copy link
Member

@thgreasi thgreasi left a comment

Choose a reason for hiding this comment

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

Feel free to self-certify after checking these comments 👍

contracts/hw.device-type/raspberrypi0-2w-64/contract.json Outdated Show resolved Hide resolved
"bootDeviceExternal": [
"Power up the {{name}} while holding down the small button near the SD slot. You need to keep it pressed until the blue LEDs start flashing wildly."
],
"flashIndicator": ["5 seconds after the LEDs have stopped flashing wildly"],
Copy link
Member

Choose a reason for hiding this comment

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

Was the On some boards the leds will shut down completely." part that we had before wrong?

contracts/hw.device-type/coral-dev/contract.json Outdated Show resolved Hide resolved
Comment on lines +25 to +26
"defaultBoot": "internal",
"altBoot": ["sdcard"]
Copy link
Member

Choose a reason for hiding this comment

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

Just to double-check: In case we care to reason whether this is a flasher DT, should we check the defaultBoot & altBoot combination?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah in the cases where the defaultBoot method is internal and there is no flash method specified (i.e. we can't directly flash the internal storage) we need to check the altBoot method to see how it is going to flash the internal storage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are there cases where we use an external media to flash another external media for booting? I think that is a case that is not covered in our current set up, but I don't think that that ever comes up.

Copy link
Member

Choose a reason for hiding this comment

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

I don't know of enough DTs to answer this. The devices team will probably know.

contracts/hw.device-type/intel-edison/contract.json Outdated Show resolved Hide resolved
@@ -22,8 +22,14 @@
"internal": true
},
"media": {
"installation": "dfu"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like it depends on the revision... which makes things harder...

JN30B Revision 4 (38346-4)

  • removed eMMC and add micro SD card

See: https://auvidea.eu/download/manual/JN30/JN30_manual.pdf
See: https://auvidea.eu/product/70787/

@mehalter mehalter force-pushed the add-device-type-partials branch from 742b808 to b8433a0 Compare May 26, 2022 16:49
@mehalter
Copy link
Contributor Author

@balena-ci rebase

@ghost ghost force-pushed the add-device-type-partials branch from b8433a0 to d83d9e2 Compare May 26, 2022 16:52
@mehalter mehalter force-pushed the add-device-type-partials branch from d83d9e2 to ade56bc Compare May 26, 2022 17:03
@mehalter
Copy link
Contributor Author

@balena-ci rebase

@ghost ghost force-pushed the add-device-type-partials branch from ade56bc to ead70c3 Compare May 26, 2022 17:04
@mehalter mehalter force-pushed the add-device-type-partials branch 5 times, most recently from dea063a to 4c3eacd Compare May 27, 2022 14:49
Change-type: major
Signed-off-by: Micah Halter <micah@balena.io>
@mehalter mehalter force-pushed the add-device-type-partials branch from 4c3eacd to 62794cb Compare May 27, 2022 14:59
@mehalter
Copy link
Contributor Author

@balena-ci I self-certify!

@ghost ghost merged commit ac86710 into master May 27, 2022
@ghost ghost deleted the add-device-type-partials branch May 27, 2022 15:02
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement versionbot/pr-draft Draft PR - Don't merge this PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants