Question Instructions for compiling android 10 based twrp 3.5.2. Want to collaborate? - Moto G Power (2021)

Hi everyone
I've been working on getting twrp to boot on our borneo device for a week or so, borrowed I the device tree made by mistersmee for the g9 power since the two devices are almost completely the same
https://github.com/TeamWin/android_device_motorola_cebu
heres where I'm at:
https://github.com/touchpro/twrp_device_motorola_borneo
The only thing I cant seem to get working is the touchscreen. I realize others have tried before me already and had the same non working touchscreen, I believe the majority of us have an Ilitek touchscreen while others have focaltech or nova. I got the driver framework up and recognizing it exists from dmesg output but cant seem to get any actual touch input to register. You can look at my changes to android 11 twrp in the github above by selecting branch twrp-android-11 and using a diff program. I use meld in ubuntu.
if you want to build for yourself and help out: (i'd use ubuntu 20.04, i tried 20.10 first but one of the packages is too new and doesnt like the toolchain)
follow the instructions here to set up your build environment
mkdir twrp (you can name this whatever you want)
cd twrp
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
repo sync
add the device tree above to twrp/device/motorola/borneo
also add this to device in twrp/device/qcom/twrp-common
make your changes inside device/motorola/borneo then
. build/envsetup.sh
export LC_ALL=C
lunch omni_borneo-eng
mka -jx clobber && mka -jx recoveryimage (-jx is number of cores you have, i have quad core i7 with hyperthreading so i use -j8. personal preference really)
your completed build will be in twrp/out/target/product/borneo as recovery.img
reboot to fastboot (adb reboot bootloader) and type
fastboot boot recovery.img
see if your changes worked! look forward to seeing what you guys can do

mine for later

Have not had the time to toss together a build environment for this, since I'd have set up the entire OS and beyond for that task, since my only Linux is Garuda in a much too small VM that is nowhere near right for that., been only hacking my way through it with Android Image Kitchen in Windows and some other utilities to get touch support in my 3.5.2.10-0 cebu source image.
It works perfectly if booted into TWRP just takes about 30-seconds before touch enables itself fully, but not when flashed (fastboot or applied internally via DD, or using a modified TWRP zip via Magisk that has had my ramdisk swapped into it).
When flashed, touch simply will not function, so something is obviously not being carried over properly so when being loaded from the recovery partition it seems, despite it being the exact same ramdisk (I extracted the recovery img, pulled out my ramdisk, popped it back into a whole new image, booted it and it had touch, so I know it's supposed to have the data there but likely needs a full from the ground up build of TWRP to behave on flashed installs.
@whoshotjr2006, had any more luck with your building of it? I can test or anything you may need in your own efforts, but just have no time for the actual building of it to tinker.
Oh, and thought you should know this works if you were wanting to go RW for System, but you'll have to use Linux due to falling prey to Error 73 https://forum.xda-developers.com/t/script-android-10-universal-mount-system-r-w-read-write.4247311/. I put mine back because it didn't seem to behave quite right there, but could be useful in your own tinkering.

OK, got it where it is fully flashable and bootable with touch for mine. Used Android Image Kitchen, unpacked TWRP image that boots with touch working, copied out the kernel and ramdisk from split_img folder, extracted stock recovery, replaced those 2 items with properly renamed versions and then repacked it with --original argument, and then it boots and flashes properly. Just a quick hack on it, but functional for those that need it.
This should be easy to combine in your /vendor/lib/modules from your own, as well as /vendor/firmware as long as you're rooted to pull it, into your TWRP ramdisk before putting it into the stock recovery this way. So you can get fully functioning touch for any display type in use.

whoshotjr2006 said:
Hi everyone
I've been working on getting twrp to boot on our borneo device for a week or so, borrowed I the device tree made by mistersmee for the g9 power since the two devices are almost completely the same
https://github.com/TeamWin/android_device_motorola_cebu
heres where I'm at:
https://github.com/touchpro/twrp_device_motorola_borneo
The only thing I cant seem to get working is the touchscreen. I realize others have tried before me already and had the same non working touchscreen, I believe the majority of us have an Ilitek touchscreen while others have focaltech or nova. I got the driver framework up and recognizing it exists from dmesg output but cant seem to get any actual touch input to register. You can look at my changes to android 11 twrp in the github above by selecting branch twrp-android-11 and using a diff program. I use meld in ubuntu.
if you want to build for yourself and help out: (i'd use ubuntu 20.04, i tried 20.10 first but one of the packages is too new and doesnt like the toolchain)
follow the instructions here to set up your build environment
mkdir twrp (you can name this whatever you want)
cd twrp
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
repo sync
add the device tree above to twrp/device/motorola/borneo
also add this to device in twrp/device/qcom/twrp-common
make your changes inside device/motorola/borneo then
. build/envsetup.sh
export LC_ALL=C
lunch omni_borneo-eng
mka -jx clobber && mka -jx recoveryimage (-jx is number of cores you have, i have quad core i7 with hyperthreading so i use -j8. personal preference really)
your completed build will be in twrp/out/target/product/borneo as recovery.img
reboot to fastboot (adb reboot bootloader) and type
fastboot boot recovery.img
see if your changes worked! look forward to seeing what you guys can do
Click to expand...
Click to collapse
finally having time to try to build an environment. Making a generic VM and will post it when done and easy to use, but running into some issues in my getting it to a point to test its success even. The steps you provided, missed a needed command "sudo ln -s /usr/bin/python3 /usr/bin/python" if using the 20.04 Ubuntu. But then how do you "add the device tree" as you put it? I'm normally a repacker to get things working, versus building things. I'm sure downloading the zip of the code and loading it into those folders is bound to break something as it always does when it comes to using links and ramdisks.
Perhaps you can provide more clear instructions of what you mean by that and I could finally gladly be able to contribute to this as more than a hackish throw-together process, since the description you provided "add the device tree" yields no meaningful results for any process for that to be pieced together from other builders.

git clone -b main https://github.com/touchpro/twrp_device_motorola_borneo.git
or you can just download the zip from my github, the only time it breaks symlinks so far that i know of is when you download a kernel in a zip file instead of git cloning it
take the twrp_device_motorola_borneo files and put them in /device/motorola/borneo and you should be good to go

whoshotjr2006 said:
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
Click to expand...
Click to collapse
That won't work, as it doesn't seem to have a twrp-10.0 as it looks to be depreciated, https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni/tree/twrp-10.0-deprecated. How'd you get yours, or did you mean 9.0?

repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0-deprecated
Twrp has always been built in an omnirom build environment but with a11 they switched to being built in an aosp environment. Twrp-10.0-deprecated they recently renamed to add the deprecated tag on but thats the one for android 10 that I initially used

Got my build environment set up and can upload the image in a bit if anyone wants it. @whoshotjr2006
using your steps it builds, but even having modified the firmware and modules to include the changes I put into mine to have it have touch support, it still will not. But the hacked android image kitchen one works just fine, which makes absolutely no sense when there are no errors, only warnings reported, but even those all look to be minor type casting of variables that I've noticed.

remind me again where you found that twrp that youve used android image kitchen on? was it from moto g9 power or another device? if you can let me know ill look through device trees and see what they have that we dont
seems like maybe its not insmod'ing the .ko file for your touchscreen, or it is and your touchscreen needs a firmware check/update at load. you'll have to remind me again which touchscreen you have (sorry its been a minute i've been busy) and we can look through other's device trees at the firmware loading portion

whoshotjr2006 said:
remind me again where you found that twrp that youve used android image kitchen on? was it from moto g9 power or another device? if you can let me know ill look through device trees and see what they have that we dont
seems like maybe its not insmod'ing the .ko file for your touchscreen, or it is and your touchscreen needs a firmware check/update at load. you'll have to remind me again which touchscreen you have (sorry its been a minute i've been busy) and we can look through other's device trees at the firmware loading portion
Click to expand...
Click to collapse
Source I used in AIK was cebu's 3.5.2.10-0 from https://twrp.me/motorola/motorolamotog9power.html. used AIK to unpack it.
To get touch using my quick hack, I just dropped in my matching .bin's from /vendor/firmware plus my ilitek_fw.bin to go with their novatech*.bin's and NT36xxx_MP_Setting_Criteria_601E.csv in place of their NT36xxx_MP_Setting_Criteria_6026.csv (deleted theirs).
Then also popped in my /vendor/lib/modules (minus audio ones).
At that point in tinkering it boots with touch. But fails to keep touch on booting into recovery.
Then I stumbled upon some obscure guidance about something in the kernel in recovery not initializing the touch on some devices and potentially being able to hex edit it after manually extracting the kernel using a hex editor. And then unpacked my booting version again, saw the kernel already separated out and pulled that and my ramdisk from split_image folder. cleaned up. unpacked the stock recovery. replaced with appropriately named kernel and ramdisk files and used the repack --original. Flashed it and it booted with perfect touch, just takes about 30-seconds on start before it's responsive. I have mine encrypted still so must input a passcode and just tap on the log button a few times till I know it's working then input my code and off it goes working normally.
Should not have anything too crazy different. I think the only thing I did was delete the etc file from the cebu, replacing it with an etc folder with a recovery.fstab and twrp.fstab I had scavenged from @svoc 's 3.4.0.0 (https://forum.xda-developers.com/t/working-twrp-but-very-unofficial-but-very-useful.4313665/ of which touch did not work for me, but it booted perfectly enough to extract my firmware and lib modules initially to put into my 3.5.2.10-0). Since every time I'd use Android Image kitchen to extract the cebu image it complained about things in /etc, and that was the only difference I could find between 3.5.2.10-0 and the 3.4.0.0. That is the only potential thing I did that could be of unknown consequence.

whoshotjr2006 said:
(sorry its been a minute i've been busy)
Click to expand...
Click to collapse
And never be sorry, you're helping out here, we understand, just like if you're waiting on a response back, that you're as understanding too

Compiled, touch working when booting it. Only change I made was to add my files as I outlined before, but into the firmware and lib folders respectively, but also edited the load_ts_firmware.sh to ensure nova and chiptone are no longer commented out. Flashed and has touch fully working as well. So it should be an easy build if I can get it working.
Edit: And touch does not take 30+ seconds per the 3.4.0.0 @svoc version I believe because it's not re-flashing the display code. So that could be why some perm lose touch, and I just got VERY lucky with mine to not.

Yes you are right all I did was put the touch screen driver in the twrp and send it to you that is why it takes less then 30 secs to do no need to recomile it each time just add your files in it and rezip it

Related

[Q] Where to start?

Hello,
I want to compile Android from source. I want to just build a fully default Gingerbread that would run nice on my phone. I got the Android source, kernel source (kernel-2.6.32-U8800-Froyo) and now I don't know what to do next. I compiled the generic one already (lunch full-eng) and it ran fine on the emulator.
My most important question is, if I make it otapackage and flash it, would it start? If it doesn't, can I recover? What folders/files are essential if I make my own device for example in "device/huawei/u8800"
Also, where can I find a GOOD porting guide? I have found some that are old and not used anymore.
Some links
Start by going through source.android.com for the general basics if you havent already.
Also, even though Google removed the PDK (Platform Developer's Kit) from the site, it has been mirrored on kandroid here: http://www.kandroid.org/online-pdk/guide/index.html
The stuff in the the PDK, although inadequate, is still very important and explains how to create the necessary makefiles to add to the build, configuring for a new market, etc. etc.
Also,
watch these two videos over here. These were very helpful in my ROM development:
http://www.youtube.com/watch?v=1_H4AlQaNa0
http://www.youtube.com/watch?v=rFqELLB1Kk8
Learn to use github. It is helpful for you to keep track of your changes as well as incorporate others works into your own.
http://help.github.com/
Finally, Cyanogenmod repos are your BEST friend. Almost all major AOSP ROM devs owe some sort of thanks to those guys who have done so much. If you want to check out some of the code changes and patches that you want to incorporate look here on their gerrit:
review.cyanogenmod.com
If you want to look at the other changes that are actually in the cyanogenmod builds, best to look at their git repos here:
https://github.com/CyanogenMod
I am still learning right now while I create my ROM but your welcome to PM me if you have any questions
Glad someone helped. Now that ICS is available, I will build that instead. Now, I will follow the kandroid tutorial and add hardware_msm7x30 from cyanogenmod's repos. Then I'll make my own makefiles in the huawei/u8800 and I'll see if that works.
Also, some things I am not still clear. If I am not adding any recovery files, it shouldn't replace it, right? I want to make sure I can recover. However, my phone has a bootloader mode, which should still work, even if other's messed up. And the kernel, if I already have a compiled kernel for android 2.2, should it work for newer versions?
Thanks
Well AOSP as far as I know adds the stock recovery into the build so if you have a stock ROM, then you will lose your recovery (unless you change the source to skip the adding of recovery to otapackage).
Your bootloader should be fine. so you will theoretically be able to re-flash a custom recovery with fastboot as long as your bootloader is unlocked (assuming your phone is already rooted and has a custom rom, then it should be unlocked)
If you are using CM7 as base, then you dont have to worry about it as it is configured to NOT replace the recovery during the building and creating the otapackage.
The kernel should not be compatible as there were significant changes from Froyo and you should not use it. By the way, for now, work on the ROM first. Creating a custom kernel from scratch is hard work and should be left as the last task to do (assuming you know linux kernel development). Just use the stock pre-built kernel that comes with the source.
Also, according to Google:
Starting with IceCreamSandwich, the Android Open-Source Project can't be used from pure source code only, and requires additional hardware-related proprietary libraries to run, specifically for hardware graphics acceleration.
Click to expand...
Click to collapse
This means you need to find the correct hardware drivers first. Where to find that is beyond me. Check CM repos. It would be easy if everyone had a Nexus S/ Galaxy Nexus as the drivers are immediately available on source.android.com. Ah...well....
Personally, I am going to wait a few weeks before dabbling into ICS ROMs. Wait till CM7 comes out with a nightly for my nexus one and then rip the drivers from their ROM and use it for mine
I got ICS source and made the necessary Android.mk, AndroidProducts.mk, BoardConfig.mk and u8800(my device).mk, also vendorsetup.sh . Now, when I am trying to build it doesn't give me an error, more of a suggestion. It says to include "LOCAL_MODULE_TAGS := optional" in the hardware/msm7k/liblights/Android.mk. I added that, and tried again. Got that message again, but with other type /libril/Android.mk
About fastboot, I am not sure if my device has that. It can be turned on with volume up and down + power, but it boots to so called "pink screen". When I mount phone using usb to my pc, I can browse the recovery.img and other related stuff. If I have the otapackage, can I just take the recovery out from there or what should I modify in source? Add something to the makefiles?
Yeah I am pretty sure you should add the LOCAL_MODULE_TAGS to all of the relevant pre-built files. maybe they made the compiler less harsh in ICS when compared to the one for gingerbread. In gingerbread, it outright crashed the compile and asked you to add the tags.
According to Google engineers, here is the reason why they use these tags:
Short answer: lack of time.
The urgent concern was to prevent new modules from using a user tag
(implicitly or explicitly), and we took care of that. We haven't had
time to deal with the existing modules, there are over 1000 of those.
JBQ
Click to expand...
Click to collapse
By the way, I hope you have git setup and the changes you have made are being staged and commited to your repo in github. If you ever make a mistake that hardcore crashes your compile and you dont know what you did, git will be there for you to rollback the changes as well as keep track of everything you have done from commit to commit
As far as I know, CM repos dont have everything complete for a full build of ICS but I could be wrong.
So you are working with AOSP correct?
As for the fastboot every android phone should have a fastboot by default but I believe each phone has a slightly different version. I will post how my fastboot looks like in a bit.
As for the removal of recovery, there should be somewhere in either source, makefiles or argument for the otapackage command that should leave out the recovery when making update.zip. You could just remove the recovery from the update.zip, change the updater-script and repackage it but its not a clean solution and those changes should be done in a uniform manner so you dont repeat this step every time you do a new build.
Where exactly is it, I have yet to know. Still learning much of this myself.
I now completely understand what modes of turning on my phone has... First one is normal, second is recovery, third is update-bootloader(I can access all files with it too) and four being the fastboot. The custom recovery I have on has an issue that it wants to boot to charging mode when I type "adb reboot bootloader". I can get to fastboot with the custom ROM I have on right now though. I think I am safe if I have issues.
I edited msm7k Android.mk to remove libaudio and libgralloc (errors with those), and it compiles to the step where it says it has no rule to make kernel requied by boot.img. I have put into BoardConfig.mk the line TARGET_PREBUILT_KERNEL with my kernel. I don't understand, what's wrong now...
My goal is to simply get it booting up. I'll look into libraries and other later.
-e-
Got the kernel thing sorted out. Copied device.mk from tuna device and edited to fit my device. Also modified full_u8800.mk and made the call to inherit from device.mk. Compiling now and I think I got past that.
-e2-
Got it built successfully. Fastboot won't let it install, because it has no mount points. Added mount points and let's see...
Nice to see you are making progress.
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Blefish said:
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Click to expand...
Click to collapse
If you successfully compiled, take the boot.img and system.img and package them into a zip and use dsixda's kitchen to make it flashable
Blefish, is it possible for you to share your device/vendor structures somewhere? I just finished setting up a build machine for ICS (using Cyanogenmod's repos in my case), and made a working full-eng image that seems to boot just fine in the emulator, so I'm seemingly all ready to hack around our device's specifics. But I would rather not do duplicate work, so I decided to ask
I'm also grabbing Huawei's new 2.6.35-based package to get the new kernel config, can't wait for them to release the actual sources for the update.
I'll share them on GitHib once I get a working build. I haven't got much time, and I changed to CM9 alpha now (repo branch ics). Since we got a 2.3 update, my first task is to port the latest clockworkmod recovery and then the ICS.
Compiling Android is long task and I'll do it in weekends, but the recovery should be available sometime, it shouldn't be hard to port that.
Oh yeah, look up stockwell's, dzo's and genokolar's github, they have done the device configuration. You can get much help from there. This weekend I'll propably test the build, I got otapackage command working now (it needed some things I can't write on mobile).
Sent from my U8800 using Tapatalk

[DEV TUT] Building Kernels and Android Sources

Dear Community,
Please read the following before starting on reading on.After lots of requests I decided its time to provide every oncoming developer with a short guide on how to start developing for our beloved Mimmi (most stuff applies also for Robyn or other Android devices).
I'd also like to get a few words passed on what actually in most cases developing is, so let's start with the basics:
There is different ways of developing there is people like Cyanogen Mod which provide you with a bunch of changes to the original Android source code which enables new features, adds hardware support or make things easier for specific device developers. However these people at Cyanogen are often not fully recognized so please make sure to thank these people as well. Besides that there are ports of similiar devices which will not be explained in this tutorial but also these developers usually put a lot of effort into their roms however since the source is already compiled changes are usually of a cosmetic nature. In this tutorial however you will find the basics on how to compile kernel or android from source in order to build your own changes into your own rom, which btw would have never been possible without the developers porting xrecovery or cwm to our devices so please give these people a big thumbs up as well after reading on.
What do I need/Environment set up
Most people have issues on setting up a the heart of your Developer Carreer, the Environment. What I strongly advise is to have at least a bit knowledge of the main usuage of Linux Distributions and also programming languages. Without these you will most likely fail at one stage or another to make a successful build.
So lets evaluate what you need :
Linux Distro (i.e. any Ubuntu should do well)
a VM or native Linux
quite a bit of Linux skills and programing skills
Time and a high tolerance of frustration
Sufficent RAM (at least 4 GB, more is advised otherwise use native Linux)
If you know how to install a native Linux Distribution you can probably skip this part, I will explain how to use a VM to fill the basic needs and keep your development area seperated from you most likely otherwise needed productive platform.
The following Steps are just keywords, if you want to develop you will need to inform yourself how to achieve all this yourself, there's lots of tutorials out there.
Step 1: Download a VM and a Linux Distro
Step 2: Install VM Software (i.e. VirtualBox or VMWare Server)
Step 3: Install the Linux Distro in VM (you'll need at least 6 GB Swap and 50 GB or More HD space to have enough room for experiments/seperate syncs/etc...)
Step 4: Figure out if you installed 32 Bit or 64 Bit (you'll need this later)
Step 5: Boot your new VM based Linux Distro
Step 6: Set up a Share Mount between your host and your VM
Step 7: download the Android Source/Cyanogen Source of your desire (i.e. : repo http://**** -b gingerbread) into a folder for you desire (the folder should represent your ROM's/Kernel name)
Building a Kernel
Building a Kernel is one of the easier parts considering the full source code is available for download. Sony Erricson Open Source Dev Website is providing fully funtional Kernel sources usually in the tar.gz format. Download the source code and extract it, or if you use a git based repository clone or checkout the project into a folder of your desire.
The next step, is not mandatory but advised to sync the entire Android repo/CyanogenRepo as the repo also provides the Cross Compiler toolchain which is needed to compile for your device.
Once everything is finished downloading you should check the following path in the Android repo : platform/linux-x86(orx64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/ this is the cross compiler we will use to build the kernel itself, its vital to have the compiler present, the version number maybe different though.
Lets start with the building process itself:
Code:
cd kernelfolder
cp arch/arm/configs/semc_mimmi_defconfig .config (the command maybe change to copy another default config file, it creates a file in the root of the kernel folder called ".config"
ARCH=arm make menuconfig (this will bring up the kernel configuration menu for arm devices)
In the Menu Config you can change/add features to the Kernel once you are done safe the kernel config. Now your Kernel is ready to be compiled:
Code:
ARCH=arm CROSS_COMPILE=/pathtoandroid_source/platform/linux-x86(x64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j4
This will start a compile with 4 Jobs using the Architecture ARM and the Cross Compiler arm-eabi from the Android Source Repo. Once finished you'll find your Image in your kernel folder under arch/arm/boot/Image. Now you'll need to build your own ramdisk this is covered here at xda as well azuzu has also build a tool available to download.
Follow the instructions to create the kernel.sin which now can be flashed with Flashtool. Changes to Kernel source will now be available to your compiled Kernel. How to change the Kernel source is beyond this tutorial but programmers in C will have fun there.
Building Android from Source
Now lets get started with the more advanced part and the most frustrating part in the beginning. The easiest way to build for the mimmi would be to sync the Cyanogen Gingerbread source code. Which can be checked out using the repo binary (see tutorials on googles website also which packages for which architecture (x86 or x64) are addionally needed also the correct java version is important)
Now lets cut to the chase.
Code:
repo sync -u http://github.com/CyanogenMod/... -b gingerbread (or froyo or another branch you would like to check out)
once your repo is synced (you could also add "-j8" to enhance the speed of the repo command, it will take quite a while) you are almost ready to start. If you synced an AOSP source you will have the get your device and hardware libraries ready first. This means you will have to port i.e. the device project and hardware project (mimmi and msm7227-common folders from CM and also hardware folder from CM) to the AOSP source. It makes sense to port these to your AOSP source since they are the most complete so far. For Camera libraries you can sync from doixanhs repo the libcamera-5mp.
Now lets get a short overview over the Android source, it contains of various folders:
frameworks
device
vendor
hardware
platform
external
These are the most interesting, frameworks folder holds a bunch of android libraries and files which provide the functionality however often you will need to change a few things here and there since the mimmi is unique in its hardware. Everything you change will need to be approved with the following command:
Code:
make update-api
This will add all the functions, variables or anything else to the current-api.xml and ensure its available at build time.
The device folder holds device specific files, build-configs and so on. Lets look at some of the important files:
Code:
device/semc/mimmi/overlay/frameworks/base/res/res/values/config.xml/power.xml
The two xmls hold configurations of the build process which are device specific either LightSensorWarmupTime and so on the full list is in the root folder of frameworks/base/res/res/values/config.xml <-- any part you feel you need to change copy the lines from there and change in you device specific config.xml.
Now to another file:
Code:
device/semc/msm7227-common/BoardConfig.mk
This files olds the device sepecific configurations for the ARM, WLAN, etc.
Look at all the files in mimmi and msm7227-common and figure out what they do, google of course will guide you on that.
Also take a look in the:
Code:
vendor/cyanogen/products/
folder and find the mimmi config and get familiar with this as well. Nobody will be able to help unless you face specific issues. Developing is learning by doing and a lot of self teaching and the will to understand all of this yourself. We can't teach but you can learn. Specific questions however are usually proudly answered by most devs if they have already figured it out.
Lets start building now, first you'll need to get your lunch command to know which devices have makefiles (I always do it to be sure)
Code:
source build/envsetup.sh
This will now add all the known devices to your lunchcombo (the devices are usually definied in the vendorsetup.sh pointing to the makefiles)
Code:
lunch
Will get you the list of available devices and will wait for user input to select the device you want to build, choose the mimmi.
Code:
make -j4
This will start the building process with 4 jobs.
Now its time to get a coffee. Usually you will have a bunch of different issues on this part but the CM source is pretty good and you might be lucky there.
Now lets look at typicial errors:
Code:
symbol not found : means a variable in used in the code has not been defined, before its use this one is a tricky one
try to locate the source file and find the line the compiler is complaining about. Now check in the framework usually in
res/res/values or layout look for the type of the erros (String or array) and look in the corresponding xml if the variable
is present. Now look in vendor/cyanogen/overlay if your variable is also declared there and so on.
Code:
function not found/function of incompatible types : also a tricky one, you might sync a repo and made local changes to
a file and suddenly your functions another file calls are not present or have changed, find the differences between them and
think about how it has changed, maybe add the function again or maybe another function does the job now. you will need
to locate the changes compare them and you should be fine again
Code:
No Rule to make target: this one is usually due to a missing/incomplete Makefile you might need to add manually or
if you don't need it anyway the easiest would be to delete the not building folder
Once your source has finished compiling you will find you system image in:
Code:
out/products/mimmi/system/
As of now unfortunately its still missing a few files here and there. Compare ROMs and Compare what might needs to be added. However I advise not switch libraries around its best to use your own libraries. However sometimes you will face issues when doing this so start with the files created there and just add the recovery and ramdisk to your rom. Now observe via adb if everything is running. This will take time and add one missing lib after another one and reboot, after each (like grallocs or librils or fm libs and so). This is basically a debugging part of the job.
You will now add one by one more functionality, but keep in mind to use logcat to see what goes wrong, maybe some stuff can be changed in the source rather then randomly adding stuff.
also this one just in case.
Hey there c: As always, you come surprising everyone with your stuff haha Good job on this one, I think it is always good to have some tutorials from the people who build specifically for our Mimmi's
Before reading this, I wanted to get started on developing and I went to Android's official developers site, I did some steps, now I have the complete source of Android here (I use Ubuntu 10.04, the LTS version... Dunno if telling you that it is LTS ver. really matters, but just in case) andthe whole environment ready to build. Now, reading at this, I realize I don't have 4Gb of RAM on this "old" (2007..) notebook. Anyways, the thing is: I followed the steps listed here, but when I wrote this command-
Code:
$ make -j4
-the terminal started to execute files, or something... I'll add a screenshot at the end about this. It has been 3 days since that, and the terminal is still doing the same. I know developing requires a lot of patience, but... 3 days? Is this normal?? I have looked through the Internet for problems with this command, but no one seems to have talked about it.
Thanks for your time, work and effort for the community, we really appreciate it c: Bye!
Link to the Screenshot:
http://i259.photobucket.com/albums/hh313/link_4ever/Screenshot.png
The 'make -j4' uses 4 threads to compile everything, if your notebook does not have at least an hyperthreading-technology enabled CPU, well, that's to expect when building an entire OS, plus you don't have sufficient RAM, I do have 2GB and a DualCore CPU and it takes at least 1 hour to compile an average desktop kernel with that same command. I have not tried to compile android, but I think that it will take at least 4 hours to compile everything. Just my thought.
RozenTensai said:
The 'make -j4' uses 4 threads to compile everything, if your notebook does not have at least an hyperthreading-technology enabled CPU, well, that's to expect when building an entire OS, plus you don't have sufficient RAM, I do have 2GB and a DualCore CPU and it takes at least 1 hour to compile an average desktop kernel with that same command. I have not tried to compile android, but I think that it will take at least 4 hours to compile everything. Just my thought.
Click to expand...
Click to collapse
Thank you for your answer! Just ten minutes ago, the 'make' command finished ! And about my notebook, it is just like yours: 2Gb RAM and Dual-Core CPU, I'm not sure but I think it runs at 2,8 GHz. And also, like I said earlier, I know developing takes time. I know how slow processes can be, in fact, there were commands previously that took 1 hour or more to finish their tasks. 1 hour, 4 hours, it's ok but... 3 days? Isn't it a bit too much xd?? Now I'm afraid to turn off the computer because I don't want to compile that thing again hahaha
the "-j" option depends on the number of (virtual) cores you have.
get the number:
Code:
grep processor /proc/cpuinfo | wc -l
if you have native linux and like to work on the machine I recommend do lower the number at least -1 otherwise get a coffee and keep hands off the build process
b
make -j4, lol. Many people do not have. 4 cores on the processor
paul-xxx said:
make -j4, lol. Many people do not have. 4 cores on the processor
Click to expand...
Click to collapse
This parameter refers to threads instead of hardware cores
Sp4rrow said:
This parameter refers to threads instead of hardware cores
Click to expand...
Click to collapse
ok. probably a mistake. but still. I always use 2. it brought to me the best results
I use j6
And also j refers to jobs everybody may change to what they want. For kernel i build with j12.
If you know better like it seems you always do write it down.
Sent from my U20i using xda premium
I can't find any 2.1.1.A.0.6 Sources. Link to the sources you use slade?
http://developer.sonyericsson.com/cws/devworld/search-downloads/opensource?cc=gb&lc=en
should be:
x10_x10mini_X10minipro_x8_eclair_2.1.A.0.435.tar.gz
Stock Kernel with only CWM5 installed...
Slade i want some help from you. how can i embed CWM5 in the stock kernel without any other changes to it??
i want a stock kernel with nothing changed in it only CWM5 installed in it. how this can be done???
i forgot to say the most important thing!: Thank you very much for your work and effort Slade
I just came to the configuration menu of the kernel. i see there are options predefined for the mimmi, but how can i optimize it more, there are soooo many options, and to tell the truth i don't have a clue what they do

[DEV][CM9][HOWTO] Build CM9 From Scratch!

It's time. As offered previously for the Nook Color and HP Touchpad...
A Build CM9-for-NookTablet Walkthrough
What is this?
This document provides instructions for developers to build a complete Cyanogenmod 9 update.zip for the Nook Tablet aka "acclaim" (and more theoretically the newer 512MB model, aka "elation") from source code. The instructions require a Linux computer and appropriate tools (discussed below).
It is important to emphasize that CM9 is a work in progress and if you try it you will be building/using something in mid-development. Things may break and/or not work at any time. Read below, the build instructions, and the relevant licenses for additional info and disclaimers.
Hopefully, for those developers who are interested and willing to take the risks, this can be a fun and educational experiment. And hopefully more developers will help chrmhoffman, kuzma30, mik_os, and others improve CM and the 3.0 kernel.
So does this build use the new, experimental 3.0 kernel then?
Update: At first, I mentioned that 2.6.35 was also supported, but apparently this will require additional files that aren't currently installed. So for now, yes, it uses the 3.0 kernel, which may not be compatible with the newer 512MB NTs. Although it is not confirmed one way or the other, as it has not been tested on these devices.
The configuration uses the experimental 3.0 kernel, which is built on-the-fly from the latest source code.
Unless you really want to take some risks, if you have a newer-model 8GB/512MB Nook Tablet (aka "elation"), the 3.0 kernel build is not for you...yet! It may boot, it may not. It has not been tested by any of the developers with that device, and as of this writing there are known kernel issues with the 512MB. (So actually, this is a good opportunity for developers to try it and contribute.) The 3.0 kernel development thread has more on this.
Any further discussion below assumes the 3.0 configuration, as the 2.6.35 branch isn't as up-to-date and isn't really being maintained. 3.0 is the future!
These instructions are for Linux. How do I build on Windows/Mac/etc?
If you have Mac or Windows or something else, you may consider installing a virtual machine such VirtualBox (which is free). Then run Linux, say a Ubuntu distribution, as a guest from your host computer. This allows you to "sandbox" your development environment, and gives an opportunity to learn about Linux with actual hands-on experience, all without reformatting your computer...
CM9 can also be built on Mac natively, either in Snow Leopard or Lion. Instructions for building (CM7) on a Mac can be found on the CyanogenMod wiki.
A few modifications need to be made to those instructions for CM9 & Lion, but such instructions aren't hard to find.
Will my build actually be usable?
CM9 (and the acclaim port) is in active development, and when you do a build from the latest source, you are using a bleeding-edge build of whatever happens to be in the repositories at the time. There is no guarantee it will work in any capacity. It may actually cause terrible damage. So only try at your own risk, and assume responsibility for your actions. If you find a bug, help fix it.
It is critical that you understand the risks before trying this and fully back up your system before trying any build. It is equally important to have a bootable SD standing by so that you can restore your device to a known good version if something goes terribly wrong, which may actually happen. Hopelessly staring at a non-booting device is never fun. There are other threads about recovering hosed acclaim systems, so I will leave you to finding and understanding them and preparing yourself for solving such problems. You should always assume the worst will happen, so be prepared.
Speaking personally, I don't have either model of NT and have never run CM9 on one, so can not attest to its usability per se. You should consider this a work in progress full-of-bugs until told otherwise.
Which bootloader is this using?
Cyanoboot, based on u-boot. The full github repo w/history (rather than raw files) is now available as well. Special credit to bauwks for fixing the locked bootloader design flaw.
Will this build result in a working update.zip suitable for use with ClockWorkMod recovery?
The build process has been modified to generate a fully flashable update.zip, but, as, with everything else, nothing is guaranteed.
Does this create a build for SD Card or for EMMC (internal storage)?
EMMC.
I'm stuck! I've been at it for hours. Something isn't working. Where can I get help?
If you have never built an operating system before-- this may be a good way to learn, provided you accept the risks and consequences of trying. This and other forum threads may be a good place to look for help. Also try IRC.
You are also able to leave comments in the walkthrough document itself. If you have a tip that might help others, post it there. If I get a chance, I'll take the best of them and incorporate it into the doc.
Does this build ClockworkMod recovery too?
It should. Check the $OUT directory for two files-- recovery.img and recovery.img.sdcard. The recovery.img file is (hopefully) flashable via fastboot:
fastboot flash recovery recovery.img
The recovery.img.sdcard can be renamed to recovery.img and put on your sdcard.
Can I build twrp2 instead of ClockWorkMod?
TWRP2, in case you're not familiar with it, is an alternative recovery image created by Team Win, particularly user dees_troy. It can be used for flashing update.zip files and making/restoring backups, among other things.st
The 3.0 build configuration currently contains the needed settings for a twrp build. You will just need to replace the ~/android/system/bootable/recovery repo with twrp's source code. You can do this by adding the following lines to your local_manifest.xml file:
<remove-project name="CyanogenMod/android_bootable_recovery"/>
<project name="TeamWin/Team-Win-Recovery-Project" path="bootable/recovery" remote="gh" revision="master" />
You can then repo sync (per the instructions) and then do this command to rebuild the recovery using twrp2.
mka recoveryimage
The recovery.img and recovery.img.sdcard files in $OUT should now contain the latest twrp2. (If it doesn't, try clearing out the recovery-related files in $OUT, including $OUT/obj/RECOVERY_EXECUTABLES)
Please direct twrp2-related questions and solutions to the twrp2 thread, not here.
Who do I thank?
Thanks to chrmhoffmann, mik_os, kuzma30, cyanogen, arcee, nemith, Texas Instruments, Barnes & Noble, and all the other devs, testers, and contributors, of which there are many. And special thank to bauwks, who made this all possible.
For this walkthrough in particular, big thanks to chrmhoffmann as well as eyeballer for testing. Everyone-- go find a thread by these people and thank them.
Who do I blame?
Yourself. Only yourself.
To whom do I donate?
Not to me. You can donate to any of the above if you feel like it. I do suggest considering a donation to the Electronic Frontier Foundation, who among other noble activities are fighting to keep "jailbreaking" and its Android phone and tablet equivalents legal. Your Android devices are full-fledged computers. Don't let corporate or government special interests take away the right to mess with your own possessions as you wish.
Finally, good luck. We're all counting on you. If and when you have problems, post them, and hopefully others will help find a solution.
Developers are needed. Enquire within.
-ft
(twitter)
-----
How To Build CM9 for Nook Tablet From Source
(Google Doc... or is it Google Drive now?)
And one more thing...
If I think of something to add, I'll put it here.
Good stuffs. I'll give it a try later in the week. I have everything set up. Going to be fun testing.
Im planning on doing this too. Thanks for making a guide, although I'll probably be in the IRC within 5 minutes of starting with questions
Sent from my Team A CM9 Alpha 0.03 Nook Tablet
Thank you very much for putting this together!
I am testing on an 8GB nook.
I can verify that the cwm and twrp2 recovery images boot with the 3.0 kernel, however CM9 fails to boot, it hangs on a blank screen with the backlight on and eventually just reboots. I am not able to get it to connect via usb to print logcat so I don't think it is getting very far.
Do you happen to have any instructions for tapping into the serial on these devices to see what is going on?
Also, with the new cwm it will not mount the sdcard through the menu. If I open a shell within cwm recovery I can mount it fine, except it is read-only.
In case it is useful, here is a dmesg from cwm:
http://pastebin.com/0fkyuSwe
arcon2600 said:
Also, with the new cwm it will not mount the sdcard through the menu. If I open a shell within cwm recovery I can mount it fine, except it is read-only.
In case it is useful, here is a dmesg from cwm:
http://pastebin.com/0fkyuSwe
Click to expand...
Click to collapse
Ah, this is very interesting! It's similar behavior to twrp.. a mounting issue with sdcard... wonder if this means the kernel is somehow not letting it mount, or if the problem is with recovery.fstab...
New patch, there shouldn't be a gpio_wp pin assigned to begin with...
Also, this is tested on my 8GB, I don't have a 16GB to test with.
diff --git a/arch/arm/mach-omap2/board-nooktablet.c b/arch/arm/mach-omap2/board-nooktablet.c
index de38b5c..a10dd93 100644
--- a/arch/arm/mach-omap2/board-nooktablet.c
+++ b/arch/arm/mach-omap2/board-nooktablet.c
@@ -684,7 +684,7 @@ static struct omap2_hsmmc_info mmc[] = {
.mmc = 1,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | MMC_CAP_1_8V_DDR,
// .gpio_cd = -EINVAL,
- .gpio_wp = 4,
+ .gpio_wp = -EINVAL,
.nonremovable = false,
// .no_off_init = true,
#ifdef CONFIG_PM_RUNTIME
Build environment ready but cannot use repo command
HI! i would love to build a zip with the new kernel but i cannot use the repo command in the terminal in Linux Mint latest build. I have downloaded Android SDK and all the required build libraries and set up all the directories. i have the NTsparkkernel folder in the android directory. Could anyone offer some advice on how to apt-get (the REPO module) so I can build the zip. Thank you for your time. Bruce
about repo
C64assembly said:
HI! i would love to build a zip with the new kernel but i cannot use the repo command in the terminal in Linux Mint latest build. I have downloaded Android SDK and all the required build libraries and set up all the directories. i have the NTsparkkernel folder in the android directory. Could anyone offer some advice on how to apt-get (the REPO module) so I can build the zip. Thank you for your time. Bruce
Click to expand...
Click to collapse
The repo command is actually something you get from Google. It's not in the apt-get repositories.
To install the repo script:
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
The repo binary will be in ~/bin and you can add this to your path if you like.
Confirmed by chrmhoffmann and committed. Thank you!
Thank you for this guide. I've compiled stuff before, but built my first Android from source last night. Although the build from that time has random reboots (the nature of the beast).
I'll be building quite a bit I think
Damn see I'm just porting right now I wanna build from source but my PC isn't Linux friendly yet I'm waiting on a tb internal so I can set up and learn this but it just looks so complicated and idk why. I feel once I learn it probably be easy as hell. Thanks Fattire
__________________________________________________
Sent from my SPH-L700-GNEX-using Tapatalk 2
Danrarbc said:
Thank you for this guide. I've compiled stuff before, but built my first Android from source last night. Although the build from that time has random reboots (the nature of the beast).
I'll be building quite a bit I think
Click to expand...
Click to collapse
Hey congrats and welcome to the club!
Cannot Make the bacon...
Hey Fattire! Thank you for your guide. I was able to finally download the source for cm9 and add the 3.0 kernel repository. I have everything in one folder. I am new to Linux and had to add a Path command to get Repo Sync to work correctly. Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
I have to issue PATH=~/bin:$PATH every time I repo sync.
C64assembly said:
Hey Fattire! Thank you for your guide. I was able to finally download the source for cm9 and add the 3.0 kernel repository. I have everything in one folder. I am new to Linux and had to add a Path command to get Repo Sync to work correctly. Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
Click to expand...
Click to collapse
I use Ubuntu here I started with 10.04 LTS since it was the the build used and supported by Googles build instructions. Yous should still be able to do it though.
Did you initialize the build environment using ". build/envsetup.sh" at android/system (it looks like is the base of your source from your post)
Yes. Thank you for your advice KeithN. I am going to start from scratch. I might just put Ubuntu 10.04 on my comp tonight if I cannot get it to build properly.
I'm going for Ubuntu 12.04 command-line. If that doesn't go well, I'll go for 10.04 as well.
I built mine on 12.04 (Xubuntu, but that doesn't matter so much).
I added a debian sqeeze apt repository to get sun-java6-jdk, then used -f install when it complained because one of it's dependencies exists in Ubuntu but not that same version #. Commented out the repository after it installed so I don't get more debian packages on accident. For everything else I think it was just following the guide as-is.
C64assembly said:
I am new to Linux and had to add a Path command to get Repo Sync to work correctly.
Click to expand...
Click to collapse
Yes, I had recommended doing that. The PATH=$PATH:~/bin command will ensure that no matter what directory you type "repo", it'll know where to find the file.
C64assembly said:
Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
I have to issue PATH=~/bin:$PATH every time I repo sync.
Click to expand...
Click to collapse
Instead of entering it every time, you can add that PATH statement so that it's automatically invoked when you open a new Terminal window.
Just add the line to an "invisible" file (it's invisible because it starts with a period (.) and won't show up in a normal listing) called .bashrc in ~/.bashrc (the ~ is a shortcut for your home directory, or /home/youraccountname/). The hidden .bashrc file will probably exist already. Just add the statement to the end.
Keithn said:
Did you initialize the build environment using ". build/envsetup.sh" at android/system (it looks like is the base of your source from your post)
Click to expand...
Click to collapse
This is right. Try this:
$ cd ~/android/system
$ . build/envsetup.sh
(the $ represents the prompt and should not be typed. For the second command, it's literally a period followed by a space followed by build/envsetup.sh)
I am using the latest 12.04 ubuntu, fwiw.
I know this is for CM9, but any help would be appreciated (trying aokp). I had issues with the packaging of the .zip it looks like. I was able to build for my fascinate so I know the source will build. Any suggestions?
Output

Question about compiiling TWRP for a new phone

Hi,
I'm totally new to android custom ROM development scene, and one of the first things I really wanted to do was to be able to create TWRP recovery for any device that I could possibly own.
As such, I started doing my research. I've read a lot of guides and the more I read the guides, the more I seem to get lost on what to do... :crying:
By far, the best guide I've read is this one :
https://forum.xda-developers.com/android/software/guide-how-to-compile-twrp-source-step-t3404024
So far I've 'repo sync'ed twrp-6.0 from 'minimal sources', so what I understand is that I have a build environment to build an android ROM, but now I have to tweak several files to match it to my device.
In the tutorial, it says that I need to have 3 directories set up correctly.
1. kernel
2. device
3. vendor
I have a device SM-J5108.
My first goal was to correctly set up the 'device' directory. So I set off to look for a pre-made 'device' that's similar to my model. I landed on this page.
https://github.com/TeamWin/android_device_samsung_j7ltespr
It's for Galaxy J7, but it had the simplest directory & file structure so I decided to use this one.
However, I think it would be wise to get configs for the BoardConfig.mk from this repository.
https://github.com/TeamWin/android_device_samsung_j5nltexx
Next, I would download the original firmware from somewhere like 'updato.com', and rip off the original kernel from that file. then I would replace the 'kernel' file in the repository with that one.
I would do the same with the ramdisk.
Up to this point, am I on the right track?
And another thing that questions me is since I've ripped off the kernel and ramdisk, is the '/home/username/NameOfTheFolder/kernel/vendor/devicename' folder from the guide not needed at all?
And the third folder in the guide, '/home/username/NameOfTheFolder/vendor/vendor/devicename'.
From my understanding, this folder needs to contain all proprietary libraries & .ko and other stuff specific to the device that is not mounted by the ramdisk.
And from this guide :
https://web.archive.org/web/2016111...ro#Collect_any_available_existing_source_code
It tells me to use 'extract-files.sh' to automate the process of extracting these files. But I'm not entirely sure if I can just use a universal 'extract-files.sh' for this.
Could I use 'extract-files.sh' from any Samsung device repository such as this one?
https://github.com/omnirom/android_device_samsung_i9300
Or do I have to build a new 'extract-files.sh' just for this device...?
After settings up these two folders, I should just
Code:
cd ~/NameOfTheFolder
source build/envsetup.sh
lunch
Type the number of your device and press enter. For example in my case the number 16 is my device
mka recoveryimage ---> This command will start the compilation of the recovery.
And a recovery image should be ready to be flashed on the device right?
Thanks!

Asus Zenwatch 2 (Sparrow) - How to get rebuilt kernel work (need framebuffer console)

Hello XDA developers,
First of all my motivation to write here is to create a commandline GNU/Linux-like UI (and maybe add desktop GUI later) on the Asus Zenwatch 2, so I could see the kernel messages at bootup and use Midnight Commander without starting the entire main system (for example, get a text-mode shell and stop after every devices got initialized, firmwares got loaded, but before loading any Surfaceflinger and Dalvik stuff). I did similar thing on an Android tablet before by writing my own keyboard and touchscreen handlers based on Yaft. But that didn't help with boot-time kernel messages and the built-in framebuffer console in the kernel is probably much better. It's not enabled in the stock kernel, so I tried to recompile the Sparrow kernel from source (I didn't modify the default configs yet). After some tweaks to the kernel-source (which doesn't compile without them) I could build the Momentum-kernel and the stock Sparrow-kernel too using the provided .config files (e.g: make sparrow_defconfig). I used Android NDK's r13b gcc on Lubuntu 18.04, because an earlier attempt with NDK r18b wanted to use clang and compilation stopped early with errors.
My problem is that despite the kernel finally got compiled it doesn't seem to start at all. (I had similar experience with the Android-kernel in the past, but more success with Raspberry PI)...
I used mkbootimg to repack the generated zImage-dtb and the previously decompressed initrd into a boot.img, and ran fastboot boot on it, but booting simply stucked at fastboot screen, the animated ASUS logo never came in.
Can anyone point me into the right direction how I could troubleshoot further why the kernel doesn't work?
(I assume the 4.9 gcc isn't the issue here, though I got a zImage with slightly different filesize. I've read somewhere the earlier 14.04 Ubuntu and 4.8 gcc is advised for Sparrow kernel compilation but do these versions matter here? Should I replace the modules too on the system partition with their newly built versions, as the zImage changed?)
I know others managed to build a working kernel, for example TWRP has its own custom kernel and it works fine on the Sparrow watch... Is there any step I might have missed? Is there a debug-tool or logging which helps me to find out why the kernel doesn't boot? Something to troubleshoot the kernel-loading and booting? (A simulator for example? Or how do the experts do it in practice?)
I hope I declared every aspects to get some help. If for some reason I don't succeed I might try to make more linux-like AsteroidOS or PostmarketOS to get my complete Linux console on the smartwatch. The thing is that these don't support all hardware on the watch, that's why I'm trying with Android in the first place.
I guess if I'll be able to compile and then run the stock original kernel somehow the rest will be easy. (To enable framebuffer-console, set governors, remove unnecessary drivers, etc.)
Thanks in advance for the help, XDA gurus...

Categories

Resources