• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

Yanun

Senior Member
Apr 4, 2017
146
85
Białystok
Can someone help? :confused:
I'm getting error with FMRadio.apk when building XOSP for Xperia z2
Error:
Building with Jack: /home/yanun/XOSP/out/target/common/obj/APPS/FMRadio_intermediates/with-local/classes.dex
Copying: /home/yanun/XOSP/out/target/common/obj/APPS/FMRadio_intermediates/classes.dex
target Package: FMRadio (/home/yanun/XOSP/out/target/product/sirius/obj/APPS/FMRadio_intermediates/package.apk)
Warning: AndroidManifest.xml already defines versionCode schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName schemas.android.com/apk/res/android);using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion /schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion schemas.android.com/apk/res/android) using existing value in manifest.
make: *** No rule to make target '/home/yanun/XOSP/out/target/product/sirius/system/lib/libfmjni.so', needed by '/home/yanun/XOSP/out/target/product/sirius/system/priv-app/FMRadio/FMRadio.apk'. Stop.

#### make failed to build some targets (03:02:46 (hh:mm:ss)) ####
 

spookcity138

Senior Member
Nov 9, 2015
1,877
2,649
Eindhoven
  • Like
Reactions: Indigoeyes

Indigoeyes

Senior Member
Aug 17, 2013
119
65
Succesfully compiled the ROM =) but when I'm booting it up it's stuck at "android is starting" any ideas what could cause this issue? :)

I just noticed there wasn't any pre-installed launcher bypassed it by going into settings -> apps -> google play store and downloading launcher
 
Last edited:

qiurigao

Senior Member
Oct 11, 2016
127
54
JIAGNXI
Copying: /opt/sm/out/target/common/obj/APPS/messaging_intermediates/classes-jarjar.jar
Copying: /opt/sm/out/target/common/obj/APPS/messaging_intermediates/emma_out/lib/classes-jarjar.jar
Copying: /opt/sm/out/target/common/obj/APPS/messaging_intermediates/classes.jar
ProGuard, version 5.1
Reading program jar [/opt/sm/out/target/common/obj/APPS/messaging_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/ims-common_intermediates/classes.jar]
Reading library jar [/opt/sm/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar]
Preparing output jar [/opt/sm/out/target/common/obj/APPS/messaging_intermediates/proguard.classes.jar]
Copying resources from program jar [/opt/sm/out/target/common/obj/APPS/messaging_intermediates/classes.jar]
target Dex: messaging
Copying: /opt/sm/out/target/common/obj/APPS/messaging_intermediates/classes.dex
target Package: messaging (/opt/sm/out/target/product/PD1613/obj/APPS/messaging_intermediates/package.apk)
W/asset (29529): Asset path /opt/sm/out/target/common/obj/APPS/framework-res_intermediates/package-export.apk is neither a directory nor file (type=1).
ERROR: Asset package include '/opt/sm/out/target/common/obj/APPS/framework-res_intermediates/package-export.apk' not found.
make: *** [/opt/sm/out/target/product/PD1613/obj/APPS/messaging_intermediates/package.apk] 错误 1
make: *** 正在删除文件“/opt/sm/out/target/product/PD1613/obj/APPS/messaging_intermediates/package.apk”
make: *** 正在等待未完成的任务....

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

neonkat

Senior Member
Aug 15, 2014
4,408
2,936
lost
Can someone help? :confused:
I'm getting error with FMRadio.apk when building XOSP for Xperia z2
Error:
Building with Jack: /home/yanun/XOSP/out/target/common/obj/APPS/FMRadio_intermediates/with-local/classes.dex
Copying: /home/yanun/XOSP/out/target/common/obj/APPS/FMRadio_intermediates/classes.dex
target Package: FMRadio (/home/yanun/XOSP/out/target/product/sirius/obj/APPS/FMRadio_intermediates/package.apk)
Warning: AndroidManifest.xml already defines versionCode schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName schemas.android.com/apk/res/android);using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion /schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion schemas.android.com/apk/res/android) using existing value in manifest.
make: *** No rule to make target '/home/yanun/XOSP/out/target/product/sirius/system/lib/libfmjni.so', needed by '/home/yanun/XOSP/out/target/product/sirius/system/priv-app/FMRadio/FMRadio.apk'. Stop.

#### make failed to build some targets (03:02:46 (hh:mm:ss)) ####

can you link your device trees?
 

kaibsora

Senior Member
Nov 16, 2013
111
96
Fairdale
Build error

So i am building aosp(caf) for moto x pure(clark) and all of my repos are located at xPureAosp on github

when i try to build i get this error

Code:
ninja: error: '/home/kai/android/nougat/out/target/product/clark/obj_arm/SHARED_LIBRARIES/libtime_genoff_intermediates/export_includes', needed by '/home/kai/android/nougat/out/target/product/clark/obj_arm/SHARED_LIBRARIES/libandroid_servers_intermediates/import_includes', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (23 seconds) ####

