[GUIDE][COMPLETE] Android ROM Development From Source To End

Search This thread

_d4Mn_

Member
Jul 14, 2018
11
0
Can Auto-Permissions Enabled be done?

Friends,

I'm in a making of an application that has to be running on a custom rom (this projects is running for 1,5 years now and I am nearly finished). Basically I am creating a tablet that is meant to be used for one thing only and that's it (purpose made machine). Have nearly finished my app and have built my ROM with most of the modifications I needed (cm14.1).
Few things I cannot figure out.

The goal is to avoid the "give permission" pop-up window to appear at the first run of the app.

1.: Is it achievable to have the required permissions already given to my application? Can I set this somewhere in the source files?
2.: Alternatively can I give all the required permissions to every app somehow?
3.: Is the above goal is achieveable at all?

This tablet will be used in schools by mentally low-skilled people and cannot rely on them reading and giving the permissions at the first run. I also dont want their teachers to do this at the first time after the tablets are delivered. I would like to have a ROM that I flash and will have everything ready to go.

Can anyone help?
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
7,385
7,398
Sydney
Having a bootloop issue on an Oreo Rom for ks01ltexx.
kernel: https://github.com/kyasu/android_kernel_samsung_msm8974
device: https://github.com/kyasu/android_device_samsung_ks01ltexx
vendor: https://github.com/kyasu/android_vendor_samsung_ks01ltexx

The weird things are:
It will boot loop about 2-5 times and then boot up ok
If I replace the init.qcom.rc from another device (but a little similar), the bootloop disappears but things like WiFi don't work
I previously built this without problems

I have taken a last_kmsg at both success and failure, and compared the two.Basically the difference starts at the following
GOOD: https://www.hastebin.com/avabopojug.bash
BOOT-LOOP: https://www.hastebin.com/odajuqonit.bash
View attachment 4577859

They appear to diverge at "samsung_dsi_panel_event_handler : unknown event " on the good side, but that same event occurs many times on both sides above.

Any ideas? or even where to start next?

I have looked for the function, and its defined in 4 or 5 files within the kernel, which appear to be based on resolution. I am 1920x1080
View attachment 4577872
 

Jay_B

Senior Member
Feb 5, 2012
731
2,059
Xiaomi Poco X2
POCO M2 Pro
I am compiling Oreo-based ROMs for Oxygen (Xiaomi Mi Max 2). The Oreo sources are not out yet for it.

The issue we have been facing is the "in-call" vol. We are not able to increase or decrease the vol during a call be it from the phones hardware keys or from a headphones hardware keys. For the rest of the media, it works quite good.

I am attaching a call log along with links to the trees I am using, hoping someone out on XDA might be able to help us out.

Oxygen DT : https://github.com/jayant-b/device_xiaomi_oxygen

msm8953-common DT :
https://github.com/jayant-b/device_xiaomi_msm8953-common

Kernel :
https://github.com/jayant-b/andorid_kernel_xiaomi_oxygen

Vendor
https://github.com/jayant-b/proprietary_vendor_xiaomi_oxygen

Log:
https://hastebin.com/wetaxomibo.coffeescript
 

Sapphiress

Senior Member
Can anyone help me with this. I keep getting this error even though I've manually removed -Werror and replaced it with -Wno-error in all of the make files.
Code:
[ 52% 14718/28091] target  C++: hwcomp...ay/msm8994/libhwcomposer/hwc_utils.cpp
FAILED: out/target/product/angler/obj/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates/hwc_utils.o 
/bin/bash -c "PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-g++ -I hardware/qcom/display/msm8994/libhwcomposer/../libgralloc -I hardware/qcom/display/msm8994/libhwcomposer/../liboverlay -I hardware/qcom/display/msm8994/libhwcomposer/../libcopybit -I hardware/qcom/display/msm8994/libhwcomposer/../libqdutils -I hardware/qcom/display/msm8994/libhwcomposer/../libhwcomposer -I hardware/qcom/display/msm8994/libhwcomposer/../libhdmi -I hardware/qcom/display/msm8994/libhwcomposer/../libqservice -I ./external/skia/include/core -I ./external/skia/include/images -I hardware/qcom/display/msm8994/libhwcomposer -I out/target/product/angler/obj/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates -I out/target/product/angler/gen/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates -I libnativehelper/include_jni \$(cat out/target/product/angler/obj/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates/import_includes)  -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem out/target/product/angler/obj/include -isystem device/huawei/angler/kernel-headers -isystem hardware/qcom/msm8994/kernel-headers -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64 -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -fno-canonical-system-headers -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -fdiagnostics-color -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -mcpu=cortex-a53  -Wsign-promo -fvisibility-inlines-hidden  -std=gnu++11   -fno-rtti -DDEBUG_CALC_FPS -Wno-missing-field-initializers -Wconversion -Wall -Werror -D__ARM_HAVE_NEON -DVENUS_COLOR_FORMAT -DMDSS_TARGET -D__STDC_FORMAT_MACROS -DANDROID_JELLYBEAN_MR1=1 -DLOG_TAG=\\\"qdhwcomposer\\\" -std=c++11 -fPIC -D_USING_LIBCXX -Wno-attributes -DANDROID_STRICT   -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast  -MD -MF out/target/product/angler/obj/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates/hwc_utils.d -o out/target/product/angler/obj/SHARED_LIBRARIES/hwcomposer.msm8994_intermediates/hwc_utils.o hardware/qcom/display/msm8994/libhwcomposer/hwc_utils.cpp"
In file included from frameworks/av/media/libmedia/include/media/IMediaPlayer.h:27:0,
                 from frameworks/av/media/libmedia/include/media/IMediaPlayerService.h:29,
                 from frameworks/av/media/libmedia/include/media/IMediaDeathNotifier.h:21,
                 from hardware/qcom/display/msm8994/libhwcomposer/hwc_qclient.h:37,
                 from hardware/qcom/display/msm8994/libhwcomposer/hwc_utils.cpp:41:
frameworks/av/include/media/VolumeShaper.h: In copy constructor 'android::media::VolumeShaper::Configuration::Configuration(const android::media::VolumeShaper::Configuration&)':
frameworks/av/include/media/VolumeShaper.h:135:18: error: base class 'class android::Parcelable' should be explicitly initialized in the copy constructor [-Werror=extra]
         explicit Configuration(const Configuration &configuration)
                  ^
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
16:22:13 ninja failed with: exit status 1

#### failed to build some targets (04:36 (mm:ss)) ####


Update: Fixed, I missed common.mk and It was still setting -Werror.
 
Last edited:
  • Like
Reactions: bcrichster

Ololoev9999

Member
Oct 8, 2016
20
0
Hello guys!
I am building Pie rom and want to include some system accents to it.
I dont have sources of them but i have apks wich should be located in /vendor/overlay/*name*/*name*.apk
How can i include them to rom?
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
7,385
7,398
Sydney
I have been looking at an init.*.rc file for my device (specifically init.qcom.rc on https://github.com/kyasu/android_device_samsung_ks01ltexx/blob/lineage-15.1/rootdir/etc/init.qcom.rc). One thing I have noticed is that it references many paths/files which do not exist.

The one which is confusing me the most, I have found on 3 other devices. the following is the excerpt for example (around line 110):
Code:
# DRK permission
    mkdir /efs/prov 0770 radio system
    chown radio system /efs/prov/libdevkm.lock
    chmod 0660 /efs/prov/libdevkm.lock

So, reading this to me it translates to (in English):
  1. make the directory /efs/prov
  2. change the owner of the file /efs/prov/libdevkm.lock
  3. change the permission on the file /efs/prov/libdevkm.lock

However, logically to me :cyclops:, simply by creating the directory, it is assuming that the file "libdevkm.lock" magically appears in the newly created directory :silly: I have checked on a booted device, and this file does not exist. I could maybe understand if a service or another boot process creates the file, but assuming the file to exist a few micro seconds after creating the path seems a bit of a reach, And the booted device appears to agree with me; ie the file is not even there a boot completed. As I said, these same lines are in three other devices I checked.:confused:

Am I missing something?
 
Last edited:

TimSchumi

Senior Member
Mar 9, 2016
883
406
22
Friends,

I'm in a making of an application that has to be running on a custom rom (this projects is running for 1,5 years now and I am nearly finished). Basically I am creating a tablet that is meant to be used for one thing only and that's it (purpose made machine). Have nearly finished my app and have built my ROM with most of the modifications I needed (cm14.1).
Few things I cannot figure out.

The goal is to avoid the "give permission" pop-up window to appear at the first run of the app.

1.: Is it achievable to have the required permissions already given to my application? Can I set this somewhere in the source files?
2.: Alternatively can I give all the required permissions to every app somehow?
3.: Is the above goal is achieveable at all?

This tablet will be used in schools by mentally low-skilled people and cannot rely on them reading and giving the permissions at the first run. I also dont want their teachers to do this at the first time after the tablets are delivered. I would like to have a ROM that I flash and will have everything ready to go.

Can anyone help?

You might want to try and target an API level (with your app) that doesn't support runtime permissions. That way, Android should fall back to the old permissions-on-installation way of handling those things. Alternatively, try making it a system app (at build time) and sign it with the platform keys.
 

RickySplashHD

Member
Feb 27, 2017
9
0
Hi,
Where can I obtain proprietary files for my Wiko View? I'm trying to compile a 9.0 AOSP-based ROM, but I can't find anything online.

Aaand sorry for the dumb question :p
 

RickySplashHD

Member
Feb 27, 2017
9
0
On GitHub there isn't nothing for my device. But there are 2 repos for another device, that for what I saw it's similar (or identical too) to mine. Tinno bought Wiko last year, so maybe they can be useful. Here are the links.

Device compared: https://www.devicespecifications.com/en/comparison/5e37d2e7f
Android device for similar device: https://github.com/TINNO-8937/android_device_micromax_hs2
Proprietary vendor for similar device:
https://github.com/TINNO-8937/proprietary_vendor_tinno

So can I use them for my device?
 

eccko

Senior Member
Mar 15, 2018
285
142
Katowice
On GitHub there isn't nothing for my device. But there are 2 repos for another device, that for what I saw it's similar (or identical too) to mine. Tinno bought Wiko last year, so maybe they can be useful. Here are the links.

Device compared: https://www.devicespecifications.com/en/comparison/5e37d2e7f
Android device for similar device: https://github.com/TINNO-8937/android_device_micromax_hs2
Proprietary vendor for similar device:
https://github.com/TINNO-8937/proprietary_vendor_tinno

So can I use them for my device?

You can TRY. But always you can find any rom for this device Micromax Canvas Infinity and port them. ;)
 

