2060 Commits

Author SHA1 Message Date
Benedict Aas
5771c0f56e fix: rid linux startup elevation (#1831)
We remove the Linux elevation meant for usbboot device access.

Reverts: https://github.com/resin-io/etcher/pull/1708
See: https://github.com/resin-io/etcher/issues/1819
Change-Type: minor
Changelog-Entry: Remove Linux elevation meant for usbboot.
2017-11-13 15:34:20 -04:00
Jonas Hermsmeier
8b13a23117
fix(sdk): Remove event listeners on unsubscribe (#1834)
Change-Type: patch
2017-11-09 14:44:42 +01:00
Benedict Aas
08b6397a9a minifix: remove duplicate debug enable in usbboot (#1835)
Changelog-Entry: Remove duplicate debug enabling in usbboot module.
Change-Type: patch
2017-11-09 12:05:55 +00:00
Jonas Hermsmeier
66441e28cb fix(sdk): Correct "subscribe" typos (#1832)
* fix(sdk): Correct "subscribe" typos
* test(dictionary): Add subsribe -> subscribe

Change-Type: Patch
2017-11-08 18:06:00 +00:00
Andrew Scheller
26b521411f
fix: Correct image.size usage in tests and code-comments (#1833)
image.size is always an object, never a plain number

Change-type: patch
2017-11-08 16:53:57 +00:00
Jonas Hermsmeier
03b252024e
fix(gui): Don't check elevation on start on Windows (#1822)
This fixes Electron startup on Windows

Change-Type: patch
2017-10-31 20:20:27 +01:00
Jonas Hermsmeier
68f3f695cd
feat(sdk): Implement continuous scanning (#1814)
This implements an SDK.Scanner which handles any given
adapters and manages the scans. This change enables continuous
scanning without the need to `.scan()` scheduling in other places.

Change-Type: minor
2017-10-31 18:05:32 +01:00
Jonas Hermsmeier
c0d25786ef
fix(scripts): Fix pip install in docker (#1818)
This works around the "Cannot fetch index base URL http://pypi.python.org/simple/"
error by installing pip==9.0.1 directly from the pypi.python.org/packages/

Change-Type: patch
2017-10-31 14:04:00 +01:00
Juan Cruz Viotti
8caf03327c
fix(usbboot): increase device reboot delay a little bit (#1815)
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-27 16:32:20 -04:00
Benedict Aas
9815f9a5a1 fix: set debug env variable on remote electron process (#1789)
We fix the DEBUG environment variable by setting it on the `electron.remote`
instead, and we also move the code to `lib/gui/app.js` and away from
`lib/gui/index.html`.

Changelog-Entry: Set the DEBUG environment variable on the remote
electron process.
Change-Type: patch

* use debug.enabled, fix drivelist env setting
* fix: set debug env variable on remote electron process
2017-10-27 20:42:57 +02:00
Benedict Aas
f2f5955264 feat(GUI): use tabindex and focus to navigate (#1745)
* feat(GUI): use tabindex and focus to navigate

We make navigating with the tab key easier by highlighting focused
elements more visibly, adding `tabindex` attributes to elements, and
making `open-external` links respond to keyboard events.

Change-Type: minor
Changelog-Entry: Improve tab-key navigation through tabindex and visual improvements.
Connects-To: https://github.com/resin-io/etcher/issues/1734

* outline with 10s timeout

* use orange "warning colour" as outline

* smaller outline on settings buttons, fix order on settings page

* allow selection in drive-selector

* fix typo, better tabindexes
2017-10-27 20:41:47 +02:00
Jonas Hermsmeier
e5d69465ab test(Makefile): Update codespell excludes (#1811)
This adds excludes for .dtb, .dtbo, .dat, .elf, .bin, .foo, and xz-without-extension
to reduce unnecessary warning output in `make lint`.

```
WARNING: Binary file: lib/blobs/usbboot/bcm2709-rpi-2-b.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2710-rpi-cm3.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2708-rpi-cm.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2708-rpi-b.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2710-rpi-3-b.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2708-rpi-0-w.dtb
WARNING: Binary file: lib/blobs/usbboot/bcm2708-rpi-b-plus.dtb
WARNING: Binary file: lib/blobs/usbboot/overlays/dwc2.dtbo
WARNING: Binary file: lib/blobs/usbboot/raspberrypi/fixup_cd.dat
WARNING: Binary file: lib/blobs/usbboot/raspberrypi/start_cd.elf
WARNING: Binary file: lib/blobs/usbboot/raspberrypi/bootcode.bin
WARNING: Binary file: tests/image-stream/data/unrecognized/xz-without-extension
WARNING: Binary file: tests/image-stream/data/unrecognized/xz-with-invalid-extension.foo
```

Change-Type: patch
2017-10-26 19:21:56 +02:00
Juan Cruz Viotti
eba06a2139 style(usbboot): wait before scanning drives after the file server phase (#1799)
This is a workaround to prevent the USB device from disappearing after
the file server phase, until the resulting block device comes up.

By adding a delay after the file server phase, we prevent the USB
scanner from getting triggered again, therefore keeping the current USB
device visible in the drive selector modal.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-26 12:05:59 -04:00
Juan Cruz Viotti
daa847d29b feat(usbboot): add progress property to usbboot scanned drives (#1803)
This commit re-architects the usbboot adapter to prepare the drives in
the background, while emitting scan results every 2s, where each drive
has a `progress` percentage property.

Change-Type: minor
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-25 14:03:30 -04:00
Benedict Aas
433b2734bb feat: add sudo-prompt to start on linux (#1708)
We prompt the user with a sudo-prompt upon launch on Linux-based systems
to ensure the program has enough permissions for features needed
throughout the program's runtime.

Changelog-Entry: Add a sudo-prompt upon launch on Linux-based systems.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-25 11:27:40 -04:00
Juan Cruz Viotti
02f7a5f55b refactor(SDK): make adapter scan functions event based (#1781)
* refactor(SDK): make adaptor scan functions event based

This change will allow us to start emitting progress events out of the
adaptors scan functions.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

* refactor(sdk): Make adapters event emitters
2017-10-25 13:26:43 +02:00
Benedict Aas
2556807166 feat(GUI): add optional progress bars to drive-selector drives (#1800)
We show a progress bar for any drive objects with a `progress` field
that isn't falsy, e.g. `undefined` or `0`.

Changelog-Type: minor
Changelog-Entry: Add optional progress bars to drive-selector drives.
2017-10-24 14:43:43 -04:00
Juan Cruz Viotti
5bf6633cbe refactor(sdk): add bus number, device address, and ids in usb devices (#1802)
The combination of bus number and device address is the only way to
uniquely identify a USB device, so we'll use that for the `device` and
`raw` properties.

Also, we store the USB vendor and product IDs as properties of the
drives, since they will be handy when implementing the prepare function.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-24 14:32:33 -04:00
Jonas Hermsmeier
acb4271833 doc(CONTRIBUTING): Add note about msvs_version on Windows (#1794)
This adds a small note about setting the `msvs_version`
in the npm config on Windows.

Change-Type: patch
2017-10-20 22:11:31 +02:00
Jonas Hermsmeier
dd0bb43616 upgrade(package): Bump resin-corvus to beta.30 (#1795)
This updates resin-corvus to v1.0.0-beta.30, fixing an issue
with attempting to use https transport in browserland.

Change-Type: patch
2017-10-20 22:11:13 +02:00
Juan Cruz Viotti
a11a22453a fix(usbboot): handle LIBUSB_ERROR_NO_DEVICE when claiming a USB interface (#1796)
Consider the following scenario:

- Usbboot runs successfully on a device
- Before the block device gets a chance to appear, we run usbboot again

If we're fast enough, usbboot will try to claim the device interface,
but then the drive might not be there anymore, causing a
`LIBUSB_ERROR_NO_DEVICE`.

This commit addresses that scenario, and simply ignores the drive.

Change-Type: patch
Changelog-Entry: Fix `LIBUSB_ERROR_NO_DEVICE` error at the end of usbboot.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-20 11:10:12 -04:00
Juan Cruz Viotti
39e6207183 feat(usbboot): add new files that provide better speed (#1775)
We currently ship with `bootcode.bin` and `start.elf` from the Raspberry
Pi Foundation, which provide a writing speed of about 6 MB/s. This PR
includes new boot files by resin.io that boost the speed to ~20 MB/s.

Change-Type: minor
Changelog-Entry: Increase the flashing speed of usbboot discovered devices.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-20 10:36:35 -04:00
Juan Cruz Viotti
88ef235987 fix(usbboot): handle device disconnections (#1798)
This commit handles errors that can come up when unplugging the drive
halfway through the process. After tons of experimentation, the errors
than seem to occur are:

- `LIBUSB_TRANSFER_CANCELLED`
- `LIBUSB_ERROR_NO_DEVICE`

When these errors happen, we can omit the drive, and also not try to
close it, since given the device is no longer there, the close operation
bails out with a strange error message.

Change-Type: patch
Changelog-Entry: Gracefully handle scenarios where a USB drive is disconnected halfway through the usbboot procedure.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-20 08:50:58 -04:00
Jonas Hermsmeier
32399ba8a1 upgrade(package): Update Electron v1.6.6 -> v1.7.9 (#1784)
This updates Electron from v1.6.6 to v1.7.9

Change-Type: patch
Changelog-Entry: Update Electron to v1.7.9
2017-10-18 21:19:23 +02:00
Jonas Hermsmeier
42052dde9f doc(CONTRIBUTING): Remove refence to "install script" (#1790)
This removes a confusing reference to an "install script"
in the dependency section.

Change-Type: patch
2017-10-18 17:43:07 +02:00
Jonas Hermsmeier
ea686ee8e2 doc(CONTRIBUTING): Add libudev requirement to docs (#1787)
Closes #1771
Change-Type: patch
2017-10-18 14:20:47 +02:00
Juan Cruz Viotti
df05d4cc08 fix(usbboot): opening device debug message prints undefined (#1776)
We have a debug message that prints `device.name`, which is not a valid
property, and therefore the debug logs show `undefined` instead of the
USB id pair.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-17 10:47:34 +01:00
Juan Cruz Viotti
e54a8ae92b fix(GUI): improve usbboot USB device branding (#1780)
- Add a loading SVG icon while usbboot is running
- Make the device description more user friendly

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-17 10:47:14 +01:00
Juan Cruz Viotti
0f8043b35b fix(GUI): don't show the "too small" badge if the size is null (#1779)
Some devices don't have a size, like USB devices in the usbboot adaptor.
The `.isDriveLargeEnough()` correctly returns `false` in this case,
however we don't want to show the `TOO SMALL` badge for aesthetics
purposes.

So if a drive has a size that equals `null`, we don't allow such drive
to be selected, and we don't show a badge for it.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-16 17:51:55 +01:00
Juan Cruz Viotti
ec1f3665eb fix(GUI): don't display hyphen in drive selection entry if no size (#1778)
Some drives, like usbboot USB devices, don't have a size associated with
them, which results in the drive selection widget showing a hyphen with
nothing at the side, which looks a bit weird.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-16 16:07:48 +01:00
Juan Cruz Viotti
444072db13 refactor(GUI): generalize the concept of a "pending" drive (#1777)
This commit introduces a boolean `disabled` property rather than a
`pending` flag. Making this distinction clearer means that we can now
treat pending drives in different ways needed to improve the usbboot
experience.

Also, for usbboot, this commit removes the "pending" badge and uses a
more descriptive drive description instead.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-16 12:09:38 +01:00
Niklas Higi
6acfcfd23c fix(GUI): make sure progress button is always rounded (#1768)
At the moment the progress button which has slightly rounded corners
allows the "__bar" to overflow. This causes the corners to become
angular again which looks weird. I set the button's "overflow" to
"hidden" to fix this issue.

Changelog-Entry: Make sure the progress button is always rounded.
Change-Type: patch
2017-10-14 14:41:00 +02:00
Juan Cruz Viotti
78fdc5b07e feat(GUI): add some branding to usbboot-discovered devices (#1764)
- Add a nice icon in the drive selector dialog when a device has been
  discovered through usbboot

- Change the name of usbboot-initialized devices to "Compute Module"

Change-Type: minor
Changelog-Entry: Add eye candy to usbboot initialized devices.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-11 03:53:34 +01:00
Juan Cruz Viotti
f5fcdf4acb fix(sdk): increase bulk transfer usb timeouts (#1759)
We experienced timeouts when sending big files (ie ~14 MBs). Setting the
timeout to 0 makes the timeout infinite.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-10 23:59:49 +01:00
Juan Cruz Viotti
8aa58a722b fix(sdk): set usbboot control transfer timeout to infinite (#1760)
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-10 21:35:59 +01:00
Gergely Imreh
f7b0291bf8 fix(sdk): usbboot command typos (#1758)
Change-type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-10 19:06:00 +01:00
Juan Cruz Viotti
179597b86f upgrade: drivelist to v5.2.4 (#1755)
See: https://github.com/resin-io-modules/drivelist/pull/229
Change-Type: patch
Changelog-Entry: Fix permission denied issues when XDG_RUNTIME_DIR is mounted with the `noexec` option.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-09 10:47:56 +01:00
Juan Cruz Viotti
f6a7b2add6 feat: implement usbboot adapter (#1686)
This commit installs `node-usb` v1.3.0 from GitHub, since that version
was never published to NPM, and is the only one that works with Visual
Studio 2015 (see https://github.com/tessel/node-usb/issues/109).

The usbboot communicates with a Raspberry Pi / Amber through USB and
eventually mounts it as a block device we can write to.

This feature bundles bootcode.bin and start.elf from the original
usbboot implementation.

The flow is the following:

- On each scan, the usbboot scanner will try to get a usbboot compatible
  USB device to the next "phase", until they are all transformed to
  block devices the user can flash to as usual

Change-Type: minor
Changelog-Entry: Integrate Raspberry Pi's usbboot technology.
Fixes: https://github.com/resin-io/etcher/issues/1541
See: https://github.com/raspberrypi/usbboot
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-06 14:19:35 +01:00
Jonas Hermsmeier
3147a93ca6 feat(image-stream): Support .bin image extension (#1750)
This adds support for selecting images with a `.bin` file extension.

Change-Type: minor
Closes #1739
2017-10-03 18:13:02 +02:00
Jonas Hermsmeier
cb7117a36b upgrade(node-stream-zip): 1.3.4 -> 1.3.7 (#1730)
This fixes RangeErrors occurring with some zip files.

**Changes:**

- Fixed compatibility with node.js v0.10
- Fix error unpacking archives with a special comment
- Fix descriptive error messages

Change-Type: patch
Changelog-Entry: Fix Etcher being unable to read certain zip files
2017-09-22 20:15:29 +03:00
Jonas Hermsmeier
b5912eb9f6 fix: Support raw images without secondary file extension (#1724)
This allows selection of images without a secondary file extension
(i.e. `example.gz`, compared to `example.img.gz`) by defaulting to `img`
in the image-stream handlers, should no secondary extension be found.

Further this adjusts `.getPenultimateFileExtension()` to return `null`
if the detected penultimate extension is not a known file extension.

Change-Type: patch
2017-09-13 18:34:26 +02:00
Jonas Hermsmeier
a3c54f22c8 refactor(image-stream): Remove Promise props resolve (#1726)
This removes `Bluebird.props()` from the image type handlers,
as it's just a remnant when some properties in the return value
were Promises that needed resolving.

Change-Type: patch
Connects To: #1724
2017-09-13 13:56:51 +02:00
Juan Cruz Viotti
70edfa384b chore: fix CLI packaging snapshot relative directory (#1713)
The current CLI releases are broken. Seems that `pkg` creates the
application snapshot based on the current working directory, so at the
moment, the snapshot gets created based on the root of the project,
rather than based on the dist/Etcher-cli-* directories, causing the
native add-ons to not be resolved correctly.

Fixes: https://github.com/resin-io/etcher/issues/1706
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-11 10:45:28 -04:00
Juan Cruz Viotti
077eb5b079 upgrade: mountutils to v1.2.2 (#1712)
See: https://github.com/resin-io-modules/mountutils/pull/45
Change-Type: patch
Changelog-Entry: Retry ejection various times before giving up on Windows.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-08 15:43:46 +02:00
Jonas Hermsmeier
e654311997 chore(package): Bump resin-corvus to 1.0.0-beta.29 (#1720)
This updates `resin-corvus` to version 1.0.0-beta.29, switching
Mixpanel and Sentry analytics to HTTPS transports.

Changes:

- fix(sentry): Default to HTTPS transport
- fix(mixpanel): Use HTTPS transport
- test: Use standardjs for linting
- doc(README): Add CI & npm badges
- fix(ci): Fix Appveyor Node version matrix
- refactor: Ensure Node 4 compatibility

Change-Type: patch
Connects To: #1718
2017-09-06 11:12:18 +02:00
Juan Cruz Viotti
0d0ddd549b upgrade: drivelist to v5.1.8 (#1714)
Fixes: https://github.com/resin-io/etcher/issues/1699
Change-Type: patch
Changelog-Entry: Try to use `$XDG_RUNTIME_DIR` to extract temporary scripts on GNU/Linux.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-04 09:56:41 -04:00
Juan Cruz Viotti
ce466bd6ad docs(README): execution -> executable (#1715)
See: https://github.com/resin-io/etcher/pull/1703
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-04 09:56:29 -04:00
Juan Cruz Viotti
f67f25bcdc chore: don't zip AppImages (#1703)
See: https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages#common-mistake
See: https://github.com/resin-io/etcher/pull/772
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-28 11:27:01 -04:00
Juan Cruz Viotti
488f281ec7 chore: build armhf on GNU/Linux (#1482)
This commit makes use of the `resin/armv7hf-debian` Docker image to
test and generate armhf builds.

We needed to add a slash before `build` in `.gitignore` given that git
was refusing to include any changes on `scripts/build` otherwise.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-28 11:26:36 -04:00
Juan Cruz Viotti
7b791d622f feat(GUI): support new "pending" drive flag (#1709)
We recently added a "pending" flag to all drives that represents whether
the drive is ready for selection or not. This flag will be used by the
"usbboot" flashing adaptor, which will emit various "pending" USB
devices while it converts them to block devices that can actually be
flashed.

In terms of the GUI, the following visible changes were made:

- Drives with a `pending: true` property will be disabled in the drive
  selector window
- Drives with a `pending: true` property have a "PENDING" red badge

See: https://github.com/resin-io/etcher/pull/1707
See: https://github.com/resin-io/etcher/pull/1686
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-24 19:56:12 -04:00