This document aims to provides the insights of the app working and a What and Why?
-
BeagleBoot app is based on the Electron Framework
-
UI (including state) of the app is created and managed using React Library
-
node-beagle-boot : This usb bootloader server module is responsible for booting the BeagleBone into usb mass storage mode for flashing.
-
drivelist : This module lists the properties of usb mass storage device exposed by bootloader running in BeagleBone.
-
etcher-image-stream : This module provides a readable stream for the OS images (.xz, .img).
-
etcher-image-write : This module is used to write the image readable stream to the device.
-
node-ipc : This module provides way to communicate between the main app process and an elevated process as we don't want the whole app running as an elevated process.
-
sudo-prompt : This module is used to elevate a script which then forks usbMassStorage or imageWrite scripts as per requirement.
- The app is loaded, an
IPC server
is started in the main app process. - User clicks the
USB Mass Storage
button, this forks a scriptlib/elevate.js
which then self elevates itself usingsudo-prompt
and runs anIPC client
in the elevated process. - After
IPC client
starts running, it informs same to theIPC server
. - The
IPC server
then requests client to runlib/usbMassStorage.js
script which boots board into usb mass storage mode. - Then, user clicks
Select Image
button and selects OS image for flashing. - Then, user clicks
Flash
button. TheIPC server
now requests theIPC client
to runlib/imageWrite.js
in the elvated process to perform the image writing.