yashsingh1/xdaforums huggingface dataset:
[Android General] dargonswim:
Hello, compiling Havoc Oreo for MiPad 1 (mocha) i get the next error:

"==========" 1>&2;	echo "ERROR: permissive domains not allowed in user builds" 1>&2;	echo "List of invalid domains:" 1>&2;	cat /home/dargons10/havoc_o/out/target/product/mocha/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2;	exit 1;	fi ) && (mv /home/dargons10/havoc_o/out/target/product/mocha/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp /home/dargons10/havoc_o/out/target/product/mocha/obj/ETC/sepolicy.recovery_intermediates/sepolicy )"

device/xiaomi/mocha/sepolicy/debuggerd.te:2:ERROR 'unknown type debuggerd' at token ';' on line 36634:

allow debuggerd kernel:system module_request;

#line 1 "device/xiaomi/mocha/sepolicy/debuggerd.te"

checkpolicy: error(s) encountered while parsing configuration

/home/dargons10/havoc_o/out/host/linux-x86/bin/checkpolicy: loading policy configuration from /home/dargons10/havoc_o/out/target/product/mocha/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.conf

[ 32% 22711/69752] //external/selinux/libsepol:libsepol clang src/genusers.c [linux x86]

[ 32% 22712/69752] //external/selinux/libsepol:libsepol clang src/expand.c [linux x86]

[ 32% 22713/69752] //external/selinux/libsepol:libsepol clang src/link.c [linux x86]

ninja: build stopped: subcommand failed.

The first error is same but in other line.
[Android General] AlaskaLinuxUser:
That does seem pretty sweet! Being able to just build the system image would make things a lot easier! :good:

So, you are causing selinux policy issues. Your device tree is allowing something that should not be allowed, and it is letting you know that this will never be allowed to work.

A couple of questions:

- Have you ever built lineage os for your device? I ask because that is an important way to check if the tree you are using is worth while to be used..... E.g. of it was designed for lineage, does it actually build lineage? :confused:

- Second, there are a lot of custom ROMs out there. I priced that your past couple choices aex, omni, and havoc, are not the typical ROMs that a beginner should start with. Those ROMs have heavy caf influences and less support than lineage, aokp, and slimroms, etc. I think in your case it would be better to switch to lineage, get a successful build, and grow and learn from there. :good:

- Third, the idea behind these videos is to help you get started, so you learn how to find the answers on your own. Not for me to answer all your build errors. :D

So, my recommendation is to switch to lineage until you get a successful build. :cowboy:

To resolve your current issue, you need to search your device tree files and find the selinux policy causing that error, and either delete or modify it so it is proper. :good:
[Android General] dargonswim:
[Guide][Video Tutorial] How to build Custom ROMs and Kernel Modification![P,O,N,M,L]

the device tree was created by other developers unofficially for lineage, what happens with this tablet is that the cpu is nvidia tegra so current developers have ported blobs since nvidia shield, but have camera problems (do not work since nougat) and hardware acceleration (since oreo).

My idea is to continue the development of roms with stocks blobs, whose development is stopped since nougat, hence I have put device, kernel and vendor de lineage nougat. However in shield blobs we are already on our feet, but with the problems mentioned above. All developments are from unofficial developers.

Secondly, I thank you for telling me to start with lineage, in fact I'm trying to compile both at the same time, since havoc comes from lineage. In lineage oreo I get the same errors.

Third. I also thank you for all your videos and tutorials are very helpful for all of us. When I go to the thread is because I can not find a solution to the error found. I look first in google and try the solution found, sometimes it works (most cases) other not, and in the latter I go to your thread to try to fix it.

I show again my gratitude and admiration for sharing all his knowledge with us.

So what do you recommend? Continue with lineage oreo or try to create a tree from scratch following yours tutorials?

Thanks a lot
[Android General] AlaskaLinuxUser:
Okay, that makes more sense. I do appreciate that. I definement want to help, and I appreciate that you are searching first before coming here to ask. :good:

