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 <{link removed}>:

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.
 

rm -rf node_modules
make electron-develop
npm start

Code:
% git clone --recursive https://github.com/balena-io/etcher
Cloning into 'etcher'...
remote: Enumerating objects: 28072, done.
remote: Counting objects: 100% (180/180), done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 28072 (delta 68), reused 136 (delta 46), pack-reused 27892 (from 1)
Receiving objects: 100% (28072/28072), 97.56 MiB | 6.23 MiB/s, done.
Resolving deltas: 100% (17296/17296), done.
% cd etcher
% npm start

> balena-etcher@1.19.22 start
> electron-forge start

sh: electron-forge: not found
% rm -rf node_modules
% make electron-develop
make: don't know how to make electron-develop. Stop

make: stopped making "electron-develop" in /usr/home/grahamperrin/dev/etcher
% make electron-forge
make: don't know how to make electron-forge. Stop

make: stopped making "electron-forge" in /usr/home/grahamperrin/dev/etcher
%
 
Ether is my go-to for dding anything on Windows. I usually do Windows -> Fedora but their own image writer had failed media checks multiple times, and even Rufus too with its ddmode. Etcher's bulky 100MB+ portable package wrote no problem every time :p

Linux -> Windows I usually copy files from a Windows image as-is to a FAT32 or NTFS HDD for UEFI installs, but Legacy I used WoeUSB.

On FreeBSD I did dd to Linux no problem, and assume FAT32/NTFS directly would be fine too. WoeUSB I could deal without but I'd expect some commands to somehow hook up a Windows bootloader for Legacy boot.

But Etcher itself I only use as a GUI on Windows, since it's the most convenient thing that works reliably for me on Win; can deal with command-line anywhere else.
 
There is "dd" for regular OS.
For windows there is,
I was in need of Windows. Downloaded. Tried everything to get W10 iso to usb - including this one - none of them helped. Had to Install proxmox , download iso from url and create W10 VM inside Proxmox to get going and get W10 to usb lol.
What a journey !
 
Code:
% git clone --recursive https://github.com/balena-io/etcher
Cloning into 'etcher'...
remote: Enumerating objects: 28072, done.
remote: Counting objects: 100% (180/180), done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 28072 (delta 68), reused 136 (delta 46), pack-reused 27892 (from 1)
Receiving objects: 100% (28072/28072), 97.56 MiB | 6.23 MiB/s, done.
Resolving deltas: 100% (17296/17296), done.
% cd etcher
% npm start

> balena-etcher@1.19.22 start
> electron-forge start

sh: electron-forge: not found
% rm -rf node_modules
% make electron-develop
make: don't know how to make electron-develop. Stop

make: stopped making "electron-develop" in /usr/home/grahamperrin/dev/etcher
% make electron-forge
make: don't know how to make electron-forge. Stop

make: stopped making "electron-forge" in /usr/home/grahamperrin/dev/etcher
%
`make` is rarely the correct command for compiling Linux software on FreeBSD; they usually want gmake instead of our bmake and the two are not directly compatible.
 
On FreeBSD I did dd to Linux no problem, and assume FAT32/NTFS directly would be fine too. WoeUSB I could deal without but I'd expect some commands to somehow hook up a Windows bootloader for Legacy boot.

In-lieu of this, I have a USB DVD drive lying around, a bag full of DVD-Rs, and that's sounding more fun to mess with right now instead of command-line USB drive stuff :p (haven't burned a disc in years let alone installed Windows from one since probably Vista or 7)
 
Back
Top