3

I currently have an Asus c300 chromebook. Since it doesn't have legacy boot, I'm using crouton to get a more standard command line environment. I was able to install gcc very easily in the chroot environment. It works very well under chroot.

Since the underlying hardware is the same, I thought the resulting executable should work for chromebook, without me being in the chroot environment. If true, I thought I could go into the chroot environment, compile whatever program I want/need, and exit back out to the regular environment and use it.

I tried it with a simple hello world program. When I tried to run the executable, I got the following error:

bash: ./a.out: Permission denied.

I tried to run it with sudo, and I get a similar error:

sudo: unable to execute ./a.out: Permission denied.

I even used su to login as root, and I still could not run the program (got the first error).

I thought su/sudo would override any kind of permission restriction. But, it's apparently not the case on the chromebook.

What am I missing? Is what I want to do possible?

EDIT: File permission was already set to 777.

Andree Wille
  • 928
  • 1
  • 9
  • 22
yth
  • 103
  • 1
  • 7

2 Answers2

0

You might simply have to change the permissions of the file or check the files ownership. umask determines weather or not a file that is created gets execute permissions by default. What does -ls -lat on the file reveal?

Also try running

chmod +x ./a.out
ojblass
  • 21,146
  • 22
  • 83
  • 132
  • What about ldd on the binary could it be some of the libraries it loads have different permissions? – ojblass Jul 31 '15 at 12:07
  • Output from ldd under chroot: linux-vdso.so.1 => (0x00007ffea0895000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8553d5c000) /lib64/ld-linux-x86-64.so.2 (0x00007f855413a000). I don't have ldd in the regular shell. However, I was not able to find /lib/x86_64-linux-gnu/libc.so.6 in normal environment. – yth Aug 05 '15 at 03:40
0

You can find more details of error with strace command
use:
strace ./a.out and check output.
I suppose you have different env (path and LD_library_path) under the chroot.

Laser
  • 6,652
  • 8
  • 54
  • 85