I am a little confused on a few points, though. Does it have lineage Oreo already? But when you try to build it the build fails? Or did it have nougat, and you are upgrading to Oreo?

I get the idea of the vendor/shield problem. Since that is unique to your device, and not something I am familiar with, you may need to contact or work with developers that are working on your device already, as I don't know what specifically you need for that device.

To get past the selinux errors, you could comment out all selinux lines in your device.mk and board config.mk files, and add androidboot.selinux=permissive to your kernel line. That should cut out all selinux errors for now, and you can slowly reimplement them once the build is working. :good:
[Android General] dargonswim:
Thank you for your answer. I will try to explain myself better.

For mipad there are two branches of development. One of them is android nougat with stock blobs, which is the one I want to continue because it doesn't have graphic acceleration or camera problems. I started directly by trying to compile from zero lineage oreo with device, vendor and kernel branch's nougat.

The other branch that is the current one implements blobs of nvidia shield tablet since the two tablets share CPU, but there is no graphic acceleration nor cameras.

Thanks for the help on selinux . I will try to apply it.

Again very grateful.
[Android General] Atifbaig786:
I got it to work.But I have 2 more Questions for you

1-Which Toolchain should I use currently I am using linaro 7.2.1 but there are a load of other (Give link if possible)

2-How to disable all werrors and warning being treated as errors

Thanks In advance.I am building nougat hlte after which I will build for Pixel 2 XL Yes I have built 2 kernels before with little to no errors and am very much confused about toolchains.The only mission I have is to add a few audio modifications a few patches.I built kernel for s4 then a Pixel.I am using Ubuntu on workstation that I borrowed.I can give you specs If you ask.
[Android General] reference2myself:
Hey I'm trying to build android pie on Arch Linux. First time trying to build android and I'm failing around 89% with this error. Any ideas? Any extra info I need to provide? I tried searching around, found answers for the previous errors I was getting, but can't figure this one out.

Hidden API: out/target/common/o...ES/android.test.base_intermediates/javalib.jar
FAILED: out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar
/bin/bash -c "(rm -f out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar ) && (cp "out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar" "out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar" ) && (rm -rf out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (unzip -q out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar 'classes*.dex' -d out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (find out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -name "classes*.dex" | sort | sed 's/^/--dex=/' | xargs out/host/linux-x86/bin/hiddenapi --light-greylist=out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt ) && (out/soong/host/linux-x86/bin/soong_zip -o out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -C out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -D out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (out/soong/host/linux-x86/bin/merge_zips -D -zipToNotStrip out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -stripFile "classes*.dex" out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar out/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar )"
xargs: out/host/linux-x86/bin/hiddenapi: terminated by signal 4
[Android General] reference2myself:
I have a nexus 6p, but I was just doing a generic arm64 build to see if I could even get it to build and test in the emulator as a start.

AOSP

Actually what I wanted to do was see if I could eventually build the ABC rom for my phone since it's looking like nobody is going to be building for my phone anymore once they switch to pie.

Yes I followed the arch wiki, using OpenJDK 8 and Python 2.7, had to rebuild flex too because the prebuilt one was giving me an error. I haven't been able to find any other guides for building with Arch.
[Android General] AlaskaLinuxUser:
I have an idea. One of the big problems is determining if your build is set up correctly or not, since it is through Arch. A good way to prove to yourself that Arch is set up properly and building properly, would be for you to build marlin, just like I did in my videos for building Android Pie. https://www.youtube.com/playlist?list=PLRJ9-cX1yE1m8k9gztsQnnXDg1G4X1f6z

If Marlin builds just like it did in my video series, then you will know that your system is set up properly. In the mean time, I am going to run a build of arm64 to see if it builds properly on my machine. Then we can compare notes. :good:
[Android General] reference2myself:
Haha, we were thinking the same thing. I'm actually in the middle of building 8.1 for my phone (angler) to see if that builds or if I get a similar problem. I'll try Marlin pie next. Thanks.
[Android General] dargonswim:
The truth is, I haven't tried nougat yet. I did it directly with oreo because the rom I liked is havoc and the source of this begins with oreo.

