Why can't Android be installed similar to how you install an OS on a PC? - Android Q&A, Help & Troubleshooting

So Android has been around for a long time, and it is open source. How come we can't easily buy a cell phone with no OS, and install vanilla Android on it?
For comparison, you can buy a PC with no OS, or build one from scratch. They all have somewhat standardized hardware. I can easily install Windows 7, windows 10, Debian, Ubuntu, Linux Mint, etc. I can even install something like the Debian minimal install that doesn't even start with a Desktop environment, and customize exactly what desktop environment I want. Sure you might need to install some wifi drivers and graphics card drivers but they are readily available.
So why is cell phone hardware and Android so different despite being open source and hardware being so competitive? How come I can't just buy a generic phone with no OS, download a Vanilla Android ISO, and install it? Then simply add whatever radio/sensor/gps drivers might be needed, which should be either generic, or else available from the phone hardware manufacturer, similar to how motherboard drivers are available from the motherboard manufacturer.
I realize there are experienced developers out there who are able to make custom roms, but I'm talking about something a general user can do with similar ease to installing and customizing linux on a PC? Why must we generally have to buy exploitable phones to root, overwrite the recovery, and then hopefully find and trust some community rom that some stranger on the forums made?

Well you make a few mistakes. Android is not open source completely. It is under the Apache license. So any code other fixes anyone does they get to keep and dont have to share. Unlike the kernel which is truly open source.
Next your missing a few things. The bootloader for each device which is different unlike with Windows which has a pretty standard one. Also each device has different hardware so the drivers for everything (which are closed sourced as well) will have to be gotten from the oem which they don't share.
Even if you look at the new pc they have locked bootloader so the only things that have ms certs can be flashed.

Thanks for the reply. So the kernel is open source but parts of android are not? I mean, I know some phone developers might make some custom mods that might not be, but isn't the plain Android AOSP code all open source? Isn't installing the AOSP stuff along with any hardware specific drivers enough?
You mention that different phones have different drivers and some are closed source. But PC's have all different hardware. One may have a different wifi chip for example, or sound chip, and the drivers may be closed source, but the motherboard comes with the drivers for the wifi/sound card. So I don't see what is stopping a manufacturer from releasing a phone and include any drivers, like a PC motherboard manufacturer does.
As far as a bootloader, they could just include one or allow a user to install their own. I'm sure open source bootloaders must exist. I mean on a PC you can install whatever bootloader you want, windows, grub, etc. I haven't personally heard of a motherboard having a locked bootloader before where you can't install grub and linux, but if they do exist, at least most motherboards aren't like this.

wildsquirrelfrenzy said:
Thanks for the reply. So the kernel is open source but parts of android are not? I mean, I know some phone developers might make some custom mods that might not be, but isn't the plain Android AOSP code all open source? Isn't installing the AOSP stuff along with any hardware specific drivers enough?
You mention that different phones have different drivers and some are closed source. But PC's have all different hardware. One may have a different wifi chip for example, or sound chip, and the drivers may be closed source, but the motherboard comes with the drivers for the wifi/sound card. So I don't see what is stopping a manufacturer from releasing a phone and include any drivers, like a PC motherboard manufacturer does.
As far as a bootloader, they could just include one or allow a user to install their own. I'm sure open source bootloaders must exist. I mean on a PC you can install whatever bootloader you want, windows, grub, etc. I haven't personally heard of a motherboard having a locked bootloader before where you can't install grub and linux, but if they do exist, at least most motherboards aren't like this.
Click to expand...
Click to collapse
No, even the aosp code is licensed under the Apache. This is why Google gets away with it pushing things they fixed back to the aosp project. It's never that easy even with a nexus device. There are always things that have to be fixed to make it boot.
The difference is unlike pc each device has the hardware drivers outsourced. So say Samsung doesn't really own the drivers they use for BT, wifi, cell radio and things like that. So they can't really distribute them. That's why when you are learning to build it shows you how to pull the files from the device you are building for. This sometimes happens with pc as well. I have a laptop where there are no open source options for the nic card. So if I only run Linux then I have no Internet connection at all. I have to dual boot so Linux will use the windows drivers.
The bootloaders are built per device. There is no open source option yet. Nor will there likely ever be one.
Here is a link about Windows doing it.
http://www.extremetech.com/extreme/...t-mandatory-locks-out-other-operating-systems
Sure you can still buy blank motherboards and load your own os but that doesn't always work.
What I would do is start looking into just what it takes to build the os for a supported device. Which will be a nexus. Then you can see what it takes to make it work with non supported devices.
Google is even making android less 3rd party rom developer unfriendly. Doing things like making root far more difficult to achieve and things of this nature.

Thanks for the detailed explanation. I still hope one day we can just buy empty phones, and install our choice of OS on them, but I guess it may be a long ways away.
Although I did notice according to the oneplus site, they actually allow you to unlock the bootloader and not even void the warranty, and all it takes is a simple command. So hopefully things will be sooner rather than later.
https://oneplus.net/support/answer/will-rooting-or-unlocking-the-bootloader-void-my-warranty
Guess my best alternative for the near future may be to just keep on rooting and try to learn how to make my own ROMS.

Related

[Q] Can't a newbie like me understand anything about Android on smartphones?