[email protected]:~/android/nougat$

any help?
Thank You!!!
 

nathsagar96

Senior Member
Sep 2, 2016
231
108
Mumbai
OnePlus One
Redmi K20 Pro
How to solve this problem

target SharedLib: libLLVM (/home/sagar/aosip/out/target/product/bacon/obj/SHARED_LIBRARIES/libLLVM_intermediates/LINKED/libLLVM.so)
java.lang.AssertionError
at com.android.sched.scheduler.MultiWorkersScheduleInstance.process(MultiWorkersScheduleInstance.java:523)
at com.android.jack.Jack.run(Jack.java:738)
at com.android.jack.Jack.checkAndRun(Jack.java:412)
at com.android.jack.CommandLine.runJack(CommandLine.java:79)
at com.android.jack.api.v01.impl.Cli01CompilationTaskImpl.run(Cli01CompilationTaskImpl.java:85)
at com.android.jack.server.tasks.JackTask.handle(JackTask.java:168)
at com.android.jack.server.tasks.SynchronousServiceTask.handle(SynchronousServiceTask.java:49)
at com.android.jack.server.tasks.JackTask.handle(JackTask.java:55)
at com.android.jack.server.router.PathRouter.handle(PathRouter.java:65)
at com.android.jack.server.router.ContentTypeParameterRouter.handle(ContentTypeParameterRouter.java:84)
at com.android.jack.server.router.ContentTypeRouter.handle(ContentTypeRouter.java:82)
at com.android.jack.server.router.ContentTypeRouter.handle(ContentTypeRouter.java:82)
at com.android.jack.server.router.ContentTypeRouter.handle(ContentTypeRouter.java:82)
at com.android.jack.server.router.ContentTypeParameterRouter.handle(ContentTypeParameterRouter.java:84)
at com.android.jack.server.router.ContentTypeRouter.handle(ContentTypeRouter.java:82)
at com.android.jack.server.router.ContentTypeRouter.handle(ContentTypeRouter.java:82)
at com.android.jack.server.router.MethodRouter.handle(MethodRouter.java:67)
at com.android.jack.server.router.RootContainer.handle(RootContainer.java:49)
at org.simpleframework.http.core.RequestDispatcher.dispatch(RequestDispatcher.java:121)
at org.simpleframework.http.core.RequestDispatcher.run(RequestDispatcher.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

Internal compiler error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by [email protected])).
Warning: This may have produced partial or corrupted output.
make: *** [build/core/java.mk:731: /home/sagar/aosip/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex] Error 41
make: *** Waiting for unfinished jobs....

#### make failed to build some targets (07:10:42 (hh:mm:ss)) ####
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
5,565
5,313
Sydney
Is this method correct?

I was just checking if the following is an acceptable method of doing what I need to do, or if it was a "kludge". It appears to work.

I am trying to include a pre-built APK from a Nougat ROM into my Marshmallow build. If I do it another way, the process attempts to ODEX the APK which fails (and stops the build). From my understanding this process was changed between MM and N.

The APK I am including is Jello from 14.1 into my 13.0 build. The changes I have made (apart from removing the other browser(s)) are:

1. To vendor/cm/config/common.mk i have added the lines:
Code:
# Copy Jelly
PRODUCT_PACKAGES += \
    Jelly

2. Created a folder "packages/apps/Jelly" in which I placed the "Jelly.apk" and an "Android.mk" file made up of:
Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# Copies Jelly.apk to /system/app/Jelly
LOCAL_MODULE := Jelly
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
#LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)/$(LOCAL_MODULE)
# tell dexopt not to try resigning the apk
LOCAL_CERTIFICATE := PRESIGNED

include $(BUILD_PREBUILT)

As I said, the above appears to do what I want (I have yet to flash and test one of my builds), but it may be a Kludge so was just checking if there is a better/correct way to do the above?
 

lightwars

Senior Member
Oct 19, 2010
240
220
Wuppertal
ZTE Blade S6
I spent few more hours in resolving this : https://forum.xda-developers.com/ch...android-rom-development-t2814763/post72472396

Came to know that
If I can
1)Skip recovery building (not sure how safe it is)
OR
2)Make device tree compatible with aosp recovery
2nd method differed from device to device
So can anyone tell me how can I exclude recovery from getting built ? And is it safe ?

Thanks

Hey, if you want to exclude building recovery add "TARGET_NO_RECOVERY := true" to your BoardConfig.mk.
This should not build recovery for you or attempt to create a patch, this is the point where your build breaks, but I dunno, cause I havent used that flag before.

In my opinion the error says your set sizes for boot and recovery differs, if I look at your BoardConfig.mk the values really differs. Try setting them the same size and see if error is resolved.
 

ABSathe

Senior Member
Aug 4, 2016
437
458
Pune
Hey, if you want to exclude building recovery add "TARGET_NO_RECOVERY := true" to your BoardConfig.mk.
This should not build recovery for you or attempt to create a patch, this is the point where your build breaks, but I dunno, cause I havent used that flag before.

