FORUMS
Post Reply Email Thread
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

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:
[email protected] ~/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
[email protected] ~/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.
The Following 20 Users Say Thank You to AdamOutler For This Useful Post: [ View ] Gift AdamOutler Ad-Free
7th October 2012, 07:29 AM |#2  
AdamOutler's Avatar
OP Retired Senior Recognized Developer
Flag Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
Thanks Meter: 9,893
 
Donate to Me
More
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:
[email protected] ~ $ sudo chmod 777 /usr/bin/adb
[email protected] ~ $ /usr/bin/adb
bash: /usr/bin/adb: No such file or directory
[email protected] ~ $ file /usr/bin/adb
/usr/bin/adb: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
[email protected] ~ $ 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.
The Following 2 Users Say Thank You to AdamOutler For This Useful Post: [ View ] Gift AdamOutler Ad-Free
7th October 2012, 08:06 AM |#3  
bhundven's Avatar
Inactive Recognized Developer
Flag Seattle, WA
Thanks Meter: 4,539
 
Donate to Me
More
I find dynamic dependencies this way (sgh-i717 rild for instance):
Code:
[email protected]:~/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: [ View ] Gift bhundven Ad-Free
7th October 2012, 12:04 PM |#4  
E:V:A's Avatar
Inactive Recognized Developer
Flag -∇ϕ
Thanks Meter: 2,219
 
More
Quote:
Originally Posted by AdamOutler

... Then I pulled the binary from /system/bin/adb. however when run it acts like it's not there even though it is.

Code:
[email protected] ~ $ /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
The Following User Says Thank You to E:V:A For This Useful Post: [ View ] Gift E:V:A Ad-Free
7th October 2012, 06:11 PM |#5  
AdamOutler's Avatar
OP Retired Senior Recognized Developer
Flag Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
Thanks Meter: 9,893
 
Donate to Me
More
Quote:
Originally Posted by E:V:A

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

good thinking.. but it didn't work.. cannot execute binary file.
Code:
[email protected] ~ $ export PATH=/usr/bin:$PATH
[email protected] ~ $ adb
bash: /usr/bin/adb: No such file or directory
[email protected] ~ $ /usr/bin/adb
bash: /usr/bin/adb: No such file or directory
[email protected] ~ $ . /usr/bin/adb
bash: .: /usr/bin/adb: cannot execute binary file
[email protected] ~ $
I have an older copy of ADB 1.0.26, but I need 1.0.28. What is the difference here aside from the shared objects which I've already put into /usr/lib.
Code:
[email protected] ~ $ file /usr/bin/adb #new version
/usr/bin/adb: setuid setgid ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
[email protected] ~ $ file /bin/adb  #old version
/bin/adb: setuid setgid ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.26, BuildID[sha1]=0x8ffd8c80a0705dc113149612e3067931208bfd70, not stripped
The Following User Says Thank You to AdamOutler For This Useful Post: [ View ] Gift AdamOutler Ad-Free
7th October 2012, 11:20 PM |#6  
AdamOutler's Avatar
OP Retired Senior Recognized Developer
Flag Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
Thanks Meter: 9,893
 
Donate to Me
More
I did the changes above, then a full make clean then rebuilt the source. the following pastebin shows the entire build log.

http://pastebin.com/XtH1MWVE
8th October 2012, 04:06 AM |#7  
AdamOutler's Avatar
OP Retired Senior Recognized Developer
Flag Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
Thanks Meter: 9,893
 
Donate to Me
More
Rebellos did some work and posted his source here. I modified it to link to my own source and compile directly on the device without a cross-compiler. He got farther than I did. His actually searches for a device, but there is no real server output and its not sending commands to the device.

http://dl.dropbox.com/u/32145655/adb_armv6_src.zip
8th October 2012, 07:40 AM |#8  
Inactive Recognized Developer
Flag Hull
Thanks Meter: 1,279
 
Donate to Me
More
Hi Adam.


I've built you a adb, version 1.0.29 which is based off the linaro Jellybean 4.1.1 JRO03R sources, It is a totally self contained statically linked binary which has a target arch of armv5te, which should be just fine. I don't have a PI to test it on but I did the next best thing [ link: qemu-emulating-raspberry-pi-the-easy-way ] It seems to function OK but the proof will be in the testing. If it has trouble listing devices or making connection then run the following command line to give an idea of what's going wrong.
Code:
ADB_TRACE=all ./adb
Hope That Helps!
Trev
Attached Files
File Type: 7z adb-armv5te-static.7z - [Click for QR Code] (151.6 KB, 271 views)
The Following 6 Users Say Thank You to trevd For This Useful Post: [ View ] Gift trevd Ad-Free
17th October 2012, 05:20 AM |#9  
lseidman's Avatar
Senior Member
Flag Las Vegas
Thanks Meter: 104
 
Donate to Me
More
Looks good!
7th October 2012, 08:14 AM |#10  
cdesai's Avatar
Inactive Recognized Developer
Flag IN YOUR HEAD
Thanks Meter: 4,124
 
Donate to Me
More
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
The Following User Says Thank You to cdesai For This Useful Post: [ View ] Gift cdesai Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes