5,593,793 Members 46,786 Now Online
XDA Developers Android and Mobile Development Forum

Adb for Raspberry pi

Tip us?
 
AdamOutler
Old
(Last edited by AdamOutler; 12th October 2012 at 07:36 PM.)
#1  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9428
Posts: 5,123
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Default Adb for Raspberry pi

Update: trevd has managed to make a proper adb 1.0.29 frm source. For those who wish to simply use the binary, you can download it here http://forum.xda-developers.com/atta...6&d=1349930509


From trevd:
Quote:
Originally Posted by trevd View Post
If anyone wants to hack on this I've setup an armv6 device tree on github to use the with AOSP source you can clone it to <aosp_sources>/device/generic/armv6 then do
Code:
lunch mini_armv6-userdebug && make -j4
......
more here http://forum.xda-developers.com/show...8&postcount=41






--- OLD ----
I'm trying to build ADB 1.0.28 or higher for the Raspberry Pi. I found a guide here: http://lackingrhoticity.blogspot.com...-debugger.html but it's out of date since we can no longer access kernel.org directly. So, I'm trying to find a new way.

I spoke to Entropy512 and he suggested using the Cyanogenmod repository. So, here's what I have so far.

Code:
sudo apt-get install build-essential libncurses5-dev openjdk-7-jre openjdk-7-jdk bison
mkdir adb
cd adb
git clone git://github.com/CyanogenMod/android_system_core.git system/core
git clone git://github.com/CyanogenMod/android_build.git build
git clone git://github.com/CyanogenMod/android_external_zlib.git external/zlib
git clone git://github.com/CyanogenMod/android_bionic.git bionic
echo "include build/core/main.mk" >Makefile

I edited the adb/build/core/main.mk to reflect the version of JDK and JRE I have on my system. I'm not sure if they are even required at this point... Anyway, I modified the grep statements to find OpenJDK IcedTea instead of Oracle's version. Here's some snippits from the build/core/main.mk file.. make these match the values for your system's "java -version" and "javac -version"