In my opinion the error says your set sizes for boot and recovery differs, if I look at your BoardConfig.mk the values really differs. Try setting them the same size and see if error is resolved.
Thanks for the flag !
I'll try that
Regarding the mismatched sizes of boot and recovery :
I took those sizes from lineageos official device tree and they are not equal even in the official tree ... I haven't tried building lineage with those trees .. But a lot of users say that they built lineage successfully with those trees ... So I guess the mismatched sizes are fine !

Thanks for that flag again ! I'll try that
 

Jamie_oppo

Senior Member
Sep 21, 2016
1,386
391
Sydney

Attachments

  • Screenshot_20170531-210022.png
    Screenshot_20170531-210022.png
    194.1 KB · Views: 142

kaibsora

Senior Member
Nov 16, 2013
111
96
Fairdale
build error

So thanks to mzo i got it to start building past the kernel stage. now i get a sepolicy error when building. (see below)

Code:
[  0% 276/44270] build /home/kai/andro...ETC/sepolicy_intermediates/policy.conf
m4: device/qcom/sepolicy/common/atfwd.te: 17: deprecated: unix_socket_connect(atfwd, property, init) Please use set_prop(atfwd, <property name>) instead.
m4: device/qcom/sepolicy/common/cameraserver.te: 49: deprecated: unix_socket_connect(cameraserver, property, init) Please use set_prop(cameraserver, <property name>) instead.
m4: device/qcom/sepolicy/common/cnd.te: 44: deprecated: unix_socket_connect(cnd, property, init) Please use set_prop(cnd, <property name>) instead.
m4: device/qcom/sepolicy/common/dpmd.te: 39: deprecated: unix_socket_connect(dpmd, property, init) Please use set_prop(dpmd, <property name>) instead.
m4: device/qcom/sepolicy/common/fidodaemon.te: 21: deprecated: unix_socket_connect(fidodaemon, property, init) Please use set_prop(fidodaemon, <property name>) instead.
m4: device/qcom/sepolicy/common/ims.te: 41: deprecated: unix_socket_connect(ims, property, init) Please use set_prop(ims, <property name>) instead.
m4: device/qcom/sepolicy/common/init_shell.te: 109: deprecated: unix_socket_connect(qti_init_shell, property, init) Please use set_prop(qti_init_shell, <property name>) instead.
m4: device/qcom/sepolicy/common/logdumpd.te: 34: deprecated: unix_socket_connect(logdumpd, property, init) Please use set_prop(logdumpd, <property name>) instead.
m4: device/qcom/sepolicy/common/mm-pp-daemon.te: 59: deprecated: unix_socket_connect(mm-pp-daemon, property, init) Please use set_prop(mm-pp-daemon, <property name>) instead.
m4: device/qcom/sepolicy/common/mm-qcamerad.te: 65: deprecated: unix_socket_connect(mm-qcamerad, property, init) Please use set_prop(mm-qcamerad, <property name>) instead.
m4: device/qcom/sepolicy/common/mmi.te: 31: deprecated: unix_socket_connect(mmi, property, init) Please use set_prop(mmi, <property name>) instead.
m4: device/qcom/sepolicy/common/mpdecision.te: 44: deprecated: unix_socket_connect(mpdecision, property, init) Please use set_prop(mpdecision, <property name>) instead.
m4: device/qcom/sepolicy/common/netmgrd.te: 35: deprecated: unix_socket_connect(netmgrd, property, init) Please use set_prop(netmgrd, <property name>) instead.
m4: device/qcom/sepolicy/common/qseecomd.te: 59: deprecated: unix_socket_connect(tee, property, init) Please use set_prop(tee, <property name>) instead.
m4: device/qcom/sepolicy/common/qseeproxy.te: 53: deprecated: unix_socket_connect(qseeproxy, property, init) Please use set_prop(qseeproxy, <property name>) instead.
m4: device/qcom/sepolicy/common/ridl.te: 79: deprecated: unix_socket_connect(RIDL, property, init) Please use set_prop(RIDL, <property name>) instead.
m4: device/qcom/sepolicy/common/rmt_storage.te: 25: deprecated: unix_socket_connect(rmt_storage, property, init) Please use set_prop(rmt_storage, <property name>) instead.
m4: device/qcom/sepolicy/common/usb_uicc_daemon.te: 14: deprecated: unix_socket_connect(usb_uicc_daemon, property, init) Please use set_prop(usb_uicc_daemon, <property name>) instead.
m4: device/qcom/sepolicy/common/usf.te: 31: deprecated: unix_socket_connect(usf, property, init) Please use set_prop(usf, <property name>) instead.
m4: device/qcom/sepolicy/common/wcnss_service.te: 7: deprecated: unix_socket_connect(wcnss_service, property, init) Please use set_prop(wcnss_service, <property name>) instead.
m4: device/qcom/sepolicy/common/wfdservice.te: 46: deprecated: unix_socket_connect(wfdservice, property, init) Please use set_prop(wfdservice, <property name>) instead.
m4: device/qcom/sepolicy/test/fidotest.te: 4: deprecated: unix_socket_connect(fidotest, property, init) Please use set_prop(fidotest, <property name>) instead.
m4: device/qcom/sepolicy/test/qseeproxysample.te: 31: deprecated: unix_socket_connect(qseeproxysample, property, init) Please use set_prop(qseeproxysample, <property name>) instead.
m4: device/motorola/clark/sepolicy/adspd.te: 5: deprecated: unix_socket_connect(adspd, property, init) Please use set_prop(adspd, <property name>) instead.
m4: device/motorola/clark/sepolicy/wcnss_filter.te: 1: deprecated: unix_socket_connect(wcnss_filter, property, init) Please use set_prop(wcnss_filter, <property name>) instead.
[  0% 322/44270] host C: libsepol <= /...epol_intermediates/cil/src/cil_lexer.c
/home/kai/android/nougat/out/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/cil/src/cil_lexer.c:1593:1: warning: function 'yy_fatal_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
1 warning generated.
[  0% 330/44270] host C: libsepol <= e...nal/selinux/libsepol/cil/src/cil_mem.c
external/selinux/libsepol/cil/src/cil_mem.c:109:7: warning: implicit declaration of function 'vasprintf' is invalid in C99 [-Wimplicit-function-declaration]
        rc = vasprintf(strp, fmt, ap);
             ^
