Notes: Qualcomm APQ8060 Dragonboard by follower
Working with the Qualcomm APQ8060 DragonBoard development board
Links
-
Building Android kernel:
- MSM/QSD Android Enablement Project -- Qualcomm specific process: "allows users to build an Android based platform containing additional enhancements for Qualcomm chipsets."
- http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
- http://www.uplinq.com/2011/sites/default/files/images/Snapdragon-Lab-Creating-Custom-Drivers.pdf (pdf)
- http://source.android.com/source/downloading.html
-
gitwebinstance for all QAEP ("MSM/QSD Android Enablement Project") repositories:
28 January 2012¶
Thanks to a helpful person at Qualcomm I have a APQ8060-based DragonBoard (see also) development board (with optional Peripheral Kit) to use for development & testing of Handbag.
It arrived by courier a couple of days ago.
Inside the box in which the board arrived were:
- Quick start guide & promotional flyers
- Reminder to register
- Ethernet cable
- Mini-USB cable
- Power adapter with US-style prongs
- Mostly empty box with battery & ear-piece (& hardkey sticker overlay with Windows logo)
- The board itself with peripheral boards attached
The Quick Start guide documented how to install the "Radio Card", "Sensor Board" and "Touchscreen Display" but these had already been installed on my board with no action needed on my part.
I will still need to follow the instructions to install the battery however.
The Quick Start guide also noted that neither the RJ11 (Handset) connector nor the dual USIM slots were supported--by way of a "not supported" in brackets on the sheet.
There is also a "green wire" fix going from the main processor board to an IC I assume is related to the battery. It's pretty. :)
I followed the instructions to install the battery--and noted the serial number needed for registration will be under the battery when installed. (But the battery can be slid out to read the number.)
After connecting the power adapter I pressed the "Power" button on the main board--although the touchscreen already seemed to have power applied.
The Quick Start guide said that a "welcome message" would appear on the touchscreen panel but only the standard Android loading screen appeared for me.
I noticed that in the notification area it said that the SD card was "damaged" but it was actually missing--maybe it can't detect the difference? [Update: I tried to "Format" it but while it "succeeded" it still just shows the "damaged" notification.]
Pressing the red "END/PWR" button on the keypad turns the display on if it blanks for power saving. [Update: But not for actual power on/off.]
The
Settings>About phonescreen states:- Android Version: 2.3.5
- Kernel version: 2.6.38.6-blah-blah-blah
According to
Settings>Storage settings:- Internal storage: Available space: 0.93GB
Connected via WiFi.
Noted a
Dynamic Memory Manager Settingssetting in theSettingslist that I've not seen on other Android devices--assume it's development related.Enabled
Settings>Application settings>Unknown sourcesin preparation for initial Handbag install.The touch screen is a little smaller than my Google Nexus One but seems a bit less accurate in touch detection and seems to have noticeably smaller text etc.
There are a bunch of non-standard Applications pre-installed. Some seem Qualcomm specific others less so.
The four-way + select (SEL) widget on the key pad moves through options on the display rather than using the touch screen.
The cameras don't seem to have an "active" LED.
The smaller of the cameras has a sticker as a cover over the lens--it probably pays to remove it. :)
The
DevToolsapp crashed when I selectedGoogle Login Service.The
DevToolsoptions/imagesGalaxy,Grass&Waterdidn't seem to do anything when selected.There's a
Terminal EmulatorunderDevTools. It crashes when you selectEmail tofrom the menu. And by default has a tiny font. :)The
FM Radioapplication doesn't seem to work even when I plug in the headset and change the region.Didn't have a FM radio handy to test the
FM Transmitterfunctionality. :)Global Timeapp showed a pretty globe but not much else...NeoCoreis a demo app for some Qualcomm graphics technology. I dream of a day when tech demos are peaceful and not full of robotic violence--although to their credit they didn't actually blow up the Eiffel tower-looking monument. (I guess some Qualcomm customers are in France?) :DI tried setting the
Sensorsto be enabled in theQualcomm Settingsapp but on exiting the app it seems to reset it to disabled. (Maybe I need to read some documentation...)Hmmm, can't download the
Handbag.apkfile because the device wants an SD card. What's it doing with all it's spare internal storage then? :-pOkay, fine, I'll stop playing now and go download the documentation...
Headed to http://store.bsquare.com/doc_download/ for documentation download--which requires the serial number of the board to register/login. [Update: I realised after I typed the number in by hand that the delivery email actually includes the serial number in it, so I could've copied & pasted.] [Update: A server error was triggered on log out but it does seem to have logged me out.]
Downloaded:
- Programming Guide (pdf)
- Quick Start Guide (pdf) (Duplicate of hardcopy included in package modulo disclaimer text)
- User Guide (pdf)
- Build Instructions (software build, not hardware) (zip with text & shell scripts)
There's also Schematics & BOM which I didn't download.
Also started download of a software download dated 19 January 2012. Annoyingly it doesn't seem to specify a size before downloading. [Update: It's just under 73MB in size.] [Update: It's not entirely clear if it's an applicable upgrade to the build I've got.]
The help at http://bsquare.custhelp.com/ doesn't appear to have any specific category for the DragonBoard and searching for the term only returns a couple of results.
Notes from the User Guide (1.0 - 13 October 2011):
-
Specs listed include:
- "LPDDR2 SDRAM (4GB)"
- "eMMC Flash(4GB)"
-
Specs also claim these LEDs are on the board but I've seen no evidence of either (I notice the display bezel where one might expect a power LED to be is different--smaller--to one shown in the pictures):
- "Power on LED: Green"
- "Diagnostics LED: GYB color x 1"
-
Although I note further down:
- "Power on LED: GPIO"
- "Diagnostics LED: GPIO (TBD)"
-
Apparently the Bluetooth chip on the Radio Board supplies the FM radio functionality but I can't read the markings on the IC to see if the identifier matches the one listed "WCN2243".
-
Apparently there is “no software support” for the "Pressure and Temperature Sensor".
-
The "3-Axis Compass" section on page 13 incorrectly repeats the details for the "Proximity and Ambient Light sensor"--a presumably correct IC number reference is on page 19.
-
Toward the end of the User Guide is a bunch of code related to configuring/activating sensors--I assume needed at the build stage. From the examples it looks like you can find a bunch of interesting stuff in
/sys/module/.
-
Notes from the "Dragonboard™ APQ8060 – Android Programming Guide" (1.0 - 11 November 2011):
-
Was amused by "Windows Embedded partner - 2008 Excellence Awards" logo on the front. :D
-
Just so you know:
"This device is not...for use in a residential environment... This development device may only be used in a controlled user environment where operators have obtained the necessary regulatory approvals for experimentation using a radio device and have appropriate technical training. The device may not be used by...individuals that have not been instructed on methods for conducting controlled experiments and taking necessary precautions for preventing harmful interference and minimizing RF exposure risks."
*cough* -
Only "Ubuntu 10.04 LTS 64-bit" is supported for building Android.
-
Apparently https://www.codeaurora.org/ is used for storing related patches etc. (Includes a not very active forum/wiki also.)
-
Toward the end of the Programming Guide is a bunch of information on building/testing/configuring Android builds etc. They suggest not replacing the whole image.
-
As suggested in the Programming Guide I used the following command:
adb shell getprop ro.product.boardWith the result:
* daemon not running. starting it now on port 5037 * * daemon started successfully * MSM8660_SURFDue to the build number returned from the following command you need to follow the modified instructions for building found in the "Build Instructions" zip file downloaded earlier:
adb shell getprop ro.build.version.incrementalAttempted to install the Handbag
.apkviaadbwith:adb install Handbag.apkBut it failed with:
248 KB/s (35110 bytes in 0.138s) pkg: /data/local/tmp/Handbag.apk Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]I'm assuming this means USB ADK support is not included.
I used this command to look at the logs:
adb logcatAnd found this line:
E/PackageManager( 173): Package com.rancidbacon.Handbag requires unavailable shared library com.android.future.usb.accessory; failing!So, I guess I need to find out how to include that. Hopefully it doesn't require rebuilding all of Android.
Here's some discussion of making USB ADK support work with Cyanogenmod. It includes some references to filenames/diagnostics that might prove helpful.
Following instructions from the above thread I checked the kernel configuration for a
CONFIG_USB_ANDROID_ACCESSORYsetting but it doesn't even have it listed as "not set":adb pull /proc/config.gz zgrep CONFIG_USB_ANDROID_ACCESSORY config.gzIt should return:
CONFIG_USB_ANDROID_ACCESSORY=yThis will do for now...
Well, almost: Holding down the
END/PWRbutton doesn't seem to bring up the "Power Off" dialog--you need to use the "Power" button on the main board for that to appear.Also, if you leave the power cord in, it seems to force a reboot rather than a shutdown. To shutdown the device completely you need to remove the power adapter from the board, then shutdown.
(Also--assuming I get this working--given the start up time this will sure beat using the emulator! (Not that you can for the USB part anyway.))
29 January 2012¶
Added some links found with various descriptions of building the Android kernel--both DragonBoard specific and not.
The
codeaurora.orgsite seems to be fairly flakey with timeouts when accessing gitweb and forums.
30 January 2012¶
The Qualcomm build instructions mentioned that only one specific 64-bit Linux Ubuntu version was supported.
Reading the main Android build instructions it seems they support Linux & Mac OS X. Unfortunately the instructions say OS X 10.6 is required and I'm only running 10.5.8. (But then later on the page it says "If using Mac OS 10.4" so who knows...)
I can feel the yaks approaching already...
In terms of resources the main build instructions warn "Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 90GB (or more) for a full set of builds."
I realised later this refers to the whole Android build whereas I assume I only need the kernel.
Later on the download instructions page there's a section on just downloading kernel code so that might help.
From my poking around it seems the USB Android Accessory functionality--when included--is part of the gadget driver. This appears to be compiled statically into the kernel so I don't think I can just compile a module with the USB Android Accessory support enabled and use it--I assume I need to compile the kernel completely.
This commit seems to be where the USB Android Accessory functionality is added: https://www.codeaurora.org/gitweb/quic/le/?p=kernel%2Fmsm.git;a=commitdiff;h=5d9d8625e39f815673dedea353f39edccabb1fac
It adds an
USB_ANDROID_ACCESSORYoption todrivers/usb/gadget/Kconfigwhich I need to enable when re-building the kernel. When enabled it will appear in the deviceconfig.gzfile asCONFIG_USB_ANDROID_ACCESSORY=y.(The core of the implementation resides in
drivers/usb/gadget/f_accessory.c.)Am looking at attempting to build the kernel on a Ubuntu 10.4 box to which I have access.
Installed git on the box:
sudo apt-get install git-coreCopied & unzipped the
Dragonboard_Build_Instructions_20120127.ziparchive file.From looking at the
repodocumentation it seems it's possible to only download specific projects with a command like:repo sync PROJECT0 PROJECT1 PROJECT2 ...I'm hoping this will reduce the files I need to download to only those required for the kernel.
(You can find the project names in the
versioned.xmlfile in theDragonboard_Build_Instructions_20120127.ziparchive.)Next we need to install the
reposcript:# First create the user `bin` directory # (My `.profile` automatically adds it to PATH when I # re-login. Otherwise you can add it manually.) mkdir ~/binDownload the
reposcript:curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repoThen, of course, we check the SHA-1 checksum (cough):
sha1sum ~/bin/repowhich should give:
29ba4221d4fccdfa8d87931cd73466fdc24040b5And finally we make it executable:
chmod a+x ~/bin/repoNow running this command gives some output (assuming
repois actually correctly on your path--you did relogin, right?):repo --helpOkay, so, now we'll try to download some sources after restricting them to only the kernel.
I unzipped the archive file into the directory
Dragonboard_Build_Instructions_20120127so now do this:cd Dragonboard_Build_Instructions_20120127Looking at
versioned.xmlI can see this:<project name="kernel/msm" path="kernel" revision="29d21a1c3b631134502039210f87bf961094d76d"/>So, I'll edit the
repo syncline in thegetSources.shscript to hopefully restrict it to that, like this:--- getSources.sh~ 2012-01-27 16:02:38.000000000 +0000 +++ getSources.sh 2012-01-30 05:55:09.000000000 +0000 @@ -11,7 +11,7 @@ repo init --repo-url=git://codeaurora.org/tools/repo.git -u git://codeaurora.org/platform/manifest.git -b gingerbread rm -rf .repo/manifest.xml cp ../versioned.xml .repo/manifest.xml -repo sync -j4 +repo sync kernel/msm -j4 source build/envsetup.shNow's the time to place your bets... :)
Running the edited
getSources.shscript like so:sh getSources.shGreat, so, first up get a
Connection reset by peererror. And then another...Woo, and then another... Up to
(try: 5)by now.That's when I remember I actually downloaded the required file
https://www.codeaurora.org/patches/quic/la/PATCH_APQ8060_8993_Dragonboard_required_modifications_20111103.tar.gzto my local machine yesterday, so let's use that instead. (Well, obviously you can't, so, good luck with that...)Commented out the
wgetline and trying again...Progresss! The
gitretrieval seems to work. Then I get asked for my details (this is mentioned in the docs for use with thegerritreview tool).Fill all that out...
Now it's displaying:
Initializing project kernel/msm ...And finally arrives at:
remote: Counting objects: 2686463, done.Before continuing.
And now it's carrying on:
Receiving objects: 3% (89108/2686463), 31.43 MiB | 405 KiB/sIf my math is correct I guess that means we're looking at ~1GB download. (Which is 1/6th of the full one, I guess.) So, this will take a while... [Update: Hmmm, okay, so it's not actually possible to work out the final size during the download--not very useful.]
Oh, and now it's suddenly jumped to:
Receiving objects: 97% (2620675/2686463), 590.72 MiB | 406 KiB/sSo maybe it won't be so bad after all... :)
Yep, finished with:
Receiving objects: 100% (2686463/2686463), 602.54 MiB | 410 KiB/s, done.Annnnd... now it's "resolving deltas":
Resolving deltas: 3% (76242/2249071)(This appears to be a machine-limited rather than network-limited operation.)
Some time later (15-20 minutes?) it did some more things and the
repo syncstage finished with:Fetching projects: 100% (1/1), done. Checking out files: 100% (37555/37555), done.But then it generated:
getSources.sh: 17: source: not found getSources.sh: 19: choosecombo: not found getSources.sh: 23: croot: not found cd: 24: can't cd to hardware/alsa_sound fatal: Not a git repository (or any of the parent directories): .git getSources.sh: 27: croot: not found cd: 28: can't cd to hardware/msm7k fatal: Not a git repository (or any of the parent directories): .git getSources.sh: 31: croot: not found cd: 32: can't cd to bootable/bootloader/lk/ fatal: Not a git repository (or any of the parent directories): .git getSources.sh: 35: croot: not found cd: 36: can't cd to device/qcom/msm8660_surf fatal: Not a git repository (or any of the parent directories): .git getSources.sh: 39: croot: not found Applying: 8060: wlan: Use proper gpio value for dragonboard Applying: ASoC: msm: Add audio recording support to dragonboard Applying: ASOC: msm: Fix suspend/resume bug in WM8903 driver Applying: Dragonboard needs enabling more configs to work with Audio Applying: Kconfig: Temporarily disable HAVE_HW_BREAKPOINT feature flagSome of this was expected due to not downloading all the projects (and so related directories don't exist).
But then it hung on trying to retrieve
https://www.codeaurora.org/patches/quic/la/PATCH_MSM8660_8230_Dragonboard_required_modifications_20110928.tar.gzanyway (a different patch file required for some camera fix).The error
source: not foundis misleading--I think it means it can't find thebuild/envsetup.shfile (because we didn't sync it). I'm guessing it possibly addschoosecombo,crootetc?From poking around in
versioned.xmlit seems the project name with the build-related things isplatform/build, so let's try that:cd 8060_v3/ repo sync platform/build -j4Yep, that seems to pull things down okay, so will need to re-run the script from the point it broke.
It turns out that the
sourceline breaks if you haven't run thegetSources.shfile directly, so:chmod a+x getSources.sh ./getSources.shThere's a bunch of complaints of the form:
"frameworks/base/data/sounds/OriginalAudio.mk" does not exist.And also one of:
** Not a valid product: msm8660_surfAnd then
No such file or directory&fatal: Not a git repositoryerrors related to the attempts to patch. Plus a couple ofprevious rebase directory [...] still exists but mbox given.On the plus side, at least the second patch file archive downloads now. :)
So, it would seem we need to add some more projects to the
repo sync.Added the following:
platform/frameworks/base platform/hardware/alsa_sound platform/hardware/msm7k kernel/lk platform/vendor/qcom/msm8660_surfHmmm, adding the [L]ittle [K]ernel to the
repo synclists adds a bunch more data to the download (~683MiB). I assume it's only needed for the bootloader so not sure if we can just skip it. [Update: Oh, it might beplatform/frameworks/base, need to check.]Okay, so, now another set of errors:
external/svox/pico/lang/PicoLang* "device/qcom/common/common.mk" does not exist. warning: 1 line adds whitespace errors. previous rebase directory [...] still exists but mbox givenAdded the following to the
repo sync:platform/external/svox device/qcom/commonOkay, so now the errors we're getting are:
/bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: No such file or directory /bin/bash: bison: command not found /bin/bash: java: command not foundWhich are understandable as I haven't installed them yet. :)
There's also patch apply fails which I guess is because they're already applied.
The first error means we need to add another project to the list:
platform/prebuilt(Yeah, this would probably be quicker if I just added everything but that's not the point...)
And... that adds 1.78GiB:
Receiving objects: 100% (20462/20462), 1.78 GiB | 413 KiB/s, done.(And further investigation shows that it's that big because it includes prebuilt binaries for 9 platforms--it would be nicer if it only included the current platform--but I guess disk/bandwidth doesn't matter to most people. :) ) [Update: Actually, having said that, it seems most of it is for
linux-x86anyway... :)]So, for posterity here is the current
repo syncline:repo sync kernel/msm platform/build platform/frameworks/base platform/hardware/alsa_sound platform/hardware/msm7k kernel/lk platform/vendor/qcom/msm8660_surf platform/external/svox device/qcom/common platform/prebuilt -j4(Well, that should include all the pieces, anyway.)
And now to fix the
bison/javaissues. :)Install
bisonwith:sudo apt-get install bisonIt turns out that with a minimum install
add-apt-repositoryis not installed (because you could just edit the file directly). To install it I needed to do:sudo apt-get update sudo apt-get install python-software-propertiesThen I can add Java with:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update sudo apt-get install sun-java6-jdkNow things go through without missing tools but there's still issues around the patches being applied.
So, I do this to get a repository status:
cd 8060_v3 repo statuswhich shows a bunch of
prior sync failed; rebase still in progresserrors onbranch work. So, let's trying deleting that branch to see if version control is useful:repo abandon work(Always encouraging to type that, I'm sure...)
Hmm, so that seems to remove the branch but then leaves things in the
prior sync failed; rebase still in progressstate except with(*** NO BRANCH ***)specified. Helpful.So then I tried this:
cd 8060_v3 repo forall -c git checkout -fAnd that didn't help...
Next up I tried:
repo forall -c git rebase --abortwhich generated:
It looks like git-am is in progress. Cannot rebase. No rebase in progress? No rebase in progress? It looks like git-am is in progress. Cannot rebase. No rebase in progress? No rebase in progress? It looks like git-am is in progress. Cannot rebase. It looks like git-am is in progress. Cannot rebase. It looks like git-am is in progress. Cannot rebase. No rebase in progress?So, that didn't work either...
Then I tried the following command on one directory and it appeared to get rid of the
rebase in progressmessage, so then applied it to all:repo forall -c git am --abortwhich generated a bunch of:
Resolve operation not in progress, we are not resuming.but did seem to remove the
prior sync failed; rebase still in progressmessages anyway.That just left me with multiple
PATCH_MSM8660_8230_Dragonboard_required_modifications_20110928.tar.gzfiles in thekerneldirectory so I deleted those.This left me with:
repo statusgenerating:
nothing to commit (working directory clean)So, that's good. Let's try it all one last time...
Aside from two
warning: 1 line adds whitespace errors.messages things seem to be okay when running:./getSources.shFinally!
So this produces the summary:
============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=2.3.5 TARGET_PRODUCT=msm8660_surf TARGET_BUILD_VARIANT=eng TARGET_SIMULATOR=false TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID=GRJ90 ============================================So, that looks hopeful.
The final output is:
Your source tree now exists in 8060_v3 directory. Change into 8060_v3 and issue "./build.sh" to build.I can't see an obvious way to just do just the kernel--perhaps
bootimageorabootas targets?So, doing
./build.shresults in:Checking build tools versions... find: `../../external/apache-http/src/org/apache/http': No such file or directory find: `../../libcore/dalvik/src/main/java/dalvik': No such file or directory find: `../../libcore/json/src/main/java': No such file or directory find: `../../libcore/junit/src/main/java': No such file or directory find: `../../libcore/luni/src/main/java/java': No such file or directory find: `../../libcore/luni/src/main/java/javax': No such file or directory find: `../../libcore/luni/src/main/java/org/xml/sax': No such file or directory find: `../../libcore/luni/src/main/java/org/w3c': No such file or directory find: `../../libcore/xml/src/main/java/org/xmlpull/v1': No such file or directory find: `../../external/apache-http/src/org/apache/http': No such file or directory find: `../../external/nist-sip/java': No such file or directory find: `../../external/apache-http/src': No such file or directory find: `../../external/tagsoup/src': No such file or directory build/core/java.mk:9: *** frameworks/base: Target java module does not define any source or resource files. Stop.Wooo, yaks! :)
Neither
abootorbootimagein thebuild.shmakeline makes (snort) any difference...I mean, seriously,
apache-httpsurely can't be required to build the kernel...[ Time passes....]
Okay, so, let's try this approach for building an Android kernel...
gunzipit into8060_v3/kernelas.config.[Update:
First do:
cd 8060_v3/device/ . ../build/envsetup.sh choosecombo 1 1 msm8660_surf eng cd ../kernel/]
Try:
make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- oldconfigThen:
make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -j4Hey, what do you know, it's actually compiling stuff...
...but then dies with:
arch/arm/mach-msm/sdio_al.c:18:29: error: sdio_al_private.h: No such file or directory(Hmmm, well, everything else carries on after the
make: *** Waiting for unfinished jobs.......)The issue appears to be caused by the following in 3 files:
#include <sdio_al_private.h>If they are changed to the following, compilation continues past okay:
#include "sdio_al_private.h"w00t! Progress!
So, now it appears the following files exists, as expected:
8060_v3/kernel/arch/arm/boot/zImage(All up it didn't take too long to compile... Maybe 10 minutes?)
[ ... More poking around (mostly the Cyanogenmod wiki) ...]
We want the
mkbootimgtool & possibly others, so let's get those too:cd 8060_v3 repo sync platform/system/core -j4Fails with:
system/core/include/mincrypt/rsa.h:31:22: error: inttypes.h: No such file or directory[... Side, side trip into trying to get the
fastboottool. Mmmm, furry yaks... ...]Alas, "so close"... But this will have to do for tonight.
2 February 2012¶
Okay, so, the story of
fastboot-mac...In short: gah.
In longer:
-
Okay, let's add
external/zlibto therepo syncline. -
[TODO: Explain the steps somewhere...]
-
Seriously, the Android team created their own
cpcommandacp? (Yes.)Lol, awesome:
# acp uses libhost, so we can't use # acp to install libhost. LOCAL_ACP_UNAVAILABLE:= truesigh
W00, I actually managed to compile
fastbootfor Mac OS X on Mac OS X 10.5.x.It even displays help... (So it might actually work.)
So, for some reason
fastbootfor Mac OS X (orfastboot-mac) isn't included in the SDK/tool downloads.[Retro-Update: (This means I discovered this at the time but am only documenting it now.)
I don't know why
fastbootisn't included in the Mac OS X download (as of r16, at least). Apparently it was unintentionally(?) removed from the Windows build but the relevant ticket implies it was reinstated. And while the instructions for the known issue suggest downloading an older version, AFAIK older versions of the Mac OS X SDK/tools don't include it either.Most of the pre-existing guides say that you can download the Mac OS X version of
fastbootfromhttp://developer.htc.com/adp.html--unfortunately HTC has reorganised their site and that URL just redirects to a top level domain. (Cool URIs don't change, people!)While the awesome people at http://archive.org/ have an archive of
http://developer.htc.com/adp.htmlit doesn't actually help us:-
The actual tool URL is hidden (base64 encoded) behind a Javascript click-through EULA (
aHR0cDovL2RsNC5odGMuY29tL1JvbUNvZGUvQURQL2Zhc3Rib290LW1hYy56aXA=-->http://dl4.htc.com/RomCode/ADP/fastboot-mac.zipbtw). -
The actual tool URL doesn't work anymore, even if you append the click-through parameter, etc, etc. So, it would seem that's a dead end.
Depending on how you feel about running random binaries from the internet (lol) there were some posts that linked to other (non-official) download locations. I downloaded a couple from different sources and they appeared to be the same file so I tried my luck... :)
Here's a selection of links to possible sources--I do not vouch for their legitimateness or not:
- http://blog.wapnet.nl/2011/05/setup-adb-and-fastboot-with-android-sdk-on-mac-osx/
- http://forum.xda-developers.com/showpost.php?p=17968804&postcount=102
- http://forum.xda-developers.com/showpost.php?p=17968804&postcount=102
- http://rootzwiki.com/topic/5697-tool-fastboot-on-your-mac/
And, FWIW, here's a link to the binary I eventually compiled (no vouching for this one either :D ):
For the sake of completeness, here's various guides to
fastbootI encountered along the way:- http://wiki.cyanogenmod.com/wiki/Fastboot
- http://elinux.org/Android_Fastboot
- http://android-dls.com/wiki/index.php?title=Fastboot
And, now we return your programme already in progress...]
Thus, I "needed" to compile it on my Mac OS X machine.
This is in fact possible by grabbing about 2.4MB of compressed source files and then editing a bunch of configuration files for
make.[Retro-Update: The required Mac OS X
fastbootpatches (hopefully). The patches remove a bunch of checks we don't care about and prevent building of things we don't actually need forfastboot. ]Once done,
fastbootcan be compiled simply with:mmm build/libs/host build/tools/acp external/zlib/ system/core/libzipfile system/core/fastbootfrom (local OS X box equivalent of) the
8060_v3directory.The editing is necessary because there doesn't seem to be a way to say "just build the host things". Or, if there is--I haven't found it.
-
And, hey, why not, with another edit we can also do:
mmm system/core/libmincrypt system/core/mkbootimgTo get
mkbootimgwhich is used somewhere along the way. (Yeah, I haven't written all that up...)(This may require some sort of Java on the machine also judging by:
host Java: dumpkey (out/host/common/obj/JAVA_LIBRARIES/dumpkey_intermediates/classes) Install: out/host/darwin-x86/framework/dumpkey.jarbut that might be able to be skipped also.)
Okay, managed to successfully do a test boot via fastboot with the
boot.imgfile from8060Dragonboard_v3_Update.20120119.zipfile with:out/host/darwin-x86/bin/fastboot boot boot.imgStill need to work out how to try it with my kernel. (Because attempts so far have failed by hanging after the
Booting...message.)Hmmm, worse case scenario I might be able to hack up the make configuration (on the Linux box) to build the boot image (which is kernel + ramdisk + kernel configuration commandline thingy...).
3 February 2012¶
Using
make -d out/target/product/msm8660_surf/boot.img(Print lots of debugging information) makes it possible to see which files are being included and thus where the errors generated are coming from. Handy. :)Commenting out the following line in the file
java_library.mkseems to avoid thebuild/core/java.mk:9: *** frameworks/base: Target java module does not define any source or resource files. Stop.error:include $(BUILD_SYSTEM)/java.mkThis allows things to get further before I hit the following error:
8060_v3/kernel is not clean, please run 'make mrproper'(Although
finderrors are still kicked up but ignored.)Doing what I was told I executed:
cd 8060_v3/kernel make mrproper(I assume I had to clean this up because I did the "manual" kernel compilation earlier.)
Then I changed back to
8060_v3directory.Now get the error:
scripts/kconfig/zconf.tab.c:206:24: error: zconf.hash.c: No such file or directoryOther people who got this error (without useful responses) include:
bero& friends -- includes comment "after applying doanac patch .. the one which moved kernel .o files to out directory" (Possibly related to kernel doesn't build out-of-tree.)- Issue compiling Android-x86 gingerbread-x86 code on Ubuntu 10.04 x86_64
- build failing
- gingerbread build on ubuntu 11.04
One post I found (duplicate) suggested that enabling the following line in the file
kernel/scripts/kconfig/Makefilemight make it work:LKC_GENPARSER := 1For this to work requires
flex&gperf(&bisonbut we've already installed that).Dum de doo... Let's install
flexhere with:sudo apt-get install flexAnd
gperf(generates perfect hashes):sudo apt-get install gperfIn theory they shouldn't need to be regenerated though because they should use the "shipped" files--indicated by
SHIPPEDin the log... [TODO: Look into this further? Yeah, right.] (This post may or may not be related but suggests a change inscripts/Makefile.buildmight be responsible.)This now moves us onto:
scripts/kconfig/zconf.tab.c: In function ‘zconfparse’: scripts/kconfig/zconf.tab.c:1648: error: ‘kconf_id_strings’ undeclared (first use in this function)Which I guess is progress?
Oooooh....
So, I think it's got further now.
I did the following dance again (based on the suggestion at end of this thread) and it seemed to progress further:
cd 8060_v3/kernel make mrproper(And then the now "standard":
make V=0 out/target/product/msm8660_surf/boot.img(Not that I think I've mentioned that's the current
makeinvocation I'm currently trying. :) Changing V=1 makes things more verbose at some stages.) )Gah. I'll have to go back to see whether or not the
LKC_GENPARSERchange "fixed" things but then led to this issue.It's currently compiling away...
Well, this is promising:
Kernel: arch/arm/boot/Image is ready ... Kernel: arch/arm/boot/zImage is readyBut apparently there's more to go as it continues with:
Building modules, stage 2.But... it eventually b0rks with:
target Prebuilt: (out/target/product/msm8660_surf/root/init.target.rc) make: *** No rule to make target `out/target/product/msm8660_surf/obj/lib/crtbegin_static.o', needed by `out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/LINKED/init'. Stop.Let's see what we can do with the
zImagebefore going any further though...I tried using
fastbootwith thezImageproduced in:8060_v3/out/target/product/msm8660_surf/obj/KERNEL_OBJ/arch/arm/boot/zImagebut it still no-worky, when running:
fastboot -c "ttyHSL0,115200,n8 androidboot.hardware=qcom loglevel=1" boot /tmp/tmpy/zImagehanging with:
creating boot image... creating boot image - 4657152 bytes downloading 'boot.img'... OKAY [ 1.139s] booting...[Update: Link for later reference: "HOWTO: Unpack, Edit, and Re-Pack Boot Images". (Note: the files appear to be missing on the server--you'll need to do a web search to find them.]
[Retro-Update:
At one stage I looked into tools for splitting pre-existing boot image files into the kernel & ram disk portions. I didn't seem to have success with them though--I don't know why. I noticed that the boot images for the DragonBoard had some kernel command-line options in them which the splitting tool didn't preserve--but even when I passed in the options manually--when recreating the file--it didn't seem to make any difference.
So either the tools don't currently work with these images or I can't work the tools--or something else. :)
But now that I can create my own kernel & initial ram disk I'm less concerned about the issue--it would need further investigation.
For the sake of completeness, here are some related links:
These ones are related to configuring and building the kernel (and aren't fully related to this section--I just had to put them somewhere...):
(Note that the above links aren't tailored for the Dragonboard/Qualcomm builds.)
]
Hmmm, back to trying:
make bootimageWhich fails with the same error:
make: *** No rule to make target `out/target/product/msm8660_surf/obj/lib/crtbegin_static.o', needed by `out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/LINKED/init'. Stop.[Links update: Here are some other people I found with the same error message (and not really any useful replies): Error when compiling nightly , Error while compiling CM7, Porting glibc.
So, I haven't really solved the problem either, just worked around it for the moment (which caused its own problems...).]
Trying again with the following to see if it gives any clues:
make -v bootimageSo, there's a line:
Considering target file `out/target/product/msm8660_surf/ramdisk.img'So I might be able to speed up the tests with this:
make ramdiskHmmm.
Must remake target `out/target/product/msm8660_surf/obj/lib/crtbegin_static.o'.There are references to
crtbegin_static.oin (amongst other places):build/core/combo/TARGET_linux-arm.mkBut in
build/core/shared_library.mkit has:# The latest ndk does NOT support TARGET_CRTBEGIN_SO_O and TARGET_CRTEND_SO_O yet. # my_target_crtbegin_so_o := $(my_ndk_version_root)/usr/lib/crtbegin_so.o # my_target_crtend_so_o := $(my_ndk_version_root)/usr/lib/crtend_so.o my_target_crtbegin_so_o := my_target_crtend_so_o :=But there's actually a bunch of files in:
./prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-arm/usr/lib/crtbegin_static.oWith also 3,4,5 in addition to 8 as version numbers(?)
I found a patch--that Google cached--entitled "[PATCH] Add NDK crtbegin_so.o and crtend_so.o if they exist." which is:
From cc737a5aa322909ae31c4a016d630c68571b80b2 Mon Sep 17 00:00:00 2001 From: Ying Wang <wangying@android.com> Date: Fri, 8 Apr 2011 14:57:36 -0700 Subject: [PATCH] Add NDK crtbegin_so.o and crtend_so.o if they exist. Change-Id: Ic088a986d3810a1d313df30361145a467ba07e06 --- core/shared_library.mk | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/shared_library.mk b/core/shared_library.mk index 77d253f..0393d17 100644 --- a/core/shared_library.mk +++ b/core/shared_library.mk @@ -35,11 +35,8 @@ my_target_crtbegin_so_o := $(TARGET_CRTBEGIN_SO_O) my_target_crtend_so_o := $(TARGET_CRTEND_SO_O) ifdef LOCAL_NDK_VERSION my_target_global_ld_dirs += -L$(my_ndk_version_root)/usr/lib -# The latest ndk does NOT support TARGET_CRTBEGIN_SO_O and TARGET_CRTEND_SO_O yet. -# my_target_crtbegin_so_o := $(my_ndk_version_root)/usr/lib/crtbegin_so.o -# my_target_crtend_so_o := $(my_ndk_version_root)/usr/lib/crtend_so.o -my_target_crtbegin_so_o := -my_target_crtend_so_o := +my_target_crtbegin_so_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtbegin_so.o) +my_target_crtend_so_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtend_so.o) endif $(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs) $(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags) -- 1.6.6After further poking around, I found this link which seems to be the same commit on the Qualcomm etc repository site.
At the current time the most recent version of the file also incorporates a patch "Put the NDK library paths ahead of TARGET_GLOBAL_LD_DIRS" which apparently avoids a race condition.
I'm not currently sure where
LOCAL_NDK_VERSIONis set though.Turns out you can set it with something like:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 system/core/init(Except this doesn't work for other reasons--of course.)
FWIW this doesn't work either:
mm LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= ramdiskAnd trying to use:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 ramdiskResults in:
build/core/binary.mk:21: *** frameworks/base/cmds/app_process: LOCAL_NDK_VERSION can only be used to build target shared/static libraries, while your module is of class EXECUTABLES. Stop.(BTW, here's the obsolete build cookbook with the useful variable names not defined: http://www.kandroid.org/online-pdk/guide/build_cookbook.html)
Manually copying the
lib&includefiles from the prebuilt NDK directories after defeating the checks for "sane" NDK use gets us further until:system/core/libcutils/mspace.c:59:50: error: ../../../bionic/libc/bionic/dlmalloc.c: No such file or directorySo, let's try adding that to the repo sync:
repo sync platform/bionic -j4[TODO: Add that to the get sources script.]
With:
make out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/LINKED/initI get:
bionic/libdl/libdl.c:24: error: expected declaration specifiers or '...' before 'Dl_info'(I think that was caused by copying the files for the Platform version 4 rather than 8.)
So:
mkdir -p out/target/product/msm8660_surf/obj/include/ # May already have `librpc` directory in it cp -r ./prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-arm/usr/include/* out/target/product/msm8660_surf/obj/include/ mkdir -p out/target/product/msm8660_surf/obj/lib cp -r ./prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-arm/usr/lib/* out/target/product/msm8660_surf/obj/libYeah, that seems to have fixed it.
Now we get:
host C: apriori <= build/tools/apriori/apriori.c In file included from build/tools/apriori/apriori.c:2: build/tools/apriori/common.h:4:20: error: libelf.h: No such file or directorySo, let's try:
sudo apt-get install libelf-devOh, yeah, okay we also had:
build/tools/apriori/apriori.c:5:20: error: libebl.h: No such file or directory build/tools/apriori/apriori.c:7:28: error: libebl_arm.h: No such file or directoryBut this doesn't fix it:
sudo apt-get install elfutilsNow going for:
repo sync platform/external/elfutils -j4And, hey, this too:
repo sync platform/external/elfcopy -j4[TODO: Add these to the get source script.]
And, away it goes...
For quite a bit longer until:
target asm: libc_common <= bionic/libc/arch-arm/bionic/_setjmp.S bionic/libc/arch-arm/bionic/_setjmp.S: Assembler messages: bionic/libc/arch-arm/bionic/_setjmp.S:59: Error: undefined symbol `_JB_CORE_BASE' in operation bionic/libc/arch-arm/bionic/_setjmp.S:93: Error: undefined symbol `_JB_CORE_BASE' in operation make: *** [out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/arch-arm/bionic/_setjmp.o] Error 1Hmmm, okay, so it seems there's a:
bionic/libc/arch-arm/include/machine/setjmp.hAnd it's got the correct defs, but the wrong ones are being picked up instead. (From, I assume what I copied from
./prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-arm/usr/include/.)So, delete the content of
out/target/product/msm8660_surf/obj/include/machineif you're following along. (Sure, you could probably fluff around with include order, but let's see what happens...)It now seems to pick up the correct thing but b0rks with:
bionic/libc/bionic/pthread-rwlocks.c:70: error: expected ')' before '*' tokenSeems to be the same kind of issue:
./out/target/product/msm8660_surf/obj/include/pthread.h ./bionic/libc/include/pthread.hSo, deleted the one in:
out/target/product/msm8660_surf/obj/include/pthread.h(Of course, who knows if we're breaking anything else in process...)
Same again with:
./out/target/product/msm8660_surf/obj/include/sys/_sigdefs.h ./bionic/libc/include/sys/_sigdefs.hWonder if I should be doing this more than piecemeal.
(Deleted the whole
sysdirectory but that broke other things. So, we'll just delete_sigdefs.h.)Also delete:
./out/target/product/msm8660_surf/obj/include/sys/wait.h ./out/target/product/msm8660_surf/obj/include/sys/cdefs.hNow:
target thumb C: init <= system/core/init/builtins.c system/core/init/builtins.c: In function 'do_exec': system/core/init/builtins.c:193: warning: implicit declaration of function 'wait' target thumb C: init <= system/core/init/init.c In file included from out/target/product/msm8660_surf/obj/include/signal.h:32, from system/core/init/init.c:23: out/target/product/msm8660_surf/obj/include/limits.h:89:28: error: arch/syslimits.h: No such file or directory make: *** [out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/init.o] Error 1So, try deleting:
out/target/product/msm8660_surf/obj/include/signal.hAnd, also, now:
out/target/product/msm8660_surf/obj/include/limits.h(Okay, so, maybe I should've looked at modifying the include order instead... :/)
So, that allows a bunch more until:
target thumb C: libc_common <= bionic/libc/tzcode/strftime.c bionic/libc/tzcode/strftime.c:64: error: variable 'C_time_locale' has initializer but incomplete typeWhich we get rid of by deleting:
out/target/product/msm8660_surf/obj/include/time.hNow things continue okay until:
target StaticLib: libc_common (out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a) target SharedLib: libc (out/target/product/msm8660_surf/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so) prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(sigaltstack.o):bionic/libc/arch-arm/syscalls/sigaltstack.S:18: error: undefined reference to '__NR_sigaltstack'Sigh.
4 February 2012¶
Delete:
out/target/product/msm8660_surf/obj/include/netinet/in6.hWhich also produced an error:
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(getaddrinfo.o): in function _get_precedence:bionic/libc/netbsd/net/getaddrinfo.c:1410: error: undefined reference to 'IN6_IS_ADDR_ULA'I corrected it as a test and it worked okay...
Delete:
out/target/product/msm8660_surf/obj/include/sys/linux-syscalls.hwhich fixes the rest of the issues apparently.
The command:
make out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/LINKED/initresults in:
target StaticExecutable: init (out/target/product/msm8660_surf/obj/EXECUTABLES/init_intermediates/LINKED/init)[TODO: Do it with a change of include order instead...]
So, now, let's go back to trying:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= ramdiskWhich now results in:
target thumb C: adbd <= system/core/adb/adb.c In file included from system/core/adb/adb.c:28: system/core/adb/sysdeps.h:257:28: error: cutils/sockets.h: No such file or directoryYou know that "hack it to get it to work stage"?
Yeah, way past that:
So, I dunno why it's not including the
system/core/includepath on the include search path but this is how I'm working around it insysdeps.h:#if 0 #include <cutils/sockets.h> #include <cutils/properties.h> #include <cutils/misc.h> #else #include "../include/cutils/sockets.h" #include "../include/cutils/properties.h" #include "../include/cutils/misc.h" #endifAwesome. :/
Meh, it continues with this anyway:
In file included from system/core/adb/adb.c:28: system/core/adb/sysdeps.h: In function 'adb_shutdown': system/core/adb/sysdeps.h:339: warning: implicit declaration of function 'shutdown'So that probably didn't help anything.
Okay, so keeping the above hack, deleting this:
out/target/product/msm8660_surf/obj/include/sys/socket.hThen:
target thumb C: init <= system/core/init/builtins.c system/core/init/builtins.c:42:47: error: private/android_filesystem_config.h: No such file or directoryYep:
#if 0 #include <private/android_filesystem_config.h> #else #include "../include/private/android_filesystem_config.h" #endifGo ahead, judge me. It's late/early. :-p
Ditto as appropriate for:
system/core/init/init.cand:
system/core/init/devices.c system/core/init/property_service.c system/core/init/util.c system/core/init/signal_handler.c system/core/libcutils/socket_inaddr_any_server.c system/core/libcutils/socket_local_client.cOkay, I'm calling it quits for now. I need to find how to add the include directory properly... :/
There's far more instances of this case than I first realised.
AFAICT, things should be set up in the make files to include
$(TOPDIR)system/core/includethrough various intermediate names but it doesn't seem to do so.The cookbook mentioned
LOCAL_C_INCLUDESso I insystem/core/libcutils/Android.mkI modified the line near the bottom to:LOCAL_C_INCLUDES := $(KERNEL_HEADERS) $(TOPDIR)system/core/includeI should go back and look if this fixes the issue in other cases.
It seemed to work for compilation.
Then moved on to:
target thumb C: libcutils <= system/core/libcutils/properties.c In file included from system/core/libcutils/properties.c:294: system/core/include/cutils/threads.h:60:4: error: #error "no thread_store_t implementation for your platform !!"Hard coded one or more defines somewhere to bypass that for the moment.
Deleted:
out/target/product/msm8660_surf/obj/include/arpa/inet.hSomething like:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= HAVE_PTHREADS=1 ramdiskAdd to
system/core/liblog/Android.mkin two places toward end:LOCAL_C_INCLUDES := $(TOPDIR)system/core/includeHardcode this somewhere:
#define HAVE_SYS_UIO_HAdd to
bionic/libc/Android.mkinlibc_common.asection:LOCAL_C_INCLUDES := $(libc_common_c_includes) $(TOPDIR)system/core/includeHardcode this in
iosched_policy.c:#define HAVE_SCHED_HOther
Android.mkedits (including the reversing of the hardcode../include/stuff.). Adding#include <sys/socket.h>tosysdeps.h.And ended up with:
Target ram disk: out/target/product/msm8660_surf/ramdisk.imgOkaaay. (Life would be so much easier as an optimist. :) )
(That was with:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= HAVE_PTHREADS=1 ramdisk)
Now trying with:
mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= HAVE_PTHREADS=1 bootimageWhich looks like it's recompiling the kernel image.
Please hold...
woooo....
target Prebuilt: (out/target/product/msm8660_surf/kernel) Target boot image: out/target/product/msm8660_surf/boot.img 1+0 records in 1+0 records out 2048 bytes (2.0 kB) copied, 4.3511e-05 s, 47.1 MB/s 0+1 records in 0+1 records out 256 bytes (256 B) copied, 4.6863e-05 s, 5.5 MB/s out/target/product/msm8660_surf/boot.img total size is 4808704So, the question is: will it blend, er, boot! :D
IT WOOOOOOOOOOOOOOORRRRRKKKKKSSSSSSSSSSSS!!!!!!!!!!!!!!! :D :D :D :D :D
Ummm, yeah, finally. :)
And totally reproducible, I'm sure... :)
Oh, yeah, so this was the amazing action:
out/host/darwin-x86/bin/fastboot boot boot.imgWhich resulted in:
downloading 'boot.img'... OKAY [ 1.175s] booting... OKAY [ 0.014s] finished. total time: 1.190sAnd here's a totally un-shopped screenshot:

(Okay, so, perhaps I could've scaled the image down a little. :) )
And, for the sake of it, here's the boot image file: http://code.rancidbacon.com/projects/dragonboard/files/boot-first-compiled-kernel-20120204.img
So, this gives us some sort of idea on the modified files:
repo statusWith the output:
# on branch work project bionic/ (*** NO BRANCH ***) -m libc/Android.mk project build/ branch work -m core/binary.mk -m core/java_library.mk -m core/shared_library.mk project kernel/ branch work -m arch/arm/mach-msm/sdio_al.c -m arch/arm/mach-msm/sdio_al_dloader.c -m arch/arm/mach-msm/sdio_al_test.c -- arch/arm/mach-msm/smd_rpc_sym.c -m scripts/kconfig/Makefile -m scripts/kconfig/lex.zconf.c_shipped project system/core/ (*** NO BRANCH ***) -m adb/Android.mk -m adb/sysdeps.h -m include/cutils/threads.h -m include/cutils/uio.h -m init/Android.mk -m init/builtins.c -m init/devices.c -m init/init.c -m init/property_service.c -m init/signal_handler.c -m init/util.c -m libcutils/Android.mk -m libcutils/iosched_policy.c -m libcutils/socket_inaddr_any_server.c -m libcutils/socket_local_client.c -m liblog/Android.mkAnd here's a diff of the repo in its current state: http://code.rancidbacon.com/projects/dragonboard/files/first-boot-files-repo.diff
Obviously it doesn't show the manually copied files. (Which should really also become include/library path configurations in some way...)
Now--as a side note--although this is actually the real reason for the whole compilation exercise...
The kernel configuration option
CONFIG_USB_ANDROID_ACCESSORYis what we're aiming to enable--amongst other configuration details.Looking for
CONFIG_USB_ANDROIDshows where similar options are set:kernel/arch/arm/configs/msm8660_defconfig kernel/arch/arm/configs/msm8660-perf_defconfigAnd referenced places like:
kernel/arch/arm/mach-msm/board-msm8x60.c kernel/arch/arm/mach-msm/devices-msm8x60.c kernel/include/linux/usb/android.h kernel/include/linux/usb/android_composite.h kernel/drivers/usb/gadget/ kernel/drivers/usb/gadget/Kconfig
7 February 2012¶
As an aside, the following page has some suggestions on speeding up the build process:
Some additional notes from the QSD Android Enablement Project // Downloading and Building from Source section:
If you want to compile the kernel with a specific configuration file other than the one defined in vendor/qcom/{product}/AndroidBoard.mk (e.g. msm7201a_defconfig) pass the KERNEL_DEFCONFIG flag on the Make command line.
make -j4 KERNEL_DEFCONFIG=your_defconfigThe kernel objects, vmlinux and zImage will be at {platform}/out/target/product/msm7201a_surf/obj/KERNEL_OBJ and its subdirectories.
Also, this option will just print the commands that will be used:
make --just-print bootimageA note on using
gitweb:If you want to be able to choose between tags/heads then:
-
from https://www.codeaurora.org/gitweb/quic/la/ you need to--for example--click the summary link; and then,
-
scroll to the bottom of the page to choose--for example--the shortlog of
gingerbread_chocolateor the tree view.
I kept on getting lost and/or not being able to find the branch I was looking for because it seems like you can only pick that at the summary screen. AFAICT. I could be wrong. :)
-
So, revising from a long time ago:
-
This commit ("USB: gadget: f_accessory: New gadget driver for android USB accesories") appears to be where the the USB Accessory functionality was added.
-
Here is the plain text patch.
-
Hmmm, so the Code Aurora site is being a pain and hanging again...
Here is a copy of the USB Accessory patch (note however that there appear to be follow-up patches also that aren't included).
I tested applying it with:
cd kernel/ patch -p1 --dry-run < android-usb-accessory.patchInitially the following error occurred:
patch unexpectedly ends in middle of line patch: **** malformed patch at line 920:It turned out this was because there was no newline at the end of the last line--so I added it and then the dry-run went smoothly.
Then I applied the patch for real:
patch -p1 < android-usb-accessory.patchIt applied cleanly and generated the following output:
patching file drivers/usb/gadget/Kconfig Hunk #1 succeeded at 1173 with fuzz 2 (offset 289 lines). patching file drivers/usb/gadget/Makefile Hunk #1 succeeded at 79 with fuzz 2 (offset 10 lines). patching file drivers/usb/gadget/android.c Hunk #1 succeeded at 538 with fuzz 2 (offset 134 lines). patching file drivers/usb/gadget/f_accessory.c patching file include/linux/usb/f_accessory.hThen it was time for:
cd .. source build/envsetup.sh choosecombo 1 1 msm8660_surf engWith a test run:
make --just-print bootimageThe test run detected a change and prompted:
Android USB accessory function (USB_ANDROID_ACCESSORY) [N/y/?] (NEW)I typed
y [enter]which it accepted and wrote to.config. (Which suggests it's not exactly "just-print" at all...)Then it carried on happily to the end of the test.
With the following:
make bootimagethe following was included in the output:
CC drivers/usb/gadget/android.o LD drivers/usb/gadget/built-in.o LD drivers/built-in.owhich suggested it changed. :)
Hmmm, but then eventually I got:
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(getaddrinfo.o): in function _get_label:bionic/libc/netbsd/net/getaddrinfo.c:1369: error: undefined reference to 'IN6_IS_ADDR_ULA' prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/msm8660_surf/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(getaddrinfo.o): in function _get_precedence:bionic/libc/netbsd/net/getaddrinfo.c:1410: error: undefined reference to 'IN6_IS_ADDR_ULA' collect2: ld returned 1 exit status make: *** [out/target/product/msm8660_surf/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so] Error 1But that was after:
Kernel: arch/arm/boot/zImage is readySo let's see if we can do anything with that first...
Nope, I still can't get either of these working:
fastboot -c "ttyHSL0,115200,n8 androidboot.hardware=qcom loglevel=1" boot zImage fastboot -c "ttyHSL0,115200,n8 androidboot.hardware=qcom loglevel=1" boot zImage ramdisk.imgOh, so that other error may be because I wasn't using
mmetc, so let's try that:mm LOCAL_NDK_VERSION=4 LOCAL_SDK_VERSION=8 LOCAL_NO_STANDARD_LIBRARIES= HAVE_PTHREADS=1 bootimageAnd... it's back to being okay again--I must remember that. :)
So, we end up with:
Target boot image: out/target/product/msm8660_surf/boot.img 1+0 records in 1+0 records out 2048 bytes (2.0 kB) copied, 7.5212e-05 s, 27.2 MB/s 0+1 records in 0+1 records out 256 bytes (256 B) copied, 3.4499e-05 s, 7.4 MB/s out/target/product/msm8660_surf/boot.img total size is 4808704And... that downloads and boots okay:
fastboot boot boot.img downloading 'boot.img'... OKAY [ 1.176s] booting... OKAY [ 0.014s] finished. total time: 1.190sSo, now we need to find out if it made anything USB-y work. I don't think we can just try an accessory because we haven't installed the Java side of things...
Oh, so, incidentally:
platform-tools/adb shell dmesgIncludes in its output:
<5>[ 0.000000] Linux version 2.6.38.6-perf-00039-g74a7f2e-dirty (philip@li141-33) (gcc version 4.4.3 (GCC) ) #4 SMP PREEMPT Tue Feb 7 09:00:27 UTC 2012So, I plug an accessory in and get:
<3>[ 1165.851694] android_usb gadget: common->fsg is NULL in fsg_setup at 629 <4>[ 1165.851720] ------------[ cut here ]------------ <4>[ 1165.851757] WARNING: at <...>/8060_v3/kernel/drivers/usb/gadget/f_mass_storage.c:474 fsg_setup+0x58/0x128() <4>[ 1165.851797] Modules linked in: <4>[ 1165.851856] [<c00564b4>] (unwind_backtrace+0x0/0x128) from [<c00df5b8>] (warn_slowpath_common+0x4c/0x64) <4>[ 1165.851913] [<c00df5b8>] (warn_slowpath_common+0x4c/0x64) from [<c00df5e8>] (warn_slowpath_null+0x18/0x1c) <4>[ 1165.851967] [<c00df5e8>] (warn_slowpath_null+0x18/0x1c) from [<c03f3194>] (fsg_setup+0x58/0x128) <4>[ 1165.852019] [<c03f3194>] (fsg_setup+0x58/0x128) from [<c03e6938>] (android_setup_config+0x38/0x60) <4>[ 1165.852073] [<c03e6938>] (android_setup_config+0x38/0x60) from [<c03e8748>] (composite_setup+0xe68/0xf80) <4>[ 1165.852126] [<c03e8748>] (composite_setup+0xe68/0xf80) from [<c03e5f60>] (usb_interrupt+0x6f8/0x9fc) <4>[ 1165.852179] [<c03e5f60>] (usb_interrupt+0x6f8/0x9fc) from [<c012301c>] (handle_IRQ_event+0x24/0xc4) <4>[ 1165.852232] [<c012301c>] (handle_IRQ_event+0x24/0xc4) from [<c012612c>] (handle_level_irq+0x164/0x254) <4>[ 1165.852284] [<c012612c>] (handle_level_irq+0x164/0x254) from [<c0050580>] (handle_IRQ+0x90/0xd4) <4>[ 1165.852338] [<c0050580>] (handle_IRQ+0x90/0xd4) from [<c004ef4c>] (__irq_svc+0x4c/0xe4) <4>[ 1165.852396] [<c004ef4c>] (__irq_svc+0x4c/0xe4) from [<c00b7e04>] (msm_cpuidle_enter+0x5c/0x6c) <4>[ 1165.852449] [<c00b7e04>] (msm_cpuidle_enter+0x5c/0x6c) from [<c04a5640>] (cpuidle_idle_call+0xc8/0x130) <4>[ 1165.852500] [<c04a5640>] (cpuidle_idle_call+0xc8/0x130) from [<c0050c9c>] (cpu_idle+0x7c/0xd8) <4>[ 1165.852548] [<c0050c9c>] (cpu_idle+0x7c/0xd8) from [<c0008b0c>] (start_kernel+0x2b0/0x30c) <4>[ 1165.852579] unwind: Unknown symbol address c0008b0c <4>[ 1165.852602] unwind: Index not found c0008b0c <4>[ 1165.852624] ---[ end trace e00af545cf83fc52 ]--- <6>[ 1166.239639] msm_otg_suspend: usb in low power mode <6>[ 1167.474380]So, yeah, that's probably not good... :/
Oh, that was worth checking: the standard kernel has the same error so I guess it's not just mine...
Meh.
25 October 2012¶
I want to close these tabs, so in case I get back to this in the future here's the remaining tabs (some of which I may already have linked):
-
ADK - USB - Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
-
Code Aurora Forum .:Gitweb:. - kernel/msm.git/history - drivers/usb/gadget/f_accessory.c
-
"USB: gadget: f_accessory: New gadget driver for android USB accesories" (commitdiff_plain)
-
[PATCH 0493/2342] usb: gadget: android: Update android gadget driver
-
[PATCH 0490/2342] USB: gadget: f_accessory: New gadget driver for android USB accesories
-
Code Aurora Forum .:Gitweb:. - kernel/msm.git/tree - drivers/usb/gadget/
-