I have read a few posts in this section, but it is totally impossible for someone like me (new to smartphones, flashing and the rest) to understand anything. Would you please explain some of the terminologies used here? Some of them are: kernel, 3g, port, system.ext2, BT... and thousands more.
Thank you very much!
you don't really "need" to understand any of that.
all you need to do is to learn how to download files, learn how to extract the downloaded file, learn how to copy them to an sd card, and learn how to run a program inside windows mobile.
if you can do all that, you should be set!!!
just follow steps 1-6 (ignore step 1b - the part about system.ext2) - http://forum.xda-developers.com/showthread.php?t=951962
Well noted AkumaX. Thank you very much!
XDAndroid is a project to port Android onto older HTC phones.
There are two main parts of XDAndroid, which combine to form a complete port:
Kernel/drivers: You can find packages to run Android on old HTC phones from a variety of sources, but whatever package you use, all rely upon the kernels/drivers created by the XDAndroid team to enable the basic hardware.
Android system: The Android system forms all of the parts of the phone's interface that you can directly interact with. Once the kernel/drivers have setup the hardware, you can add on an Android system port of your choice to form a complete build. Many system ports are available, both in terms of different versions (2.1 Eclair, 2.2 Froyo, 2.3 Gingerbread, etc.) and different starting points in the case of ports written by those outside of XDAndroid.
XDAndroid releases an "official" system port you can use, which is directly ported over by the XDAndroid team from the Android Open Source Project, and is very close to stock. Many of the alternative builds you come across are modifications of the XDAndroid system, containing customizations that deviate farther from stock Android, while others have different starting points altogether, and are ports of the ROMs found on official shipping devices that have already been customized (but still use the same basic kernel/drivers found here).
Android is a framework that runs on top of Linux. In order to get Android running on our devices, first we must get Linux running on the hardware with all drivers implemented, and then, we hook Android into these drivers. Thus, broadly viewed, the XDAndroid project is divided into two parts: the kernel/drivers and the Android port.
When you look at the files in your Android directory, you'll probably see something like the following:
zImage: The Linux kernel and drivers.
modules-###: Additional drivers for the kernel. Your system will load without this, but things like wifi may not work, or you may encounter instability.
initrd.gz: Used in the Linux boot process.
system.ext2: Most of the Android framework.
rootfs.img: Additional parts of the Android framework that are customized for our devices.
data.img: This file contains what would be your internal memory on a real Android device. Whenever you install a program it goes in to here. A new empty one will be automatically created if you don't have one.
haret.exe: Reboots you from Windows into XDAndroid.
startup.txt: Commands passed to XDAndroid on bootup that are customized by the user.
ts-calibration: Contains calibration information for the touch screen. If you don't have this file, you will be prompted to calibrate your screen on startup.
AndroidApps: A folder where if you copy any apks into it, they will be automatically installed on bootup.
manekineko said:
XDAndroid is a project to port Android onto older HTC phones.
-------.
Click to expand...
Click to collapse
Good explanation manekineko!...I believe this is what op was looking for.
there is light at the end of the tunnel, it wont take much longer if the devs keep up this good work, until there can be made stable and good builds with good battery life etc. when the time is there i will create an complete noob friendly installation guide (with pics and maybe even an vid).
I'm currently trying to figure out which one to install!
manekineko said:
XDAndroid is a project to port Android onto older HTC phones.
There are two main parts of XDAndroid, which combine to form a complete port:
Kernel/drivers: You can find packages to run Android on old HTC phones from a variety of sources, but whatever package you use, all rely upon the kernels/drivers created by the XDAndroid team to enable the basic hardware.
Android system: The Android system forms all of the parts of the phone's interface that you can directly interact with. Once the kernel/drivers have setup the hardware, you can add on an Android system port of your choice to form a complete build. Many system ports are available, both in terms of different versions (2.1 Eclair, 2.2 Froyo, 2.3 Gingerbread, etc.) and different starting points in the case of ports written by those outside of XDAndroid.
XDAndroid releases an "official" system port you can use, which is directly ported over by the XDAndroid team from the Android Open Source Project, and is very close to stock. Many of the alternative builds you come across are modifications of the XDAndroid system, containing customizations that deviate farther from stock Android, while others have different starting points altogether, and are ports of the ROMs found on official shipping devices that have already been customized (but still use the same basic kernel/drivers found here).
Android is a framework that runs on top of Linux. In order to get Android running on our devices, first we must get Linux running on the hardware with all drivers implemented, and then, we hook Android into these drivers. Thus, broadly viewed, the XDAndroid project is divided into two parts: the kernel/drivers and the Android port.
When you look at the files in your Android directory, you'll probably see something like the following:
zImage: The Linux kernel and drivers.
modules-###: Additional drivers for the kernel. Your system will load without this, but things like wifi may not work, or you may encounter instability.
initrd.gz: Used in the Linux boot process.
system.ext2: Most of the Android framework.
rootfs.img: Additional parts of the Android framework that are customized for our devices.
data.img: This file contains what would be your internal memory on a real Android device. Whenever you install a program it goes in to here. A new empty one will be automatically created if you don't have one.
haret.exe: Reboots you from Windows into XDAndroid.
startup.txt: Commands passed to XDAndroid on bootup that are customized by the user.
ts-calibration: Contains calibration information for the touch screen. If you don't have this file, you will be prompted to calibrate your screen on startup.
AndroidApps: A folder where if you copy any apks into it, they will be automatically installed on bootup.
Click to expand...
Click to collapse
Thank you so much for your explanations, manekineko. I believe that I am now ready to cruise through all the threads of this section without fear.
shatred said:
there is light at the end of the tunnel, it wont take much longer if the devs keep up this good work, until there can be made stable and good builds with good battery life etc. when the time is there i will create an complete noob friendly installation guide (with pics and maybe even an vid).
Click to expand...
Click to collapse
shatred, I am eagerly waiting for two things: (i) for the developers to release the perfect Android builds (my sincere encouragements to them by the way!!!) and (ii) for your installation guide.
gueyenono said:
I'm currently trying to figure out which one to install!
Click to expand...
Click to collapse
tell me your phone type, so an rhod-100? 200? 300? etc.
and tell me what you prefer more, an good battery life and an stable running system without camera support OR less stable system, bad battery life but with camera support.
Tell me and i will help you
shatred said:
tell me your phone type, so an rhod-100? 200? 300? etc.
and tell me what you prefer more, an good battery life and an stable running system without camera support OR less stable system, bad battery life but with camera support.
Tell me and i will help you
Click to expand...
Click to collapse
Uhm... You no longer have to choose. WisTilt2 pulled the latest commits from GIT into his test kernel.
arrrghhh said:
Uhm... You no longer have to choose. WisTilt2 pulled the latest commits from GIT into his test kernel.
Click to expand...
Click to collapse
yeah but if you activate the camera libs the phone wont go into deep sleep mode right? or is that fixed already?
shatred said:
yeah but if you activate the camera libs the phone wont go into deep sleep mode right? or is that fixed already?
Click to expand...
Click to collapse
Seems I was wrong about that. It was the other way around, if the libs are disabled the phone won't sleep.
However, with FRX05 there's no need for the libs. FRX05 + GIT kernel or WisTilt2's newest kernel is all you need for cam.
arrrghhh said:
Seems I was wrong about that. It was the other way around, if the libs are disabled the phone won't sleep.
However, with FRX05 there's no need for the libs. FRX05 + GIT kernel or WisTilt2's newest kernel is all you need for cam.
Click to expand...
Click to collapse
hmm yeah about that, i tried frx05 with wistilt2 latest kernels but it doesnt work for me, i think its an problem with my user conf... can you perhaps send me your user conf from frx05?
shatred said:
hmm yeah about that, i tried frx05 with wistilt2 latest kernels but it doesnt work for me, i think its an problem with my user conf... can you perhaps send me your user conf from frx05?
Click to expand...
Click to collapse
Same for FRX04... It's in my bundle.
If you remove all of the ln -s and bind mounts, should work just fine...