1 warning generated.
[  0% 355/44270] build /home/kai/andro...bj/ETC/sepolicy_intermediates/sepolicy
FAILED: /bin/bash -c "(/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf ) && (/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates//sepolicy.dontaudit /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf.dontaudit ) && (/home/kai/android/nougat/out/host/linux-x86/bin/sepolicy-analyze /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then 		echo \"==========\" 1>&2; 		echo \"ERROR: permissive domains not allowed in user builds\" 1>&2; 		echo \"List of invalid domains:\" 1>&2; 		cat /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2; 		exit 1; 		fi ) && (mv /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy )"
device/motorola/clark/sepolicy/wpa.te:3:ERROR 'unknown type sudaemon' at token ';' on line 40028:
allow wpa sudaemon:unix_dgram_socket sendto;
allow wpa rild:unix_dgram_socket sendto;
checkpolicy:  error(s) encountered while parsing configuration
/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy:  loading policy configuration from /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (01:19 (mm:ss)) ####

[email protected]:~/android/nougat$
 

Garv Maggu

Senior Member
Dec 21, 2014
345
512
Delhi NCR
I successfully compiled Resurrection Remix 5.8.3 for my device Moto G5 Plus. Successfully booted it but the only bug is camera and flashlight, it's not working and always showing error while opening an application that uses camera (Snapchat, WhatsApp, Open Camera etc). I tried recompiling it also but the it is the same. The compiling went without a single error. I used intact Resurrection Remix rom source and my intact Lineage OS Device tree without making even a single change and whole compiling completed without even a single error but still camera and flashlight are not working.

Tree - https://github.com/boulzordev/android_device_motorola_potter
Kernel - https://github.com/boulzordev/android_kernel_motorola_msm8953
Vendor - https://github.com/boulzordev/android_vendor_motorola_potter

Any ideas what to do and how to fix it?
 
Last edited:

martinusbe

Recognized Developer
Jun 18, 2011
2,193
6,115
53
Belgium / Flanders
martins-sclc.blogspot.com
So thanks to mzo i got it to start building past the kernel stage. now i get a sepolicy error when building. (see below)

