Building Halium for Redmi 4a - Xiaomi Redmi 4a Questions & Answers

Hey guys,
I am trying to port halium and ubports on Redmi 4a (rolex). I am able to build hybris-boot but upon making system image i get the following error:
Code:
ninja: error: '/home/salik/Documents/halium/out/target/product/rolex/obj_arm/STATIC_LIBRARIES/[email protected]_intermediates/export_includes', needed by '/home/salik/Documents/halium/out/target/product/rolex/obj_arm/SHARED_LIBRARIES/camera.msm8937_intermediates/import_includes', missing and no known rule to make it
I tried adding empty files but there are a lot of files that depend on this [email protected]_intermediates library/framework. Is there any way to solve this besides adding empty files?
Regards!

Related

[Help] Trying to compile from source but getting error

I am trying to compile from froyo source and when I go to make the files I get this error "frameworks/policies/base/PolicyConfig.mk:22: *** No module defined for the given PRODUCT_POLICY (android.policy_phone). Stop.
" I can't figure out what I need to do in order to get this working. Any help would be appreciated. Thanks

Make errors...Error 41

Hey there, I'm compiling the android source with a couple of mods merged in from cyanogenmod and leonnib4. I was getting a few random errors, but they went away with simple fixes...Now, I'm getting a new error, and I can't seem to wrap my head around it. It happens almost right out of the gate...every time I type make...
EDIT: New error 41. I seemed to have fixed the old error 1 by removing the previous build from out/target/product/passion, as the error pointed to the obj folder. Everything went smooth until the camera, and now I have a new error. I'm trying to merge in CyanogenMod camera source (for 720p), and I think that's the problem. Could it be something in the framework? I'm lost.
I have set up my build env on a MacBook Pro running OS X 10.5.8 with all the proper tools installed as per the AOSP site's instructions. I have run the envsetup script, and chosen the passion lunch option (yum )...
Anyway, here's the error:
Code:
81 errors
make: *** [out/target/common/obj/APPS/Camera_intermediates/classes-full-debug.jar] Error 41
The full scenario on pastebin: http://pastebin.com/8359mktC
Does anyone have any idea what's going on?
ik this is really old but what did u do to fix this? having the same error compiling cm9

[Q] [Help] Porting Ubuntu Touch ti Xperia L

While trying to port Ubuntu touch to Xperia L(codename taoshan) using cm source code an compilation error is arising.
$host Executable: aprotoc (phablet/out/host/linux-x86/obj/EXECUTABLES/aprotoc_intermediates/aprotoc)
$phablet/out/host/linux-x86/obj/EXECUTABLES/aprotoc_intermediates/src/google/protobuf/compiler/parser.o: file not recognized: File truncated
$collect2: error: ld returned 1 exit status
$make: *** [phablet/out/host/linux-x86/obj/EXECUTABLES/aprotoc_intermediates/aprotoc] Error 1
After googling for a while, most of what I got is it's some kinda problem relating with OPENCV,although I've no idea what it is.
I've treid setting ANDROID_OPENCV=/media/vihit/227480fc-d7e5-4de2-ac02-18da54b81aac/android-sdk-linux/opencv-2.4.10/ but couldn't do further steps because most of them are related to QT projects. Does anyone have any idea what I can do?

Got error when compiling rom, Why?