But I gladly accept your recommendation and will start compiling lineage nougat to see if everything works out correctly.

Thanks again
[Android General] ApeBut65F:
just a quick question to ask.. am I able to build a Custom ROM (my own) on 8.1.0.152 (C432)?

if yes, I would continue and use this excellent tutorial on how to make my own ROM.

I'm kinda stuck between LineageOS and ROMAur but I don't wanna use them Custom ROMs.. I tried both on a earlier version on my phone, and I ain't happy with it. I wanna expand my advantages on my phone.

thanks for the feedback
[Android General] AlaskaLinuxUser:
Welcome to the discussion.

Well, aosp numbers are actually revision numbers. For android 8.1, the highest revision is 48. This number: 8.1.0.152 (C432) is a vendor revision number that you can only get from the vendor ( like hawei or lg, or what ever the case may be ).

But yes, you can get the latest aosp if you would like and build that. Hope that helps! :good:
[Android General] AlaskaLinuxUser:
Okay, so I just build generic arm64 on AOSP android pie. The build completed with no errors, and required no intervention on my part, so I think your system is not quite set up correctly. I would recommend using virtual box and Ubuntu 14.04 (or a clean install of it), so you can follow my video guides. :good:
[Android General] AlaskaLinuxUser:
Just an FYI, new HD kernel modification videos are getting posted on YouTube and in the OP. This time I will be covering a 64 bit kernel in HD, as opposed to the last one which was a 32 bit kernel and the video quality was rather poor. Currently only 2 videos are available, but I am working on getting better audio so I can continue the series. Hopefully, I'll have that ready to go tomorrow, and I can continue recording. :good:
[Android General] Atifbaig786:
Thanks

Thanks man.I got worried for having a lot of Options.Currently I am using GCC 4.9 and Starting to figure out linaro.The main Difference between the two is That linaro runs smoother when I have low frequencies tuned in.Also GCC gives out less to no errors.
[Android General] AlaskaLinuxUser:
Just a quick update: the new 64 bit kernel modification videos are back under way! Today I added the Darkness gov to the BLOX2. You can check out the vids or the commit here: https://gitlab.com/alaskalinuxuser/...mmit/f8bd467360c811fa51a9973a262db95e11b501c0

Next up is adding I/O schedulers. I also found some very interesting kernel mods in the redmi 3 section, so we will be taking a look at a few of those as well! :good:
[Android General] IvanHephaestus:
Hi AKLU, i tried to build havoc 2.0 for lenovo a6000 with msm8916 soc. everything is working expect media codecs. Can you tell me where should i search? Log https://pastebin.com/xHFiQkUa if you need any additional information i will share
[Android General] AlaskaLinuxUser:
You are not in the right place, but we are helpful here, so here are some thoughts for you :good:

- It is probably an issue with your key layout files.

Check out this video: https://www.youtube.com/watch?v=BzO-QgCx3Ts&index=21&t=0s&list=PLRJ9-cX1yE1nnhWBrZtuVz5YC2OPfQVVp

In that video, I talk about key layout files and how they work and where to put them.

I suspect that you need to load your old rom (or unzip one on the computer) and pull the keylayout files out and put them in where you need them to be on your new ported rom. Let me know if that works or not. I hope that helps and good work porting a rom! :highfive:

First, well done for building your own rom! :highfive:

Second, a few questions:

Do the media codecs fail for everything? or particular types of media?

Is it only certain apps, or any app? E.G., does the built in video app not play mp4 files, but VLC downloaded from the playstore does?

Does the camera take photos and record video?

Does screenrecording work?

Typically, you define codecs in two places, part in your build tree, and part in the hardware/media or media-caf folder. But often, your media codecs are built, but you need an xml file to tell your rom to use it on this phone.

For instance, in my device tree for the BLOX2 that I just built, I have this folder:

https://gitlab.com/alaskalinuxuser/android_device_blu_life_one_x2/tree/master/configs