Code:
[  0% 276/44270] build /home/kai/andro...ETC/sepolicy_intermediates/policy.conf
m4: device/qcom/sepolicy/common/atfwd.te: 17: deprecated: unix_socket_connect(atfwd, property, init) Please use set_prop(atfwd, <property name>) instead.
m4: device/qcom/sepolicy/common/cameraserver.te: 49: deprecated: unix_socket_connect(cameraserver, property, init) Please use set_prop(cameraserver, <property name>) instead.
m4: device/qcom/sepolicy/common/cnd.te: 44: deprecated: unix_socket_connect(cnd, property, init) Please use set_prop(cnd, <property name>) instead.
m4: device/qcom/sepolicy/common/dpmd.te: 39: deprecated: unix_socket_connect(dpmd, property, init) Please use set_prop(dpmd, <property name>) instead.
m4: device/qcom/sepolicy/common/fidodaemon.te: 21: deprecated: unix_socket_connect(fidodaemon, property, init) Please use set_prop(fidodaemon, <property name>) instead.
m4: device/qcom/sepolicy/common/ims.te: 41: deprecated: unix_socket_connect(ims, property, init) Please use set_prop(ims, <property name>) instead.
m4: device/qcom/sepolicy/common/init_shell.te: 109: deprecated: unix_socket_connect(qti_init_shell, property, init) Please use set_prop(qti_init_shell, <property name>) instead.
m4: device/qcom/sepolicy/common/logdumpd.te: 34: deprecated: unix_socket_connect(logdumpd, property, init) Please use set_prop(logdumpd, <property name>) instead.
m4: device/qcom/sepolicy/common/mm-pp-daemon.te: 59: deprecated: unix_socket_connect(mm-pp-daemon, property, init) Please use set_prop(mm-pp-daemon, <property name>) instead.
m4: device/qcom/sepolicy/common/mm-qcamerad.te: 65: deprecated: unix_socket_connect(mm-qcamerad, property, init) Please use set_prop(mm-qcamerad, <property name>) instead.
m4: device/qcom/sepolicy/common/mmi.te: 31: deprecated: unix_socket_connect(mmi, property, init) Please use set_prop(mmi, <property name>) instead.
m4: device/qcom/sepolicy/common/mpdecision.te: 44: deprecated: unix_socket_connect(mpdecision, property, init) Please use set_prop(mpdecision, <property name>) instead.
m4: device/qcom/sepolicy/common/netmgrd.te: 35: deprecated: unix_socket_connect(netmgrd, property, init) Please use set_prop(netmgrd, <property name>) instead.
m4: device/qcom/sepolicy/common/qseecomd.te: 59: deprecated: unix_socket_connect(tee, property, init) Please use set_prop(tee, <property name>) instead.
m4: device/qcom/sepolicy/common/qseeproxy.te: 53: deprecated: unix_socket_connect(qseeproxy, property, init) Please use set_prop(qseeproxy, <property name>) instead.
m4: device/qcom/sepolicy/common/ridl.te: 79: deprecated: unix_socket_connect(RIDL, property, init) Please use set_prop(RIDL, <property name>) instead.
m4: device/qcom/sepolicy/common/rmt_storage.te: 25: deprecated: unix_socket_connect(rmt_storage, property, init) Please use set_prop(rmt_storage, <property name>) instead.
m4: device/qcom/sepolicy/common/usb_uicc_daemon.te: 14: deprecated: unix_socket_connect(usb_uicc_daemon, property, init) Please use set_prop(usb_uicc_daemon, <property name>) instead.
m4: device/qcom/sepolicy/common/usf.te: 31: deprecated: unix_socket_connect(usf, property, init) Please use set_prop(usf, <property name>) instead.
m4: device/qcom/sepolicy/common/wcnss_service.te: 7: deprecated: unix_socket_connect(wcnss_service, property, init) Please use set_prop(wcnss_service, <property name>) instead.
m4: device/qcom/sepolicy/common/wfdservice.te: 46: deprecated: unix_socket_connect(wfdservice, property, init) Please use set_prop(wfdservice, <property name>) instead.
m4: device/qcom/sepolicy/test/fidotest.te: 4: deprecated: unix_socket_connect(fidotest, property, init) Please use set_prop(fidotest, <property name>) instead.
m4: device/qcom/sepolicy/test/qseeproxysample.te: 31: deprecated: unix_socket_connect(qseeproxysample, property, init) Please use set_prop(qseeproxysample, <property name>) instead.
m4: device/motorola/clark/sepolicy/adspd.te: 5: deprecated: unix_socket_connect(adspd, property, init) Please use set_prop(adspd, <property name>) instead.
m4: device/motorola/clark/sepolicy/wcnss_filter.te: 1: deprecated: unix_socket_connect(wcnss_filter, property, init) Please use set_prop(wcnss_filter, <property name>) instead.
[  0% 322/44270] host C: libsepol <= /...epol_intermediates/cil/src/cil_lexer.c
/home/kai/android/nougat/out/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/cil/src/cil_lexer.c:1593:1: warning: function 'yy_fatal_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
1 warning generated.
[  0% 330/44270] host C: libsepol <= e...nal/selinux/libsepol/cil/src/cil_mem.c
external/selinux/libsepol/cil/src/cil_mem.c:109:7: warning: implicit declaration of function 'vasprintf' is invalid in C99 [-Wimplicit-function-declaration]
        rc = vasprintf(strp, fmt, ap);
             ^
1 warning generated.
[  0% 355/44270] build /home/kai/andro...bj/ETC/sepolicy_intermediates/sepolicy
FAILED: /bin/bash -c "(/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf ) && (/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates//sepolicy.dontaudit /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf.dontaudit ) && (/home/kai/android/nougat/out/host/linux-x86/bin/sepolicy-analyze /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then 		echo \"==========\" 1>&2; 		echo \"ERROR: permissive domains not allowed in user builds\" 1>&2; 		echo \"List of invalid domains:\" 1>&2; 		cat /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2; 		exit 1; 		fi ) && (mv /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy.tmp /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/sepolicy )"
device/motorola/clark/sepolicy/wpa.te:3:ERROR 'unknown type sudaemon' at token ';' on line 40028:
allow wpa sudaemon:unix_dgram_socket sendto;
allow wpa rild:unix_dgram_socket sendto;
checkpolicy:  error(s) encountered while parsing configuration
/home/kai/android/nougat/out/host/linux-x86/bin/checkpolicy:  loading policy configuration from /home/kai/android/nougat/out/target/product/clark/obj/ETC/sepolicy_intermediates/policy.conf
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (01:19 (mm:ss)) ####

