5

First of all, I have inside an android Operating System a chroot environment created using Linux Deploy. I am able to access it from Android using a terminal emulator and root permission. I would like to run a script inside it. However, when trying to run the script, or even normal shell commands, it doesn't executes and returns this error:

"No such file or directory"

So, I am wondering, is it there a way to execute, from the host within a chroot environment, commands/scripts? Has the problem to do with the proper setting of the environment PATH variable?

I am able to execute ls command within the chroot environment but when printing with the -la argument it doesn't even show the . and .. directories. Could someone explain why is this happening and how could we overcome this issue?

P.D.: I've posted this issue in unix/linux stack exchange because I thought it concerns more to it. However, if you recommend me to also post it in stackoverflow or any other, I am open to do so.

4
  • 1
    You must of course populate the chroot environment before chrooting into it. To run commands it must have /bin, /sbin etc. with the commands in them.
    – AlexP
    Commented Nov 6, 2017 at 11:54
  • Actually, I can find them on the chroot environment. However, when executing it shows the error described above. Commented Nov 6, 2017 at 13:20
  • If you have a correctly populated the chroot environment (including libraries for example), have you tried invoking the commands using their full pathname?
    – AlexP
    Commented Nov 6, 2017 at 17:01
  • I am currently trying to populate the chroot environment. I tried invoking the commands using their full pathname or even changing the PATH environment variable to search on the chroot bin but still didn't work. Commented Nov 7, 2017 at 12:09

1 Answer 1

0

It sounds like you may not have fully configured your chroot environment. Here are instructions for setting up a Debian chroot on Android:

There are lots of other OS-specific instructions online for setting up a chroot, e.g.:

The bottom line is that you typically would install the programs into your chroot environment before trying to execute them. What have you done to setup your chroot?

6
  • I have just installed a linux image using linux deploy app, which as I understand created a chroot environment. I was able to enter this chroot environment through the terminal emulator. I Don't know if I was totally clear with this, maybe I should rephrase the question. Commented Nov 6, 2017 at 13:18
  • @SantiagoNicolasMartin Sure. Can you explain why you need (or want) to run scripts/programs from the host environment without installing them in the chrooted environment?
    – igal
    Commented Nov 6, 2017 at 14:05
  • Sure, It comes really from the need to install rockchip's gstreamer plugins on linux, as I am working on a video processing project. When running the installation script for this plugins from the chroot environment which is accessed via VNC, it doesn't find some files, which I suppose are on the host system which can't be accessed. Therefore, I am trying to see if running the script on the host environment could fix this issue and install the plugins on the chroot's linux. Commented Nov 6, 2017 at 14:14
  • Why not install those files in the chroot environment?
    – igal
    Commented Nov 6, 2017 at 14:26
  • In fact, I do not know what are those files I am missing because I supposed they were already there on the package one can download from github. It seems I need extra stuff which seems to be no documentation about. Commented Nov 6, 2017 at 15:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.