meefik / linuxdeploy

Install and run GNU/Linux on Android
https://meefik.github.io/linuxdeploy
GNU General Public License v3.0
5.17k stars 678 forks source link

Mount Folder, Premissions, Documentation & Busybox #745

Open s243a opened 7 years ago

s243a commented 7 years ago

The tutorials that I came across are very basic which is great if everything works but if someone runs into trouble it would be helpful to have more documentation about how Linux deploy works. I wrote about some of my problems on FMS (a usnet like plugin for freent): http://127.0.0.1:8080/forumviewthread.htm?threadid=9202&boardid=158#26726 Mirrored at: https://www.pearltrees.com/s243a/linux-deploy/id17177923/item197565582

but I will simplify here for the benefit of the readers. The biggest question I have is where is the best place to mount the image at. The default location seems to be at: /data/local/mnt/

On my system. I don't have permission to mount at this point. I'm inclined to think the best place to mount it at might be at something like: /data/data/ru.meefik.linuxdeploy/mnt/debian/ or /storage/99999/run.meefik.linuxdeploy/mnt/debian/ where /storage/99999/ is the location of my external SD card on my samsun note 4. Well not exactly. 99999 is replaces some other set of numbers which I replaced since I don't know if it is a security feature of my phone.

The point being here is that if it is under the linux deploy directory then it shouldn't be any permission issues. The downside is I don't know if linuxdeploy might inadvertently alter something that I put in this folder. I could pick a mount point outside of this folder but then I may need to modify the folder permissions.

Now regarding documentation, there should be as a minimum a document which explains each and every setting in linux deploy. People seem to be getting confused. For instance I saw one person saying that he set the environment path to somewhere in the system folder. Fortunately my phone gives me an error if I try this, to keep me from over-writing important system components. I think there is a way under superSu to elevate my permission enough so I won't get this error but it doesn't seem like a good idea to give my self permissions I don't need.

From what I can tell all the env path seems to do is copy the following files into the env directory .ash_history .nomedia cli.conf cli.sh /cong/debian_arm.conf /include/*

The file cli.conf seems to define the mount point. I may try changing this to one of my settings above. It would be better if the mount point was a configuration option.

Now regarding Busybox. Linux deploy wasn't doing anything for me without busybox although none of the tutorials say it is required. Oddly though linux deploy seems to have it's own copy of busybox under: /data/data/ru.meefik.linuixdeploy/ or equivanetly /data/user/0/bu.meefik.linuxdeploy/bin

which isn't symbolically linked to the version of busybox that I installed. I don't know if this is linuxdeploys own version of busybox or if it copied the files from the version of busybox that I installed. Some people are suggesting replacing this with a symbolic link. See issues: https://github.com/meefik/linuxdeploy/issues/670 https://github.com/meefik/linuxdeploy/issues/157

some guidince when and under what circumstance that a person should do this would be helpful. Even if it isn't something that some should do, some discussion about why-not would be interesting.

WilsonBradley commented 6 years ago

Anything new? Same, seem to have problems mounting folder on external SD.

th8a commented 6 years ago

To my surprise, it would seem that linuxdeply ignores ones links or mountpoints and does things it's own way regardless of your sdcard configuration or mounting setup. For instance, I set a directory install path to point to a mountpoint in which my external sd card is mounted on, /data/sdext2/. That card is 64gb in size and ext4 partition. I have a full distro of kali running off of if it perfectly using nethunter, but when I try to install ubuntu using linux deploy, it will install the files to /data/sdext2, however it writes the directory to the internal memory as if no card was mounted there at all! That got really confusing when some attempts to browse the files in my card showed the files that were on my external sd and other attempts showed only the files that linux deploy installed internally. At first I thought it somehow erased everything on my sdcard! thankfully, that is not the case. I am finding that ldeploy does not play nice with symlinks or mount --bind. Im not sure how this behavior is even possible, but I think it has to do with something involving the mountpoints of linux deploy pointing at nodes instead of pointers, as even when I install ubuntu normally and then copy/link/mount the files on the external memory, is still behaves as if there is no card mounted and seems unaware of any memory but the internal memory. Any fix/workaround for this would be great, as I cannot really install anything in my ubuntu without maxing out my internal memory and screwing up everything in the process.

nottux commented 4 years ago

to mount a folder on my sdcard and internal memory on android 7.0, i first had to populate those folders otherwise they wouldn't mount. I set folders in settings like this: image

I think permission errors caused by androids way of accessing storage explained here. So when linux deploy mounts /sdcard folder, it doesn't really have access to storage directly and thus have to respect permissions set by android. Fix to problem maybe mounting sdcard manually https://forum.xda-developers.com/galaxy-s2/help/swap-internal-external-storages-4-4-t2548834/post56052673#post56052673

With sudo, i can read write execute to mounted folders whether its sdcard or internal just fine