Add update-firmwares-and-configs.js and make update-all-firmwares.js apply and save the config into the EEPROM.
This commit is contained in:
@@ -34,6 +34,8 @@ require('shelljs/global');
|
|||||||
|
|
||||||
if (program.overwriteUserConfig) {
|
if (program.overwriteUserConfig) {
|
||||||
exec(`${__dirname}/write-config.js ${firmwarePath}/devices/uhk60-right/config.bin`);
|
exec(`${__dirname}/write-config.js ${firmwarePath}/devices/uhk60-right/config.bin`);
|
||||||
|
exec(`${__dirname}/apply-config.js`);
|
||||||
|
exec(`${__dirname}/eeprom.js writeUserConfig`);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.verbose = false;
|
config.verbose = false;
|
||||||
|
|||||||
25
packages/usb/update-firmwares-and-configs.js
Executable file
25
packages/usb/update-firmwares-and-configs.js
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const program = require('commander');
|
||||||
|
const fs = require('fs');
|
||||||
|
require('shelljs/global');
|
||||||
|
|
||||||
|
config.fatal = true;
|
||||||
|
|
||||||
|
program
|
||||||
|
.usage(`firmwarePath {iso|ansi}`)
|
||||||
|
.parse(process.argv);
|
||||||
|
|
||||||
|
if (program.args.length !== 2) {
|
||||||
|
console.error('Both firmwarePath and layout must be specified.');
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const firmwarePath = program.args[0];
|
||||||
|
const layout = program.args[1];
|
||||||
|
|
||||||
|
config.verbose = true;
|
||||||
|
exec(`${__dirname}/update-all-firmwares.js --overwrite-user-config ${firmwarePath}`);
|
||||||
|
exec(`${__dirname}/write-hca.js ${layout}`);
|
||||||
|
config.verbose = false;
|
||||||
|
|
||||||
|
echo(`Firmwares and configs updated successfully. HCA updated to ${layout}`);
|
||||||
Reference in New Issue
Block a user