944 Commits

Author SHA1 Message Date
Jonas Hermsmeier
d01b73a661
upgrade(package): Update udif 0.10 -> 0.13
This updates `udif` to 0.13.0:

**v0.13.0:**

- fix(readstream): Use strict mode for compat with Node 4
- refactor(lib): Improve & fix zerofill streaming
- test: Add passthrough to check for read/push after EOD
- test: Add compression method tests
- feat(udif): Add LZFSE compression type constant
- fix(readstream): Fix passing on readable stream options

**v0.12.0:**

- feat(image): Support use of custom `fs` instances
- feat(readstream): Stream ZEROFILL & FREE blocks

Fixes a buffer allocation failure on large zerofill ranges.

Change-Type: patch
Changelog-Entry: Fix "Array buffer allocation failed" when flashing some .dmg images
2018-02-08 16:11:56 +01:00
Jonas Hermsmeier
5754b4c6af
feat(gui): Add ref params to homepage links in menu
This adds a `ref` param to the URLs in the menu,
in order to see where page views are coming from.

Change-Type: patch
2018-02-08 13:42:53 +01:00
Benedict Aas
e769ef7d0b feat(GUI): replace ng-show and ng-hide with ng-if
We replace `ng-show/hide` with `ng-if` on the main page in order to
remove unnecessary calls and become more efficient.

Changelog-Entry: Replace ng-show/hide with ng-if on main page.
Change-Type: patch
2018-02-07 17:53:17 +00:00
Benedict Aas
76a05d2dc9 fix: move tabindex attrs to button from within
We move the `tabindex` attributes to the button element directly from
elements contained within the button element – this is to satisfy the
HTML linter.

Changelog-Entry: Move tabindex attributes to button elements from
contained elements.
Change-Type: patch
2018-02-07 16:06:07 +00:00
Jonas Hermsmeier
a5aaf760d0
fix(gui): Fix DevTools opening in docked mode
This fixes the Developer Tools opening in docked mode by default.

Change-Type: patch
2018-01-29 21:59:46 +01:00
Benedict Aas
df2ebf93b6 refactor: replace lodash templates #1810 (#2006)
We replace the lodash templates with arrow-functions and change the
single-argument object into multiple arguments.

Fixes #1810 
Closes #2006 