Which has an xml file called media_codecs.xml

Do you have something similar?

Also, in your device.mk file you should install it with:

# Media
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/media_codecs.xml:system/etc/media_codecs.xml \
$(LOCAL_PATH)/configs/media_codecs_performance.xml:system/etc/media_codecs_performance.xml \
$(LOCAL_PATH)/configs/media_profiles.xml:system/etc/media_profiles.xml

PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml

How does that look in your device tree?

Hope that gets you pointed in the right direction! :good:

And for the group:

New Kernel modification videos are out! 64 bit kernel mods of adding i/o schedulers and overclocking GPU! Be sure to check them out if you have time! :D
[Android General] lucki1000:
Okay thanks, where's the right place to post this problem?

And if understand it right I must copy my stock ROM keylayout folder to the port ROM folder?
[Android General] AlaskaLinuxUser:
Great questions!

As for where to post, I'm not sure. Porting is not something I cover here, as this is about building from source. Don't worry, though, I'm not kicking you out! :D You are welcome to ask here. But for specific porting help, I'd recommend a thread that is about porting. Maybe something like this: https://xdaforums.com/showthread.php?t=1908008&page=327

or this: https://xdaforums.com/showthread.php?t=2769142

Yes, as far as I know, you can put the stock rom keylayout folder over the port rom keylayout folder. But again, I don't port roms, so I'm not 100% sure.

Hope that helps!
[Android General] lucki1000:
Thanks I will try it and I will look in this thread if I have still problems with that.

Thanks for the support.

---------- Post added at 10:20 PM ---------- Previous post was at 10:03 PM ----------

It still not working I have post my question in both threads and hope they can help me.
[Android General] IvanHephaestus:
Well, screenshot work, camera take photo but can't record video. I defined media codecs in device.mk but put them in system/vendor/etc and after copying codecs to system/etc nothing changed. Codec fail in youtube and telegram, but in chrome it works. And I have rom of one of my friend for the same device with the same soc with working codecs. What can I take from his rom to make my codecs work? Devica are mostly same. Only camera and ram capascity is different. And on android 8 everything was working fine, i got this fail after upgrade to 9
[Android General] dargonswim:
Good, after a while I continue to develop lineage oreo as well as lineage nougat for mocha.

In oreo after correcting some errors I find myself with the following one for which I can't find a solution:

" In file included from device/xiaomi/mocha/camera/Camera3Wrapper.cpp:22:

In file included from device/xiaomi/mocha/camera/CameraWrapper.h:22:

In file included from frameworks/av/camera/include/camera/Camera.h:22:

In file included from /home/dargons10/havoc_o/out/soong/.intermediates/frameworks/av/camera/libcamera_client/android_arm_armv7-a-neon_cortex-a15_shared_core/gen/aidl/android/hardware/ICameraService.h:4:

In file included from frameworks/av/camera/include/camera/android/hardware/ICamera.h:22:

frameworks/native/include/binder/Parcel.h:23:10: fatal error: 'android-base/unique_fd.h' file not found

#include <android-base/unique_fd.h>

^~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

[ 77% 53760/69753] target StaticLib: libwificond (/home/dargons10/havoc_o/out/target/product/mocha/obj/STATIC_LIBRARIES/libwificond_intermediates/libwificond.a)

[ 77% 53761/69753] target thumb C++: libvold <= system/vold/Utils.cpp

9 warnings generated.

Suppressed 10 warnings (5 in non-user code, 1 NOLINT, 4 with check filters).

Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 77% 53762/69753] target thumb C++: libdrmframework_jni <= frameworks/base/drm/jni/android_drm_DrmManagerClient.cpp

[ 77% 53763/69753] target thumb C++: libcamera2ndk <= frameworks/av/camera/ndk/NdkCameraManager.cpp

[ 77% 53764/69753] target thumb C++: libvold <= system/vold/Ext4Crypt.cpp

9 warnings generated.

Suppressed 9 warnings (5 in non-user code, 4 with check filters).

Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 77% 53765/69753] target thumb C++: libvold <= system/vold/KeyStorage.cpp

