beaglebone wip

This commit is contained in:
Alexis Svinartchouk 2021-03-02 14:47:05 +01:00
parent cc9b063f16
commit e96129d857
4 changed files with 61 additions and 16 deletions

View File

@ -187,16 +187,16 @@ function prepareDrive(drive: Drive) {
if (drive instanceof sdk.sourceDestination.BlockDevice) {
// @ts-ignore (BlockDevice.drive is private)
return drive.drive;
} else if (drive instanceof sdk.sourceDestination.UsbbootDrive) {
// This is a workaround etcher expecting a device string and a size
} else if (
drive instanceof sdk.sourceDestination.UsbbootDrive ||
drive instanceof sdk.sourceDestination.UsbBBbootDrive
) {
// This is a workaround etcher expecting a device string
// @ts-ignore
drive.device = drive.usbDevice.portId;
drive.size = null;
// @ts-ignore
drive.progress = 0;
drive.disabled = true;
const debouncedUpdateDriveProgress = _.throttle(updateDriveProgress, 100);
drive.on('progress', (progress) => {
updateDriveProgress(drive, progress);
debouncedUpdateDriveProgress(drive, progress);
});
return drive;
} else if (drive instanceof sdk.sourceDestination.DriverlessDevice) {
@ -266,7 +266,9 @@ function removeDrive(drive: Drive) {
}
function updateDriveProgress(
drive: sdk.sourceDestination.UsbbootDrive,
drive:
| sdk.sourceDestination.UsbbootDrive
| sdk.sourceDestination.UsbBBbootDrive,
progress: number,
) {
const drives = getDrives();

View File

@ -26,7 +26,10 @@ const adapters: sdk.scanner.adapters.Adapter[] = [
// Can't use permissions.isElevated() here as it returns a promise and we need to set
// module.exports = scanner right now.
if (platform !== 'linux' || geteuid() === 0) {
adapters.push(new sdk.scanner.adapters.UsbbootDeviceAdapter());
adapters.push(
new sdk.scanner.adapters.UsbbootDeviceAdapter(),
new sdk.scanner.adapters.UsbBBbootDeviceAdapter(),
);
}
if (

51
npm-shrinkwrap.json generated
View File

@ -1219,6 +1219,19 @@
}
}
},
"@balena/node-beaglebone-usbboot": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@balena/node-beaglebone-usbboot/-/node-beaglebone-usbboot-1.0.3.tgz",
"integrity": "sha512-XGycuPr98g9XEppCazWOH43MeeZi4Qn2hlZ5Ki1vBdIf4wGoc9Ubb/Su/xde/kxugotj4NH3DEiCMLYvHrBX9w==",
"dev": true,
"requires": {
"@balena.io/usb": "^1.3.13",
"binary-parser-encoder": "^1.4.5",
"debug": "^4.3.1",
"endian-toggle": "0.0.0",
"schemapack": "^1.4.2"
}
},
"@balena/node-crc-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@balena/node-crc-utils/-/node-crc-utils-2.0.0.tgz",
@ -3086,6 +3099,15 @@
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"dev": true
},
"binary-parser-encoder": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/binary-parser-encoder/-/binary-parser-encoder-1.5.3.tgz",
"integrity": "sha512-yu3tdLBYqPIwGRaXyswLoLrhaffkuZkNuXveq/jYoyBHQbFMjamHCWPFOmI2Qz+Go0Rh6wE9f6tt0EAvsgDD0g==",
"dev": true,
"requires": {
"smart-buffer": "^4.1.0"
}
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
@ -3279,11 +3301,11 @@
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"dev": true
},
"buffer-alloc": {
"version": "1.2.0",
@ -5826,6 +5848,12 @@
"once": "^1.4.0"
}
},
"endian-toggle": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/endian-toggle/-/endian-toggle-0.0.0.tgz",
"integrity": "sha1-5cx1eLEDLW7gHq/Nc3ZdsNtNwKY=",
"dev": true
},
"enhanced-resolve": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz",
@ -6059,11 +6087,12 @@
"dev": true
},
"etcher-sdk": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-6.1.1.tgz",
"integrity": "sha512-pLbeu+mONr6QeIilo9AukJ51oZoPQy2YlsqKF3CTFVfZAPdue+7lxpUHNrtze7wsjIVeH9+8BoqRoJfVp5q+VQ==",
"version": "6.2.0-beagle-bone-1e75cbc18fa680df8ca0647a145d2d9fd55570b0",
"resolved": "https://registry.npmjs.org/etcher-sdk/-/etcher-sdk-6.2.0-beagle-bone-1e75cbc18fa680df8ca0647a145d2d9fd55570b0.tgz",
"integrity": "sha512-70Vk+1THMbHyNNnX/VWOtPnW/MhmzemAMnzmHqYlHqsWHWIJ8MOAANc115dtrSDq+7gyEGfW2rnQHqIMAoqEow==",
"dev": true,
"requires": {
"@balena/node-beaglebone-usbboot": "^1.0.3",
"@balena/udif": "^1.1.1",
"@ronomon/direct-io": "^3.0.1",
"aws4-axios": "^2.0.1",
@ -11210,6 +11239,12 @@
"ajv-keywords": "^3.5.2"
}
},
"schemapack": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/schemapack/-/schemapack-1.4.2.tgz",
"integrity": "sha1-i1gqVeEo40WFTOP7OANxxYJk80k=",
"dev": true
},
"scss-parser": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/scss-parser/-/scss-parser-1.0.4.tgz",
@ -11610,6 +11645,12 @@
}
}
},
"smart-buffer": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz",
"integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==",
"dev": true
},
"source-list-map": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",

View File

@ -53,7 +53,6 @@
"crc",
"iconv-corefoundation",
"plist",
"smart-buffer",
"dmg-license",
"fsevents",
"winusb-driver-generator"
@ -87,7 +86,7 @@
"electron-notarize": "^1.0.0",
"electron-rebuild": "^2.3.2",
"electron-updater": "^4.3.5",
"etcher-sdk": "^6.1.1",
"etcher-sdk": "^6.2.0-beagle-bone-1e75cbc18fa680df8ca0647a145d2d9fd55570b0",
"file-loader": "^6.2.0",
"husky": "^4.2.5",
"immutable": "^3.8.1",