NEW !!! balena-io/etcher for FreeBSD

# Building etcher on Windows, Linux, and Mac

> How do you build etcher? On Windows, Linux, Mac
It’s the same on all systems:

First clone the repository recursively:

`git clone --recursive https://github.com:balena-io/etcher`

```
rm -rf node_modules
make electron-develop
npm start
```

To build packages for distribution, run `make electron-build` after the steps above.

### Windows

> What version of mingw and visual studio are needed to build? Any other dependencies for windows? Instructions for how to install?
Visual studio 2019 with:
MSVC v142
Windows 10 SDK
Mingw64, install it from https://www.msys2.org/


> It appears you’re supposed to use `npm i` and then `npm watch` and then `npm start` in order to build/run the electron app, but I’m getting the error:
NODE_MODULE_VERSION 88. This version of Node.js requires
NODE_MODULE_VERSION 80. Please try re-compiling or re-installing

From the module `xxhash`

This error means that a module wasn’t built for the correct runtime (node or electron) and version. In general it means that either you ran `npm i` instead of `make electron-develop` or you just updated the electron version.
Remove the node_modules folder and run `make electron-develop`, that should fix it.

If you want to use only npm, set up some env vars to target the correct runtime as in https://github.com/balena-io/EtcherProApplication/blob/v1.0.0/Dockerfile#L11-L13


Each time you change a js file, you need to run `npm webpack` again. This is quite slow. To make it faster leave `npm run watch` running. It actually just runs `webpack --watch`


### Mac OS X

Install XCode via the App Store

> I get the error: `gyp: No Xcode or CLT version detected!`
Fix with:

```
sudo xcodebuild -license accept
```

> I get the error: `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`
Fix with:

```
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
```

> I get the error: `[webpack-cli] Error: Could not find lzma_native binding`
Try removing node_modules and running `make electron-develop` again.

### Linux

Should work OOTB, please create issue if not.

* Note: Might have to downgrade to Node 14


### FreeBSD

Should work OOTB, please create issue if not.

* Note: Might have to downgrade to Node 14
 
For me the question is: what can this app do, which other programs on FreeBSD cannot do (yet)?

The command line way would be to use dd. And if you want something with a GUI, then there's unetbootin being available which fits that spot quite nicely.

There's IMHO nothing Balena can do which the latter cannot. So there's no strong need to have Balena being available at all on FreeBSD.

More importantly still Electron as its underlying framework is a resource and memory hog directly from hell, because it is basically Chromium running all over the time in the background. Maintaining Electron to be always up to date is challenging.
 
Etcher can autodetect whether a device has enough storage space to fit the dd img or iso. Other than that dd isn't much different, although it wouldnt surprise me if dd has that feature as well I just havent come across it out of not checking.
 
For me the question is: what can this app do, which other programs on FreeBSD cannot do (yet)?

The command line way would be to use dd. And if you want something with a GUI, then there's unetbootin being available which fits that spot quite nicely.

There's IMHO nothing Balena can do which the latter cannot. So there's no strong need to have Balena being available at all on FreeBSD.

More importantly still Electron as its underlying framework is a resource and memory hog directly from hell, because it is basically Chromium running all over the time in the background. Maintaining Electron to be always up to date is challenging.
100% agree, Electron is a vialation of the Geneva convention. The god aweful load times and the 3 digit RAM usage for a glorified copy-paste operation is painful.

However, I did have times in the past, where for whatever reason SD images would not read properly, when just written directly with dd. Writing it with Etcher solved it. There is some more logic underneath I believe.
Etcher is a go-to "just works" application, highly user-friendly. That design goal it fullfulls masterfully. It has a place and I'm happy it got ported.
 
… what can this app do, which other programs on FreeBSD cannot do (yet)? …

Post-write verification, with a GUI. From <https://www.balena.io/etcher/>:

1625943984691.png


These build instructions honestly look like a mistake.

I haven't viewed them recently, but I did try, a few months ago, to build on FreeBSD.

… I'm happy it got ported.

For clarity: it's not in the FreeBSD ports collection.
 
Last edited:
For me the question is: what can this app do, which other programs on FreeBSD cannot do (yet)?

The command line way would be to use dd. And if you want something with a GUI, then there's unetbootin being available which fits that spot quite nicely.

There's IMHO nothing Balena can do which the latter cannot. So there's no strong need to have Balena being available at all on FreeBSD.

More importantly still Electron as its underlying framework is a resource and memory hog directly from hell, because it is basically Chromium running all over the time in the background. Maintaining Electron to be always up to date is challenging.
I totally agree, the command dd is the easiest and not only that, it is already in your system, you don't have to download any additional software.
 
For me the question is: what can this app do, which other programs on FreeBSD cannot do (yet)?

The command line way would be to use dd. And if you want something with a GUI, then there's unetbootin being available which fits that spot quite nicely.

There's IMHO nothing Balena can do which the latter cannot. So there's no strong need to have Balena being available at all on FreeBSD.

More importantly still Electron as its underlying framework is a resource and memory hog directly from hell, because it is basically Chromium running all over the time in the background. Maintaining Electron to be always up to date is challenging.
- Installed unetbootin, got this: UNetbootin requires *mounted* MSDOSFS (FAT) filesystem to work against, it will not mount your USB memstick or SD card for you!
- It won't refresh - you have to restart the program for it to see a USB drive you connected.
- It won't unzip the ISO files automatically.
- It must be run as root (and you should already know how to configure your sudo or doas to make your system potentially insecure by running graphical programs as rood)
- Choosing FreeBSD as the OS to download, the highest version unetbootin shows is 8.0
- Options for image type are ISO and Floppy, my current machine has neither
- Chose Diskimage, yet unetbootin was stuck on "downloading files (current)"
- There is no Cancel or Stop option
- Closing the window gets you "You tried to close window 'UNetbootin 702" from application "unetbootin" (Process ID: 49004) but the application is not responding."
- Clicking on Terminate application does nothing

Sure dd works, but it'll clobber your hard drives if you're not at the top of your game every time you type in that command.

Just in case anybody takes these comments at face value and believes we already have all the tools we'll ever need.
 
Back
Top