Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): load usbboot adapter on start #2296

Merged
merged 1 commit into from
Aug 7, 2018
Merged

Conversation

zvin
Copy link
Contributor

@zvin zvin commented May 1, 2018

For some reason loading it later didn't work

Change-Type: patch
Changelog-Entry: Load usbboot adapter on start on GNU/Linux if running
as root.

@ghost ghost assigned zvin May 1, 2018
@ghost ghost added the in progress label May 1, 2018
@zvin zvin requested a review from jhermsmeier May 1, 2018 17:38
Copy link
Contributor

@curcuz curcuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zvin zvin added ready and removed in progress labels Jun 12, 2018
// to open USB devices.
if (os.platform() !== 'linux') {
// On GNU/Linux, we only support usbboot when running as root.
if ((os.platform() !== 'linux') || (process.geteuid() === permissions.UNIX_SUPERUSER_USER_ID)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this duplicating the functionality already contained inside permissions.isElevated() ? Or are you doing it this way simply to avoid using Promises?

Copy link
Contributor Author

@zvin zvin Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use isElevated() here as it returns a promise and we want to set exports now.

@ghost ghost added the in progress label Jun 19, 2018
@zvin zvin force-pushed the fix-usbboot-on-linux branch 6 times, most recently from e755567 to a880d97 Compare August 6, 2018 15:21
@ghost ghost assigned thundron Aug 6, 2018
@thundron thundron force-pushed the fix-usbboot-on-linux branch 2 times, most recently from a880d97 to 4e28fd8 Compare August 7, 2018 01:19
Change-type: patch
Changelog-entry: Load usbboot adapter on start on GNU/Linux if running as root.
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
@thundron thundron merged commit 49b70d0 into master Aug 7, 2018
@ghost ghost removed the in progress label Aug 7, 2018
@thundron thundron deleted the fix-usbboot-on-linux branch December 28, 2018 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants