We have moved to a new Sailfish OS Forum. Please start new discussions there.
21

[Bug] Yliaavanlampi: Android app doesn't have access to memory card. [answered]

asked 2015-02-22 00:25:27 +0300

javiermon gravatar image

updated 2016-08-17 14:39:55 +0300

jiit gravatar image

Hi

I'm using challenger viewer and I don't have access to the memory card. Previously I could access /media/sdcard/[card-id]/ but not now.

Any ideas how to fix this?

Thanks,

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by simo
close date 2015-05-06 23:34:15.323330

Comments

6 Answers

Sort by » oldest newest most voted
5

answered 2015-03-06 10:55:14 +0300

javiermon gravatar image

updated 2015-03-06 10:55:53 +0300

Hi all,

Thanks everyone for the workarounds and suggestions here. I already did my own workaround, which AFAIK works with any sd card formatted in any filesystem type jolla supports, here it is: https://gist.github.com/javiermon/3551dc42f03625ccb9a2

The point of this bug report was not to search for a workaround, but report that a previously working feature is now missing due to a implementation change in the new feature, i.e. a regression bug.

Thanks.

edit flag offensive delete publish link more

Comments

Hehe, proper solution. :-) Thx!

Moth ( 2015-03-07 14:03:16 +0300 )edit

I tried that, but then received:

[root@Jolla system]# systemctl enable mount-sd4android.service
Failed to issue method call: Bad message

Cannot see what went wrong at this point...

wcr ( 2015-03-08 19:52:56 +0300 )edit

@javiermon, thanks for your solution! Based on your answer, I created simple package for this (if someone need): https://openrepos.net/content/schturman/mount-sd-card-android-u11-only :)

Schturman ( 2015-03-10 00:19:14 +0300 )edit

@javiermon, your solution is not working for btrfs, as we have no p1 device. I think it just better do:

mkdir /opt/alien/sdcard_jolla
mount -o bind /media/sdcard /opt/alien/sdcard_jolla

and it will be universal solution

coderus ( 2015-03-10 04:31:24 +0300 )edit

@coderus, thanks for tip. And if we going to change it, we need to change this line in the service file:

[Unit] Description=Mount sd for android After=mount-sd@mmcblk1p1.service

What should be in the "After=" ? Thanks

Schturman ( 2015-03-10 12:43:15 +0300 )edit
4

answered 2015-02-22 00:42:15 +0300

foss4ever gravatar image

updated 2015-02-22 13:31:50 +0300

It's not a bug but a feature that in 1.1.2.15 onwards the AlienDalvik is running in chroot env and does not have access to the whole / -filesystem (but e.g. /home/nemo is available).

See more related discussion here: https://together.jolla.com/question/82037/release-notes-upgrade-112-yliaavanlampi-early-access/?answer=82150#post-id-82150

edit flag offensive delete publish link more

Comments

3

So what you're saying is that now I have to have all my data in the phone so that android app can consume it? I think it's a poor decision and I consider this a bug not a feature.

javiermon ( 2015-02-22 00:44:31 +0300 )edit
3

@javiermon don't get me wrong, but if you want to let google have a watch into every corner of your filesystem, you could just buy any android phone. so in my opinion it was a good decision from jolla. and as rudi mentioned below, sailfish is an linux os, so you could symlink your sd-card to your home directory to have access to your data again.

breiti_oi ( 2015-02-22 11:55:18 +0300 )edit
10

Breaking existing functionality at the expense of security or whatever the reason this chroot env for Dalvik was created is a regression bug in my book. If you are going to provide access to user's home in the chroot I see no reason why you cannot do the same for the sd-card.

Is the average Jolla user expected to workaround every bug a new firmware brings because it's a linux os and he can do so? Please stop calling this a feature because it's not. It's a missing existing feature of a re-implementation (the way the new firmware gives androir apps access to the filesystem). I understand this is an early access to the next firmware upgrade, so in my opinion this is a bug in this early preview and should be fixed before rolling the stable release.

javiermon ( 2015-02-22 12:03:41 +0300 )edit
9

I think that feature is good, but this is the bug. Jolla, you should make mount point or link to ~/Android_storage/Sd_card for the memory card. The memory card is must be available.

Makeclick ( 2015-02-22 12:19:40 +0300 )edit
2

@javiermon I'm saying nothing about your android app/data usage patterns etc., just that IMHO the chrooting of AlienDalvik was done for security/privacy reasons, so it's not a bug but a planned feature.

foss4ever ( 2015-02-22 13:31:21 +0300 )edit
4

answered 2015-03-07 21:38:00 +0300

Sthocs gravatar image

updated 2017-05-10 04:28:04 +0300

DarkTuring gravatar image

For those who want a quick solution without having to create/edit system files:

$ mkdir /home/nemo/sdcard
$ devel-su
# mount --bind /media/sdcard/xxx-xxx /home/nemo/sdcard

You can then access your SD card data from Android apps at path /home/nemo/sdcard

edit flag offensive delete publish link more

Comments

1

Thank you, good solution! Works fine for me.

AkiBerlin ( 2015-03-17 15:13:49 +0300 )edit

Does not work for Osmand, it claims about "I/O error", Osmand is unable to access the card.

Holger ( 2015-03-21 15:29:00 +0300 )edit

Yes it does. You have an "osmand" directory in the path you've set in OsmAnd? You've created the mounted directory with nemo user?

Sthocs ( 2015-03-21 22:42:10 +0300 )edit

Yes for both questions. In the sailfish file browser it works, but osmand says I/O error (eh strictly spoken it is Osmand+ ).

Holger ( 2015-03-22 12:18:09 +0300 )edit

Are you trying to read the maps stored on your SD card or downloading some new maps?

Sthocs ( 2015-03-24 12:37:49 +0300 )edit
4

answered 2015-05-06 22:17:59 +0300

Sthocs gravatar image

Hey, I just figured out that in 1.1.4, /dev/mmcblk1p1 is mounted into /opt/alien/media/sdcard/xxxx-xxxx, so Android app can read again SD card data from /media/sdcard/xxxx-xxxx, as in 1.1.1

If it's working also for you, you can mark this question as resolved.

edit flag offensive delete publish link more

Comments

Confirmed.

Moth ( 2015-05-06 22:47:46 +0300 )edit
3

answered 2015-03-06 10:23:41 +0300

wcr gravatar image

I think, unfortunately, here a really useful thing has been lost with the update and all solutions are hidden somewhere in several threads - why can we not have some clear how-to's for these situations which must arise in several places?

I use the sdcard, following some of the earlier threads, and this has survived at least one earlier update. But I cannot remember if I use btfrs, nor do I remember how to find out. I fear that my card COULD be in ext4.

So how do I get access to the card again, after this update, and ideally also without loosing all the data that is on it, and that was nicely accessible to the previous version of sailfish?

edit flag offensive delete publish link more
2

answered 2015-02-22 01:12:09 +0300

rudi gravatar image

updated 2015-02-22 01:46:11 +0300

there is an ugly workaround for this 'feature'
mount your sdcard also to e.g.
/home/nemo/whateverdir
your apps have access again. not funny, but working
you need to have developer mode enabled, but you need this already to run btrfs checks, to know the 'real' freespace of your device - to check, if updates are possible in general

edit flag offensive delete publish link more

Comments

this seems to work. put the following statement into /etc/fstab:

/dev/mmcblk1p1 /home/nemo/sdcard btrfs noatime,user 0 0

assumptions: sdcard formatted with btrfs, directory /home/nemo/sdcard exists

ortylp ( 2015-03-03 23:58:57 +0300 )edit

Question tools

Follow
3 followers

Stats

Asked: 2015-02-22 00:25:27 +0300

Seen: 2,987 times

Last updated: May 10 '17