[Q] Is it possible to split mod roms into device-dependent and -independent packages?

I think it's came to many people's mind, but I can't find who asked this on the forum.
If we could split the ROM to 2 packages, one is device dependent, and another is device independent. Then it should make life easier for port, and update.
For porting, only thing they should care is to make the device dependent package, it's not necessary for them to care which the Launcher should be used, what exactly android framework version they would used.
For maintain and update, if there are only changes in the java code, only device independent package will be update, and all device could immediately get an update.
I'm not familiar with the porting, and I'm not sure for the possibility of this. I know android is based on Linux, and is easy to port on various devices. So, It should have some kind of hardware abstract layer to hide the hardware details.
I guess the main differences between ROMs between 2 devices for same version of Mod, such CM, are linux kernel, hardware drivers, some binary libraries/executables. Binary executables and libraries could be different for various CPU instruction sets. So for some of them, maybe same for different device with same CPU instruction sets.
Most java code, jar and apk, should be the same, except for those used JNI.
I compared some of apk and jar for CM of different devices but in same version, I found for most them, only sign is different, the compiled java code and resources are same.
So, I just feel it's might be possible. And, it's possible, and Google do thing this way, we can get android update very quickly. For example, if android got update from 4.0.1 to 4.1.0, and the under ABI hasn't been changed, so we can still use the previous kernel and drivers, binary libraries, only java code changed. Google can release the device-independent update package to all devices, without waiting for the long cycle of manufactures and carriers testing. Which would be really great for all of us.
But the scenario sound paradise, it's not like this right now for a reason. Could anyone know the porting tell me is it impossible?

[Android ABC] What's a Bootloader,ROM,Kernel,Firmware,ADB,Root etc