Hi, I recently try compiling AOSPA rom, I tried following the instructions given by others but when I use
Code:
./rom-build.sh ghost
It firstly runs a lot of lines of commands but finally return
Code:
make: *** No rule to make target `bacon'. Stop.
I tried to use otatools and envsetup and lunch, but they seem don't work on me, can somebody help me? Thank you

Lenovo failing to provide working kernel sources that can be compiled for TB-8704F

On the Lenovo website, I have finally found source code for the kernel of the Lenovo Tab 4 8 Plus. I downloaded the source, made defconfig, and enabled KVM in the kernel and then compiled. I got several errors which couldn't be fixed. I wondered if this was the cause of KVM, so I disabled KVM and tried again. Same errors. Strange that the archive containing the sources for the Lenovo Tab 4 10 Plus is much larger than that of the Lenovo Tab 4 8 Plus, which suggests that the Tab 4 8 Plus sources are not complete yet they both have the same SoC. Shame on Lenovo! This is the last time I get a product from them unless things improve. When I went to complain on the forums, I couldn't even start a thread, even though I had logged in and had verified my email, which is why I'm complaining here. They're also violating the GPL. The Tab 4 series were released in 2017 yet only in 2019 has Lenovo started releasing the kernel source code, clearly a GPL violation. I wanted to start learning ROM development and possibly port Android Pie to the Tab 4 8 Plus but because of this I can't. I love my Tab 4 8 Plus and my Ideapad 310 laptop but I think I'm done with Lenovo after this unless things improve.
code_exec said:
Shame on Lenovo! This is the last time I get a product from them unless things improve. When I went to complain on the forums, I couldn't even start a thread, even though I had logged in and had verified my email, which is why I'm complaining here. They're also violating the GPL. The Tab 4 series were released in 2017 yet only in 2019 has Lenovo started releasing the kernel source code, clearly a GPL violation.
Click to expand...
Click to collapse
I completely agree with your opinion on Lenovo. However, cannot confirm the problem with their forum. Also, they would have published the kernel sources much sooner if someone had asked earlier - which doesn't excuse the fact that they should publish the kernels immediately on their own.
I asked for the kernel source for the 10 Plus and the 8 Plus and got both after a longer wait.
code_exec said:
On the Lenovo website, I have finally found source code for the kernel of the Lenovo Tab 4 8 Plus. I downloaded the source, made defconfig, and enabled KVM in the kernel and then compiled. I got several errors which couldn't be fixed. I wondered if this was the cause of KVM, so I disabled KVM and tried again. Same errors. Strange that the archive containing the sources for the Lenovo Tab 4 10 Plus is much larger than that of the Lenovo Tab 4 8 Plus, which suggests that the Tab 4 8 Plus sources are not complete yet they both have the same SoC.
Click to expand...
Click to collapse
This isn't right. Text can be compressed very well. You have to compare the sources after unpacking, the code of the 8 Plus is compressed twice and therefore much smaller. At first view the kernel looks ok. But I didn't compile it, so you can still be right with your error messages, but the size of an archive is not an argument.
To compare two directories I use the tool Meld.
code_exec said:
I wanted to start learning ROM development and possibly port Android Pie to the Tab 4 8 Plus but because of this I can't. I love my Tab 4 8 Plus and my Ideapad 310 laptop but I think I'm done with Lenovo after this unless things improve.
Click to expand...
Click to collapse
I started with rom development for the same reasons as you, only that I have the Tab4 10 Plus. I want to motivate you not to give up at this point. You have actually very good conditions to develop a working rom, because the Tab3 8 Plus has one or more device tree and kernel and you can use my work on the 10 Plus as well.
LumenReaper said:
I started with rom development for the same reasons as you, only that I have the Tab4 10 Plus. I want to motivate you not to give up at this point. You have actually very good conditions to develop a working rom, because the Tab3 8 Plus has one or more device tree and kernel and you can use my work on the 10 Plus as well.
Click to expand...
Click to collapse
Does the 10 Plus kernel work on the 8 Plus though?
code_exec said:
Does the 10 Plus kernel work on the 8 Plus though?
Click to expand...
Click to collapse
Not without adjustments.
The archive of the X704F contains build instructions from Lenovo and a working defconfig.
Compare the defconfig of the 10 Plus with your own. And as already said, compare the sources with Meld. I'm pretty sure you could get a working kernel out of it.
LumenReaper said:
Not without adjustments.
The archive of the X704F contains build instructions from Lenovo and a working defconfig.
Compare the defconfig of the 10 Plus with your own. And as already said, compare the sources with Meld. I'm pretty sure you could get a working kernel out of it.
Click to expand...
Click to collapse
Here's the actual error I get when compiling: https://pastebin.com/mJyei1Y9
code_exec said:
Here's the actual error I get when compiling: https://pastebin.com/mJyei1Y9
Click to expand...
Click to collapse
Can you send me your defconfig please? I will look into it but probably not today.
LumenReaper said:
Can you send me your defconfig please? I will look into it but probably not today.
Click to expand...
Click to collapse
It's just called defconfig and is located in arch/arm64/configs. The MSM ones appear to be for the Snapdragon 430 and not the Snapdragon 625 the Tab 4 8 Plus uses.
code_exec said:
Here's the actual error I get when compiling: https://pastebin.com/mJyei1Y9
Click to expand...
Click to collapse
interestingly, I get a different error:
HTML:
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC arch/arm64/mm/dma-mapping.o
In file included from ./arch/arm64/include/asm/dma-iommu.h:12:0,
from arch/arm64/mm/dma-mapping.c:33:
include/linux/dma-mapping-fast.h:46:15: warning: 'struct dma_iommu_mapping' declared inside parameter list
error, forbidden warning: dma-mapping-fast.h:46
scripts/Makefile.build:257: recipe for target 'arch/arm64/mm/dma-mapping.o' failed
make[1]: *** [arch/arm64/mm/dma-mapping.o] Error 1
Makefile:946: recipe for target 'arch/arm64/mm' failed
make: *** [arch/arm64/mm] Error 2
and using the kernel config extracted from the kernel in build 180906 for the TB-8704X (I don't have the tablet yet):
HTML:
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/net/ethernet/msm/rndis_ipa.o
In file included from drivers/net/ethernet/msm/rndis_ipa_trace.h:81:0,
from drivers/net/ethernet/msm/rndis_ipa.c:32:
include/trace/define_trace.h:83:43: fatal error: ./rndis_ipa_trace.h: No such file or directory
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^
compilation terminated.
scripts/Makefile.build:257: recipe for target 'drivers/net/ethernet/msm/rndis_ipa.o' failed
make[4]: *** [drivers/net/ethernet/msm/rndis_ipa.o] Error 1
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet/msm' failed
make[3]: *** [drivers/net/ethernet/msm] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Error 2
Makefile:946: recipe for target 'drivers' failed
make: *** [drivers] Error 2
I'll play with it some more when I get mine sometime next week and update it and extract the kernel config
I haven't had any luck playing with merging the TB-X704L and TB-8704X sources, still getting the same error.
Edit: I get the same error for the TB-X704L and TB-X704F.
Another edit: did a diff with the Pixel kernel:
HTML:
diff -ur tab48plus/drivers/net/ethernet/msm/rndis_ipa_trace.h msm/drivers/net/ethernet/msm/rndis_ipa_trace.h
--- tab48plus/drivers/net/ethernet/msm/rndis_ipa_trace.h 2017-05-02 05:06:34.000000000 +0100
+++ msm/drivers/net/ethernet/msm/rndis_ipa_trace.h 2019-04-08 13:21:43.806756700 +0100
@@ -77,5 +77,5 @@
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/msm
#include <trace/define_trace.h>
now I've gotten further, there's a lot of these errors
After fixing all the incorrect includes and adding the missing files, I have a kernel image
Edit: https://github.com/Phoenix09/android_kernel_lenovo_tb8704
 @code_exec: you should probably extract the config from your device and try building with this repo, I have no idea if any of the configs in the source are for this tablet.
Phoenix09 said:
interestingly, I get a different error:
HTML:
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC arch/arm64/mm/dma-mapping.o
In file included from ./arch/arm64/include/asm/dma-iommu.h:12:0,
from arch/arm64/mm/dma-mapping.c:33:
include/linux/dma-mapping-fast.h:46:15: warning: 'struct dma_iommu_mapping' declared inside parameter list
error, forbidden warning: dma-mapping-fast.h:46
scripts/Makefile.build:257: recipe for target 'arch/arm64/mm/dma-mapping.o' failed
make[1]: *** [arch/arm64/mm/dma-mapping.o] Error 1
Makefile:946: recipe for target 'arch/arm64/mm' failed
make: *** [arch/arm64/mm] Error 2
and using the kernel config extracted from the kernel in build 180906 for the TB-8704X (I don't have the tablet yet):
HTML:
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/net/ethernet/msm/rndis_ipa.o
In file included from drivers/net/ethernet/msm/rndis_ipa_trace.h:81:0,
from drivers/net/ethernet/msm/rndis_ipa.c:32:
include/trace/define_trace.h:83:43: fatal error: ./rndis_ipa_trace.h: No such file or directory
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^
compilation terminated.
scripts/Makefile.build:257: recipe for target 'drivers/net/ethernet/msm/rndis_ipa.o' failed
make[4]: *** [drivers/net/ethernet/msm/rndis_ipa.o] Error 1
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet/msm' failed
make[3]: *** [drivers/net/ethernet/msm] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Error 2
Makefile:946: recipe for target 'drivers' failed
make: *** [drivers] Error 2
I'll play with it some more when I get mine sometime next week and update it and extract the kernel config
I haven't had any luck playing with merging the TB-X704L and TB-8704X sources, still getting the same error.
Edit: I get the same error for the TB-X704L and TB-X704F.
Another edit: did a diff with the Pixel kernel:
HTML:
diff -ur tab48plus/drivers/net/ethernet/msm/rndis_ipa_trace.h msm/drivers/net/ethernet/msm/rndis_ipa_trace.h
--- tab48plus/drivers/net/ethernet/msm/rndis_ipa_trace.h 2017-05-02 05:06:34.000000000 +0100
+++ msm/drivers/net/ethernet/msm/rndis_ipa_trace.h 2019-04-08 13:21:43.806756700 +0100
@@ -77,5 +77,5 @@
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/msm
#include <trace/define_trace.h>
now I've gotten further, there's a lot of these errors
After fixing all the incorrect includes and adding the missing files, I have a kernel image
Edit: https://github.com/Phoenix09/android_kernel_lenovo_tb8704
@code_exec: you should probably extract the config from your device and try building with this repo, I have no idea if any of the configs in the source are for this tablet.
Click to expand...
Click to collapse
That GitHub repository lacks a defconfig for the TB-8704F (WiFi-only variant), which I have. Will the TB-8704X (LTE variant) kernel work on the TB-8704F out of the box without adjustments or will adjustments be needed for the kernel to boot? Also, how do I extract the defconfig from my device?
code_exec said:
That GitHub repository lacks a defconfig for the TB-8704F (WiFi-only variant), which I have. Will the TB-8704X (LTE variant) kernel work on the TB-8704F out of the box without adjustments or will adjustments be needed for the kernel to boot? Also, how do I extract the defconfig from my device?
Click to expand...
Click to collapse
it might work, I don't know.
to extract the config:
you'll need mkboot
backup boot with TWRP, transfer boot.img to PC
extract boot.img:
Code:
./mkbootimg_tools/mkboot boot.img boot
decompress kernel:
Code:
cd boot
zcat kernel > kernel.out
extract the config:
Code:
/path/to/kernel/source/scripts/extract-ikconfig kernel.out > defconfig.txt
Phoenix09 said:
it might work, I don't know.
to extract the config:
you'll need mkboot
backup boot with TWRP, transfer boot.img to PC
extract boot.img:
Code:
./mkbootimg_tools/mkboot boot.img boot
decompress kernel:
Code:
cd boot
zcat kernel > kernel.out
extract the config:
Code:
/path/to/kernel/source/scripts/extract-ikconfig kernel.out > defconfig.txt
Click to expand...
Click to collapse
I backed up boot to a microSD card in TWRP recovery. However, there are three files in the backup folder of the microSD: one called 'boot.emmc.win', one called 'boot.emmc.win.sha2', and one called 'recovery.log'
The first file could possibly contain boot.img, but how do I extract it? The second one contains a SHA2 checksum for the first file. The third one is a more detailed log of what was happening in TWRP.
EDIT: Simply renaming boot.emmc.win to boot.img seems to have done the trick. Just extracted it, will look into it now.
EDIT 2: Managed to extract the defconfig and copied it over to the arch/arm64/configs folder and renamed it to tb8704f_defconfig. I then made defconfig and started compiling. Unfortunately same error. Something about topology.c is either broken on this kernel or my version of gcc is unable to parse something in topology.c. Even on the version off of GitHub. You said it was working for you, just curious, what Linux distro are you using? I'm happy to install it into a VM and compile the kernel from that. I'm running Ubuntu 18.04 and have tried compiling both on my host and in a systemd container, but same error.
EDIT 3: Yeah, it's an issue with my gcc compiler, because it doesn't error out at topology.c on an Ubuntu 16.04 systemd container with gcc 5 vs the Ubuntu 18.04 host and container I tried building it on with gcc 7 which did error out at topology.c. It's compiling right now in the Ubuntu 16.04 container and I do hope that it doesn't error out at another stage. It seems to be building well so far.
EDIT 4: I'm currently building it with the tb8704f_defconfig file I extracted from the tablet's boot image. Working well so far. I'm gonna build it without any modifications to the .config file and then flash it to the tablet to see if it works before making modifications with menuconfig. If this compilation goes well, I'll start making modifications with menuconfig.
EDIT 5: Kernel built, now I've got a file called 'Image' as well as Image.gz and Image-dtbs.gz Gzip archives. How do I flash these to the tablet?
code_exec said:
EDIT 2: Managed to extract the defconfig and copied it over to the arch/arm64/configs folder and renamed it to tb8704f_defconfig. I then made defconfig and started compiling. Unfortunately same error. Something about topology.c is either broken on this kernel or my version of gcc is unable to parse something in topology.c. Even on the version off of GitHub. You said it was working for you, just curious, what Linux distro are you using? I'm happy to install it into a VM and compile the kernel from that. I'm running Ubuntu 18.04 and have tried compiling both on my host and in a systemd container, but same error.
Click to expand...
Click to collapse
I'm pretty sure 3.18 won't built with GCC newer than 4.9 (at least without a lot of patches), I'm using Ubuntu 18.04 and Google's toolchain
code_exec said:
EDIT 5: Kernel built, now I've got a file called 'Image' as well as Image.gz and Image-dtbs.gz Gzip archives. How do I flash these to the tablet?
Click to expand...
Click to collapse
replace kernel in the unpacked boot image with Image-dtbs.gz, repack using:
Code:
mkboot boot/ new-boot.img
then you can flash that using the "flash image" option in TWRP
Phoenix09 said:
then you can flash that using the "flash image" option in TWRP
Click to expand...
Click to collapse
Got bootlooped when doing this, but thankfully I made a backup of my previous boot partition so I could restore in TWRP.
Unfortunately, I don't think we're getting very close to making custom ROMs for this tablet. Maybe the reason I got bootlooped was because you used files from the Pixel kernel for the missing files on your GitHub repository. I wonder if files from the Lenovo Tab 4 10 Plus kernel (which has been compiled in the past because there are custom ROMs available for this tablet) could be used instead.
code_exec said:
Got bootlooped when doing this, but thankfully I made a backup of my previous boot partition so I could restore in TWRP.
Unfortunately, I don't think we're getting very close to making custom ROMs for this tablet. Maybe the reason I got bootlooped was because you used files from the Pixel kernel for the missing files on your GitHub repository. I wonder if files from the Lenovo Tab 4 10 Plus kernel (which has been compiled in the past because there are custom ROMs available for this tablet) could be used instead.
Click to expand...
Click to collapse
the files I used from the Pixel kernel were probably generic Qualcomm stuff, I had the exact same issues with the 10 Plus kernel, I can play with it more when I get mine on Thursday.
Edit: I checked properly, they're generic Linux ones, those wouldn't affect booting (all netfilter stuff).
Edit 2: Have opened a ticket about the broken source, let's see if we get anywhere.
Edit 3: There is definitely issues with their source, repacked the stock boot image without modifying it and that boots, repacking it with my compiled kernel does not.
Hi Guys. Great to see people working on this. Will be great to eventually see a ROM for the tab 8 4. Best of luck.

Categories

Resources