-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lib/sdk/adapters/index.js
Outdated
// 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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
04a2532
to
43bb363
Compare
e755567
to
a880d97
Compare
a880d97
to
4e28fd8
Compare
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>
4e28fd8
to
26779ef
Compare
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.