Change-Type: patch
Changelog-Entry: Replace Lodash templates with arrow-functions.
2018-01-29 12:46:13 -08:00
Benedict Aas
4dc64ee15b
feat(GUI): add app to gui folder structure (#2002)
* feat(GUI): add app to gui folder structure

We add a `lib/gui/app/` folder to help transition to Webpack usage.

Change-Type: patch
Changelog-Entry: Add `lib/gui/app` folder to ease into Webpack usage.
2018-01-29 18:34:21 +00:00
Jonas Hermsmeier
a83ae05316
upgrade(package): Update yargs 4.7.1 -> 11.0.0 (#1995)
This updates `yargs` to 11.0.0

Change-Type: patch
2018-01-29 06:25:50 -08:00
Benedict Aas
b0e6170d93 fix: specify utf-8 encoding with meta tag (#2003)
We specify the encoding to be UTF-8 with a meta tag such that Electron
won't get confused and try any other encodings.

Change-Type: patch
Changelog-Entry: Specify UTF-8 encoding with meta tag.
2018-01-26 10:45:49 -08:00
Jonas Hermsmeier
890122894f
fix(gui): Fix menu's application name (#1996)
This replaces use of `electron.app.getName()` with the package.json's `.displayName`
property to ensure the correct application name is displayed when packaged.

Change-Type: patch
2018-01-26 07:04:54 -08:00
Jonas Hermsmeier
38ff0e39d6
fix(lib): Fix readonly property typo (#1986)
This fixes the camelcasing of the `.isReadOnly` property
of detected storage devices.

Change-Type: patch
2018-01-23 06:30:06 -08:00
Jonas Hermsmeier
e1ddbd300d
fix(gui): Allow selection of images in folders with extension (#1976)
This fixes selection of images contained in directories with a file extension
(i.e. "openSUSE-Leap-42.3-DVD-x86_64.iso") in the open file dialog.

Change-Type: patch
Changelog-Entry: Fix selection of images in folders with file extension on Mac OS
2018-01-19 06:27:07 -08:00
Jonas Hermsmeier
45c72f0c28
fix(usb): Ignore errors if winusb doesn't load (#1970)
Due to some Windows systems missing certain C runtime libraries
(Visual C/C++ 2012 / 2015 Redistributables), we ignore errors when loading
this module until we can ensure distribution of those along with it.

Change-Type: patch
Changelog-Entry: Fix "The specified module could not be found" on Windows
Fixes #1956
2018-01-18 09:11:46 -08:00
Jonas Hermsmeier
96dddecd4d
fix(writer): Silence IPC output on stdout (#1961)
This was causing the stdout maxBuffer size to be exceeded
when flashing larger images (or having flashes that took a while).

Fixes #1955 

Change-Type: patch
Changlog Entry: Fix "stdout maxBuffer exceeded" error on Linux
2018-01-08 23:09:55 +01:00
Jonas Hermsmeier
9b721d83dc
upgrade(package): Update drivelist 5.2.12 -> 6.0.0 (#1953)
* upgrade(package): Update drivelist 5.2.12 -> 6.0.0

This updates `drivelist` to incorporate the new native
bindings rewrite on Windows, fixing scanning errors.

Change-Type: patch
Changelog Entry: Fix "Couldn't scan drives" error

* test(drive-selection): Adjust to breaking drivelist changes

* fix(drivelist): Correct conditions in standard adapter

* refactor(usbboot): Adjust readonly & system flags

* doc(drive-constraints): protected -> isReadonly
2018-01-05 17:22:00 +01:00
Juan Cruz Viotti
9c624e8e52
chore: move updates disabling logic out of the Makefile (#1939)
The Makefile current has logic to disable updates when building deb or
rpm packages. To make the Concourse pipeline transition easier, the
logic that disables updates on deb and rpm has been moved to the main
application code.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2018-01-05 11:51:33 -04:00
Juan Cruz Viotti
2291321b46 refactor(GUI): remove the intermediate child writer proxy process (#1910)
Etcher currently elevates a child writer proxy that itself spawns the
Etcher CLI in robot mode, parses the output, and proxies those messages
to the GUI application over IPC.

After these set of changes, Etcher elevates a single child writer
process that directly communicates back with the GUI using IPC. The main
purpose behind these changes is to simplify the overall architecture and
fix various issues caused by the current complex child process tree.

Here's a summary of the changes:

- Stop wrapping the Etcher CLI to perform writing
- Remove the robot option from the Etcher CLI (along with related
  documentation)
- Elevate a new `child-write.js` standalone executable
- Move the relevant bits of `lib/child-writer` to the `image-writer` GUI
  module
- Remove the `lib/child-writer` directory
- Add a new "Child died unexpectedly" Mixpanel event
- Floor state percentage in the flash state model

The above changes made is possible to tackle all the remaining issues
where the writer process would remain alive even if the parent died.

Change-Type: patch
Changelog-Entry: Ensure the writer process dies when the GUI application is killed.
See: https://github.com/resin-io/etcher/pull/1873
See: https://github.com/resin-io/etcher/pull/1843
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2018-01-04 20:46:09 +01:00
Jonas Hermsmeier
4a6955c173
fix(gui): Re-enable application menu (#1888)
* fix(gui): Re-enable application menu

This re-enables the application menu to allow for OS native shortcuts
to work again (i.e. hide/minimize window), which also allows us to
get rid of the global-shortcuts hack to prevent window reloads.

Change-Type: patch
Changelog-Entry: Fix disabled native OS window shortcuts

* refactor(gui): Update kbd shortcut comment to be less specific
2018-01-04 18:07:10 +01:00
Juan Cruz Viotti
cb876436d4 fix(shared): trailing space in Windows elevation env vars (#1949)
This is a strange one. On Windows, putting a space before the
double-ampersand command concatenator makes the environment variable
value contain a trailing space. So for something like `set foo=bar &&
...` the variable `foo` will be `'bar '` instead of `'bar'`.

Change-Type: patch
Changelog-Entry: Fix trailing space in environment variables during Windows elevation.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2018-01-04 12:47:10 +01:00
Benedict Aas
13758c9568
feat(GUI): remove angular from image-writer (#1680)
* feat(GUI): remove angular from image-writer

We remove Angular from the `image-writer` module by using Redux store
updates, subscribing to them while flashing.

Changelog-Entry: Remove Angular dependency from image-writer.
Change-Type: minor
2018-01-04 11:12:08 +00:00
林博仁
737b3be5be docs: Add WoeUSB as an alternative tool to burn Windows USB images
By far WoeUSB is one of the few applications that support Windows image
and runs on GNU/Linux so I assume it is worth to mention it.  Additional
line wrapping is made to comply to the code conventions.

Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>
2017-12-28 05:26:50 +08:00
Jonas Hermsmeier
5387bf19d9
fix(writer): Add EBUSY to transient errors on Linux (#1918)
Change-Type: patch
2017-12-21 18:06:25 +01:00
Jonas Hermsmeier
74c0c13fbd
feat(writer): Add read/write retry delays (#1919)
Change-Type: minor
2017-12-15 16:09:11 +01:00
Juan Cruz Viotti
b703a6f5fb
feat(SDK): display Compute Modules even if host OS has no drivers (#1892)
This is the first step towards full usbboot Windows support. The driver
selector dialog will now display disabled devices to represent Compute
Modules even when Windows drivers are not installed to act on them.
These drives will state "Missing drivers."

Change-Type: minor
Changelog-Entry: Display connected Compute Modules even if Windows doesn't have the necessary drivers to act on them.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-13 13:37:34 -04:00
Juan Cruz Viotti
f8c3faec79
fix(GUI): only emit toggle drive event if drive is selectable (#1913)
Right now we emit "Toggle drive" analytics events even when clicking on
disable/unselectable drives.

The fix is to move the `analytics.logEvent` inside the code path that
applies if a drive selection is considered valid.

Change-Type: patch
Changelog-Entry: Don't send analytics events when attempting to toggle a disabled drive.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-09 16:57:12 -04:00
Jonas Hermsmeier
657142716c
fix(writer): Add missing read/write-retry handling (#1885)
This adds read- & write-retry handling of potentially temporary errors,
as well as errors due to device disconnection.

Change-Type: patch
Changelog-Entry: Fix handling of temporary read/write errors
2017-12-06 13:58:03 +01:00
Juan Cruz Viotti
618440e38f
fix(GUI): ensure settings are loaded before bootstrapping application (#1879)
We load localStorage settings into the Redux store in an asynchronous
way. This means that user settings might not be loaded by the time the
application starts, resulting in Mixpanel sending a few tracking events
before Etcher realises that the user opted out from anonoymous analytics
and error reporting.

In order to fix that, we remove `ng-app` and we manually bootstrap the
Angular.js application *after* the local settings are loaded.

Change-Type: patch
Changelog-Entry: Don't send initial Mixpanel events before "Anonymous Tracking" settings are loaded.
Fixes: https://github.com/resin-io/etcher/issues/1772
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-05 11:04:52 -04:00
Benedict Aas
f22938030d minifix: hide drive selector hyphen when no size info (#1900)
We hide the separator hyphen between the name and size when there is no
size information available, in the drive selector modal.

Change-Type: patch
Changelog-Entry: Hide the drive-selector separator hyphen when no drive
size is available.
2017-12-04 19:11:07 -04:00
Jonas Hermsmeier
69c3d61c28
fix(writer): Set flags manually to avoid verifying cache (#1875)
We change from using `rs+` to a composition of read/write,
exlusive, sync & direct i/o flags, in order to avoid reading
stale data from the cache during verification.

Change-Type: patch
Changelog-Entry: Fix verification step reading from the cache
2017-11-23 14:42:11 +01:00
Jonas Hermsmeier
4e891151f4
feat(writer): Display actual write speed (#1863)
As we've actually been displaying the read-speed in various
forms during the flashing process, this is a venture into
displaying the actual write-speed from the end of the pipeline.

Change-Type: minor
Changelog-Entry: Display actual write speed
2017-11-22 21:12:38 +01:00
Jonas Hermsmeier
f9085667d1
fix(child-writer): Reduce env vars passed during elevation (#1872)
As we're not escaping env vars properly in `permissions.getEnvironmentCommandPrefix()`,
passing the entire environment along can cause another instance of the "stuck at starting"
problem, thus we limit the vars explicitly passed along again, keeping PATH and DEBUG.

Change-Type: patch
2017-11-22 17:56:10 +01:00
Jonas Hermsmeier
ecedff2cdf
fix(writer): Fix verify size for unaligned images (#1868)
Change-Type: patch
2017-11-20 19:28:20 +01:00
Jonas Hermsmeier
6779e15872
fix(writer): Emit checksum event when verifying bmaps (#1859)
Due to the Blockmap.FilterStream not emitting a "checksum"
event (as it individually verifies specified ranges), the
flashing process would get stuck on finish.

This emits a "checksum" event on "finish" when blockmapping,
averting this issue.

Change-Type: patch
2017-11-17 22:56:25 +01:00
Jonas Hermsmeier
b3b52fce62
fix(writer): Don't calculate checksum before block-stream (#1858)
The checksum-stream being situated in front of the block-stream, which
ensures block size alignment to multiples of 512, and pads the last block,
caused the checksum to be incorrectly calculated for images where the last
block needed to be padded.

Change-Type: patch
2017-11-17 21:37:49 +01:00
Jonas Hermsmeier
0e02998faf
fix(gui): Re-enable printing progress in console (#1853)
Change-Type: patch
2017-11-17 14:36:21 +01:00
Jonas Hermsmeier
19275a5ba4
fix(gui): Disable outlines (#1854)
For the time being, the focus outlines are removed, until
we can improve the UX on this.

Change-Type: patch
2017-11-17 13:33:19 +01:00
Andrew Scheller
701893b472
fix(s3): Fix EAI_AGAIN error at startup with no internet connection (#1855)
Change-type: patch
2017-11-17 11:22:22 +00:00
Jonas Hermsmeier
66cb7293e7
fix(drive-scanner): Dynamically get unsafe mode setting (#1852)
Due to the SDK keeping it's options once initialized,
the unsafe mode setting change was not reflected on subsequent scans.

Change-Type: patch
2017-11-17 03:28:32 +01:00
Jonas Hermsmeier
773ddb6e9e
fix(child-writer): Pass parent env during elevation (#1851)
Change-Type: patch
2017-11-17 02:56:42 +01:00
Jonas Hermsmeier
7ebff68506 fix(store): Fix "Missing state eta" error on Infinity/NaN (#1850)
If the speed is zero, the eta becomes Infinity, which isn't transmitted
properly over IPC for at this time unknown reasons.
To prevent the "Missing state eta" error from popping up when the speed is
zero, we set the eta to zero as well in those cases.

Change-Type: Patch
2017-11-16 17:58:58 -04:00
Jonas Hermsmeier
bb4e6c74e0 fix(child-writer): Ensure tmpdir path has trailing slash (#1849)
There's a bug in node-ipc which doesn't allow it to handle
tmpdirs without trailing slashes; this works around this bug.

Change-Type: patch
2017-11-16 15:04:50 -04:00
Jonas Hermsmeier
5046af5313
fix(child-writer): Handle exits due to a signal (#1843)
This adds handling for cases where the writer child process
exits due to reception of a signal, while also adjusting some peripherals,
like the IPC socket directory and inherited process environment.

Another addition is that the child process is explicitly killed
should an error arise on the IPC.

Change-Type: patch
2017-11-15 15:52:57 +01:00
Jonas Hermsmeier
5e77958106
feat(writer): Implement streaming pipelines (#1671)
This implements a new way of image write streaming under use of pipage and blockmap, which paves the way for a few things like using network locations as sources, and imaging of storage devices (aka backups). As it allows for mutation of the streaming pipeline while it's writing, it also facilitates the development of dynamic block-mapping.

Change-Type: minor
2017-11-14 19:54:10 +01:00
Juan Cruz Viotti
63528ce8f3 fix(SDK): disable usbboot adapter on GNU/Linux (#1841)
Various GNU/Linux distributions require root access to be able to open
USB devices. This means that Etcher would need to be ran as root, which
is now not possible on Wayland based systems.

We declare usbboot as unsupported on GNU/Linux from the time being, but
we are currently working on a solution.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-11-14 18:00:01 +01:00
Josh Leeb-du Toit
e815d97265 fix(CLI): add check for drive flag with yes flag (#1753)
Add an options check for the `drive` flag to appear with the `yes` flag.
If the `yes` flag appears without the `drive` flag then a user error
will be thrown.

Change-Type: patch
Link: https://github.com/resin-io/etcher/pull/1753
Fixes: https://github.com/resin-io/etcher/issues/1454
2017-11-14 11:02:43 +00:00
Benedict Aas
0058919a8e
feat(GUI): add progress and status to window title (#1438)
* feat(GUI): add progress and status to window title

We add the progress percentage to the window alongside the status
(validating, flashing).

Closes: https://github.com/resin-io/etcher/issues/1427
Fixes: https://github.com/resin-io/etcher/issues/1439
Changelog-Entry: Add the progress and status to the window title.
2017-11-14 09:23:41 +00:00
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