build/core/main.mk
Code:
.
.
.
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.7[\. "$$]')
#Removed the next 3 lines


.

# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.7[\. "$$]')
So this puts me here:
Code:
pi@raspberrypi ~/adb $ make out/host/linux-x86/bin/adb
^[[A^[[B============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76L
============================================
build/core/tasks/kernel.mk:68: **********************************************************
build/core/tasks/kernel.mk:69: * Kernel source found, but no configuration was defined  *
build/core/tasks/kernel.mk:70: * Please add the TARGET_KERNEL_CONFIG variable to your   *
build/core/tasks/kernel.mk:71: * BoardConfig.mk file                                    *
build/core/tasks/kernel.mk:72: **********************************************************
host C: adb <= system/core/adb/adb.c
cc1: error: unrecognized command line option ‘-m32’
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb.o] Error 1
pi@raspberrypi ~/adb $
I'm still working on the rest. help would be appreciated. I can't get it to build on my desktop either. I really need help with this.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
The Following 13 Users Say Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
AdamOutler
Old
#2  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9428
Posts: 5,123
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
I found a build of Android4.0 for the Raspberry pi. I know that Android ICS and higher come with adb installed on the device for use with USB Host Mode on the device. So I yanked a copy and installed to an sdcard. Then I pulled the binary from /system/bin/adb. however when run it acts like it's not there even though it is.

Code:
pi@raspberrypi ~ $ sudo chmod 777 /usr/bin/adb
pi@raspberrypi ~ $ /usr/bin/adb
bash: /usr/bin/adb: No such file or directory
pi@raspberrypi ~ $ file /usr/bin/adb
/usr/bin/adb: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
pi@raspberrypi ~ $ readelf -d /usr/bin/adb

Dynamic section at offset 0x1708c contains 24 entries:
  Tag        Type                         Name/Value
 0x00000003 (PLTGOT)                     0x1f198
 0x00000002 (PLTRELSZ)                   768 (bytes)
 0x00000017 (JMPREL)                     0x9048
 0x00000014 (PLTREL)                     REL
 0x00000011 (REL)                        0x9348
 0x00000012 (RELSZ)                      16 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000006 (SYMTAB)                     0x8488
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000005 (STRTAB)                     0x8bd8
 0x0000000a (STRSZ)                      1135 (bytes)
 0x00000004 (HASH)                       0x8128
 0x00000001 (NEEDED)                     Shared library: [libc.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so]
 0x00000020 (PREINIT_ARRAY)              0x1f000
 0x00000021 (PREINIT_ARRAYSZ)            0x8
 0x00000019 (INIT_ARRAY)                 0x1f008
 0x0000001b (INIT_ARRAYSZ)               8 (bytes)
 0x0000001a (FINI_ARRAY)                 0x1f010
 0x0000001c (FINI_ARRAYSZ)               8 (bytes)
 0x0000001e (FLAGS)                      
 0x00000000 (NULL)                       0x0
I can see there are shared libraries required (libc.so, libstdc++.so and libm.so) , so I added those to /usr/lib/ chmod'd 777 and still nothing changed. What is required for a non-statically compiled binary to run? Did I install those libs properly? Why is that file saying it's not found?

I usually deal with hardware and java. these system binaries are like greek to me.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
The Following User Says Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
bhundven
Old
(Last edited by bhundven; 7th October 2012 at 07:12 AM.)
#3  
bhundven's Avatar
Recognized Developer
Thanks Meter 4455
Posts: 2,001
Join Date: Aug 2009
Location: Seattle, WA
I find dynamic dependencies this way (sgh-i717 rild for instance):
Code:
bryan@minime:~/build/vendor/samsung/quincyatt/proprietary/bin$ ~/arm-2009q3/bin/arm-none-linux-gnueabi-objdump -x rild | grep NEEDED
  NEEDED               liblog.so
  NEEDED               libcutils.so
  NEEDED               libril.so
  NEEDED               libdl.so
  NEEDED               libc.so
  NEEDED               libstdc++.so
  NEEDED               libm.so
EDIT: I just re-read about you finding NEEDED. At that point you have to do the same thing to each of those libraries, and find out what they depend on.

EDIT2: Do you have prebuilt/ ?
The Following User Says Thank You to bhundven For This Useful Post: [ Click to Expand ]
 
cdesai
Old
#4  
cdesai's Avatar
Recognized Developer
Thanks Meter 3968
Posts: 2,272
Join Date: Jan 2011
Location: IN YOUR HEAD

 
DONATE TO ME
You can try compiling it statically, sync the AOSP master to get the latest code, then you'll have to edit system/core/*something*(probably adb)/Android.mk and tell it to link the target binary statically.

I'll link the exact file when on a pc.

Sent from my GT-P1000
CyanogenMod Maintainer | SGT7 | TeamBBQ

 
BBQLinux - An Arch based Linux distribution for Android developers
Website: http://www.bbqlinux.org | Downloads: [url]http://sourceforge.net/projects/bbqlinux/files//url]
IRC: #bbqlinux on freenode
The Following User Says Thank You to cdesai For This Useful Post: [ Click to Expand ]
 
bhundven
Old
#5  
bhundven's Avatar
Recognized Developer
Thanks Meter 4455
Posts: 2,001
Join Date: Aug 2009
Location: Seattle, WA
Quote:
Originally Posted by cdesai View Post
You can try compiling it statically, sync the AOSP master to get the latest code, then you'll have to edit system/core/*something*(probably adb)/Android.mk and tell it to link the target binary statically.

I'll link the exact file when on a pc.

Sent from my GT-P1000
Right:
Code:
LOCAL_FORCE_STATIC_EXECUTABLE := true
where host adb is defined in system/core/adb/Android.mk
The Following User Says Thank You to bhundven For This Useful Post: [ Click to Expand ]
 
AdamOutler
Old
#6  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9428
Posts: 5,123
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
That would be great! How do you compile statically for arm? I put in about 12 hours trying to do this today.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
The Following User Says Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
bhundven
Old
(Last edited by bhundven; 7th October 2012 at 07:55 AM.)
#7  
bhundven's Avatar
Recognized Developer
Thanks Meter 4455
Posts: 2,001
Join Date: Aug 2009
Location: Seattle, WA
Quote:
Originally Posted by AdamOutler View Post
That would be great! How do you compile statically for arm? I put in about 12 hours trying to do this today.
It was my assumption from the original link you posted that this was being built on the r-pi.

Without the prebuilts being part of the environment, linux-x86 directory would be the host gcc. In this case on r-pi debian, arm gcc.

Edit: From the original build you had a problem with -m32 not being a valid argument.
You could comment out lines 48 and 49 of: build/core/combo/HOST_linux-x86.mk
and see what happens.

irc?
The Following User Says Thank You to bhundven For This Useful Post: [ Click to Expand ]
 
trevd
Old
#8  
Recognized Developer
Thanks Meter 1132
Posts: 862
Join Date: Jul 2011
Location: Hull

 
DONATE TO ME
Quote:
Originally Posted by AdamOutler View Post
I put in about 12 hours trying to do this today.
Seems like your fighting a losing battle there, for that length of time you might as well have sync'd the full lot and done a full build to begin with, It really is the path of least resistance when It comes to android. Otherwise you end up chasing shadows as you get deeper into the build system.

What are you trying to achieve with this? do you want to connect to other devices from the RaspPi or is the Rasp meant to be on the receiving end?
because obviously you'll need to build the daemonized version if the Rasp is your target, that lives in /sbin/adbd normally on the device.

I had a quick look at that guide. Googles sources now live at android.googlesource.com which can be used instead of the old kernel.org address
i.e
Code:
git clone git://android.git.kernel.org/platform/system/core.git system/core
becomes

Code:
 git clone https://android.googlesource.com/platform/system/core.git system/core
Don't forget to click Thanks If this post has helped. It gives me a little warm feeling inside

I WILL NOT RESPOND TO PM'S REQUESTING TECHNICAL SUPPORT


Development Work: Git Hub (https://github.com/trevd) | Huawei Dongle Support : Archos G9 , Asus Nexus 7 | adb extended version ( adbx ) [Always WIP] | The No Script, No Cygwin Standalone Boot Image Utility [WIP]
Other Work : Custom framework-res.apk resources.arsc using vendor overlays | [GUIDE][HACK]Cross Compiling for OSX on Linux with AOSP

A bug report without logs is just trivia!

Code:
adb shell dmesg ; adb logcat -b system -b radio -b events -b main
The Following User Says Thank You to trevd For This Useful Post: [ Click to Expand ]
 
AdamOutler
Old
#9  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9428
Posts: 5,123
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Quote:
Originally Posted by trevd View Post
Seems like your fighting a losing battle there, for that length of time you might as well have sync'd the full lot and done a full build to begin with, It really is the path of least resistance when It comes to android. Otherwise you end up chasing shadows as you get deeper into the build system.

What are you trying to achieve with this? do you want to connect to other devices from the RaspPi or is the Rasp meant to be on the receiving end?
because obviously you'll need to build the daemonized version if the Rasp is your target, that lives in /sbin/adbd normally on the device.

I had a quick look at that guide. Googles sources now live at android.googlesource.com which can be used instead of the old kernel.org address
i.e
Code:
git clone git://android.git.kernel.org/platform/system/core.git system/core
becomes

Code:
 git clone https://android.googlesource.com/platform/system/core.git system/core
Are you sure that will compile on ARM host? I don't want to spend 24 hours downloading and compiling on a 700 MHz processor. The resulting adb binary must run on an arm linux host.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
The Following User Says Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
E:V:A
Old
#10  
E:V:A's Avatar
Recognized Developer
Thanks Meter 1418
Posts: 1,094
Join Date: Dec 2011
Location: -∇ϕ
Quote:
Originally Posted by AdamOutler View Post
... Then I pulled the binary from /system/bin/adb. however when run it acts like it's not there even though it is.

Code:
pi@raspberrypi ~ $ /usr/bin/adb
bash: /usr/bin/adb: No such file or directory
Looks to me as you forgot to add your /usr/bin to your PATH variable (which also need to be exported to shell.)
Until you do that you need to use the source operator ".":
Code:
$ ./usr/bin/adb
MSM8960 Info, Architecture and Bootloader(s)
El Grande Partition Table Reference
How to talk to the Modem with AT commands


Want to know when your phone is getting tracked or tapped?

Help us develop the IMSI Catcher / Spy Detector!
(To be part of the EFF & The Guardian Project toolsets.)
_______________________________
If you like what I do, just click THANKS!
Everything I do is free, altruism is the way!
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
I do not answer support related PM's.


The Following User Says Thank You to E:V:A For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes