Closed Bug 1000918 Opened 10 years ago Closed 10 years ago

Update getDeviceRoot sdcard discovery logic to suit Firefox OS devices

Categories

(Testing :: Mozbase, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla32

People

(Reporter: zcampbell, Assigned: ahal)

References

Details

Attachments

(1 file)

We discusssed in https://bugzilla.mozilla.org/show_bug.cgi?id=999506#c14

Andrew Halberstadt [:ahal] 2014-04-23 06:10:56 PDT
So changing the ordering to:

- /storage/sdcard0
- /storage/sdcard1
- /sdcard
- /mnt/sdcard
- /data/local

should work?

Zac C (:zac) 2014-04-23 06:26:47 PDT
That would work ahal.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Blocks: 999506
This patch will switch emulators from using /data/local to /sdcard. I'm not sure what affect if any this might have on tests, but here is a try run to find out:
https://tbpl.mozilla.org/?tree=Try&rev=5151d5365ee0

If that fails and it is too hard to fix, we can move /sdcard below /data/local and then Zac can manually override the default by passing in 'deviceRoot' to the dmADB constructor.
Attachment #8411955 - Flags: review?(wlachance)
Comment on attachment 8411955 [details] [diff] [review]
add new mozdevice default root paths

Review of attachment 8411955 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm as long as try passes. I don't anticipate this causing any problems.
Attachment #8411955 - Flags: review?(wlachance) → review+
Blocks: 1003158
Actually now that I think of it I should probably land this myself to make sure it goes in before bug 1003255
Keywords: checkin-needed
Oops, too late, mid-air collision! Never mind, the patches went in in the correct order.
https://hg.mozilla.org/mozilla-central/rev/ec6b9792a042
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Repeating myself over here at Zac's sugestion...

(In reply to Zac C (:zac) from comment #0)
> We discusssed in https://bugzilla.mozilla.org/show_bug.cgi?id=999506#c14
> 
> Andrew Halberstadt [:ahal] 2014-04-23 06:10:56 PDT
> So changing the ordering to:
> 
> - /storage/sdcard0
> - /storage/sdcard1
> - /sdcard
> - /mnt/sdcard
> - /data/local
> 
> should work?

So, personally, I don't think that hardcoding paths is the right thing to do.

A couple of corrections from previous comments:
1 - /sdcard is almost always a symlink to the real sdcard volume location.
2 - /mnt/sdcard should always be a mount point and not a symlink.

On devices which have sharable sdcards, (i.e. sdcard is in a separate partition), then you should be able to do:

adb shell vdc volume list | grep sdcard

On devices like the hamachi, this will return something like this:

110 sdcard /mnt/sdcard 4

which tells us that /mnt/sdcard is the mount point. Some devices have sdcard and extsdcard volumes, so you'll probably need to refine the grep to make sure you're getting the right place. /storage/sdcard0 and /storage/sdcard1 is peak/keon specific, not generic. Helix and Leo both use different schemes from that and from each other IIRC.

On devices, like the Nexus-4, which have no sharable sdcard, you should probably just use /sdcard.

On the nexus4, /sdcard is a symlink to /storage/emulated/legacy and /storage/emulated/legacy is a symlink to /mnt/shell/emulated/0

Oh yeah, /data/local is never a place that device storage would look for files, except if someone sets up a fake volume to allow that to happen (I've done this for testing, but it doesn't happen on normal phones).
You need to log in before you can comment on or make changes to this bug.