9 warnings generated.

Suppressed 9 warnings (5 in non-user code, 4 with check filters).

Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

ninja: build stopped: subcommand failed."

The unique_fd.h file is in the tree, so I don't understand why it tells me not found. The files of CameraWrapper too. I dont know if is PATH problem..

my unique_fd.h path is: system/core/base/include/android-base/

Note: I supose that the warnings, they have to fix when i compile completly the rom
[Android General] AlaskaLinuxUser:
You could change the line:

#include <android-base/unique_fd.h>

to be:

#include <[pathToGetThere]android-base/unique_fd.h>

For example:

#include <../../../../system/core/base/include/android-base/unique_fd.h>

Double check that it correct.

Which will work. However, there seems to be a problem in the includes to reach out to where it should go.
[Android General] dargonswim:
This fix it the problem. Now i have similar error, but i know how fix it. Thanks a lot
[Android General] Atifbaig786:
Just a Question.Can we compile a kernel for our device from another source.For example can I make a kernel from lge_hammerhead to Samsung_hlte considering they have identical hardware.And if not what changes would make this possible.
[Android General] AlaskaLinuxUser:
Great! Glad I could help! :good:

Yes and no. :D

No two phones have exactly identical hardware, but they may be really, really close. Most likely, you can build with the other kernel, but you will need to change things in the device tree as well. For instance, even with the same hardware, one may specify the naming convention of the partitions differently, causing partitions not to be found when you try to boot. That is just one of dozens of things that you would need to check.

Vendor files may also be an issue, since those are prebuilt, you can't easily change them, and would likely need to exchange a few of them from the other phone. Mainly things like graphics drivers for the screen, etc. Even with the same SoC, there may be other goodies in the phone that are not identical.

TL;DR

If you can flash the kernel and ROM from one phone to the other, and it boots, then you will likely be good to go. Most likely it will not, and you will have to edit a few things to make it work. :good:

It is with a try, especially because it is fun! ;)
[Android General] @vjnexus:
How to add customisation to aosp rom???
[Android General] IvanHephaestus:
AKLU i moved system/lib , system/vendor system/bin , system/etc system/media and vendor folders from working rom to my, but nothing changed, I still can't watch video, but i can record it with camera
[Android General] AlaskaLinuxUser:
Not sure what you want to customize with. Details would help me answer your question better.... ;)

I do have videos for adding apps to your ROM, and editing apps source code to change the words or colors or icons. I also have videos about adding your own boot animation and changing the default background. So you mean something like that? :good:
[Android General] AlaskaLinuxUser:
I'm not sure. It sounds like you have a codec issue being declared properly in your build tree. Without access to the phone in question, in not sure what the issue is. You may need to post in your phone's specific forum on XDA and ask for phone specific help. :confused:
[Android General] dargonswim:
I don't know why, but putting it there makes the compilation stop at the beginning:

"build/core/base_rules.mk:391: warning: ignoring old commands for target `/home/dargons10/havoc_o/out/target/product/mocha/system/lib/hw/lights.tegra.so'

ninja: error: /home/dargons10/havoc_o/out/soong/build.ninja:732424: multiple rules generate /home/dargons10/havoc_o/out/soong/ndk/sysroot/usr/include/android/rect.h [-w dupbuild=err]"
[Android General] AlaskaLinuxUser:
Hmmmmm..... Not sure. I think you will have to ask the Havoc ROM group.
[Android General] @vjnexus:
Add led function while charging

Changing navigation bar (smart bar)

Quick pull down

Pixel accent blue

can u tell me how to add these thing in aosp ROM
[Android General] Atifbaig786:
OK.What if I made the same changes to my device's kernel source?I am trying to build a Nethunter kernel with monitor mode support inside chroot.For which I require the hammerhead_nexmon_kernel.There is a Log of what changes were made to the kernel.What if I made the exact changes will my kernel source have the same functions.This way I don't have to stray further to replace device blobs,graphic drivers and the partition details.