[email protected]:~/android/nougat$
just remove or comment the sudaemon line in wpa.te
 

lightwars

Senior Member
Oct 19, 2010
240
220
Wuppertal
ZTE Blade S6
Guys we need professional help over at the oppo f1f forums.
This picture basically explains the problem. (To do wit backlight in kernel)

I'm working on getting LOS14.1 running on my device, at first backlight brightness was set to its maxmium value after booting. Then I noticed the lights.msm8916.so was missing in system/lib/hw. After I placed and old lib lights there and rebooted, the backlight was controllable.

So have you checked if the lib is missing or are there any changes comming from cm-13.0 to cm-14.1? Have you tried replacing the lights.msm8916.so with an older working one from cm-13.0?
If the lib is correct maybe the code in the kernel was altered.
 

Ozadroid

Senior Member
Oct 19, 2011
952
544
So I am building AOSP with kernel from source.

But I am getting stuck with this error:
Code:
ninja: error: 'out/target/product/cancro/kernel', needed by 'out/target/product/cancro/boot.img', missing and no known rule to make it
06:01:43 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1

This is my local_manifest:
Code:
<project path="device/xiaomi/cancro" name="mi3-dev/android_device_xiaomi_cancro" remote="github" revision="mnc-dev"/>
<project path="device/xiaomi/cancro/common" name="mi3-dev/android_device_xiaomi_msm8974-common" remote="github" revision="lollipop-mr1"/>
<project path="vendor/xiaomi/cancro" name="mi3-dev/proprietary_vendor_xiaomi" remote="github" revision="mnc-dev"/>
<project path="kernel/xiaomi/cancro" name="mi3-dev/android_kernel_xiaomi_msm8x74pro" remote="github" revision="lollipop-mr1"/>

When I start make, It calls my 'build/core/main.mk', which then calls my 'config.mk via 'include $(BUILD_SYSTEM)/config.mk which then calls 'envsetup.mk via 'include $(BUILD_SYSTEM)/envsetup.mk'.