RickySplashHD

Member
Feb 27, 2017
9
0
You can TRY. But always you can find any rom for this device Micromax Canvas Infinity and port them. ;)

For the port: isn't port only possible between same version rom? ex. 7.1 to 7.1. What I am trying to achieve is to upgrade my device to 9.0. (From what I know)
For the compile: Now I only miss the kernel. Any advice? Do I need that for my device or the latest one?
 

eccko

Senior Member
Mar 15, 2018
285
142
Katowice
For the port: isn't port only possible between same version rom? ex. 7.1 to 7.1. What I am trying to achieve is to upgrade my device to 9.0. (From what I know)
For the compile: Now I only miss the kernel. Any advice? Do I need that for my device or the latest one?

Fitrst question, Porting is only rom 6.0 to 6.0 not from 6.0 to 9.0.
Second question, I didin't find any kernel repositories. As you can see on XDA there is 0 roms for Micromax Canvas Infinity - https://xdaforums.com/t/micromax-canvas-infinity


Also you cannot use this propert vendor (https://github.com/TINNO-8937/proprietary_vendor_tinno), there is msm8937 and you have msm8917. Addidtional there is only branch cm-14.1 - android 7.1.2.
https://www.devicespecifications.com/en/comparison/5e37d2e7f

You have to find device with same Processor - msm8917 snapdragon 425 and for better SAME RESOLUTION and same GB of RAM. Then this maybe something we can do. :)
 
Last edited:

RickySplashHD

Member
Feb 27, 2017
9
0
Fitrst question, Porting is only rom 6.0 to 6.0 not from 6.0 to 9.0.
Second question, I didin't find any kernel repositories. As you can see on XDA there is 0 roms for Micromax Canvas Infinity - https://xdaforums.com/t/micromax-canvas-infinity


Also you cannot use this propert vendor (https://github.com/TINNO-8937/proprietary_vendor_tinno), there is msm8937 and you have msm8917. Addidtional there is only branch cm-14.1 - android 7.1.2.
https://www.devicespecifications.com/en/comparison/5e37d2e7f

You have to find device with same Processor - msm8917 snapdragon 425 and for better SAME RESOLUTION and same GB of RAM. Then this maybe something we can do. :)

So the device tree is correct or I need to change that too? Oh man, this is more complicated that I thought! (and I like it :D)
Anyway, for vendor and kernel is there a way to "get them from my current rom"? Any other way is accepted too.
 

eccko

Senior Member
Mar 15, 2018
285
142
Katowice
So the device tree is correct or I need to change that too? Oh man, this is more complicated that I thought! (and I like it :D)
Anyway, for vendor and kernel is there a way to "get them from my current rom"? Any other way is accepted too.

To make it easier, you just need to find a device that is similar or nearly identical to yours. There is no need to complicate matters, just find a simple exit. ;)
I find a HUGE list of smartphones who using Snapdragon 425 (msm8917) I pretty sure, you there find a similar device to your - https://www.kimovil.com/en/list-smartphones-by-processor/qualcomm-snapdragon-425-msm8917

If you've already found a device, I'd be happy to help you with the ROM porting for your Wiko View. :)
 
Last edited:

RickySplashHD

