Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 2.07 KB

ARCHITECTURE.md

File metadata and controls

28 lines (19 loc) · 2.07 KB

ARCHITECTURE

This document aims to provides the insights of the app working and a What and Why?


The major modules used in app are:

  • 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.

Basic working of the app:

  • The app is loaded, an IPC server is started in the main app process.
  • User clicks the USB Mass Storage button, this forks a script lib/elevate.js which then self elevates itself using sudo-prompt and runs an IPC client in the elevated process.
  • After IPC client starts running, it informs same to the IPC server.
  • The IPC server then requests client to run lib/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. The IPC server now requests the IPC client to run lib/imageWrite.js in the elvated process to perform the image writing.