Trying to build Etcher on Raspberry Pi 4

I tried

./node_modules/.bin/electron-builder --arm --linux deb

And it failed with the message:

Unknown argument: arm

It also dumped all the permitted commands, as if I had specified “–help”, and there are clearly only two arm-related choices, which are:

  --armv7l                 Build for armv7l                            [boolean]
  --arm64                  Build for arm64                             [boolean]

So, I’m going to try armv7l, just to see what happens.

When I try armv7l, I get the following, which seems like a lot of successful building followed by a failure to package, trying to run an x86 version of fpm on an arm machine.

pi@pi4:~/Documents/etcher $ ./node_modules/.bin/electron-builder --armv7l --linux deb
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
  • electron-builder version=20.40.2
  • loaded configuration file=/home/pi/Documents/etcher/electron-builder.yml
  • writing effective config file=dist/builder-effective-config.yaml
  • executing node-gyp rebuild arch=armv7l
  • rebuilding native production dependencies platform=linux arch=armv7l
  • packaging       platform=linux arch=armv7l electron=3.1.9 appOutDir=dist/linux-armv7l-unpacked
  • building        target=deb arch=armv7l file=dist/balena-etcher_1.5.60_armv7l.deb
Error: Exit code: 1. Command failed: /home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/fpm -s dir -t deb --architecture armv7l --name balena-etcher --force --after-install /tmp/t-Bew2la/0-after-install --after-remove /tmp/t-Bew2la/1-after-remove --description balenaEtcher is a powerful OS image flasher built with web technologies to ensure flashing an SDCard or USB drive is a pleasant and safe experience. It protects you from accidentally writing to your hard-drives, ensures every byte of data was written correctly and much more.
 Flash OS images to SD cards and USB drives, safely and easily. --version 1.5.60 --package /home/pi/Documents/etcher/dist/balena-etcher_1.5.60_armv7l.deb --maintainer Balena Inc. <hello@etcher.io> --url https://github.com/balena-io/etcher --vendor Balena Inc. <hello@etcher.io> --category utils --deb-compression xz --deb-priority optional --depends gconf2 --depends gconf-service --depends libappindicator1 --depends libasound2 --depends libatk1.0-0 --depends libc6 --depends libcairo2 --depends libcups2 --depends libdbus-1-3 --depends libexpat1 --depends libfontconfig1 --depends libfreetype6 --depends libgcc1 --depends libgconf-2-4 --depends libgdk-pixbuf2.0-0 --depends libglib2.0-0 --depends libgtk-3-0 --depends liblzma5 --depends libnotify4 --depends libnspr4 --depends libnss3 --depends libpango1.0-0 --depends libstdc++6 --depends libx11-6 --depends libxcomposite1 --depends libxcursor1 --depends libxdamage1 --depends libxext6 --depends libxfixes3 --depends libxi6 --depends libxrandr2 --depends libxrender1 --depends libxss1 --depends libxtst6 --depends polkit-1-auth-agent | policykit-1-gnome | polkit-kde-1 --license Apache-2.0 /home/pi/Documents/etcher/dist/linux-armv7l-unpacked/=/opt/balenaEtcher /home/pi/Documents/etcher/assets/iconset/16x16.png=/usr/share/icons/hicolor/16x16/apps/balena-etcher-electron.png /home/pi/Documents/etcher/assets/iconset/32x32.png=/usr/share/icons/hicolor/32x32/apps/balena-etcher-electron.png /home/pi/Documents/etcher/assets/iconset/48x48.png=/usr/share/icons/hicolor/48x48/apps/balena-etcher-electron.png /home/pi/Documents/etcher/assets/iconset/128x128.png=/usr/share/icons/hicolor/128x128/apps/balena-etcher-electron.png /home/pi/Documents/etcher/assets/iconset/256x256.png=/usr/share/icons/hicolor/256x256/apps/balena-etcher-electron.png /home/pi/Documents/etcher/assets/iconset/512x512.png=/usr/share/icons/hicolor/512x512/apps/balena-etcher-electron.png /tmp/t-Bew2la/2-balenaEtcher.desktop=/usr/share/applications/balena-etcher-electron.desktop
/home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: cannot execute binary file: Exec format error
/home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success

/home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: cannot execute binary file: Exec format error
/home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin/ruby: line 6: /home/pi/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86/lib/ruby/bin.real/ruby: Success

    at /home/pi/Documents/etcher/node_modules/builder-util/src/util.ts:126:16
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:600:12)
From previous event:
    at FpmTarget.build (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/targets/fpm.ts:93:44)
    at /home/pi/Documents/etcher/node_modules/app-builder-lib/src/platformPackager.ts:131:24
From previous event:
    at AsyncTaskManager.add (/home/pi/Documents/etcher/node_modules/builder-util/src/asyncTaskManager.ts:14:20)
    at LinuxPackager.packageInDistributableFormat (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/platformPackager.ts:123:17)
    at /home/pi/Documents/etcher/node_modules/app-builder-lib/src/platformPackager.ts:114:10
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
From previous event:
    at LinuxPackager.pack (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:430:24
    at Generator.next (<anonymous>)
    at xfs.stat (/home/pi/Documents/etcher/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /home/pi/Documents/etcher/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:155:5)
From previous event:
    at Packager.doBuild (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:396:24)
    at /home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:366:57
    at Generator.next (<anonymous>)
    at /home/pi/Documents/etcher/node_modules/graceful-fs/graceful-fs.js:111:16
    at /home/pi/Documents/etcher/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:141:20)
From previous event:
    at Packager._build (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:335:133)
    at /home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
From previous event:
    at Packager.build (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/packager.ts:288:14)
    at build (/home/pi/Documents/etcher/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/home/pi/Documents/etcher/node_modules/electron-builder/src/builder.ts:228:10)
    at then (/home/pi/Documents/etcher/node_modules/electron-builder/src/cli/cli.ts:46:19)

and, as previous posts have covered, so far I haven’t been able to get a proper fpm.

I’ve asked for help with this on the Raspberry Pi forum - perhaps they can help me get a working fpm installed, and then I can get back here to continue the build, trying @shaunmulligan’s tip about pointing to a local fpm.

Hello everyone,
It seems that another user successfully built a debian package for rpi4, you can check the forum thread here
@futurejones If you’re willing to give some feedback about the issues you encountered and how you overcame them, even if they made you switch to another path, that would be highly appreciated so we can hopefully enhance the documentation with the missing pieces and/or investigate more!

@thundron, I am working on that now. When I have successfully reproduced all the build steps I will post details.