WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: MC 12 x64 -sh: ./adb: not found  (Read 4860 times)

Offline Santos

  • Full Member
  • ***
  • Posts: 105
MC 12 x64 -sh: ./adb: not found
« on: March 09, 2022, 12:59:54 PM »
Hello

https://developer.android.com/studio/releases/platform-tools#downloads

I just recently downloaded the latest version of  adb  from the AOSP project page. In CorePlus with lots of extensions loaded, the binary does runs and I'm able to execute it without any issues.

However, in  microcore  with no extension loaded, I'm getting the   -sh: ./adb: not found   error. I don't know which one is the missing piece in MC.

Typing in: ldd ./adb

Code: [Select]
        linux-vdso.so.1 (0x00007ffc56bf3000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f15ed6e5000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f15ed6c8000)
libm.so.6 => /lib/libm.so.6 (0x00007f15ed5a4000)
librt.so.1 => /lib/librt.so.1 (0x00007f15ed59b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f15ed581000)
libc.so.6 => /lib/libc.so.6 (0x00007f15ed3fd000)
/lib64/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x00007f15eddcb000)

Any advise?

Thank you.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #1 on: March 09, 2022, 01:55:36 PM »
Hi Santos
It's saying that  adb  can not be found in the current directory. Do you see it if you run this command:
Code: [Select]
ls -l a*
If it shows up, see if running this fixes it:
Code: [Select]
chmod 775 adb

Offline Santos

  • Full Member
  • ***
  • Posts: 105
Re: MC 12 x64 -sh: ./adb: not found
« Reply #2 on: March 09, 2022, 02:44:00 PM »
Hello Rich

Yes,  adb  it is present and permissions are properly set up.

Code: [Select]
tc@box:~/Descargas/adb64/platform-tools$ ls -l a*
-rwxr-xr-x    1 tc       staff      8168736 Mar  9 16:20 adb

What confuses me is that if the file is non-existing the error message is almost the same, but the 'dash' at the beginning is missing.

Code: [Select]
sh: ./adc: not found

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #3 on: March 09, 2022, 06:07:21 PM »
Hi Santos
Do either of these commands produce a different response:
Code: [Select]
./adb --help
./adb help

Does running this first help:
Code: [Select]
hash -r
Maybe you need to start loading your extensions to see if one of them allows it to work. Openssl, tls, and python
come to mind.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #4 on: March 09, 2022, 07:16:05 PM »
Hi Santos
I think this type of error sometimes occurs when bash is needed but not found.

Offline Santos

  • Full Member
  • ***
  • Posts: 105
Re: MC 12 x64 -sh: ./adb: not found
« Reply #5 on: March 09, 2022, 07:44:04 PM »
Hello Rich

...
Code: [Select]
./adb --help
./adb help

...
Code: [Select]
hash -r
...

I tried:
Code: [Select]
./adb help
./adb --help

On my CorePlus installation I do have output. But same error message (not found) popping up on my bare  microcore  install.

For the  hash  command, result was the same (not found message).

...
Maybe you need to start loading your extensions to see if one of them allows it to work. Openssl, tls, and python
come to mind.


I was trying to avoid going that path. Is there any "tracer" (besides  ldd) so I can check on libraries interacting with the binary?

Hi Santos
I think this type of error sometimes occurs when bash is needed but not found.


bash  is not present on my CorePlus install, seems like  adb  is not linked to it.

Thank you for your help.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #6 on: March 09, 2022, 07:59:38 PM »
Hi Santos
... I was trying to avoid going that path. Is there any "tracer" (besides  ldd) so I can check on libraries interacting with the binary? ...
It's possible using  strace  might identify what was  "not found" , but strace can generate a lot of output.

It's possible what's missing is not a library, but some support file provided by an extension, or an environmental
variable that gets set, or a link to a file that gets created.

Offline Santos

  • Full Member
  • ***
  • Posts: 105
Re: MC 12 x64 -sh: ./adb: not found
« Reply #7 on: March 09, 2022, 08:13:52 PM »
Hello Rich

Thank you!

I'll try.

But first I'll need to read on how to use  strace. I'm very positive that the  man  page will suffice.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #8 on: March 09, 2022, 08:39:28 PM »
Hi Santos
Something like this might be a start:
Code: [Select]
strace -e trace=open ./adb

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: MC 12 x64 -sh: ./adb: not found
« Reply #9 on: March 09, 2022, 08:53:49 PM »
Is a symlink /lib64 -> /lib present?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: MC 12 x64 -sh: ./adb: not found
« Reply #10 on: March 09, 2022, 08:57:50 PM »
Hi Juanito
According to the  ldd  command in the original post, I think it is.

Offline Santos

  • Full Member
  • ***
  • Posts: 105
Re: MC 12 x64 -sh: ./adb: not found
« Reply #11 on: March 12, 2022, 12:46:19 PM »
Hello

...

Code: [Select]
strace -e trace=open ./adb

Did it. Almost exact output. I really thought I'll be getting lots of sys calls, and such.

Code: [Select]
tc@box:~$ strace ./adb-bin/platform-tools/adb
execve("./adb-bin/platform-tools/adb", ["./adb-bin/platform-tools/adb"], 0x7fffd6bcc430 /* 19 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++


Is a symlink /lib64 -> /lib present?

It is.



***

I ended up loading extension by extension (  while  loop) to check which one triggered  adb  to be executed. Firefox did it.

Currently, I'm loading each  dep  at at time to see whats the extension with the library/files, etc. that is allowing  adb  to run.

This is what I'm getting from  strace  after loading firefox and being able to run  adb  .

(See attachment with messy output due to  script  ).
« Last Edit: March 12, 2022, 12:50:03 PM by Santos »

Offline Santos

  • Full Member
  • ***
  • Posts: 105
Re: MC 12 x64 -sh: ./adb: not found
« Reply #12 on: March 12, 2022, 11:00:36 PM »
Hello

After loading all firefox dependencies  adb  wasn't being executed.

The line I used to test the packages was this (ignore leading +, was getting forum error):

Code: [Select]
++while read -r line ; ++do tce-load -il $line ; ++sleep 3 ; /home/tc/bin/adb ; ++done < firefox.tcz.dep



I checked  tce-load  script to try to add a  sleep  command and a line to execute  adb  right after a package is loaded. But I don't know on which section of the code should I put it.

What changes can I introduce on  tce-load  to have a  sleep  and  adb  being tested after each package is loaded?
« Last Edit: March 12, 2022, 11:30:14 PM by Santos »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: MC 12 x64 -sh: ./adb: not found
« Reply #13 on: March 12, 2022, 11:04:18 PM »
It's probably something in FF's install script then. Look in /usr/local/tce.installed/firefox after loading it (or use unsquashfs or mounting to see it without loading).
The only barriers that can stop you are the ones you create yourself.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: MC 12 x64 -sh: ./adb: not found
« Reply #14 on: March 12, 2022, 11:37:30 PM »
Code: [Select]
file /home/tc/Downloads/platform-tools/adb
/home/tc/Downloads/platform-tools/adb: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, not stripped
/home/tc/Downloads/platform-tools/adb
sh: /home/tc/Downloads/platform-tools/adb: not found
sudo ln -s /lib /lib64
/home/tc/Downloads/platform-tools/adb
Android Debug Bridge version 1.0.41
Version 33.0.0-8141338