Android ABC​
I've gathered some info for newcomers to the Android world.
Copied over from my thread at androidforums...
I've tried to keep it relatively simple. So if you want more info, follow the links!
And please if you want anything added, do post!
I hope this helps someone....
Inventory:
Bootloader
Kernel
CWM
Firmware
Flashing
Rooting
Custom ROMs
ADB
Baseband
Dalvik
init.d​
What's A Bootloader?
Taken from: Android 101: What is a bootloader? | Android-Does.com
In literal terms, the bootloader is code that is executed before any Operating System starts to run. Bootloaders basically package the instructions to boot operating system kernel and most of them also have their own debugging or modification environment. Think of the bootloader as a security checkpoint for all those partitions. Because if you’re able to swap out what’s on those partitions, you’re able to break things if you don’t know what you’re doing.
As the bootloader kicks off before any piece of software on your device, it makes it extremely processor specific and every motherboard has it’s own bootloader. This is one reason that all Android phones have different custom ROMS developed due to high variance of processing hardware present on the device.
Android Bootloader
Every Android phone has a bootloader that instructs the operating system kernel to boot normally. But you need to understand one thing here that as Android OS is an open source OS and is available on a variety of different hardware, every manufacturer has their own version of bootloader specific for the hardware present in it’s environment. At its most basic level, your Android smartphone is like a hard drive, made of up several partitions. One of those partitions holds the Android system files, another holds all the app data you accumulate (which is how you’re usually able to update without losing all your stuff), and others to do more behind-the scenes stuff.
A lot has been said about bootloaders being “locked” and even the developer-friendly Nexus devices shipped with a locked bootloader (Nexus devices and a couple tablets are easily unlocked with a single command).In fact, a lot bootloaders are locked and encrypted, meaning simple commands like “fastboot oem unlock”, won’t do a thing.
Why are Bootloaders Locked?
A bootloader is usually locked on an Android device because although it’s an open source OS, still the manufacturers want you to stick to their Android OS version specifically designed for the device. In order to apply this concept, manufacturers lock the bootloader. With a locked bootloader on Android devices, it is virtually impossible to flash a Custom ROM and forced attempts void warranty as well as usually end up in bricks. Therefore, the first step is to always unlock the bootloader.
Why keep a bootloader out of reach? One of the biggest reasons is that the carriers and manufacturers don’t want to have to support hacked phones. The other is that a lot of time and money is spent developing these things. HTC Sense ain’t cheap. Neither is TouchWiz. But Samsung and HTC both have managed to find a middle ground with the modding community, and pressure is on other companies to do so as well.
Also a very good read about bootloaders: http://www.tested.com/news/feature/1879-know-your-android-bootloaderwhat-it-is-and-why-it-matters/
---------------------------------------------------------------------------
What's a kernel?
Taken from: Android A to Z: What is a kernel? | Android Central
A kernel isn't something unique to Android -- iOS and MacOS have one, Windows has one, BlackBerry's QNX has one, in fact all high level operating systems have one. The one we're interested in is Linux, as it's the one Android uses. Let's try to break down what it is and what it does.
Android devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of Android specific code built in, and Google's Android kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent Android developers and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software.
When software needs the hardware to do anything, it sends a request to the kernel. And when we say anything, we mean anything. From the brightness of the screen, to the volume level, to initiating a call through the radio, even what's drawn on the display is ultimately controlled by the kernel. For example -- when you tap the search button on your phone, you tell the software to open the search application. What happens is that you touched a certain point on the digitizer, which tells the software that you've touched the screen at those coordinates. The software knows that when that particular spot is touched, the search dialog is supposed to open. The kernel is what tells the digitizer to look (or listen, events are "listened" for) for touches, helps figure out where you touched, and tells the system you touched it. In turn, when the system receives a touch event at a specific point from the kernel (through the driver) it knows what to draw on your screen. Both the hardware and the software communicate both ways with the kernel, and that's how your phone knows when to do something. Input from one side is sent as output to the other, whether it's you playing Angry Birds, or connecting to your car's Bluetooth.
It sounds complicated, and it is. But it's also pretty standard computer logic -- there's an action of some sort generated for every event. Without the kernel to accept and send information, developers would have to write code for every single event for every single piece of hardware in your device. With the kernel, all they have to do is communicate with it through the Android system API's, and hardware developers only have to make the device hardware communicate with the kernel. The good thing is that you don't need to know exactly how or why the kernel does what it does, just understanding that it's the go-between from software to hardware gives you a pretty good grasp of what's happening under the glass. Sort of gives a whole new outlook towards those fellows who stay up all night to work on kernels for your phone, doesn't it?
---------------------------------------------------------------------------
What's CWM?
Taken from: AddictiveTips » Blog ArchiveWhat Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]
ClockworkMod, abbreviated as CWM, is a popular custom recovery for Android phones and tablets developed by Koushik Dutta (Koush), a well-known name in the Android dev community. ClockworkMod recovery allows you to perform several advanced recovery, restoration, installation and maintenance operations on your Android device that aren’t possible with the stock recovery, and is one of the most common ways used to gain root access, back up device data, install a custom ROMs, kernels, themes, mods and more. However, for anyone new to Android customization and hacking, some of its options might prove to be a tad confusing. In what follows, we will cover all that this recovery is capable of doing, and how to do it.
About Android Recovery
All Android devices ship with a recovery console that is basically a partition on the device’s internal memory and can be booted into. The stock recovery of almost all Android devices provides a few basic yet handy options that allow you to factory reset your device and also to recover its operating system using an official ROM in zip format, but that’s all you can do with it. That’s where a custom recovery comes handy.
A custom Android recovery basically replaces the stock recovery with one that lets you do all you can do with the stock recovery, plus a plethora of more options to give you a lot more control on your device. With a custom recovery, you can install official and unofficial ROMs as well as other updates including apps, themes, kernels etc. using zip files, wipe not just user data but pretty much every partition on your device, mount the storage card for USB mass storage access without leaving recovery, partition your SD card, wipe Dalvik cache and battery stats, fix permissions, perform, manage and restore backups and so on.
Introduction To ClockworkMod
ClockworkMod recovery is one of the most widely used custom Android recoveries that is available for most mainstream Android devices. It is our custom recovery of choice here at AddictiveTips and almost every custom ROM that we install on our devices is done using this recovery.
ClockworkMod recovery has been developed by Koushik Dutta (also known as Koush) – the same guy who brought us the Android ROM Manager. He can be found at his blog hacking away at Android devices and at Twitter.
CWM options explained:
[REF] CWM - Clockworkmode menu options & Partitions– GENERAL KNOWLEDGE - xda-developers
---------------------------------------------------------------------------
What's Firmware?
Taken from: What is Firmware, Rom and Firmware Flashing ? - I Teach Android
What the heck is this firmware? Definition of firmware is permanent software programmed into a read-only memory
In Simple words, you can understand it like windows for pc , in case of android we are going to do same thing – installing firmware (Froyo,Gingerbread, ICS, Jelly Bean etc.) on your phone. All phones have their different firmwares and installing tools regard less to the Andriod version (Froyo,Gingerbred). So never think that we can install any firmware on any android phone like we do in PCs.
Wiki link for even more info: Firmware - Wikipedia, the free encyclopedia
---------------------------------------------------------------------------
What's Flashing?
Flashing refers to the overwriting of existing data on ROM modules present in an electronic device with new data. This can be done to upgrade a device or to change the provider of a service associated with the function of the device, such as changing from one mobile phone service provider to another or installing a new operating system.
In simple words flashing is called installing firmware on your phone.
---------------------------------------------------------------------------
What's Rooting?
Taken from: Rooting for Android: What, why and how? | Ubergizmo
WiKi link: https://en.wikipedia.org/wiki/Rooting_(Android_OS)
When carriers and manufacturers sell you your device, it is almost certain that the device would come with certain software restrictions in place. There are a variety of different reasons why they might do that – some claim that this is done to protect the user, preserve the device’s warranty (this policy will vary from manufacturer to manufacturer), prevent users from getting rid of carrier bloatware apps or simply because the manufacturer would prefer if your device was distinguishable from the competition based purely on its user interface (i.e. Samsung’s TouchWiz, HTC Sense UI, etc).
Whatever their reasoning may be, chances are if you are looking to customize your device on a deeper level, you’d be out of luck and this is where rooting comes into play.
Rooting is essentially a process that allows users of smartphones, tablets or other devices running on Android to gain “superuser” access to the software. This will allow the user to perform administrative tasks such as writing to locations normally restricted by the system which in turn will allow for deeper customization. For iOS users, rooting on Android devices could be thought of as a close equivalent to jailbreaking your device.
---------------------------------------------------------------------------
What are custom ROMs?
Taken from: Custom ROMs For Android Explained - Here Is Why You Want Them
A stock ROM is the version of the phone's operating system that comes with your phone when you buy it.
A custom ROM is a fully standalone version of the OS, including the kernel (which makes everything run), apps, services, etc - everything you need to operate the device, except it's customized by someone in some way.
So what does the "customized" part mean? Since Android is open source, developers are free to take stock ROMs, modify them, strip them of garbage, optimize them, add things, and pretty much do whatever their imagination and skills allow.
---------------------------------------------------------------------------
What is ADB?
Taken from: Android 201: What is adb? | Android Central
According to Google "Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or Android-powered device." That certainly sounds like Google, doesn't it? To put it simply, adb is two different applications -- one running on your computer (Windows, Linux or Mac) and one running on your phone. When your phone is connected, and USB debugging is enabled, you can issue commands and communicate with the phone using your computer screen and keyboard.
Your Android phone uses a modified Linux kernel and tools as a base. This means that quite a few Linux commands can be sent via the adb server (the one running on your computer) to the adb client (the one running on your phone) and they will be executed. In our example picture, I've sent the "top" command over the wire to my phone, and my phone sent me back the information and printed it to my terminal.
This can be awfully handy for debugging things that aren't going right, as well sending those weird commands you need when you're hacking away in the middle of the night. Chances are, if you aren't actively debugging something or trying to break hack at your phone, you won't have much use for adb. And that's OK -- there's more than one way to have fun with an Android device.
----------------------------------------------------------------------------
What's baseband?
Baseband is the Radio or Modem version depending upon the Phone Model, Carrier and Android Software Stack version. The Radio/Modem file is flashed via Recovery tool (other options are ADB/ODIN). The mismatched Radio/Modem and ROM will lead to things not working. You need to find the matching Radio/Modem for the particular ROM you are running.
The radio firmware controls basic low-level functions like network connectivity, Wi-Fi, and GPS. Upgrading Radio firmware will fix connectivity issues, increase range or performance, decrease battery usage, etc. Incorrec tRadio frimeware can disable some functions in your phone such as MMS, 3G Data, VM Notifications, etc. Network operators/carriers select the correct version of the Radio firmware that is suitable for the phone, network and bandwidth.
There is also Modem and Baseband Radio Processor chipsets in Mobile phones. Usually, Google, Phone Manufacturers and carriers develop various types of modem firmware/software that controls the functions of these chipsets.
Firmware is the overall version of the Android system on your phone. Baseband version is the version of the radio embedded in the device. Since Android is based on the Linux operating system, they show you the current version of the Kernel used in the heart of the system. The Build number is just an indicator of which numerical version of the current overall system was built by developers for your device.
You cannot update any of these from the official web site. Updates to the Android system are pushed to the phone over-the-air by the manufacturer or the cell phone carrier. The only other way to update or change an Android phone it to install custom modified ROMs in place of the existing system firmware. That usually requires rooting the phone and a fairly considerable knowledge of how to hack hardware.
----------------------------------------------------------------------------
What's Dalvik?
http://www.techopedia.com/definition/4262/dalvik
http://butterflydroid.wordpress.com/2011/09/22/what-is-dalvik-vm-heapsize-benefits-and-downfalls/
Dalvik is named after a fishing village in Iceland where ancestors of Dan Bornstein, the person who wrote the VM’s original code, lived. Dalvik is designed for fast execution speeds and operatation in resource-constrained environments like those in mobile devices (with limited memory, CPU and battery power). A Dalvik VM is designed to run multiple instances of itself with each instance hosted on its own separate process and running one application each. When one instance crashes, other concurrently running applications don’t suffer.
Although Android apps are written in Java, they are first compiled into the Dalvik Executable (DEX) format to make them run on the Dalvik VM. DEX files are generally smaller than compressed .JAR (Java Archive) files, making them suitable for mobile devices.
The main difference between Dalvik and a typical Java VM is that the former is register-based while the latter is stack-based. Register-based VMs require fewer instructions than their stack-based counterparts. Although the register-based VMs also require more code, they are generally considered to exhibit faster startups and have better performance than stack-based VMs.
The Dalvik source code license is based on the Apache license. That means, it is free to modify and hence attractive to mobile phone carriers.
What's init.d?
init.d is a folder located at /system/etc
To keep it simple, it allows the user to run scripts at system startup/ boot.
You can adjust many different things/settings with scripts. You can tweak system settings, prolong battery life etc.
To enable init.d and to get some scripts, go here: http://forum.xda-developers.com/showthread.php?t=1881401
----------------------------------------------------------------------------
great job brother, do much to newcomers become familiar with android and they need to know :highfive:
woooow , thats nice and great thread ...... thx ..... but between that , can u continue explain many things like what each android device need to boot up and what the most commen partitions in android devics , and getting deeper in android world ad then give some tut about adb using
thx so much
Good stuff, thanks!
Great guide for android noobie who want to learn how to root
add CID and MID ... ?
Hey -- a really great resource. great work.
could be nice to include CID, MID, etc.
also, would like to understand why ROM has to be built for specific carrier variant of phone.
Example: HTC ONE M8 has multiple different ROM threads -- ATT, Tmobile, Verizon, etc. While I understand there are some small frequencies support differences between an M8_tmobile and M8_Verison, why doesn't a Rooted with S-off M8 care whether it's a ATT or Verizon model?
thx
Thanks iONEx, this post helped me some. I already have 20 years of experience with Linux on PCs and Macs, so I already understood concepts like Bootloader, Kernel, Rooting, Flashing, Firmware, and init.d. I've had to flash a new BIOS on several PC motherboards, so I understand the difference between nonvolatile storage in firmware mounted on an integrated circuit of the motherboard versus nonvolatile storage in a physical spinning magnetic hard drive connected to the motherboard via a SCSI or SATA bus and controller. I rooted my first Android (a Motorola Atrix) a year ago, so I also understand CWM, Custom ROMs, and ADB. But your explanation of Baseband and Dalvik was new and helpful to me.
Right now I'm running Paranoid Android on my Oneplus One and using the Settings app in it, I see that I have Android version 4.4.4, ParanoidAndroid version 4.6-BETA6, Baseband version MPSS.DI.2.0.1..., Kernel version 3.4.0-ParanoidAndroid (Mon Nov 3 21:55:14 UTC 2014), Build number pa_bacon-userdebug...).
I found your post while trying to understand more about my OPO that I rooted a few days ago. I installed TWRP, F-Droid, Busybox, MultiROM, and a few other major customizations on it, but I feel like there's still a whole lot that I don't understand at all. For example, in this thread [forums.oneplus.net/threads/unofficial-beanstalk-rom-for-bacon-lollipop-5-02-r1.247146/#post-9394373] I commented that I was unable to get Beanstalk 5.0.2 to function reliably on my OPO.
From chineel's reply "The Steps To Have Better Experience With OnePlus One With Lollipop ROMs" though, I realized that I must still be missing some important concepts, so I started searching for a comprehensive picture of my OPO and of Android phones in general, and although your post helped some, I'm still looking for a much more comprehensive understanding of this device.
I do understand that the nonvolatile storage in my phone must be partitioned into several mutually exclusive sections and that's how it's possible for me to wipe (using TWRP) all of the partitions (Dalvik Cache, System, Data, and Cache) except Internal Storage and flash a new ROM like Beanstalk and yet I still have the contents of /sdcard/ as they were before I wiped and flashed. Obviously, /sdcard/ as mounted in ParanoidAndroid and Beanstalk must be on the Internal Storage partition that did not get wiped.
But when chineel wrote that I should download latest “Cm Nightly” and “(CM Nightly Is for Modem and firmware Update only ) you can Just Flash Firm ware Update [s.basketbuild.com/filedl/devs?dev=chineel&dl=chineel/BeanStalk/bacon/Full-CM-12.01.18-modem-flashable.zip] Instead of...”, that's when I realized that when I flashed a new ROM, I was apparently still leaving something aside from the Internal Storage partition untouched: the modem/baseband/radio?
And so if I flash the latest CM nightly from [download.cyanogenmod.org/?device=bacon&type=] then I'll end up doing what I have not been doing before which is to also change the modem/baseband/radio. Is that right?
So then if I flash a new ROM (like Beanstalk) AFTER flashing the CM Nightly, then I'll be replacing the ROM (from the CM Nightly to Beanstalk), but I won't be changing again the modem/baseband/radio that was changed when I flashed the CM Nightly. Is that right?
If so, then where in this partition system is the modem/baseband/radio firmware (which is apparently separate from the whole ROM) stored in nonvolatile storage? Is it also on Internal Storage? Or is it stored on a separate integrated circuit (like the BIOS is on a PC) or on some other hidden partition?
And what about flashing the kernel? When I flashed my PA ROM, I got a new kernel with it, without explicitly installing from TWRP a new kernel. So sometimes flashing a ROM gives you a new kernel and sometimes flashing a ROM does not change the existing kernel? Is that right? And so is it also possible to flash a ROM and then subsequently flash a kernel and that second flash replaces the kernel that was part of the ROM of the first flash?
I just need to understand where all of this information is getting stored (in which partitions). I know I flash a ROM, then I flash GAPPS, then I flash a kernel, then I flash a modem/radio/baseband. But I can't tell; is all that software going to the System partition? If so, then why don't all the later flashes completely write over all the earlier flashes?
TL;DR
My real question here is what to read for a comprehensive explanation of all these pieces and how they fit together and why flashing sometimes replaces something that was there before, but it doesn't replace everything (like the modem/radio/baseband)? I think I need a book or something. Can you recommend one?
Thanks, and sorry for the long post.
iONEx said:
Android ABC​
I've gathered some info for newcomers to the Android world.
Copied over from my thread at androidforums...
I've tried to keep it relatively simple. So if you want more info, follow the links!
And please if you want anything added, do post!
I hope this helps someone....
Inventory:
Bootloader
Kernel
CWM
Firmware
Flashing
Rooting
Custom ROMs
ADB
Baseband
Dalvik
init.d​
What's A Bootloader?
Taken from: Android 101: What is a bootloader? | Android-Does.com
In literal terms, the bootloader is code that is executed before any Operating System starts to run. Bootloaders basically package the instructions to boot operating system kernel and most of them also have their own debugging or modification environment. Think of the bootloader as a security checkpoint for all those partitions. Because if you’re able to swap out what’s on those partitions, you’re able to break things if you don’t know what you’re doing.
As the bootloader kicks off before any piece of software on your device, it makes it extremely processor specific and every motherboard has it’s own bootloader. This is one reason that all Android phones have different custom ROMS developed due to high variance of processing hardware present on the device.
Android Bootloader
Every Android phone has a bootloader that instructs the operating system kernel to boot normally. But you need to understand one thing here that as Android OS is an open source OS and is available on a variety of different hardware, every manufacturer has their own version of bootloader specific for the hardware present in it’s environment. At its most basic level, your Android smartphone is like a hard drive, made of up several partitions. One of those partitions holds the Android system files, another holds all the app data you accumulate (which is how you’re usually able to update without losing all your stuff), and others to do more behind-the scenes stuff.
A lot has been said about bootloaders being “locked” and even the developer-friendly Nexus devices shipped with a locked bootloader (Nexus devices and a couple tablets are easily unlocked with a single command).In fact, a lot bootloaders are locked and encrypted, meaning simple commands like “fastboot oem unlock”, won’t do a thing.
Why are Bootloaders Locked?
A bootloader is usually locked on an Android device because although it’s an open source OS, still the manufacturers want you to stick to their Android OS version specifically designed for the device. In order to apply this concept, manufacturers lock the bootloader. With a locked bootloader on Android devices, it is virtually impossible to flash a Custom ROM and forced attempts void warranty as well as usually end up in bricks. Therefore, the first step is to always unlock the bootloader.
Why keep a bootloader out of reach? One of the biggest reasons is that the carriers and manufacturers don’t want to have to support hacked phones. The other is that a lot of time and money is spent developing these things. HTC Sense ain’t cheap. Neither is TouchWiz. But Samsung and HTC both have managed to find a middle ground with the modding community, and pressure is on other companies to do so as well.
Also a very good read about bootloaders: http://www.tested.com/news/feature/1879-know-your-android-bootloaderwhat-it-is-and-why-it-matters/
---------------------------------------------------------------------------
What's a kernel?
Taken from: Android A to Z: What is a kernel? | Android Central
A kernel isn't something unique to Android -- iOS and MacOS have one, Windows has one, BlackBerry's QNX has one, in fact all high level operating systems have one. The one we're interested in is Linux, as it's the one Android uses. Let's try to break down what it is and what it does.
Android devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of Android specific code built in, and Google's Android kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent Android developers and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software.
When software needs the hardware to do anything, it sends a request to the kernel. And when we say anything, we mean anything. From the brightness of the screen, to the volume level, to initiating a call through the radio, even what's drawn on the display is ultimately controlled by the kernel. For example -- when you tap the search button on your phone, you tell the software to open the search application. What happens is that you touched a certain point on the digitizer, which tells the software that you've touched the screen at those coordinates. The software knows that when that particular spot is touched, the search dialog is supposed to open. The kernel is what tells the digitizer to look (or listen, events are "listened" for) for touches, helps figure out where you touched, and tells the system you touched it. In turn, when the system receives a touch event at a specific point from the kernel (through the driver) it knows what to draw on your screen. Both the hardware and the software communicate both ways with the kernel, and that's how your phone knows when to do something. Input from one side is sent as output to the other, whether it's you playing Angry Birds, or connecting to your car's Bluetooth.
It sounds complicated, and it is. But it's also pretty standard computer logic -- there's an action of some sort generated for every event. Without the kernel to accept and send information, developers would have to write code for every single event for every single piece of hardware in your device. With the kernel, all they have to do is communicate with it through the Android system API's, and hardware developers only have to make the device hardware communicate with the kernel. The good thing is that you don't need to know exactly how or why the kernel does what it does, just understanding that it's the go-between from software to hardware gives you a pretty good grasp of what's happening under the glass. Sort of gives a whole new outlook towards those fellows who stay up all night to work on kernels for your phone, doesn't it?
---------------------------------------------------------------------------
What's CWM?
Taken from: AddictiveTips » Blog ArchiveWhat Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]
ClockworkMod, abbreviated as CWM, is a popular custom recovery for Android phones and tablets developed by Koushik Dutta (Koush), a well-known name in the Android dev community. ClockworkMod recovery allows you to perform several advanced recovery, restoration, installation and maintenance operations on your Android device that aren’t possible with the stock recovery, and is one of the most common ways used to gain root access, back up device data, install a custom ROMs, kernels, themes, mods and more. However, for anyone new to Android customization and hacking, some of its options might prove to be a tad confusing. In what follows, we will cover all that this recovery is capable of doing, and how to do it.
About Android Recovery
All Android devices ship with a recovery console that is basically a partition on the device’s internal memory and can be booted into. The stock recovery of almost all Android devices provides a few basic yet handy options that allow you to factory reset your device and also to recover its operating system using an official ROM in zip format, but that’s all you can do with it. That’s where a custom recovery comes handy.
A custom Android recovery basically replaces the stock recovery with one that lets you do all you can do with the stock recovery, plus a plethora of more options to give you a lot more control on your device. With a custom recovery, you can install official and unofficial ROMs as well as other updates including apps, themes, kernels etc. using zip files, wipe not just user data but pretty much every partition on your device, mount the storage card for USB mass storage access without leaving recovery, partition your SD card, wipe Dalvik cache and battery stats, fix permissions, perform, manage and restore backups and so on.
Introduction To ClockworkMod
ClockworkMod recovery is one of the most widely used custom Android recoveries that is available for most mainstream Android devices. It is our custom recovery of choice here at AddictiveTips and almost every custom ROM that we install on our devices is done using this recovery.
ClockworkMod recovery has been developed by Koushik Dutta (also known as Koush) – the same guy who brought us the Android ROM Manager. He can be found at his blog hacking away at Android devices and at Twitter.
CWM options explained:
[REF] CWM - Clockworkmode menu options & Partitions– GENERAL KNOWLEDGE - xda-developers
---------------------------------------------------------------------------
What's Firmware?
Taken from: What is Firmware, Rom and Firmware Flashing ? - I Teach Android
What the heck is this firmware? Definition of firmware is permanent software programmed into a read-only memory
In Simple words, you can understand it like windows for pc , in case of android we are going to do same thing – installing firmware (Froyo,Gingerbread, ICS, Jelly Bean etc.) on your phone. All phones have their different firmwares and installing tools regard less to the Andriod version (Froyo,Gingerbred). So never think that we can install any firmware on any android phone like we do in PCs.
Wiki link for even more info: Firmware - Wikipedia, the free encyclopedia
---------------------------------------------------------------------------
What's Flashing?
Flashing refers to the overwriting of existing data on ROM modules present in an electronic device with new data. This can be done to upgrade a device or to change the provider of a service associated with the function of the device, such as changing from one mobile phone service provider to another or installing a new operating system.
In simple words flashing is called installing firmware on your phone.
---------------------------------------------------------------------------
What's Rooting?
Taken from: Rooting for Android: What, why and how? | Ubergizmo
WiKi link: https://en.wikipedia.org/wiki/Rooting_(Android_OS)
When carriers and manufacturers sell you your device, it is almost certain that the device would come with certain software restrictions in place. There are a variety of different reasons why they might do that – some claim that this is done to protect the user, preserve the device’s warranty (this policy will vary from manufacturer to manufacturer), prevent users from getting rid of carrier bloatware apps or simply because the manufacturer would prefer if your device was distinguishable from the competition based purely on its user interface (i.e. Samsung’s TouchWiz, HTC Sense UI, etc).
Whatever their reasoning may be, chances are if you are looking to customize your device on a deeper level, you’d be out of luck and this is where rooting comes into play.
Rooting is essentially a process that allows users of smartphones, tablets or other devices running on Android to gain “superuser” access to the software. This will allow the user to perform administrative tasks such as writing to locations normally restricted by the system which in turn will allow for deeper customization. For iOS users, rooting on Android devices could be thought of as a close equivalent to jailbreaking your device.
---------------------------------------------------------------------------
What are custom ROMs?
Taken from: Custom ROMs For Android Explained - Here Is Why You Want Them
A stock ROM is the version of the phone's operating system that comes with your phone when you buy it.
A custom ROM is a fully standalone version of the OS, including the kernel (which makes everything run), apps, services, etc - everything you need to operate the device, except it's customized by someone in some way.
So what does the "customized" part mean? Since Android is open source, developers are free to take stock ROMs, modify them, strip them of garbage, optimize them, add things, and pretty much do whatever their imagination and skills allow.
---------------------------------------------------------------------------
What is ADB?
Taken from: Android 201: What is adb? | Android Central
According to Google "Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or Android-powered device." That certainly sounds like Google, doesn't it? To put it simply, adb is two different applications -- one running on your computer (Windows, Linux or Mac) and one running on your phone. When your phone is connected, and USB debugging is enabled, you can issue commands and communicate with the phone using your computer screen and keyboard.
Your Android phone uses a modified Linux kernel and tools as a base. This means that quite a few Linux commands can be sent via the adb server (the one running on your computer) to the adb client (the one running on your phone) and they will be executed. In our example picture, I've sent the "top" command over the wire to my phone, and my phone sent me back the information and printed it to my terminal.
This can be awfully handy for debugging things that aren't going right, as well sending those weird commands you need when you're hacking away in the middle of the night. Chances are, if you aren't actively debugging something or trying to break hack at your phone, you won't have much use for adb. And that's OK -- there's more than one way to have fun with an Android device.
----------------------------------------------------------------------------
What's baseband?
Baseband is the Radio or Modem version depending upon the Phone Model, Carrier and Android Software Stack version. The Radio/Modem file is flashed via Recovery tool (other options are ADB/ODIN). The mismatched Radio/Modem and ROM will lead to things not working. You need to find the matching Radio/Modem for the particular ROM you are running.
The radio firmware controls basic low-level functions like network connectivity, Wi-Fi, and GPS. Upgrading Radio firmware will fix connectivity issues, increase range or performance, decrease battery usage, etc. Incorrec tRadio frimeware can disable some functions in your phone such as MMS, 3G Data, VM Notifications, etc. Network operators/carriers select the correct version of the Radio firmware that is suitable for the phone, network and bandwidth.
There is also Modem and Baseband Radio Processor chipsets in Mobile phones. Usually, Google, Phone Manufacturers and carriers develop various types of modem firmware/software that controls the functions of these chipsets.
Firmware is the overall version of the Android system on your phone. Baseband version is the version of the radio embedded in the device. Since Android is based on the Linux operating system, they show you the current version of the Kernel used in the heart of the system. The Build number is just an indicator of which numerical version of the current overall system was built by developers for your device.
You cannot update any of these from the official web site. Updates to the Android system are pushed to the phone over-the-air by the manufacturer or the cell phone carrier. The only other way to update or change an Android phone it to install custom modified ROMs in place of the existing system firmware. That usually requires rooting the phone and a fairly considerable knowledge of how to hack hardware.
----------------------------------------------------------------------------
What's Dalvik?
http://www.techopedia.com/definition/4262/dalvik
http://butterflydroid.wordpress.com/2011/09/22/what-is-dalvik-vm-heapsize-benefits-and-downfalls/
Dalvik is named after a fishing village in Iceland where ancestors of Dan Bornstein, the person who wrote the VM’s original code, lived. Dalvik is designed for fast execution speeds and operatation in resource-constrained environments like those in mobile devices (with limited memory, CPU and battery power). A Dalvik VM is designed to run multiple instances of itself with each instance hosted on its own separate process and running one application each. When one instance crashes, other concurrently running applications don’t suffer.
Although Android apps are written in Java, they are first compiled into the Dalvik Executable (DEX) format to make them run on the Dalvik VM. DEX files are generally smaller than compressed .JAR (Java Archive) files, making them suitable for mobile devices.
The main difference between Dalvik and a typical Java VM is that the former is register-based while the latter is stack-based. Register-based VMs require fewer instructions than their stack-based counterparts. Although the register-based VMs also require more code, they are generally considered to exhibit faster startups and have better performance than stack-based VMs.
The Dalvik source code license is based on the Apache license. That means, it is free to modify and hence attractive to mobile phone carriers.
What's init.d?
init.d is a folder located at /system/etc
To keep it simple, it allows the user to run scripts at system startup/ boot.
You can adjust many different things/settings with scripts. You can tweak system settings, prolong battery life etc.
To enable init.d and to get some scripts, go here: http://forum.xda-developers.com/showthread.php?t=1881401
----------------------------------------------------------------------------
Click to expand...
Click to collapse
Thanks, good info
teejbee said:
Thanks, good info
Click to expand...
Click to collapse
Strewth! Not only did you quote the ENTIRE OP post in order to reply with a 3 word thank you but 2 people actually thanked you for it. I might print that out and hang it on my wall. :laugh:
Hi, what does the "Allow bootloader unlock" (or similar) mean in advanced settings on s7 and some other devices? My phablet also has this option and I turned it on without any changes after typing oem unlock. With selfmade cwm I can root my phone, if its allowed to unlock or not.. is this setting only a placeholder or did someone get the real function? M a ybe this is important for nexus devices only, or not. I do not know.
Gesendet von meinem SM-G900F mit Tapatalk
Edit: sorry for asking in xperia forums.. used tapatalk and saw the title is matching my purposes.. did not see the xperia section, but my question you can answer, too. Sry
louiscar said:
Strewth! Not only did you quote the ENTIRE OP post in order to reply with a 3 word thank you but 2 people actually thanked you for it. I might print that out and hang it on my wall. :laugh:
Click to expand...
Click to collapse
hahahahahahaha :laugh:
Dear, Can I make a custom ROM for my Android TV that can use the TV remote and IR key?
I mean, after installing a custom ROM like Lineage OS, do the remote and inputs work properly?