Then in envsetup.mk it tries to find the BoardConfig.mk via:
Code:
board_config_mk := \
	$(strip $(sort $(wildcard \
		$(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
		$(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
		$(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
	)))
ifeq ($(board_config_mk),)
  $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
endif
ifneq ($(words $(board_config_mk)),1)
  $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
endif
include $(board_config_mk)

BoardConfig is in /device/xiaomi/cancro/BoardConfig.mk which it should find from the above piece of code and call for BoardConfigCommon.mk from BoardConfig via include device/xiaomi/cancro/common/BoardConfigCommon.mk.

BoardConfigCommon contains the kernel headers:
Code:
COMMON_PATH := device/xiaomi/cancro/common

TARGET_BOARD_KERNEL_HEADERS := $(COMMON_PATH)/kernel-headers

After processing BoardConfigCommon.mk it comes back to BoardConfig.mk and calls include vendor/xiaomi/cancro/cancro/BoardConfigVendor.mk which says the comment and nothing else:
Code:
# This file is generated by device/xiaomi/cancro/setup-makefiles.sh

After this I am lost.

The thing is, I think the error that I am getting is being generated from '/Kernel/xiaomi/cancro/AndroidKernel.mk
Code:
#Android makefile to build kernel as a part of Android Build
PERL		= perl

KERNEL_TARGET := $(strip $(INSTALLED_KERNEL_TARGET))
ifeq ($(KERNEL_TARGET),)
INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
endif

But I cannot reference AndroidKernel.mk to be called from anywhere after BoardConfig.mk above.

Please someone help me to rectify this.
 

MZO

Senior Member
Jan 5, 2015
1,878
2,185
So I am building AOSP with kernel from source.

But I am getting stuck with this error:
Code:
ninja: error: 'out/target/product/cancro/kernel', needed by 'out/target/product/cancro/boot.img', missing and no known rule to make it
06:01:43 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1

This is my local_manifest:
Code:
<project path="device/xiaomi/cancro" name="mi3-dev/android_device_xiaomi_cancro" remote="github" revision="mnc-dev"/>
<project path="device/xiaomi/cancro/common" name="mi3-dev/android_device_xiaomi_msm8974-common" remote="github" revision="lollipop-mr1"/>
<project path="vendor/xiaomi/cancro" name="mi3-dev/proprietary_vendor_xiaomi" remote="github" revision="mnc-dev"/>
<project path="kernel/xiaomi/cancro" name="mi3-dev/android_kernel_xiaomi_msm8x74pro" remote="github" revision="lollipop-mr1"/>

When I start make, It calls my 'build/core/main.mk', which then calls my 'config.mk via 'include $(BUILD_SYSTEM)/config.mk which then calls 'envsetup.mk via 'include $(BUILD_SYSTEM)/envsetup.mk'.

Then in envsetup.mk it tries to find the BoardConfig.mk via:
Code:
board_config_mk := \
$(strip $(sort $(wildcard \
$(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
$(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
$(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
)))
ifeq ($(board_config_mk),)
  $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
endif
ifneq ($(words $(board_config_mk)),1)
  $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
endif
include $(board_config_mk)

BoardConfig is in /device/xiaomi/cancro/BoardConfig.mk which it should find from the above piece of code and call for BoardConfigCommon.mk from BoardConfig via include device/xiaomi/cancro/common/BoardConfigCommon.mk.

BoardConfigCommon contains the kernel headers:
Code:
COMMON_PATH := device/xiaomi/cancro/common

TARGET_BOARD_KERNEL_HEADERS := $(COMMON_PATH)/kernel-headers

After processing BoardConfigCommon.mk it comes back to BoardConfig.mk and calls include vendor/xiaomi/cancro/cancro/BoardConfigVendor.mk which says the comment and nothing else:
Code:
# This file is generated by device/xiaomi/cancro/setup-makefiles.sh

After this I am lost.

The thing is, I think the error that I am getting is being generated from '/Kernel/xiaomi/cancro/AndroidKernel.mk
Code:
#Android makefile to build kernel as a part of Android Build
PERL= perl

KERNEL_TARGET := $(strip $(INSTALLED_KERNEL_TARGET))
ifeq ($(KERNEL_TARGET),)
INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
endif

But I cannot reference AndroidKernel.mk to be called from anywhere after BoardConfig.mk above.

Please someone help me to rectify this.
Is your kernel path correct?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 443
    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 the open-source operating system used for smartphones. Full Freedom for people using it :D


    What is Android Source Code?

    Android is an open-source software stack created for a wide array of devices with different form factors. The primary purposes of Android are to create an open software platform available for carriers, OEMs, and developers to make their innovative ideas a reality and to introduce a successful, real-world product that improves the mobile experience for users.The result is a full, production-quality consumer product with source code open for customization and porting.
    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 ?
    The Android ROM is the Android operating system. This is the User interface (Sense UI in HTC phones) and the file system for maintaining contacts etc. It is composed of a Linux kernel and various add-ons to achieve specific functionality.

    What does a Android Rom Contain ?
    Basically a Android Rom Contains following main things :
    · Kernel
    · Bootloader
    · Recovery
    · Radio
    · Framework
    · Apps
    · core
    · android-runtime,Etc


    Some Basics About Above Terms

    Kernel :
    A kernel is critical component of the Android and all operating systems. It can be seen as a sort of bridge between the applications and the actual hardware of a device. 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. So basically if any instruction is given to mobile it first gives the command to kernel for the particular task execution.

    Bootloader :

    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. So basically it commands the kernel of your device to Boot the Device properly without any issues. So careful with bootloader since it can mess things very badly.

    Recovery :

    [FONT=&quot]Recovery is defined in simple terms as a source of backup. Whenever your phone firmware is corrupted, the recovery does the job in helping you to restore or repair your faulty or buggy firmware into working condition. It is also used for flashing the Rom’s , kernel and many more things.

    [/FONT]
    Radio[FONT=&quot]
    [/FONT]

    The lowest part of software layer is the radio: this is the very first thing that runs, just before the bootloader. It control all wireless communication like GSM Antenna, GPS etc.


    These are main parts of Android Operating System.

    [FONT=&quot]Now has we know what is Android and What it contains lets move to the Next major step. That is Android Rom Development from Source. But before starting this we need some Initial Setup and development Enviroment .[/FONT]

    Android Rom Development

    Setting Up Linux Enviroment




    Pre – Requirements for Android Rom Development.
    1) Linux Operating System ( I will take Ubuntu 13.10 has Example and also recommend you all)
    2) Java Development Kit (JDK)
    3) Some Tools.

    Once you Download Ubuntu 13.10 you can Install it in 2 ways :
    1) Installing has primary OS
    2) Installing Inside the Windows ( Using VM or VB)
    3) Dual booting Linux alongside Windows. ( Using different Partitions )


    Here I will explain how to Install Linux inside Windows. You can use VirtualBox (Free) or VM Workstation/Player (Paid) Softwares. In this guide I will take example of Virtual Box.

    Pre-requirements

    1) Windows 7 64 bit
    2) Download Virtual Box.
    3) Install the VirtualBox
    4) See that JDK is installed before installing VirtualBox
    5) Ubuntu 13.10 ISO file ( Download it)

    Installing Ubuntu 13.10 In VirtualBox
    I will be using 2 words.
    Guest : Operating System in Virtual Box 64 bit
    Host : Windows 7 .


    Note : Since we need to Install Ubuntu 64bit version Intel VT-x should be enabled else you will not be able to install 64bit. Your processor should support that feature.
    Enabling VT-x.
    1) ShutDown PC.
    2) Boot into SetUp Menu (Bios Settings)
    3) Go to Advanced --> Advanced Processor Options --> Intel(R) Virtualization Technology.
    4) Enable it.
    5) Save the settings.
    6) Reboot

    Installation of Ubuntu 13.10 64bit


    1) Open VirtualBox.

    2) Click on New button



    M3QKn8t.png


    ·3) [FONT=&quot]Type the Name you want to give to this OS which will displayed everytime you open VirtualBox.

    qw7keQx.png


    b6ACrTD.png


    [/FONT] 4) Now you have to set the amount of RAM you want to allocate for your Guest OS. Now this is tricky and Dangerous part. Hey don’t worry !! Its simple :D I will explain this with a simple Example : Think that your PC has 10GB of RAM installed and you have Windows 7 64bit OS (Which u need off course :p ) Now out of 10GB of RAM 4Gb will be needed for your Host to work smoothly. The remaining 6GB can be allotted to work for Virtual Box Guest OS. Now you may have a question in your mind why so much RAM is needed while VB can run in 1 GB too?
    The Answer for this simple that has the RAM for Guest Increases your ROM compiling/building speed too increases drastically. That is the reason RAM is needed a bit more here.
    Now In VirtualBox you can see that green dotted line ending with red dotted line showing how much RAM you are allocating NEVER EVER CROSS GREEN LINE TO RED DOING SO CAN CRASH YOUR PC HAS IT IS THE SAME LIMIT FOR THE WINDOWS TO WORK. SO CAREFULL. It is the Max Amount of Ram you can allocate to VB. But always keep pointer 2 dotes below the RED to Be on safer side. After setting click Next.

    FRx9MXi.png


    5) Now here you have to create virtual drive for you Linux OS and its Files. It’s same has Hard Disk for your Windows PC.Were Linux is installed and RUN.Now click on Create New Virtual Hard Drive Now and click Create button.
    · You will get various formats of Virtual Drives. Always select VMDK Since it is supported by other Softwares like VM Workstation (Paid) . Click Next.


    ED0PEO1.png


    jLe0HkX.png


    · 6) Now you will get a option to select Dynamically Allocated or Fixed Size. Select Dynamically Allocated and don’t tick Split into files option has it will mess everything.


    EtrNQrT.png


    7) Enter the Amount of HDD Space you want to allocate to Virtual Hard Disk. Remember the same amount of space should be there in our Physical hard disk of PC too. (Example : If you select 200GB than your physical drive should have atleast 220GB free storage) . Minimum storage for Virtual Drive for the Android Building is 100GB but I recommend you to keep above 150GB. You will come to know why later. Select the folder/drive in your physical drive were you want to store Virtual hard drive (VMDK) in your physical hard disk of PC.

    YJci8mw.png


    Q183qwt.png


    8) Now click on Settings and Go To System a Processor Now in Processor Drag the Pointer to End of green line That it specifies the no of Cores you want to allocate to Guest OS. It doesn’t effect to host…:D:D In my case its 2.:eek:

    RIODIn7.png


    ·9) Now go to Acceleration tab next to Processor Tab and Tick Both.


    KAbCX0n.png



    10) Now go to the Settings à Storage à Click on Controller: IDE à next to Click on small CD with + icon mark.

    d9Yddtw.png


    · 11) Navigate to Ubuntu 13.10 64 Bit ISO and select it.


    5thCPCd.png


    S4bxR0b.png




    12) Now go to settings --> System --> boot order --> change it CD/DVD First. ( Or you can directly start the system and press F12 select CD/DVD either will work fine)

    SZldi0e.png


    13) Now Click Start Button to start VirtualBox Guest .
    14) Once Ubuntu Starts you can see following screen with 2 option here you can either test or Install just click Install button to start Installation Process.


    AFgMcaI.png


    · 15)Here It will show what things Ubuntu Requires is available or not and some updates and third party installs if you want you can select ( I never selected it) click continue Here It will show what things Ubuntu Requires is available or not and some updates and third party installs if you want you can select.

    85WlRAQ.png


    16) Here it will show how you want to install the Ubuntu let it be default has shown below since this is under VirtualBox. ( In Windows Dual Boot Different Procedure will be there which will be discussed in next part

    7gaHrqW.png


    17) Select Time Zone , keyboard layout .
    18) Enter the details required.


    VkZavut.png


    ufrVr8I.png



    19) Enter the details required.


    ynfGFTB.png


    20) It will ask to log in to Ubuntu one with Email Id just skip it and continue

    UCnqdks.png



    20) Installation Begins wait until it completes

    msCeMV7.png


    Hurrrray your Linux System is Ready


    271
    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
    236
    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 "[email protected]"
    git config --global user.name "Your Name"[/SIZE][/FONT]


    replace
    "[email protected]" 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
    181
    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:
    139
    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 "[email protected]"
    "[email protected]" = 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
    # Generating public/private rsa key pair.
    # Enter file in which to save the key (/home/you/.ssh/id_rsa):
    Press Enter.

    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.
    # 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 [email protected]
    Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com.
    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:
    • 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://forum.xda-developers.com/showthread.php?t=1877040