On 01/29/2012 12:00 PM, Robert A. Lerche wrote: > Hi. I have previously built LFS and used the LFS Live CD project to > create a custom system (back in the 6.3 / 6.4 days). > > I am now engaged in a project for a client using Android on a custom > embedded system. As you may know, Android uses the Linux kernel as a > base. > > Has anyone out there built Android completely from sources?
Yes, even been through the joy of adding a new device at one point, though people much smarter than I have superseded anything I might have accomplished in my own impatience. Took me several hours to figure out how to get the sucker to boot the first time. > I'd > appreciate a chance to chat with someone familiar with setting up a > complete source build environment. See the IRC link below if you'd prefer direct chat to others methods of information gathering... > > Thanks in advance. While the final product is not even remotely similar to LFS, you will still find quite a bit in common with LFS in that massive 6GB source tree, but still way more differences. You will need a proper mult-lib setup on your build host, however, which renders LFS proper useless for Android development. See CLFS if you really want to use *LFS as a build host. I use Ubuntu in a VM myself. It's not terribly difficult to build a cross toolchain from scratch either should you need it for projects outside the tree, see codesorcery's open source changes. IMO, the biggest pain of building android is learning to use the repo script instead of git by itself. You are actually pulling code from from around 200 (or potentially more) git repositories for the Android source tree. The repo tool attempts to simplify that a bit, keeping a manifest file which describes all of the various git repos and local paths, but it, like any other tool, has a couple of gotchas. Do not try and change the path after you have done an init, remove the entire tree and start from scratch. Also, make sure it is more than one path element deep below your home directory...use something like ~/Android/AOSP and ~/Android/Evervolv, not ~/AOSP and ~/Evervolv. If you ignore this last bit, you won't like the result when you elect to remove one of the trees by choice, followed by the other as necessity (note that git itself will still work correctly so that you can push your changes back to github, or wherever). I never did dig in and figure out the cause, but it does not make a happy developer when it fails (and gives weird errors as well, usually revolving around the .repo directory). As mentioned by another poster, CyanogenMod has a great wiki and could be used as a good starting point I suppose, but they are maintaining something like 70+ devices now and have many many differences to AOSP. If you are looking for examples, I think I'd look at a project that manages less devices (Evervolv is one I follow and much much closer to AOSP proper) for figuring out custom device profiles (and mealtime functions (lunch/brunch) which are heavily modified in CM's repos). Probably look for something with similar hardware to your new target and go from there. Just about everyone uses github, so remember to include it in your search terms if looking for direction. Links: I'm sure you've found this one already, at least I hope you have: http://source.android.com/source/downloading.html CodeSorcery (custom cross toolchain, not actually needed unless you intend to develop in C outside of the Android source tree, probably just use the one in git): http://www.mentor.com/embedded-software/android/ CyanogenMod (great documentation, but probably overkill as a source for creating a new device tree): https://github.com/cyanogenmod http://wiki.cyanogenmod.com/index.php?title=Main_Page They also have a freenode IRC channel for developers, but I don't know it off the top of my head. Some really smart people in there too. Evervolv (one suggestion for example code for a new device tree (in addition to the ones already in AOSP, there are many others out there as well, but these guys tend to keep it simple enough, and the devs on IRC will likely bend over backwards to help): https://github.com/Evervolv http://wiki.evervolv.com/index.php/Main_Page irc://irc.freenode.net/#evervolv Hope that gets you going in the right direction. -- DJ Lucas -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page