[Q] In-depth questions about Android? - Android Q&A, Help & Troubleshooting

Hi,
I know Android is based on Linux and I have good knowledge when it comes to Linux. I also have a good understanding when it comes to Android right from the first devices...flashing roms etc. Still I am just using it on a user level and I am just guessing from those experiences what basic elements are and how Android is structured.
For once I would like to know how a typical Android phone is partitioned?
First there is the boot-element. I can flash ROMs all I want and it stays the same (in my case LG Animation). I guess this is a separate partition where a little bootloader like GRUB is located? Or is this located in the system-partition? Maybe the file boot.img? What is this? Some Mini-Linux?
Then there is for example the ClockWorkMod Recovery. Where is it located? It isn't deleted when I flash new ROMs. Is it on a separate partition? And what is it? Some Mini-Linux you can boot into?
Then there is the OS-Partition I can see when I install a file-explorer app in Android. I am guessing the OS itself (is this Linux or Android?) resides in /system, the user data resides in /data. Can somebody explain the main folders in this partition and what they contain?
Then there are elements like the Baseband or the RIL. Where are they located? Are they on a separate partition? Are they a Mini-Linux themselves and why aren't they changed when I flash a ROM?
In summary: I would like to understand Android better. Maybe you can answer some of my questions above or know some articles describing exactly what I want to know. I used Google and the forum search but found nothing really useful.
Cheers,
sb

Nobody got anything?

Not sure if this helps, it applies to most (if not all) Android devices:
http://androidforums.com/evo-4g-all-things-root/278898-android-partitions-kernels-explained.html

Thanks! This helped a lot. I head a similar view in my head but nothing really confirmed. There are more links to read in your link...which I will do

Related

Good tutorial anyone?

So, I've been reading a bit about how to install 2.2 on my g1. My initial impressions as a first time rooter is that it is a bit complicated. I really would like to know what I'm doing in case anything goes wrong. However, I've been a bit frustrated by any of the information I've found on google about it. Most of the tutorials only tell you what to do without explaining why you are doing it. Any explanations about how things works have been pretty brief and not much goes into how each piece of the android system relates to the other.
I'm going to run through my trouble points with learning it and if someone could jump in and explain any one of these things it would help me out a lot and hopefully other people as well.
There are (at least?) 4 main parts you need to be concerned with when installing a custom rom:
-the custom rom itself
I'm not totally sure of everything that goes into this. All the java stuff I'm guessing. Dalvik vm? Maybe the linux kernel? Some c libs too? busybox? Some other stuff?
-the spl.. aka second program loader.. I found the following explanation for this one:
Second Program Loader, in conjunction with the IPL comprise a device's bootloader. Aside from bootstrapping Android, the bootloader also fulfills various diagnostic functions. One of these functions is the manipulation of data in the device's internal flash ram. Depending on the SPL installed, the user can apply a signed NBH file, flash nand images, and more. Note that the SPL is installed and operates independently of the Android build that runs atop it. (Hold down the Camera button while the phone is booting to enter the SPL.)
Click to expand...
Click to collapse
Seems fairly straightforward. How does the IPL factor into this though? Why is the IPL typically not a concern when installing roms? What is a nbh? How does a nbh relate to a .img? Why does this get flashed?
-the radio.. i have no idea what this one is for.. references to it typically seem to be vague and mysteriousi have heard it is quote "the easiest way to brick your phone" which leads me to believe it is important. Appearantly danger SPL will kill you if you dare mess with it. This scares me because I dont really even know what it is so how am i supposed to know if I'm messing with it?
I have heard this description:
"radio.img is a image of partition table + several partitions, which are defined in the header.
You can open the file in hex editor and see it (starting at 0x18 offset):
MAGIC-NOTHING2DO: does nothing
OTA-QCSBL-UPDATE: updates qcsblhd_cfgdata.mbn and qcsblsec.mbn
OTA-OMSBL-UPDATE: updates oemsblhd.mbn and oemsblsec.mbn
OTA-RADIO-UPDATE: updates amsshd.mbn and amsssec.mbn (the actual baseband firmware)
OTA-APSBL-UPDATE: updates appsboothd.mbn and appsbootsec.mbn
OTA-CEFS--UPDATE: updates cefs.mbn (on some radio.img files this is done implicitly)"
Click to expand...
Click to collapse
What is this talking about? How do the partitions relate to what goes on when you are installing a rom? What is it used for? Why are there so many versions of it? Why?!
Finally:
-the recovery.img - this one is also a shroud of mystery to me. I'm not sure how it relates to the spl and it seems like sometimes you use this to install updates and sometimes you use the spl. I'm just not really sure how this factors into things.
This also seems to be involved a lot in things like 'repairing ext file systems' etc. What ext file system is it repairing? The sd card? The internal storage? Why are you supposed to repair it?
I have more questions but I will leave it at this. Thoughts anyone?

