Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared: NO such file or directory! #61

Closed
xqdoo00o opened this issue Mar 16, 2018 · 9 comments
Closed

Shared: NO such file or directory! #61

xqdoo00o opened this issue Mar 16, 2018 · 9 comments

Comments

@xqdoo00o
Copy link

In Termux, I setup storage and it's all right to access storage/shared.
But when I startarch, I only could access storage,
if I try to cd shared then, I got a warning like the title says.

SDRausty referenced this issue in termux/termux-packages Mar 17, 2018
@SDRausty
Copy link
Owner

@xqdoo00o thank you for posting this recent development. This is unfortunate.

Is it possible that this commit broke shared storage for PRoot? This issue shared:No such file or directory #61 just cropped up; and guess what? Cannot access shared storage on all devices developing TermuxArch as of this commit, possibly a previous one too. Is this from libraries PRoot uses?

From termux/termux-packages@fbd53df#commitcomment-28135580

@tomty89
Copy link

tomty89 commented Mar 17, 2018

All symlinks set up by termux-setup-storage points to /storage/emulated/0, but in a recent commit in TermuxArch, -b /storage has been changed to -b $EXTERNAL_STORAGE, which will be expanded to -b /sdcard, so in the Arch proot you can only access the internal storage from/sdcard, but not its realpath /storage/emulated/0.

@SDRausty
Copy link
Owner

While we are at the topic of debugging, output from bash setupTermuxArch.sh sysinfo is requested. This printout will also aid other projects like au and buildAPKs to name a couple which don't rely on automated system detection by themselves at present.

@tomty89 thank you for this update. Adding -b /storage/emulated/0/ worked on a device just tested. I shall be looking into this in more detail soon on more devices and architectures.

@xqdoo00o see whether editing statarch helps for now. Use cp startarch startarch1 before editing. When this topic is resolved, bash setupTermuxArch.sh refresh will update startarch to the newest version/release. An update is pending soon.

@tomty89
Copy link

tomty89 commented Mar 17, 2018

You can really just change it back to -b /storage. It was fine to use and I never really I asked you to change that (I only showed a script of mine that uses -b $EXTERNAL_STORAGE and told you what it refers to; it's ironic that you mimick that automatically but didn't fix you bash on $@ when I told you repeatedly to, with insanely detailed explanations).

/storage is a more general entry point which can lead you to the mountpoint of a "real" SD card when it exists as well.

I used -b $EXTERNAL_STORAGE because:

  1. I don't use a real SD card in addition to the internal storage (the emulated SD card)
  2. I don't use termux-setup-storage
  3. I always access the internal storage with the handy /sdcard symlink that exists already

But those are personal practice.

@tomty89
Copy link

tomty89 commented Mar 17, 2018

In fact you should probably avoid using the env vars anyway. I found it fancy at a point but it's actually kind of silly and unnecessary. So just do -b /data -b /storage or -b /data -b /storage -b /sdcard instead of -b $ANDROID_DATA -b $EXTERNAL_STORAGE. It will serve you better.

@SDRausty SDRausty changed the title shared:No such file or directory Shared : No such file or directory Mar 17, 2018
@SDRausty SDRausty changed the title Shared : No such file or directory Shared : NO such file or directory Mar 17, 2018
@SDRausty SDRausty changed the title Shared : NO such file or directory Shared : NO such file or directory! Mar 18, 2018
@SDRausty
Copy link
Owner

@xqdoo00o and @tomty89 exec proot... is restated time and again, this is being rewritten into a self building code block depending on the environment encountered. A little more effort, time and work at present should pay off once completed in a number of ways.

A self building PRoot statement that builds itself from the environment it finds itself in will be a timesaver for recoding TermuxArch in the future. Also, additional options to insert code into the PRoot statement will become possible through both knownconfigurations.sh and bash setupTermuxArch.sh options.

@SDRausty SDRausty changed the title Shared : NO such file or directory! Shared: NO such file or directory! Mar 18, 2018
@SDRausty
Copy link
Owner

rewritten into a self building code block

@xqdoo00o @tomty89 here it is, for your testing pleasure and code review:

prs ()
{
prootstmnt="exec proot"
if [ $koe ]; then
	prootstmnt+=" --kill-on-exit"
fi
if [ $kid ]; then
	prootstmnt+=" --kernel-release=4.14.15"
fi
prootstmnt+=" --link2symlink -0 -r $installdir -b $ANDROID_DATA -b /dev/ -b $EXTERNAL_STORAGE -b /sys/ -b /proc/ -b /storage/ -b $HOME -w $HOME /bin/env -i HOME=/root TERM=$TERM"
}

It is in knownconfigurations.sh. Use bash setupTermuxArch.sh manual to access the proot statment during install. It appears that this issue is resolved with added benefits for the user, provided the user understands proot statements. If you would like this proot statement tweeked, share a comment here.

@SDRausty
Copy link
Owner

@tomty89
Copy link

tomty89 commented Mar 19, 2018

  1. As I said, better to use -b /data -b /sdcard instead of -b $ANDROID_DATA -b $EXTERNAL_STORAGE
  2. You don't need -b $HOME when there's -b /data
  3. Order/group the -bs for readability, e.g. -b /proc -/b dev -b /sys -b /data -b /sdcard -b /storage
  4. You cannot have -w $HOME as a general option. Use -w $HOME for only login variants but -w $PWD for direct execution variants

Repository owner locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants