Android-x86 OS build
With kernel customization
Are you familiar with the Android x86 project? It's an open-source initiative that aims to port the Android operating system to run on traditional x86-based hardware And Run them Natively in laptops and desktop computers without any kind of emulation. You can then evolve your old laptops into an Education / Media Center / Gaming or even use them for Testing and Development of Android Apps on a Large Screen.
For a specific project I needed to build the Android sources for an x86 Target but the standard build process output had issues with Ethernet Drivers. It led me to customize the Android Kernel and Integrate the Ethernet Driver statically with the Kernel Build. Here in this post I will show How I managed to build an Android x86 OS variant with kernel customization. I hope you enjoy it 🙂
Host machine info
Install dependencies
Download the Source
Environment setup
The resultant build configuration would look like the following
Obtaining The Network card info
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)
Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
0c:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07)
Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Kernel driver in use: r8169
Kernel modules: r8169
Take note of the network card’s kernel module names
Customization of the Kernel
[make sure your terminal is wide and long enough ]
Note: The configuration file is the default .config
In a similar way you can change other parts of the kernel as you want
>> Now copy this config file to build systems’ actual config files’ location
>> Now rename the .config file
The build took around 25 minutes
The built kernel is at out/target/product/x86_64/
The kernel modules are at out/target/product/x86_64/system/lib/modules/
>> Now we will build the final image with the kernel we just built
Android-x86 installation on VM
Open Virtual Box >> Create new machine , choose linux type , create a virtual disk
From Settings -> storage -> Select the ISO you built
Now boot the machine , select installation of hard disk , Use GPT to write partition table
Create a partition out of the free space of the VDI , format by EXT4 , then GRUB will be asked but GRUB won’t work on a GPT partitioned so MBR will be used
Enable 3D and 2D acceleration ,
Network related Configuration
After installation completed remove iso attachment
Start the VM and you will see android x86 booting.
Installation in Laptop (Natively)
Here below is snapshot of the custom build installation nativelyYou can see all the services being started and finally the Android Screen will come up
Here is a screen out of the running OS . Please Note you would not find any google Apps with this build because you then need to be registered as a vendor and follow certain rules regulations. Otherwise you can install F-Droid kind of free app stores to download and play with different apps https://f-droid.org/en/
0 comments:
Post a Comment