[Q] Security & Privacy implications of used devices?

My question is if purchasing a used Android device could have potential security & privacy implications? I would like to start experimenting with different ROMs. I have never installed a different ROM before but I have used Fedora Linux for years and that is the basis for my question. For example, when I have purchased a used laptop off Craigslist, I would always reinstall the BIOS before putting a fresh copy of Fedora onto the laptop. Although the chance of a BIOS virus is rare, better safe than sorry.
When I was looking at a few on-line tutorials about heimdall it looks like there are a number of files that can be used in flashing a new ROM to a device; some articles talked about some of the other fields like:
- Primary Bootloader
- Secondary Bootloader​
Are these bootloader files analogous to a GRUB or LILO that I would use on my Fedora Linux boxes? Or are they the same or different than the role of the hardware BIOS on a traditional x86 motherboard? Are there other files that fulfill other similar functions?
It seems like the bootloader files are exclusive for the specific device that they are on. So I am betting that installing the wrong primary or secondary bootloader onto a device could well brick it. Kind of like installing the wrong BIOS update on an x86 motherboard would likely turn it into a piece of toast as well.
Much like BIOS virus are equally as unique to the motherboard as they are rare, they unfortunately still exist.
My question is if it is possible to buy used device that is infected and not have a way to "re-install the BIOS" for lack of better wording. If that were the case then potentially any MOD that I were to put on to the device would still lend it to being compromised in a similar way to a rootkit virus?
I am a complete Android noob so I apologize if these problems don't exist in the mobile space or are already solved. My only frame of reference is the traditional x86 experience and I can't seem to locate anything online
Thanks everybody! :cyclops:

