11
2
I'm trying to compile the firmware for my linksys WRVS4400N.
ls shows that exist but when it try to run it bash says it does not exist. I can also cat it, and it is an executable, not a shell script.
11
2
I'm trying to compile the firmware for my linksys WRVS4400N.
ls shows that exist but when it try to run it bash says it does not exist. I can also cat it, and it is an executable, not a shell script.
7
You mentioned that the output of file mkdep is 32-bit elf. You're running a 64-bit VM.
Example:
$ uname -m
x86_64
$ ls -l ./example
-rwxr-xr-x 1 root root 92312 2011-08-18 16:52 ./example
$ file ./example
example: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
$ ./example
-bash: ./example: No such file or directory
Just make a new 32-bit VM and compile it there.
1If you install ia32-libs, it should work afterwards. No need to create a 32bit VM. – Phil – 2013-02-19T15:32:13.163
5
Is it set to being executable? If not, then chmod +x filename. Is it in your PATH? If not, then call it as ./filename rather than just filename.
Its' set to executable, I've done ./mkdep to call it as well as using the full path, no dice. – Avery3R – 2011-08-18T21:26:28.443
You may need to run the file as sudo. – D'Arvit – 2011-08-18T23:17:10.460
2
When you try to execute a file and bash says it doesn't exist it sometimes means that bash believes the file is a script and that the interpreter specified in the first line (#!) does not exist.
If the files is named mkdep I would post the output of
./mkdep
file mkdep
hd mkdep | head
strace ./mkdep 2>mkdep.strace.txt
The strace command give info about system calls made, for example strace ls 2>ls.t puts the following into ls.t
execve("/bin/ls", ["ls"], [/* 22 vars */]) = 0
brk(0) = 0x8061000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f82000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=32311, ...}) = 0
mmap2(NULL, 32311, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f7a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\30\0\0004\0\0\0"..., 512) =512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30624, ...}) = 0
(running on vm, too lazy to type everything out) ./mkdep returns file or folder not found. file mkdep returns 32-bit elf exe, and head mkdep returns binary data – Avery3R – 2011-08-18T21:53:01.520
1mkdep is possibly generating this message because it can't find a file it needs?? – Linker3000 – 2011-08-18T22:04:31.737
@linker3000: Nope, it says Bash: /dirto/mkdep: file or folder not found – Avery3R – 2011-08-18T22:12:29.103
@MMavipc: try strace ./mkdep 2>mkdep.strace.txt this should give you some idea of what is going on. You may need to install strace from repositories. – RedGrittyBrick – 2011-08-18T23:08:58.363
1
Are you changing IFS in your script? I too encountered the same problem in one of my scripts and thought the same (32 bit file being read by shell script on 64 bit machine). But that wasn't the issue in my case. Instead, I was changing IFS to comma ',' and back to new line which somehow confused the parser and caused this error.
I just removed any change in IFS and it works just fine now!!!
what is output of ls -la for that particular file? – user389238 – 2011-08-18T21:29:56.533
@Ansis -rwxrwxrwx 1 1011 1011 31991 May 18 2006 mkdep – Avery3R – 2011-08-18T21:37:15.587
1show us the line from your script, and the exact error message. What is your current directory when you try to invoke the "missing" file? – glenn jackman – 2011-08-18T22:15:08.033
@glenn It's not my script that's invoking it, it's cisco's makefile, I cant get the exact error message since it's running in a vm, but, bash: /pathto/mkdep file or folder not found – Avery3R – 2011-08-18T22:19:15.270
So that's where those trolls are hiding... – Breakthrough – 2011-08-19T00:30:10.563