Question for ROM Devs - Samsung Galaxy Nexus

I have been reading on how to compile android 4.0.3 and have my linux system all set up. I have a few questions before continuing.
From my understanding, there are a few components to a full working phone (please let me known where I am mistaken):
Bootloader
Radio(s)
Recovery
Kernel
Android OS
Gapps​
What exactly is being compiled when I retrieve the source from google? My guess would be the recovery, kernel and android os. And the bootloader and radio are proprietary?
Where does one get the Gapps? Pulled from a stock phone maybe?
When flashing with
Code:
fastboot flashall -w
that erases cache and userdata, and it flashes the recovery, the kernel and the os?
What exactly is CWM doing when "installing from zip"? Is that pretty much a "fastboot boot ???"?
Once a developer compiles the source, how does he package it ready for CWM?
I don't intend to be a rom developer, but I love to tinker and I like to know what exactly is going on. It makes me a bit more comfortable flashing different roms if I know exactly what is going on in the system.

I'm no dev, although I'm compiling ICS as we speak just to tinker, as you put it. I believe its only the kernel and Android OS that is compiled from the Google source. Bootloader and radio are proprietary, like you said, and I'm not sure where the recovery comes from, but I know when I compiled from source on my OG Droid recovery wasn't included.
Sent from my Galaxy Nexus using Tapatalk

Install from zip runs a Recovery API that allows scripts to be ran to perform various tasks on the phone. You can extract and look at these update-scripts on packaged ROMs in the development section to get an idea.

Related

Questions about Kernel, Recovery. (noob alert!)