Porting AOSP to custom-built device

Hi everyone,
as title suggests, I'd like to "port" clean AOSP to be able to install and run it on the custom device.
Basically, the situation is following: I got a custom device, based on rockchip rk3288 SoC. The device currently runs Android 5.1 successfully. I'd like to update Android to version 6 (got AOSP sources and AWS builder image up and running), but the company that created Android v5 for us no longer exists.
Thus I am here to ask for advice(s) on how to proceed (or whether it even is a good idea to do that myself, given the fact that I have zero experience with Android ROMs development), possibly a step-by-step guide on what to do.
The question is, do I just find drivers for hardware components present in the device (usb hub, ethernet, etc.) and just somehow "link" those to existing sources (of AOSP) and just run the build with different parameters? Or do I need to build a whole new kernel for the given device-OS combination?
Thank you for any advice or opinion!
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
abtekk said:
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
Thanks for pointing in the right (or at least some) direction! I found some guide on porting ROMs which I followed, basically like you said. So I just replaced some files in System image. Will flash later today, so maybe I will get some results!
abtekk said:
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
So I was following this tutorial, although found some irregularities, let's say: For example, none of those 2 folders contained init.d/ directory, thus I didn't update it. Also, I haven't found META-INF folder therefore haven't updated updater-script.
Basically, when I did (or at least what I think I was doing was that I took /system partition from our current ROM, that is working on that custom device and replaced stuff in there by stuff from the new system I wanted to port. My idea from what I've read was that i took kernel (and boot/recovery) from the original, working ROM and "injected" the new system onto it. Is that correct? Is that what I needed to do? Because the problem is, I cannot boot into the system (might as well be because of Kernel version, because I am trying to port Android 6 on Kernel 3.10. which was used in the current ROM running Android 5). It looks like the device is stuck in bootloader, or "somehow doesn't know what to start" (sorry, I can't put it better), displaying only my device's logo.
When I connect it to the computer via USB cable, running adb devices shows me that device, but when I try to access shell using adb shell I got error saying that /system/bin/sh wasn't found, which made me thinking that somehow the /system partition isn't "linked" properly, like I stated in the beginning.
Was I doing everything correctly? Do I need to do something above that? (maybe do you know about some tutorial). I am trying to port AOSP 6 Android.
Thank you!

Categories

Resources