Heimdall icon indicating copy to clipboard operation
Heimdall copied to clipboard

Flashing multiple devices at the same time?

Open bkruggel opened this issue 10 years ago • 10 comments

Hello and thanks a lot for your tool! I am trying to use heimdall to prepare many Samsung tablets at the same time and would like to be able to specify which device to use (like the "-s" flag with fastboot). Is there already something like this implemented?

bkruggel avatar Jul 16 '14 15:07 bkruggel

I wanted to flash multiple devices concurrently as well so I modified the bridge manager module to continue looking for additional supported devices after failing to claim interfaces (because another heimdall interface owns it).

https://github.com/jmguill/Heimdall/commit/74a0e4e62c95abf9572e835515ebd6e32765577c

This does work for my galaxy tabs, despite the commit message (flaky USB hub or something). Also I had to fork from 1.4.0 because 1.4.1 fails to handshake.

jmguill avatar Jul 23 '14 16:07 jmguill

@bkruggel I did plan to add a device select flag a long time ago but never got around to it (mainly because no-one asked for it). When I get a chance I'll add it.

@jmguill That's interesting regarding the 1.4.0 vs. 1.4.1 handshake failure. If you're able to provide USB packet captures of 1.4.0 succeeding and 1.4.1 failing then that would be extremely helpful. Something like http://wiki.wireshark.org/CaptureSetup/USB. but any format will do

Benjamin-Dobell avatar Jul 23 '14 17:07 Benjamin-Dobell

@Benjamin-Dobell I don't know if you have planned to implement this feature, but I want to signal that I'm also interested in ! Thanks for all your work :)

superboum avatar Aug 01 '14 11:08 superboum

Hi, Btw, right now I'm using something like this:

while [ -f *.restoring ] do sleep 30 done ./adb -s $1 wait-for-device ./adb -s $1 reboot download until ./heimdall detect | grep -q detected do sleep 5 done touch $1.restoring ./heimdall flash --BOOT $image_dir/boot.img --HIDDEN $image_dir/hidden.img --RECOVERY $image_dir/recovery.img --SYSTEM $image_dir/system.img rm $1.restoring

Seems to be working well enough.

Thanks again!

bkruggel avatar Aug 18 '14 18:08 bkruggel

This feature will be super useful to me too. Just a heads up: The guys at quarksecurity have forked this project (https://bitbucket.org/quarksecurity/heimdall) and implemented multiple devices, but it doesn't use the device identifier. It relies on the usb bus and port, which is kinda irritating for me.

munimkazia avatar Jan 22 '15 08:01 munimkazia

@bkruggel You should look at the lockfile command, by the way. It will make your script much more cleaner :)

munimkazia avatar Jan 22 '15 11:01 munimkazia

@munimkazia - I work for Quark Security. Not using the device identifier (vendor/product ID) is intentional. That identifier changes once the device boots and adb comes up. We want to flash a device, then configure that specific device via adb. We ensure we're communcating with the same device by flashing it based on bus and port via heimdall, then querying for the serial number for that bus and port once the device boots and adb comes up. THen we use the ADB_SERIAL environment variables to ensure the adb commands for that device are sent to that device and only that device.

We plan to eventually submit a pull request but we changed up some libusb deps and needed to revisit that implementation.

We also have a script that handles things like parsing a dumped PIT file and constructing a flash command based on that PIT and the all images available in a directory. We'll post this to our bitbucket repos soonish.

sshimko avatar Jan 22 '15 14:01 sshimko

We also have a script that handles things like parsing a dumped PIT file and constructing a flash command based on that PIT and the all images available in a directory. We'll post this to our bitbucket repos soonish.

For a long long time I've been meaning to add an autoflash command with syntax:

heimdall autoflash <file> [...]

Which just takes a list of files (no PIT file required). It will pull the PIT from the device, then verify that each filename in the list provided uniquely matches a filename in the PIT file and use this information to flash each file to its corresponding partition (or bail-out if the filenames don't all map).

Hopefully I'll get a chance to implement this and improve device support in the next month or two.

Benjamin-Dobell avatar Jan 22 '15 15:01 Benjamin-Dobell

@sshimko Hey. Thanks for the work on the fork so far. I will look forward to your PR. I was not familiar with those environment variables, so I have to look them up. Thanks for the help.
The new device IDs is not a problem to me, because we just need to flash boot images at my place of work right now, and the device IDs don't seem to change for that. I will look up the serial environment variables anyway.

@Benjamin-Dobell if the autoflash could pick up the correct device and interact with that one when multiple devices are connected, it would be awesome! But then again, I am just planning to flash the boot partition...

munimkazia avatar Jan 23 '15 12:01 munimkazia

Hi, I know it's been 7 years, but Heimdall is still being used and updated. Any updates on that multiple heimdall handling and usbdk support? Let me know please! Anyone have an updated branch?!

P3nguin-M avatar Apr 21 '22 21:04 P3nguin-M