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

patch: checking #1513

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/models/balenaos-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const BalenaOS: Contract = {
`{{{deviceType.partials.bootDevice}}} to boot the device.`,
],
externalFlash: [
`{{#each deviceType.partials.instructions}}{{{this}}} {{/each}}`,
`Insert the {{resolveContractAlias deviceType.data.media.altBoot.[0]}} to the host machine.`,
`Write the {{name}} file you downloaded to the {{resolveContractAlias deviceType.data.media.altBoot.[0]}}. We recommend using <a href="https://etcher.balena.io/">Etcher</a>.`,
`Wait for writing of {{name}} to complete.`,
Expand Down
88 changes: 87 additions & 1 deletion src/models/device-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,48 @@ const getDeviceTypeModel = function (deps: InjectedDependenciesParam) {
* }
* // Insert the sdcard to the host machine.
* // Write the BalenaOS file you downloaded to the sdcard. We recommend using <a href="https://etcher.balena.io/">Etcher</a>.
* // Wait for writing of BalenaOS to complete.
* // Wait for writing of BalenaOS to complete.` {
"slug": "jetson-orin-nano-devkit-nvme",
"version": "1",
"type": "hw.device-type",
"aliases": [],
"name": "Nvidia Jetson Orin Nano 8GB (SD) Devkit NVME",
"assets": {
"logo": {
"url": "./jetson-orin-nano-devkit-nvme.svg",
"name": "logo"
}
},
"data": {
"arch": "aarch64",
"hdmi": true,
"led": false,
"connectivity": {
"bluetooth": true,
"wifi": true
},
"storage": {
"internal": true
},
"media": {
"defaultBoot": "internal",
"altBoot": ["usb_mass_storage"]
},
"is_private": false
},
"partials": {
"instructions": [
"For balenaOS versions v6.1.16 and newer, please ensure your device is running UEFI firmware version 36.3. Check and update the <a href=\"https://docs.balena.io/learn/develop/hardware/jetson-orin#provisioning-jetson-orin\">firmware version</a> before proceeding.",
"For balenaOS versions older than v6.1.16, please refer to the <a href=\"https://github.com/balena-os/jetson-flash?tab=readme-ov-file\">{{name}} legacy flashing</a> guide."
],
"bootDeviceExternal": [
"Insert a NVME drive in the Devkit and power up the {{name}}."
],
"flashIndicator": ["power LED is off"],
"bootDevice": ["Power up the {{name}}. If you have a display or a debug UART cable connected to the device, a progress bar will show up while the UEFI firmware is updated. Please do not interrupt this process by turning off power or rebooting the device."]
}
}
`
* // Remove the sdcard from the host machine.
* // Insert the freshly flashed sdcard into the Raspberry Pi (v1 / Zero / Zero W).
* // Connect power to the Raspberry Pi (v1 / Zero / Zero W) to boot the device.
Expand All @@ -452,6 +493,51 @@ const getDeviceTypeModel = function (deps: InjectedDependenciesParam) {
$select: 'contract',
},
));
if (contract!.slug === 'jetson-orin-nano-devkit-nvme') {
contract = {
slug: 'jetson-orin-nano-devkit-nvme',
version: '1',
type: 'hw.device-type',
aliases: [],
name: 'Nvidia Jetson Orin Nano 8GB (SD) Devkit NVME',
assets: {
logo: {
url: './jetson-orin-nano-devkit-nvme.svg',
name: 'logo',
},
},
data: {
arch: 'aarch64',
hdmi: true,
led: false,
connectivity: {
bluetooth: true,
wifi: true,
},
storage: {
internal: true,
},
media: {
defaultBoot: 'internal',
altBoot: ['usb_mass_storage'],
},
is_private: false,
},
partials: {
instructions: [
'BROOO THIS IS NEW. For balenaOS versions v6.1.16 and newer, please ensure your device is running UEFI firmware version 36.3. Check and update the <a href="https://docs.balena.io/learn/develop/hardware/jetson-orin#provisioning-jetson-orin">firmware version</a> before proceeding.',
'For balenaOS versions older than v6.1.16, please refer to the <a href="https://github.com/balena-os/jetson-flash?tab=readme-ov-file">{{name}} legacy flashing</a> guide.',
],
bootDeviceExternal: [
'Insert a NVME drive in the Devkit and power up the {{name}}.',
],
flashIndicator: ['power LED is off'],
bootDevice: [
'Power up the {{name}}. If you have a display or a debug UART cable connected to the device, a progress bar will show up while the UEFI firmware is updated. Please do not interrupt this process by turning off power or rebooting the device.',
],
},
};
}
if (!contract?.partials) {
throw new Error(
`Instruction partials not defined for ${deviceTypeSlugOrContract}`,
Expand Down
20 changes: 19 additions & 1 deletion tests/integration/models/device-type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,23 @@ describe('Device Type model', function () {
],
],
[
'jetson-nano',
'jetson-orin-nano-devkit-nvme',
[
'To provision Nvidia Jetson Nano SD-CARD, follow the instructions using our <a href="https://github.com/balena-os/jetson-flash/blob/master/docs/jetson-nano.md">Jetson Flash tool</a> to make the process more streamlined.',
],
'jetson-agx-orin-devkit-64gb',
[
'To provision Nvidia Jetson Nano SD-CARD, follow the instructions using our <a href="https://github.com/balena-os/jetson-flash/blob/master/docs/jetson-nano.md">Jetson Flash tool</a> to make the process more streamlined.',
],
'jetson-orin-nano-seeed-j3010',
[
'To provision Nvidia Jetson Nano SD-CARD, follow the instructions using our <a href="https://github.com/balena-os/jetson-flash/blob/master/docs/jetson-nano.md">Jetson Flash tool</a> to make the process more streamlined.',
],
'jetson-orin-nx-xavier-nx-devkit',
[
'To provision Nvidia Jetson Nano SD-CARD, follow the instructions using our <a href="https://github.com/balena-os/jetson-flash/blob/master/docs/jetson-nano.md">Jetson Flash tool</a> to make the process more streamlined.',
],
'jetson-orin-nx-seeed-j4012',
[
'To provision Nvidia Jetson Nano SD-CARD, follow the instructions using our <a href="https://github.com/balena-os/jetson-flash/blob/master/docs/jetson-nano.md">Jetson Flash tool</a> to make the process more streamlined.',
],
Expand All @@ -150,6 +166,7 @@ describe('Device Type model', function () {
await balena.models.deviceType.getInstructions(deviceTypeSlug);
expect(result).to.be.an('Array');
expect(result).to.not.have.length(0);
console.log(result);
expect(result).to.eql(instructions);
});

Expand All @@ -162,6 +179,7 @@ describe('Device Type model', function () {
const result = await balena.models.deviceType.getInstructions(contract);
expect(result).to.be.an('Array');
expect(result).to.not.have.length(0);
console.log(result);
expect(result).to.eql(instructions);
});
});
Expand Down
Loading