[Q] [REQ] Andoird on I8910 OmniaHD??

can someone tell me if is possible port Android on this amazing device??
someone is working on this???
I wuold like a lot if someone port Andoid on oHD!!!
lukas_ita said:
can someone tell me if is possible port Android on this amazing device??
someone is working on this???
I wuold like a lot if someone port Andoid on oHD!!!
Click to expand...
Click to collapse
I was working on it for a long time. Unfortunately it is impossible, due to limited bootloader space (not enough for an android one) and no recovery partition. Also it would need a totally new partition layout (as it only has two accessable internal and one external drive, so no cache, recovery access, nor swap.
And also do not forget about the hardware incompatibility. Even if we manage to boot it, you will hardly be able to even make a phone call. Not to say use WiFi, or GPS, BT, or anything.
hi i joined because of some interest in this,
first of all let met tell you that i own a samsoung i8320 (vodafone h1).
this in some way helps because we now have a 'working' limo kernel, in my opinion it might help us out here.
the problem i have is that i never ever yet have been able to do 'any of the work here under' - the fact that i know howto doesn't make me capable of doing, (its like the fact that you know a plain fly's because of big wings and an engine, doesn't make you a pilot)
---------
the H1 uses a rather standard linux kernel as far as i can tell from the source could, though i havn't been able to run it inside quemu yet..
some guys allready interested in porting android say that they got android running but without functions like phone or wifi. this is because thay used an android kernel rather than the samsung one.
step 1:
so what if you would strip the samsung rom from all 'userland' software, keeping only the kernel, its drivers and busybox stuf.
creating a root shell only - you may even be able to make it mount as /boot rather than /
step 2:
now ad ad adtional filesystem on the internal phone memory or an external sdcard ... format it as you like (ext3 with noadtime could do, but other options are also availible).
this should now be where the remaining of the android rom should be. you could now always update most of your your android and apps exept for your linux kernel or drivers. without reflashing. this idea is largely based on apps-2-sd so we all know its been done before.
fonix232 said:
I was working on it for a long time. Unfortunately it is impossible, due to limited bootloader space (not enough for an android one) and no recovery partition. Also it would need a totally new partition layout (as it only has two accessable internal and one external drive, so no cache, recovery access, nor swap.
And also do not forget about the hardware incompatibility. Even if we manage to boot it, you will hardly be able to even make a phone call. Not to say use WiFi, or GPS, BT, or anything.
Click to expand...
Click to collapse
The i8910 community is great....this phone is great...a porting of android on this phone wuold mean a great number of donations!
cannot you use E\ (massmemory...8Gb or 16Gb) like partition?

Turning any android phone/tablet into a raspberry pi

Hi guys!
I'm a software developer for some years now, and today I got a request if I could hack any tablet/phone to use it like a raspberry pi or something similar. Basically, the question is, if I can install & run whatever I want on it, like it's the case on the raspberry pi.
I don't fully understand the differences between a raspberry pi-like SoC with an attached touchscreen and an android phone/tablet, so I'm very interested in this topic.
Would you maybe be so kind and answer me some basic questions?
- Is it possible to extract the drivers, for example for the GPU or the touch screen, from a rooted device? If yes, is it hard? Is it always the same, or a completely different process for every different GPU/tochscreen etc?
- Is it possible to use those drivers with the normal linux kernel & any distro I like to use?
- In order to swap android with my linux distribution of choice, what will I actually need to replace, or to do in general? I know that a typical android phone/tablet's internal storage is usually formatted with different partitions, like the bootloader, system oder data partition,
- Will I need to reformat the internal storage and even install a different bootloader? Or is the preinstalled bootloader usually able to boot any system, not just android?
Of course you don't have to answer all the questions. I'm grateful for any answer that helps me in one of those questions or provides me some information I might want to know in this topic.
Thank you very much

[Q] Cooking ROMs... I still don't get it

Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
oxiroxt said:
Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
Click to expand...
Click to collapse
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
synesthete said:
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
Click to expand...
Click to collapse
OMG Finally some light! THANK YOU, THANK YOU, THANK YOU for all the info. I didn't get much right now, I'll need to read through your post a few times before I get it all, haha. I'll be sure to check the links too. Thank you!

Using the recovery image as the OS

I've read that some Android devices have recovery partitions that are quite large e.g. 250MB.
That's enough to put an entire tiny Linux distribution in there.
So my question is, has anyone worked on creating a recovery image that actually serves as an alternate operating system rather than Android?
There already exist many live Linux CDs that are as small as 250MB.
In a pinch, one could create an OS image that is less than 10MB.
Maybe my understanding of Android phones is incomplete though so if someone can explain where I might be wrong then I'd appreciate any help.
I wonder if this method could even be used to test out the Fuchsia kernel.

Categories

Resources