Member
Feb 27, 2017
9
0
To make it easier, you just need to find a device that is similar or nearly identical to yours. There is no need to complicate matters, just find a simple exit. ;)
I find a HUGE list of smartphones who using Snapdragon 425 (msm8917) I pretty sure, you there find a similar device to your - https://www.kimovil.com/en/list-smartphones-by-processor/qualcomm-snapdragon-425-msm8917

If you've already found a device, I'd be happy to help you with the ROM porting for your Wiko View. :)

Oh yeah, thank you dude! Where can we talk?
I think the Xiaomi Redmi 5A can be a nice one to start with. It has got same Soc, but different RAM, and screen resolution. The reason I choosed this one is because someone already developed a 9.0 Rom (https://xdaforums.com/xiaomi-redmi-5a/development/rom-carbonbeta-cr-7-0-t3830374). I don't know if this can be useful.
The most similar to mine is the Huawei Y6 2018, with same Soc, RAM and screen resolution.
What should we use for porting? Thanks again for helping me. :eek:
 

deve678

Member
Mar 20, 2017
39
12
Ernakulam
Oh yeah, thank you dude! Where can we talk?
I think the Xiaomi Redmi 5A can be a nice one to start with. It has got same Soc, but different RAM, and screen resolution. The reason I choosed this one is because someone already developed a 9.0 Rom (https://xdaforums.com/xiaomi-redmi-5a/development/rom-carbonbeta-cr-7-0-t3830374). I don't know if this can be useful.
The most similar to mine is the Huawei Y6 2018, with same Soc, RAM and screen resolution.
What should we use for porting? Thanks again for helping me. :eek:

You can use Honor Y6 for porting as it is more similar to yours as you don't want to do complicated.
 
  • Like
Reactions: eccko

Top Liked Posts

  • There are no posts matching your filters.
  • 453
    Hello Everyone....:D:D

    Today I will present you all the ultimate guide for ROM development starting from Source to End.
    This guide will be applicable to all devices.
    So lets Start :D



    What is Android? :rolleyes:

    Android is an open-source operating system developed by Google for smartphones, tablets, and other devices. It provides a user-friendly interface and supports a vast ecosystem of applications through the Google Play Store. With its Linux-based foundation, Android enables multitasking and offers extensive customization options for both manufacturers and users. Its integration with Google services enhances functionality and connectivity, making Android a popular choice for mobile devices worldwide.
    Full Freedom for people using it :D


    What is Android Source Code?

    Android is an open-source software stack developed for a diverse range of devices with varying form factors. The primary objective of Android is to provide an open software platform that is accessible to carriers, original equipment manufacturers (OEMs), and developers, enabling them to bring their innovative ideas to life. The goal is to create a successful, real-world product that enhances the mobile experience for users. One of the notable features of Android is that it offers a complete, production-quality consumer product with source code that is openly available for customization and porting.
    Android allows for extensive customization and enables developers to create new functionalities and experiences without significant restrictions. This openness fosters creativity and empowers developers to tailor Android to suit their specific needs. It also encourages collaboration within the Android community, where developers can share their enhancements, contribute to the platform's evolution, and address any issues or bugs.
    So basically Android Allows to customize the things you like and make new things without any Restrictions. Cool isn’t it? :cool:

    What is Android ROM ?

    An Android ROM refers to a customized version of the Android operating system that is installed on a device. ROM stands for "Read-Only Memory," which originally referred to firmware stored in a device's memory. However, in the context of Android, a ROM typically refers to the software package that includes the operating system, user interface, and other components specific to a particular device or a modified version of Android.

    While it is true that an Android ROM includes the user interface (UI) and the file system for maintaining contacts and other data, it is not limited to those aspects. The Android ROM is built upon a Linux kernel, which serves as the foundation for the operating system. Additionally, the ROM includes various system-level components, libraries, and apps that provide specific functionalities and features.

    ROMs can be developed by device manufacturers (such as HTC, Samsung, or LG) to provide a customized user experience on their devices. They often come with a unique user interface overlay, such as HTC's Sense UI or Samsung's One UI, which can offer additional features and visual enhancements.

    Moreover, ROMs can also be developed by third-party developers or communities, known as custom ROMs. Custom ROMs are modified versions of Android created by independent developers or enthusiast communities. These ROMs are typically designed to offer additional features, customization options, improved performance, or compatibility with older devices that may no longer receive official updates.


    What does a Android Rom Contain ?
    Basically a Android Rom Contains following main things:

    1. Kernel: The kernel is the core of the operating system that manages system resources and facilitates communication between hardware and software.
    2. Bootloader: The bootloader is responsible for initializing the device's hardware and loading the operating system into memory during the boot process.
    3. Recovery: The recovery is a separate bootable partition on the device that allows for system maintenance, installation of updates, and performing backups or restores.
    4. Radio: The radio refers to the software responsible for managing the device's wireless communication, including cellular connectivity.
    5. Framework: The framework consists of a set of libraries and APIs that provide the foundation for application development and interaction with the device's hardware and services.
    6. Apps: Android ROMs typically include pre-installed applications, such as system apps (e.g., dialer, messaging) and other core apps (e.g., calendar, browser), which may vary depending on the ROM.
    7. Core: The core components of the Android operating system, including system services, libraries, and essential system processes.
    8. Android Runtime: The Android Runtime (ART) is the runtime environment responsible for executing Android applications. It converts apps from bytecode into machine code for efficient execution.


    Some Basics About Above Terms

    Kernel

    • The Android kernel is a key component of the Android operating system, serving as the core of the software.
    • It is based on the Linux kernel but includes modifications and additions specific to the Android platform.
    • The kernel provides essential functionalities, such as hardware abstraction, process management, and memory management.
    • It controls the device's hardware resources, including the CPU, memory, storage, and input/output devices.
    • The kernel manages drivers that enable communication between the operating system and hardware components.
    • It facilitates power management, optimizing resource usage to maximize battery life.
    • The kernel handles security mechanisms, such as process isolation and permissions, to protect against unauthorized access.
    • It enables multitasking by scheduling and prioritizing tasks, allowing multiple applications to run simultaneously.
    • The kernel supports various file systems, networking protocols, and device drivers to ensure compatibility with different hardware configurations.
    • Kernel updates are released periodically to improve performance, fix bugs, and address security vulnerabilities.

    Bootloader
    • The Android bootloader is a critical component that starts the boot process on an Android device.
    • It verifies the integrity and authenticity of the software before loading it.
    • The bootloader is responsible for loading the operating system kernel.
    • It initializes essential hardware components, such as the CPU, memory, and display.
    • The bootloader acts as a security checkpoint, preventing unauthorized modifications to the device's software.
    • It ensures the device boots into a trusted and secure state, protecting against malware and unauthorized access.
    • The bootloader provides a means to unlock the device for advanced customization and firmware modifications.
    • Bootloader unlocking allows for installing custom ROMs, kernels, and recovery images.
    • Some devices have locked bootloaders by default to maintain system integrity and prevent unauthorized modifications.

    Recovery
    • Android Recovery is a built-in feature that provides a separate environment for system maintenance and troubleshooting.
    • It is accessed by booting into recovery mode, usually through a combination of hardware buttons during device startup.
    • The recovery mode allows users to perform various tasks, such as applying software updates and factory resetting the device.
    • It provides a limited but essential set of functions to recover or repair a malfunctioning Android system.
    • In recovery mode, users can clear cache partitions to resolve performance issues caused by cached data.
    • It enables users to flash custom ROMs, official firmware updates, and other system modifications.
    • Recovery mode allows for making and restoring system backups, protecting user data and settings.
    • It provides a command-line interface (ADB) for advanced troubleshooting and system-level operations.
    • Recovery mode is separate from the main Android system, ensuring stability even if the main OS encounters problems.

    These are main parts of Android Operating System.

    Now that we know what Android is and what it contains, let's move on to the next major step, which is Android ROM development from source. However, before starting this process, we need to set up some initial setup and development environment.

    Android Rom Development

    Setting Up Linux Enviroment

    Pre – Requirements for Android Rom Development


    1) Linux Operating System (I will use Ubuntu 13.10 as an example and recommend it to all)
    2) Java Development Kit (JDK)
    3) Various Tools

    Once you have downloaded Ubuntu 13.10, you can install it in two ways:
    1) Installing it as the primary operating system
    2) Installing it inside Windows using a virtual machine (VM) or virtualization software like VirtualBox (free) or VM Workstation/Player (paid)
    3) Dual-booting Linux alongside Windows by creating separate partitions

    In this guide, I will explain how to install Linux inside Windows using VirtualBox as an example.



    How to Install Ubuntu in VirtualBox

    1. Download and install Oracle VM VirtualBox on your computer.
    2. Download the Ubuntu ISO file from the official Ubuntu website or the specific version you want to install.
    3. Open VirtualBox and click on New to create a new virtual machine.



    M3QKn8t.png


    4. Enter a name for your virtual machine, select Linux as the type, and choose the version that matches your Ubuntu ISO.


    qw7keQx.png


    b6ACrTD.png


    5. Set the desired amount of RAM for the virtual machine. It's recommended to allocate at least 2GB or more.


    FRx9MXi.png



    6. Create a virtual hard drive by selecting Create a virtual hard disk now. Choose the VDI (VirtualBox Disk Image) option and click Next.


    jLe0HkX.png



    - Select Dynamically allocated and leave the Split into files option unchecked.


    EtrNQrT.png


    - Specify the amount of HDD space you want to allocate and choose the location for the virtual hard drive (VMDK).


    YJci8mw.png

    Q183qwt.png



    7. Go to Settings -> System -> Processor and set the desired number of cores for the Guest OS. In this example, we allocate 2 cores.


    RIODIn7.png



    8. Now, go to Settings -> System -> Acceleration and make sure both options are selected.


    KAbCX0n.png



    9. Next, go to Settings -> Storage -> Controller: IDE and click on the small CD with the plus icon.


    d9Yddtw.png



    - Navigate to the location where you saved the Ubuntu ISO file and select it.
    - Click OK to save the changes.



    5thCPCd.png


    S4bxR0b.png



    10. You can now start the virtual machine by clicking Start.

    11. The Ubuntu installation process will begin, and you can follow the on-screen instructions to complete the installation.

    12. Once the installation is finished, you'll have Ubuntu running in VirtualBox.


    AFgMcaI.png


    85WlRAQ.png


    7gaHrqW.png


    VkZavut.png


    ufrVr8I.png


    ynfGFTB.png


    msCeMV7.png


    That's it! You have successfully installed Ubuntu in VirtualBox.


    Hurrrray your Linux System is Ready!
    279
    Setting Up Build Enviroment For Compiling ROM's

    Installation of Necessary Tools and packages for ROM Development

    1)Installing Java Development Kit (JDK)

    For Kitkat

    Installation of Java V6

    Open The Terminal and Paste following Command

    a) This will Remove the wrong Java JDK from Ubuntu 13.10
    Code:
    [COLOR=#000000]sudo apt-get purge openjdk-\* icedtea-\* icedtea6[COLOR=#007700][COLOR=black]-\*[/COLOR] [/COLOR][/COLOR]


    b) Enter the Following Command and This will Install JDK

    Code:
    wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-installer_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-installer_6u45-0~webupd8~8_all.deb wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-set-default_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-set-default_6u45-0~webupd8~8_all.deb

    c) Check The Java Version Installed
    Code:
    [COLOR=#000000]java -[COLOR=#0000BB][COLOR=black]version [/COLOR] [/COLOR][/COLOR]

    For Lollipop Required Java Version is 7

    To Install Java V7


    Code:
     sudo apt-get update && sudo apt-get install openjdk-7-jdk

    :DJava Installation Completes:D

    2)
    Installation Of Required Tools
    Enter The Following Command
    Code:
    sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
    Note : If you get error like broken dependencies then use the following command and then use above command.:D

    Code:
    sudo apt-get update
    Code:
    sudo apt-get upgrade
    After Installation Completes Enter The Following Command
    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
    So The Above Are The Packages

    Now comes the binary called Repo.


    What Is Repo?:rolleyes:

    Repo is a repository management tool that we built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system and automates parts of the Android development workflow.

    Enter The Following Command
    Code:
    mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
    Using Text Editor Open ~/.bashrc for that use following command
    Code:
    sudo nano ~/.bashrc
    At The Very Bottom Line Add following Line
    Code:
    export PATH=~/bin:$PATH
    Save it. Here To save Press Ctrl+O and Enter and Ctrl+X to exit:)
    Now Enter Following Command
    Code:
    source ~/.bashrc

    :cool::cool:Now Your System Is Ready For ROM Building:D:D
    239
    Downloading Sources

    To build a Rom from Source first we need to download the sources from git.
    Note : Sources will be very huge approx 13GB to 14GB hence lot of patience is required since it will take some time depending on your Internet connection speed.

    So lets start..

    Here i will take the example of cm11.
    The steps goes has follows

    1) Create a directory were your sources will be downloaded. Enter the following command to terminal to create a directory

    Code:
    mkdir cm11
    Now in your Home directory you will see folder called cm11.

    1zEeVvZ.png


    2) The next step is you have to Initiate the repo. meaning of the repo is given above. It will communicate with the git and download the source were it is stored.
    Enter The Following Command to Terminal
    Code:
    cd cm11
    This will take you to the directory you created in Step 1.

    8zCZANO.png

    Now Enter The Following Command Which Will Initiate The Repo :laugh:
    Code:
    [FONT=Arial][SIZE=4]repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0[/SIZE][/FONT]


    AH3P62H.png


    MesK53W.png

    Since i m taking example of cm11 above repo initiate command is used you can find this here for CM11
    Note : All the details for Repo Initiate and Building will be given in respective Source Github. Various Github source links will be given in discription and the end.

    This will initialize your local repository using the CyanogenMod trees.:p:D:D
    now got to cm11 folder and press Ctrl+H this will show the hidden folder .repo were sources will be downloaded.

    WSkXUQr.png


    Buqbjst.png

    Now it might give a small error at the end stating for Email id.
    So just create a github account here
    Then Run following in Terminal
    Code:
    [FONT=Arial][SIZE=4]git config --global user.email "you@example.com"
    git config --global user.name "Your Name"[/SIZE][/FONT]


    replace
    "you@example.com" with your github email Id
    replace
    "Your Name" with github Username

    3) Now To control the files that should be downloaded while sync and for adding device tree we use local_manifest.xml. Reagrding this @Kishan14 will explain in detail with Tips and Tricks.

    4) Now it is the time to download the sources. for that run the following Command

    Code:
    repo sync -j#

    #
    is number of jobs you want to give for your downloading source. I use 2 to 4.

    hEbrLC4.png


    dE5oydZ.png

    Now it will download the Sources needed to build the Rom..Download will be huge 13GB to 14GB so be patient since it depends on your Internet Speed.

    The Above was for CM11 same procedure for other provided you have to replace cm11 with one you want to sync/build like AOSP,AOKP,AICP etc and Repo Initialize command varies with the source you want to download.

    Some Git Links :

    CM11 : https://github.com/CyanogenMod/android
    AOKP : https://github.com/AOKP/platform_manifest
    Carbon Rom : https://github.com/CarbonDev/android
    SlimRom : https://github.com/SlimRoms/platform_manifest
    184
    Building Rom For A Particular Device

    Building Rom For A Particular Device

    Now has we have downloaded the sources we need for our Rom Build Lets Move to the Next Step which is Actually Major Step the Building The ROM

    So Lets Start The Game...:laugh::D:D

    Note : I will be taking Samsung Galaxy Grand Duos - GT -I9082 has Example here.
    Example Rom : CM11

    Now before starting with Building guide you have to Download your Device Identity That is has follows
    1) Device Tree
    2) Vendor
    3) Kernel
    The Above files are very Vital Parameters of building they specify your device and its Characteristics.

    Now you might think from where you have to download those files?
    :confused:
    Don't be confused its simple Search in our device forum for CM Tree and Kernel and Vendor. The Dev of CM for your Device forum will specify it in his ROM thread.
    Once you obtain the github for your Device Tree, Vendor and Kernel. Enter following command
    Code:
    cd cm11/.repo
    Y6KmJsy.png

    Here in .repo folder you have to create file called local_manifests.xml
    1) Enter The Following Command in Terminal
    Code:
    nano local_manifest.xml
    mOFUkXi.png

    Structure of Local_manifest.xml is Has follows.
    Code:
    [COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
    [/COLOR]<manifest>
      [/COLOR]<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" /> 
    [COLOR=#000000]</manifest>[/COLOR]
    2) Add your Device , Kernel , Vendor Source
    gHq689W.png


    Taking my Ex here of GT-I9082
    After Adding device tree , Vendor , kernel my Local_manifest.xml will look like has follows
    Code:
    [COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
    [/COLOR]<manifest>
      <project path="device/samsung/i9082" name="pawitp/android_device_samsung_i9082" remote="github" revision="cm-11.0" />
      <project path="vendor/samsung/i9082" name="k2wl/android_vendor_samsung_i9082" remote="github" revision="master" />
      <project path="kernel/samsung/i9082" name="pawitp/android_kernel_samsung_i9082" remote="github" revision="cm-11.0" />
    </manifest>[/COLOR]
    ABoaVKn.png

    3) Press ctrl+O and Enter
    DpbtNWp.png


    ZNqRufc.png

    4) Press Ctrl+X to exit.
    Sx5Onvn.png

    After Adding Device Tree,Vendor,Kernel sources just repo sync again so that the files are downloaded. you can also add which files you want to download or you dont want to download. More about manifest and local_manifest will be explained by @Kishan14 in his guide:D

    Once that is done now you have your device Identity with you:laugh::laugh::highfive:
    Now follow the Instruction Given by @rutvikrvr in POST 9 to make the your CM Device Tree Compatible with your ROM Source.

    Once your CM Device tree is successfully made compatible with your ROM its Time for Building :D:cool:
    Now Building Command Various with Rom which you want to compile its different for different ROM you have to see the Manifest of The Rom for it has instruction for building will be given there. Since i m Taking example of CM11 and Device has GT-I9082 the steps goes has follows
    1) Enter the Following command in Terminal
    Code:
    cd cm11
    Just Replace CM11 by your working directory of Rom . Ex : AOGP,AICP etc
    2)Now enter following Command To Terminal
    Code:
    [COLOR=#000000][COLOR=#007700]. [/COLOR][COLOR=#0000BB]build[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]envsetup[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]sh[/COLOR][/COLOR]
    3) Build Instruction Varies from Rom to Rom so check manifest of ROM for the Same. General instuction is
    Code:
    [COLOR=#262626]time brunch <codename>[/COLOR] [COLOR=#000000][COLOR=#007700]-[/COLOR][COLOR=#0000BB]j[/COLOR][COLOR=#FF8000]#[/COLOR][/COLOR]
    <Codename> CodeName of your Device
    # is the No of CPU cores you have.
    Building will take time depending on your system configuration.

    Once building is Done.
    Its Time to apply patches which will be given in our CM Rom thread if any.
    Follow the guide by @rutvikrvr in Post 10 for applying patches.
    Once Done rebuild again using command above (This time building will be fast)

    Now go to your working directory and go to OUT/target/your device/ you will get the Zip of the Rom.
    Always make a backup of your current Rom.
    Flash it via recovery and check.:laugh::laugh:

    :cool::cool:Hurrrrrray You Just Developed A Rom from Source:cowboy::cowboy:
    141
    Uploading Device Tree To Github


    So Guys till now we learnt lot of stuffs and finally we build a Rom :highfive: During building the Rom we may have edited lot of stuffs in device tree :D:D To avoid those being repeated in case you delete the Tree or If your ROM is Unofficial then you have to upload the Device Source Tree to Github. There are lot of uses if you upload the device tree.

    Lets Start with guide Now :D:D

    1) Create a account in Github.

    2) Generate a new SSH key
    Enter Following command to Terminal
    Code:
    ssh-keygen -t rsa -C "your_email@example.com"
    "your_email@example.com" = your github Email ID

    After pressing Enter you will Observe the following output
    Code:
    # Creates a new ssh key, using the provided email as a label
    [LEFT]# Generating public/private rsa key pair.
    # Enter file in which to save the key (/home/you/.ssh/id_rsa):
    Press Enter.[/LEFT]

    Now you need to enter the passphrase
    Code:
    # Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again]
    Once all done you will see the following in your Terminal.

    Code:
    Your identification has been saved in /home/you/.ssh/id_rsa.
    [LEFT]# Your public key has been saved in /home/you/.ssh/id_rsa.pub.
    # The key fingerprint is:
    # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
    Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com.[/LEFT]
    That is go to github account settings and SSH
    copy paste id_rsa.pub content there and save it done.:D:cowboy:

    Now Its Time To Check If Everything Works.:highfive:



    • Enter The Following Command To Terminal
      Code:
      ssh -T git@github.com
    • It should display has follows
      Code:
      The authenticity of host 'github.com (207.97.227.239)' can't be established.
       # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
       # Are you sure you want to continue connecting (yes/no)?
    • type yes and press enter
      Code:
      Hi username! You've successfully authenticated, but GitHub does not
       # provide shell access.
    Now All Done Its Time To Upload The Device Tree To Github :cowboy:

    Example Device and Rom : GT-I9082 and AOGP Rom.
    In the following steps i take my example device and Rom just replace the device with your device and Rom with your Rom:cool:

    Steps :



    • In Terminal
      Code:
      cd aogp/device/samsung/i9082
    IYwxiGJ.png


    MywR13m.png


    • Then Type Following
      Code:
      git init
    VX7TpL2.png


    ovdAnqa.png


    • Setting up of the git files required to push the files to the github account will be done by following command
      Code:
      git add .
    QA1GZTL.png

    • Now we need to comment on the files we are pushing to github hence enter following command
      Code:
       git commit -m "first commit"
    m6TUgMc.png

    • Now Go to your Github account click on add button on top next to your username and Select New repository
    o9hykDa.png

    • enter the Name of your repository in my case you can see the ScreenShot below
    MJrg5oy.png

    • now you can see some commands displayed enter the git link displayed in your repository created the terminal in my case
      Code:
      git remote add origin https://github.com/username/aogp_device_samsung_i9082.git
    q7GtUIv.png


    1mHEHlS.png


    • Last Step is To Push The Source to Github. Enter The Following Command in Terminal
      Code:
      git push origin master
    lxMlsq0.png


    The Passphrase is the same you entered while creating SSH key.

    06SbxM4.png


    • Finally your source is in Github now add Readme.md File and mention This is <ROM NAME> Device Tree For <Your Device>


    :D:cool:You Have Successfully Uploaded your Device Tree To Github :cowboy::cowboy:


    Credits
    @rutvikrvr
    @Kishan14
    @k2wl (My Mentor and Inspiration for Android)




    If You want to learn more about Github and Stuffs you can visit Following Guide by XDA Senior Moderator @eagleeyetom (Thanks a lot Sir)

    Guide Link : http://xdaforums.com/showthread.php?t=1877040