Closed
Bug 1165830
Opened 10 years ago
Closed 10 years ago
Augment ADB Helper addon with Fastboot support
Categories
(DevTools Graveyard :: WebIDE, defect)
DevTools Graveyard
WebIDE
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gerard-majax, Assigned: gerard-majax)
References
Details
(Whiteboard: [spark][systemsfe])
Attachments
(1 file, 1 obsolete file)
We will need fastboot to be able to perform full device images flashing. The exposed interface should at least provide:
- fastboot devices, to enumerate existing devices
- fastboot reboot, to reboot a specific device into system
- fastboot getvar, to get variables out of a specific device
- fastboot flash, to flash an image to a partition onto a specific device
Assignee | ||
Comment 1•10 years ago
|
||
Current status is I have:
- fastboot devices
- fastboot reboot
- fastboot getvar
- a linux amd64 fastboot binary
I'm lacking:
- rebuilt from source with openssl static link of fastboot for: linux 32 bits and 64 bits, mac64 and windows
- fastboot flash
This generally seems like a useful thing to have.
Are you wanting to make use of this interface from inside WebIDE, or somewhere else?
Assignee | ||
Comment 3•10 years ago
|
||
Yes, that's something that will be useful, we already spoke about it with :ochameau :).
But for now, I'm focusing on the needs we need to fulfill for another addon :).
Hence, one question that either of you might be able to get me answer is: under which condition do you kill dynamic libraries ?
For adb, it was openssl that got compiled as static. Fastboot don't need it (my mistake in comment 1), but it does depend, on my laptop, on:
- zlib
- libpcre (I could not yet identify why, but ldd shows libpcre.so)
- libselinux
- libdl and libpthread of course
Killing the libselinux dep might be tricky, though.
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jryans)
I would think it's okay to keep these deps as dynamic, since I would not expect critical changes that affect its functionality from the libs. (Whereas, I would worry about it somewhat with adb and openssl.)
Alex may have a better opinion.
Flags: needinfo?(jryans)
Assignee | ||
Comment 5•10 years ago
|
||
fastboot flash implemented and working.
Assignee | ||
Comment 6•10 years ago
|
||
And I've pushed linux and linux64 fastboot binaries statically linked:
> linux64/fastboot:
> linux-vdso.so.1 => (0x00007ffd03d87000)
> libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff6f8c8c000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff6f88c8000)
> /lib64/ld-linux-x86-64.so.2 (0x00007ff6f8edd000)
> linux/fastboot:
> linux-gate.so.1 => (0xf77c7000)
> libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7774000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75c7000)
> /lib/ld-linux.so.2 (0xf77ca000)
Assignee | ||
Comment 7•10 years ago
|
||
Using strip and upx the fastboot binary goes from 800K to 280K.
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8606927 [details]
ADB Helper fastboot tree
Let's gather feedback on this where everything should be mostly good.
Attachment #8606927 -
Flags: feedback?(poirot.alex)
Attachment #8606927 -
Flags: feedback?(jryans)
Assignee | ||
Updated•10 years ago
|
Whiteboard: [spark]
Updated•10 years ago
|
Flags: needinfo?(poirot.alex)
Comment 9•10 years ago
|
||
Comment on attachment 8606927 [details]
ADB Helper fastboot tree
I think there is better ways to intregrate the "startsPoolingFastboot" method,
but overall I think that's right to integrate fastboot within adb helper somehow.
You may also have to tune the FastBootDevice object to avoid breaking WebIDE/Valence. (Haven't tried to run WebIDE to see if that breaks anything)
Attachment #8606927 -
Flags: feedback?(poirot.alex) → feedback+
Comment 10•10 years ago
|
||
About startsPoolingFastboot, I would like to tackle bug 1026945, then we would have a better answer to provide...
(In reply to Alexandre Poirot [:ochameau] from comment #10)
> About startsPoolingFastboot, I would like to tackle bug 1026945, then we
> would have a better answer to provide...
Yes, more people are complaining about ADB running on startup, so it would be good to fix bug 1026945.
Comment 12•10 years ago
|
||
See comment inlined on github:
https://github.com/lissyx/adbhelper/commit/e24ebcc974c671b3131b1a02df3ed0bdb2bf3047
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8606927 -
Attachment is obsolete: true
Attachment #8606927 -
Flags: feedback?(jryans)
Assignee | ||
Comment 14•10 years ago
|
||
Comment on attachment 8608087 [details]
Fastboot PR
So that should address all your previous feedback remarks.
Attachment #8608087 -
Flags: review?(poirot.alex)
Attachment #8608087 -
Flags: review?(jryans)
Comment on attachment 8608087 [details]
Fastboot PR
Overall it looks good to me! Remove the version change, and I think it's ready to merge.
Attachment #8608087 -
Flags: review?(jryans) → review+
Assignee | ||
Comment 16•10 years ago
|
||
Done, thanks. I still need to check on mac and windows (and build fastboot for windows, too).
Assignee | ||
Comment 17•10 years ago
|
||
I think I will need more infos on where to do the change you documented in bug 928416 comment 10 :)
Flags: needinfo?(jryans)
(In reply to Alexandre LISSY :gerard-majax from comment #17)
> I think I will need more infos on where to do the change you documented in
> bug 928416 comment 10 :)
Well, I am sure there's a way to do it while building from source, but I never figured that out in bug 928416.
Instead, I used the program PE Tools[1] to edit the binary later. It's kind of a scary program... I am sure there is a better way. :)
1. Open PE Tools
2. Tools menu -> PE Editor
3. Select the binary to edit in the file picker
4. Click the "Optional Header" button
5. Change the value of "Subsystem" from "0003" to "0002"
6. Click "OK" to close all dialogs (there is no save, I think it just writes immediately!)
[1]: http://sourceforge.net/projects/pe-tools/
Flags: needinfo?(jryans)
Assignee | ||
Comment 19•10 years ago
|
||
So, thanks to Paul Adenot, I could check on a Mac and the fastboot interface added into ADB Helper module do works as expected:
- devices gets detected by polling
- fastboot reboot works
- fastboot getvar works
- fastboot flash works
Assignee | ||
Comment 20•10 years ago
|
||
And pushed Windows fastboot after toggling like documented in comment 18!
Assignee | ||
Comment 21•10 years ago
|
||
I'd be happy if you could cross check on Mac and Windows on your side too. Basically, install the ADB Helper and B2G Installer modules, and then go to about:b2g-installer, then in the developper console type:
- Devices.emit("fastboot-start-polling")
If you have a fastboot devices it should show something in the JS Console
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jryans)
Comment 22•10 years ago
|
||
Comment on attachment 8608087 [details]
Fastboot PR
We may tweak:
Devices.on("fastboot-start-polling", fastboot.startPolling.bind(fastboot));
Devices.on("fastboot-stop-polling", fastboot.stopPolling.bind(fastboot));
When better integrating this into WebIDE, but I think that's reasonable until then.
Flags: needinfo?(poirot.alex)
Attachment #8608087 -
Flags: review?(poirot.alex) → review+
Does b2g-installer need a separate Mac build for testing? I only see Linux builds in your shared folder.
Flags: needinfo?(jryans) → needinfo?(lissyx+mozillians)
Assignee | ||
Comment 24•10 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #23)
> Does b2g-installer need a separate Mac build for testing? I only see Linux
> builds in your shared folder.
Yes, but you only need adbhelper for testing, making sure you can play with fastboot from it :)
Flags: needinfo?(lissyx+mozillians)
(In reply to Alexandre LISSY :gerard-majax from comment #24)
> (In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #23)
> > Does b2g-installer need a separate Mac build for testing? I only see Linux
> > builds in your shared folder.
>
> Yes, but you only need adbhelper for testing, making sure you can play with
> fastboot from it :)
Okay, I added some tiny style nits to the PR, but otherwise it works well on Mac for me.
Assignee | ||
Comment 26•10 years ago
|
||
Thanks. I've addressed the nits.
Assignee | ||
Comment 27•10 years ago
|
||
I've done some cosmetic changes mostly aiming to improve a bit readability and providing mode debugging messages in case we need. Also added a mutex to make sure we do not trigger multiple |fastboot devices| timers.
I have been able to successfully flash a couple of times my device with this, I think you can merge it.
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jryans)
Okay, merged! Thanks for working on this!
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jryans)
Resolution: --- → FIXED
Updated•10 years ago
|
Whiteboard: [spark] → [spark][systemsfe]
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•