I've tried searching for these things, but all the info seems to be very fragmented.
If someone can give me a simple answer, I would greatly appreciate it.
Kernel - Do I need to flash a new one when installing a new ROM, or is it already in there? Do I just flash it by having a .zip on my sdcard?
Recovery - is this just a shell for bootloader (terminology from the winmo days i guess)? Are there differences, one better than another?
I'd like to install the stock 2.2 ROM that netarchy released, but there is a lot of talk about kernels as related to wifi and FPS, so I wanted to see what that's all about.
Thanks.
Kernel Answers:
No. When flashing a new rom a kernel is included. Kernels are packaged up in the boot.img files inside the rom.zip. Now, with HTC Sense phones there are two types of kernels. HTC kernels and Android kernels. HTC builds their phones in such a way that a standard Android kernel will not work. This is why we need to wait for the kernel source code from them. It also depends what OS is on the device. If you have a stock Sense rom it will use a different kernel than an AOSP rom such as CyanogenMod. So as an example, you are unable to use any CM6 kernel with Sense or vice versa.
My point is this. Be careful. If you want a modified kernel make sure it is for your rom or is compatible with your rom.
Recovery Answers:
No. Recovery is different than the bootloader. Recovery is a mode built into the phone so that, assuming something goes wrong and Android doesn't boot, you can boot into recovery and flash different files. This is only meant for HTC employees however at XDA we always find a way to use this recovery for our own purposes. We take HTC's recovery, erase it and flash our own recovery over it. This allows us to backup and restore our phones, flash new files to it, wipe it, etc.
So for your question. You can use the Stock 2.2 rom and Netarchy's kernel and it should work fine. Just be careful because it is a 2.6.29 kernel. The stock kernel now is 2.6.32 so some things may or may not work properly with it as FroYo was designed to run on a 2.6.32 kernel.
Thanks a bunch for the info!
So if I do the "Volume Down + Power" thing, that goes into phones native recovery menu?
Also, if the phone is rooted (via toast's or simple root), will it then have a different recovery process?
EDIT: As has been pointed out, this thread maybe better served in the Q&A section. Mods, please move this if you feel it's necessary.

[Q] Do I need to flash boot.img every time? (HTC refugee, so possibly really dumb Q)

So I cut my Android flashing teeth on the original HTC Magic, then to a Desire and Galaxy Tabs on the tablet front. Even cooked a few roms back in the Magic days (although was little more than mashing bits into an update.zip if I'm honest)
Anyway, I'm used to the scenario where, once you've got a viable recovery, you can thenceforth flash and backup/restore whatever you want without any need to plug the thing into a computer and do any messy fastboot stuff. I can't find a clear indication, but the vibe I'm getting is that in Sonyland one must always flash the boot.img of a new rom before going into recovery to install a new update.zip. is this right, or am I taking instructions designed for first timers too literally?
When you flash your first rom, let's say CM9, you will need to install FXP's CM9 boot.img(AKA kernel). Then if you wanna update your CM9 rom(IE. From Nightly 1 to nightly 2), you can use the same boot.img. BUT, if you want to flash stock based rom, like Arconium ICS, you will need stock kernel(Sony stock kernel, DoomKernel), if you want to flash stock based GB rom, you'll need stock based Gingerbread kernel(DoomKernel for GB f.ex).
When you go to the rom's thread, the developer always tells what kernel to use. If you have one of the listed kernels, you're good to go, just flash the rom itself, and no need to flash kernel again.
I hope I was clear enough
No, that's a valid question. I don't recall the explanation (if any) but recovery on Sony's phones can't modify the kernel for some reason.
While on other phones like your old htc, and even most samsung phones, it is possible to update the kernel from recovery.

[Q] What is relationship between kernel and ROM?

I have experimented with different ROMs and two versions of TWRP, and have installed the fff bootloader. (I have two working cracked-glass KF's that I picked up cheap in addition to a like-new one, so I can try different ROMs, etc., at the same time.)
I had presumed until recently that the kernel was a part of the ROM that was locked in by the ROM developer. It appears, though, judging by the two lengthy threads about a kernel 3.0, that users can install different combinations of kernel and ROM.
Can somebody explain, or point to an explanation of, the relationship between a kernel and a ROM and how one installs a desired combination of the two? Can one install a new kernel over an existing ROM, install the kernel and then a ROM, or is it necessary to do something else, such as editing a .zip file before installing it?
I realize that if I were to read a few hundred messages in a few threads, I might come up with the answers myself, but I might also transition from being a still-coherent old guy to one with senile dementia before I got to that point. Aside from my personal needs, though, it seems that an explanation of this matter deserves to be someplace where it can be easily found.
The kernel is the main component of the operating system (ROM). The kernel is essentially the middle man between the applications and the processing being executed at a hardware level. Basically the kernel is the communicator between software and hardware.
With that said, ROM developers will use a specific kernel with their ROM. You are not locked in to use the kernel which came with "x" ROM. A new kernel can be installed. You want to make certain if you are using an ICS ROM you parallel it with an ICS kernel. If you flash an incompatible kernel that could be a problem. Some kernels work better with some ROMS. Different combinations produce different bugs. It's just a matter of tinkering until you find the combination which suits you best. Hash's latest 3.0 kernel (http://forum.xda-developers.com/showthread.php?t=1591850) is popular and seems to be mostly stable with the ICS ROMS for the KF.
Installing a kernel is just like flashing a ROM although you don't need to wipe anything. Just boot in to recovery and select the kernel you've downloaded.
Should the custom kernel be installed after the ROM? It would seem that that would be necessary if the ROM itself comes with a kernel, as it apparently does.
Also:
? Are both the kernel and the rest of the ROM installed into the system partition, /dev/block/mmcblk0p9? If not there, then where?
? Does the kernel include the compiled code for all the standard linux commands, or only the system-level ones? Does it include the Dalvik interpreter?
aarons510 said:
Should the custom kernel be installed after the ROM? It would seem that that would be necessary if the ROM itself comes with a kernel, as it apparently does.
Also:
? Are both the kernel and the rest of the ROM installed into the system partition, /dev/block/mmcblk0p9? If not there, then where?
? Does the kernel include the compiled code for all the standard linux commands, or only the system-level ones? Does it include the Dalvik interpreter?
Click to expand...
Click to collapse
1. boot.img
2. Kernel come with system calls, or API, the commands you mentioned is binutils (most popular is GNU's). In Android you can install busybox to get these commands.
Gửi từ Kindle Lửa của tôi qua Tapatalk 2
linktohack said:
1. boot.img
Click to expand...
Click to collapse
What part of my question is this an answer to? I'm guessing that it's meant to answer the questions in the third paragraph of my original post, but it's a bit cryptic, to say the least. I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
2. Kernel come with system calls, or API, the commands you mentioned is binutils (most popular is GNU's). In Android you can install busybox to get these commands.
Click to expand...
Click to collapse
I just checked the version of ICS I have installed on one KF and the CM7 installation I have on another. On both of them, the system calls seem to be in /system/bin while the file manipulation and document processing commands are in /system/xbin. Most of the latter are, indeed, symlinks to busybox while many of the former are symlinks to toolbox.
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
aarons510 said:
What part of my question is this an answer to?
Click to expand...
Click to collapse
I think he meant to tell you that the kernel is usually distributed as boot.img in the ROM zips.
aarons510 said:
I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
Click to expand...
Click to collapse
The kernel is installed along with whatever ROM you install. Let's say you pick MadeUpRom and it features kernel #8 with it. You'd have to flash kernel #11 after installing said ROM.
aarons510 said:
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
Click to expand...
Click to collapse
Kernels are installed to the boot partition, which is separate from the ROM's /system partition. Installing a new kernel will overwrite the existing one. For the dalvik, read this to understand it better: http://stackoverflow.com/questions/7541281/what-is-dalvik-and-dalvik-cache
aarons510 said:
What part of my question is this an answer to? I'm guessing that it's meant to answer the questions in the third paragraph of my original post, but it's a bit cryptic, to say the least. I do want to confirm that the new kernel gets installed after the ROM is installed, if that is indeed the case.
I just checked the version of ICS I have installed on one KF and the CM7 installation I have on another. On both of them, the system calls seem to be in /system/bin while the file manipulation and document processing commands are in /system/xbin. Most of the latter are, indeed, symlinks to busybox while many of the former are symlinks to toolbox.
So, when one installs a new kernel, is one just over-writing /system/bin and maybe other directories with a new set of system calls, or is something else going on? And where does the dalvik interpreter fit in? Is it part of the kernel, part of the ROM, or neither?
Click to expand...
Click to collapse
In Android world, a kernel is an image contains a Linux kernel and a ramdisk which is named *boot.img* and will be *write* (byte copy) to the boot partition.
A complete ROM is a singed zip file contains at least /system files and a kernel. When you flash a ROM, it will unpack and *copy* file of /system to the system partition (that's why we wipe the system partiton aka. factory reset before we flash a new ROM) then *write* boot.img to boot partition.
Usually, a kernel needs external modules, offen reside at /system/lib/modules, so developer create an *uncomplete* ROM, which contains only kernel and these external files. This flashable kernel looks like a ROM, but it's really small size compare to complete ROM.
Like I said above, files in /system/bin/ and /system/xbin/ is not related to kernel (boot.img). They are just binaries, compiled to use system calls that kernel (and modules) offer.
--- Dev only ---
System calls is not binaries, they are CPU interupt instructions. Your programs need to be compiled to call them.
In linux, system calls are called through interupt *0x80*

How to flash the stock img?

So, the stock img for Nexus 7 (2013) has been released.
a couple days ago, I flashed the wrong kernel, so I flashed an unofficial stock kernel to fix it. It works but it gets some lag when swipe between screens.
Now, GG realeases their stock so I want to flash the stock kernel or even make my Nexus 7 (2013) "stock" to see if it is a software problem or a hardware one (so I can get a replacement).
I am a newbie, so please verify if I am wrong in flashing my Nexus 7:
1. If I want to "stock" my Nexus 7: I just have to follow this thread
Code:
http://forum.xda-developers.com/showthread.php?t=2010312
although it is for nexus 4, but the steps are indentical, right?
2. If I only want to flash the kernel, I will have to extract the .taz file, and look for the boot.img, then flash that boot.img
Is that correct?
3. What is the difference between return to stock (my first question) and flashing a kernel (my second question)?
Thanks a lot.
There is a batch (.bat) file in the factory image archive (after you gunzip and tar extract) that does the commands for you. Just put everything in the directory you keep adb/fastboot and run flash-all.bat
There is an image-razor-jss15j.zip archive (you'll see it when you extract the tar) Within that zip archive is the boot.img (kernel) you are looking for.
Kernel is just the low-level OS. As a simplification, it handles lower-level device interaction. Sometimes people will build custom kernels with support for more VPN, more filesystems, loopback devices, more cpu control, etc.
Return to stock usually mean you are putting back all the components of the original system, original Kernel (boot.img) Recovery (recovery.img) and System (system.img)
system is often referred to as the ROM, though sometimes people overload the term ROM to include system and boot, depends on the context.
Sometimes you can mix/match kernel and ROM, sometimes not. Depends on the changes. You may have just changed the kernel out to get some feature, in which case, you may just want to restore just the original kernel and leave your setup otherwise unchanged.
It's very clear and informative.
Thanks a lot :good:
Easy mode here;
http://forum.xda-developers.com/showthread.php?t=2400019

Why do custom ROMs have lower quality signal compared to stock?

Hi guys,
I know custom ROMs are made of AOSP. However, it's not very clear to me why do they also have lower quality signal compared to stock ROMs. In the same area where I usually got 4G (not great signal, but still 4G), now I only get 3G.
Is there a reason for this? Aside from "it's not made by the manufacturer". Yeah, I know that, but why exactly isn't the same quality...? What makes it slightly worse?
Also, is there anything can do to improve reception?
arsradu said:
Hi guys,
I know custom ROMs are made of AOSP. However, it's not very clear to me why do they also have lower quality signal compared to stock ROMs. In the same area where I usually got 4G (not great signal, but still 4G), now I only get 3G.
Is there a reason for this? Aside from "it's not made by the manufacturer". Yeah, I know that, but why exactly isn't the same quality...? What makes it slightly worse?
Also, is there anything can do to improve reception?
Click to expand...
Click to collapse
Exactly what you said: "It's not made by the manufacturer". Proprietary blobs are extracted from the device, creating vendor image while building AOSP and modifying vendor partition it when installing a zip.
I don't think there's anything to improve, until someone makes a kernel or a vendor image.
(flashing original vendor lead to bootloop on my phone, probably because encryption?)
However, you can try downloading stock ROM and flash stock vendor, but make sure to not have your device encrypted (I did not try on a non-encrypted device).
georg3_ said:
Exactly what you said: "It's not made by the manufacturer". Proprietary blobs are extracted from the device, creating vendor image while building AOSP and modifying vendor partition it when installing a zip.
I don't think there's anything to improve, until someone makes a kernel or a vendor image.
(flashing original vendor lead to bootloop on my phone, probably because encryption?)
However, you can try downloading stock ROM and flash stock vendor, but make sure to not have your device encrypted (I did not try on a non-encrypted device).
Click to expand...
Click to collapse
I've noticed this with stock ROMs as well, when they weren't dedicated for that specific region... So...I'm guessing it's probably the same here. AOSP includes some files to make the ROM work...but not dedicated files for each region.
By the way, can you please, guide me how should I do this? It's been a really long time since I've done stuff like this. Android has changed a lot.
I already have the ROM at hand, downloaded via RSA. But it's Android 11, since that's the last ROM that Motorola released for this phone.
So that part is done. What next? )
Also, any idea if this method should also bring back VoLTE and VoWIFI? Or it's not that simple?
arsradu said:
I've noticed this with stock ROMs as well, when they weren't dedicated for that specific region... So...I'm guessing it's probably the same here. AOSP includes some files to make the ROM work...but not dedicated files for each region.
By the way, can you please, guide me how should I do this? It's been a really long time since I've done stuff like this. Android has changed a lot.
I already have the ROM at hand, downloaded via RSA. But it's Android 11, since that's the last ROM that Motorola released for this phone.
So that part is done. What next? )
Also, any idea if this method should also bring back VoLTE and VoWIFI? Or it's not that simple?
Click to expand...
Click to collapse
EDIT: Newer OS than vendor shouldn't make a problem.
Newer vendor than OS does.
Extract the ROM, there should be vendor.img in there, and there are 2 methods for this:
1. TWRP method
Install, Install Image, select your vendor image set it to flash as vendor image, and swipe to flash.
2.Fastboot method
Open a terminal/command prompt in the extracted ROM folder, and type
Code:
fastboot flash vendor vendor.img
That should do it.
georg3_ said:
Older OS than vendor shouldn't make a problem.
Older vendor than OS does.
Extract the ROM, there should be vendor.img in there, and there are 2 methods for this:
1. TWRP method
Install, Install Image, select your vendor image set it to flash as vendor image, and swipe to flash.
2.Fastboot method
Open a terminal/command prompt in the extracted ROM folder, and type
Code:
fastboot flash vendor vendor.img
That should do it.
Click to expand...
Click to collapse
Alright. So....I can't use Android 11 vendor, extracted from stock ROM, if I'm currently on PixelExperience based on Android 12, right?
arsradu said:
Alright. So....I can't use Android 11 vendor, extracted from stock ROM, if I'm currently on PixelExperience based on Android 12, right?
Click to expand...
Click to collapse
Stau bine pe engleza daca e )
I translated it wrong, i meant it would be fine to flash it
Buun. Thank you, kind sir. Will try it then and let you know.
georg3_ said:
Stau bine pe engleza daca e )
I translated it wrong, i meant it would be fine to flash it
Click to expand...
Click to collapse
I'm getting bootloop, too...
I tried to flash the rom, flash Disable_Dm-Verity_ForceEncrypt.zip (should disable encryption...unless I'm missing something). But after flashing vendor.img from stock Android 11, I can't boot anymore. I also tried wiping data after that, but no luck.
arsradu said:
I'm getting bootloop, too...
I tried to flash the rom, flash Disable_Dm-Verity_ForceEncrypt.zip (should disable encryption...unless I'm missing something). But after flashing vendor.img from stock Android 11, I can't boot anymore. I also tried wiping data after that, but no luck.
Click to expand...
Click to collapse
Probably not an encryption related issue, guess we can't fix anything.

Categories

Resources