Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-raspberrypi-usbboot

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-raspberrypi-usbboot - npm Package Compare versions

Comparing version 1.0.8 to 1.1.0-build-aethernet-allow-custom-sb-assets-2605716d9cad91cee838ca28dba6d94103fe2e31-1

3

build/index.d.ts

@@ -26,3 +26,4 @@ /// <reference types="node" />

private attachedDeviceIds;
constructor();
private extraFolder;
constructor(extraFolder?: string);
start(): void;

@@ -29,0 +30,0 @@ stop(): void;

@@ -259,3 +259,18 @@ "use strict";

};
const getFileBuffer = async (device, filename) => {
const unsafeReadFile = async (filename) => {
try {
return await (0, promises_1.readFile)(filename);
}
catch (e) {
// no data
}
};
const getFileBuffer = async (device, filename, extraFolder) => {
if (extraFolder) {
const extraBuffer = await unsafeReadFile(Path.join(extraFolder, filename));
if (extraBuffer !== undefined) {
debug(`Sending buffer from ${extraFolder}/${filename}`);
return extraBuffer;
}
}
const folder = device.deviceDescriptor.idProduct === USB_PRODUCT_ID_BCM2711_BOOT

@@ -360,3 +375,3 @@ ? 'cm4'

class UsbbootScanner extends events_1.EventEmitter {
constructor() {
constructor(extraFolder) {
super();

@@ -368,2 +383,4 @@ this.usbbootDevices = new Map();

this.attachedDeviceIds = new Set();
this.extraFolder = extraFolder;
debug(`Extra folder: ${extraFolder}`);
this.boundAttachDevice = this.attachDevice.bind(this);

@@ -463,4 +480,5 @@ this.boundDetachDevice = this.detachDevice.bind(this);

else {
const extraFolder = this.extraFolder;
debug('Second stage boot server', devicePortId(device));
await this.fileServer(device, endpoint, 2);
await this.fileServer(device, endpoint, 2, extraFolder);
}

@@ -495,3 +513,3 @@ device.close();

}
async fileServer(device, endpoint, step) {
async fileServer(device, endpoint, step, extraFolder) {
while (true) {

@@ -517,3 +535,3 @@ let data;

message.command === FileMessageCommand.ReadFile) {
const buffer = await getFileBuffer(device, message.filename);
const buffer = await getFileBuffer(device, message.filename, extraFolder);
if (buffer === undefined) {

@@ -520,0 +538,0 @@ debug(`Couldn't find ${message.filename}`, devicePortId(device));

@@ -7,2 +7,7 @@ # Change Log

# v1.1.0
## (2024-05-16)
* minor: allow passing custom assets to start SB protected CM4 [Edwin Joassart]
# v1.0.8

@@ -9,0 +14,0 @@ ## (2024-04-12)

{
"name": "node-raspberrypi-usbboot",
"version": "1.0.8",
"version": "1.1.0-build-aethernet-allow-custom-sb-assets-2605716d9cad91cee838ca28dba6d94103fe2e31-1",
"description": "Transforms Raspberry Pi Compute Modules and Zeros to mass storage devices.",

@@ -33,7 +33,7 @@ "main": "build/index.js",

"devDependencies": {
"@balena/lint": "8.0.1",
"@balena/lint": "8.0.2",
"@types/debug": "^4.1.12",
"@types/node": "^20.12.7",
"node-gyp-build": "^4.8.0",
"rimraf": "^5.0.5",
"@types/node": "^20.12.12",
"node-gyp-build": "^4.8.1",
"rimraf": "^5.0.7",
"ts-node": "^10.9.2",

@@ -43,4 +43,4 @@ "typescript": "^5.4.5"

"versionist": {
"publishedAt": "2024-04-12T10:09:10.968Z"
"publishedAt": "2024-05-16T11:34:51.000Z"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc