[Q] Cyanogenmod Kernel Configuration Option To Specific File Map - Android Q&A, Help & Troubleshooting

Hello,
I am trying to build cyanogenmod kernel for an unsupported device. As I learned, the options for kernel build are in the file cyanogenmod_xxx_defconfig.
In that file you have to specify what config you have to use (for example CCONFIG_ARM=y , CONFIG_HAVE_PWM=y). I am experiencing some build problems because if I enable some options there are other config requirements for that for example CONFIG_BT_HCIUART_H4=y requires CONFIG_BT_HCIUART=y. If you build without that there is no clear way of showing you that you are missing that config option and you have to enable it. Sometimes it does say that something is undefined, so I have to search for that word in the sources, find the missing .h file, figure it out what option does it need in the config file (sometimes unsuccessful).
I belive if a map of the config options is available somewhere will greatly help adapting cyanogenmod for other unsuported devices.
for example
CONFIG_BT_HCIUART=y (uses files from kernel\drivers\bt\.... )
|
|---------- CONFIG_BT_HCIUART_H4=y (uses files from kernel\drivers\bt\....)
If you happen to know some documentation on these files will be greatly appreciated, eventually develop a custom tool for setting those options and dependencies.
Thank you for your time.

Related

The purpose of DISABLE_DEXPREOPT?

I am offen confused with Dex Optimization details. Here are few details i know of.
Kindly correct me if i am wrong ? While exploring the source code, i found that package manager scanns all the external libraries, base frameworks, system packages, and vendor packages for dex optimization.
So, if i understand correct 'dex optimization' can be done both in compilation time and execution time.
Also, surfing in the internet, DISABLE_DEXPREOPT has an impact over this dex optimization when to be done?
Which one do i have to opt?
DISABLE_DEXPREOPT=true
[OR]
DISABLE_DEXOPT=false
while building with the below command
make TARGET=<> droid -j6
According to the source code, i understood if .odex is available as part of .jar or apk file, then it ignores dex optimization, while booting.
Kindly correct me if i am wong?. and suggest.

[Q] Editing Android Kernel - HCE/NFC

I'm currently in the process of creating a custom version of AOSP that will edit the functionality of the Host-Card Emulation feature of Android, allowing me to manually set the AID produced when my device goes into emulation mode.
I've downloaded the Android source, and have located the files I think governs HCE functionality.
From the NFC System Service, I've located the following files:
"CardEmulationManager.java" and "HostEmulationManager.java" located in "/aosp/packages/apps/Nfc/src/com/android/nfc/cardemulation/"
And from the Android core framework, for the NFC API I have found:
"CardEmulation.java" located at "/frameworks/base/core/java/android/nfc/cardemulation/CardEmulation.java"
From here, i'm unsure how to get started in editing the code. I'm unsure of the interactions between the files, and how they are called at run (I.e. which functions in the file I should be looking at, how would I go about adding my own code/modifying existing code in the file)
Is there any documentation online about how these files work/are ran? Or how would I go about finding out on my own (Through debugger tools etc.)
I'm currently using Eclipse for Ubuntu, and will be developing for a Nexus 7

Create specific device tree for AOSP

I followed official Google`s tutorial to build my own AOSP and succeeded in all steps: I have "Pure AOSP version" running on nexus emulator.
The story is I have some rare device came with some Android version full of pre-installed app's obviously I don't want... So I want to port Pure AOSP to my device - Simple as that, without any improvements or new features (So for example I don`t want to know how to build CM git repo).
Is it working just add to my local above master branch correct files into /device/vendor/model and then under cwd of master branch execute $ . build/envsetup.sh ?
If so, what are the files and their content I need to put under /device/vendor/model ? I found a lot of guides how to pull already existing tree of CM or something else, and looking on some git repo's of several devices, I tried to figure out the minimum complete set of files & their content but I didn't find correlation. I think there must be the minimum complete set and there is programming reason for the existence of each file. And what I saw in existed git repo`s was this set + custom extras each developer added by his own reasons.
Aftermath How do I determine the Build name & Buildtype to exucte $ lunch <Build name>-<Buildtype > ?
How to integrate $ make otapackage in order to build the familiar one zip file to load via recovery like CWM?
Thanks,

[Q] smali: How to add an external library to save settings

I am trying to add a library that will read/write settings in an Android ROM through smali editing.
If compiling from source I just add the library source and edit a couple of Android.mk's but from a non AOSP rom I do not know how to add the library.
So far I have tried using Xposed, but I prefer not requiring Xposed.
Is there a way or alternative approach to have a settings library added?
Thank you

[ROM][UNOFFICIAL] Testing LineageOS 14.1 Image for Dell Venue 8 3830

Testing ROM for Dell Venue 8 3830 (LineageOS 14.1)
Most of resources are available. But has some bugs.
It could be used for fun (Retroarch, E-book readers, etc)
Was build using as base Asus T00F lineage source files
I'm posting here asking for help to implement/fix missing features (if anyone still interested on such old device)
All source code to build is available on github (links bellow).
Working
Boots
Display
Touchscreen
Wi-FI
Virtual Navigation Buttons
Sound
Rotation
Bluetooth (since 2023-05-10)
Not working:
Camera
Known issues:
- ARM apps not working due mismatches with libraries (Houdini)
- Observed battery is draining quicker than expected.
# Testing Image (should be flash using FASTBOOT)
# updated 2023-06-13
# WARNING: MAY BRICK YOUR DEVICE PERMANENTLY! USE AT YOUR OWN RISK!!!!
https://drive.google.com/drive/folders/16iG6I-X83USPGPR13yUbg54S3Mn0Y7Ff?usp=share_link
Boot tablet in fastboot mode (volume down + Power) and use "flash_cmds.sh" (Linux) / "flash_cmds.bat" (Windows) to flash files through fastboot (note that proper driver drivers and fastboot must be installed)
If you wish to submit cmds manually:
fastboot oem start_partitioning
fastboot flash /tmp/partition.tbl partition.tbl
fastboot oem partition /tmp/partition.tbl
fastboot erase system
fastboot erase cache
fastboot erase config
fastboot erase data
fastboot erase logs
fastboot erase factory
fastboot oem stop_partitioning
fastboot flash dnx CLVP_CYAB_P801_FwDnX_vF9.6C_ww42_005.bin
fastboot flash ifwi CLVP_CYAB_IFWI_vF9.6C_ww42_005_P801_wifi_uos.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system_img.img.gz
Source Files
# LOCAL MANIFEST
GitHub - pstglia/local_manifests at DELL_VENUE_LOS_14.1
Contribute to pstglia/local_manifests development by creating an account on GitHub.
github.com
Init a NEW repo
(repo init -u https://github.com/LineageOS/android.git -b cm-14.1)
Copy local manifest to .repo/local_manifests and sync it.
repo sync -c --no-tags --no-clone-bundle -j$(nproc --all)
# Kernel
GitHub - pstglia/linux: Linux kernel source tree
Linux kernel source tree. Contribute to pstglia/linux development by creating an account on GitHub.
github.com
NOTE: must be build using gcc 4.7 [1]. Checkout commit c7931763d41be602407ed9d71e2c0292c6597e00, update prebuilts link to this gcc
and build using kernel_build.sh script. If everything goes as expected, You'll have a new_boot.img created
# device/dell/P801_NoModem
GitHub - pstglia/android_device_dell_P801_NoModem: general device configuration for Dell Venue 8 (P801_NoModem)
general device configuration for Dell Venue 8 (P801_NoModem) - GitHub - pstglia/android_device_dell_P801_NoModem: general device configuration for Dell Venue 8 (P801_NoModem)
github.com
# vendor/dell/P801_NoModem
GitHub - pstglia/android_vendor_dell_P801_NoModem: Vendor files (configs, libs, etc)
Vendor files (configs, libs, etc). Contribute to pstglia/android_vendor_dell_P801_NoModem development by creating an account on GitHub.
github.com
# hardware/libaudio
GitHub - pstglia/hardware-libaudio at DELL_VENUE_LOS_14.1
hardware/libaudio repo (forked from Android-x86.org) - GitHub - pstglia/hardware-libaudio at DELL_VENUE_LOS_14.1
github.com
# external/boringssl
GitHub - pstglia/android_external_boringssl: Boring ssl (libcrypto & friends)
Boring ssl (libcrypto & friends). Contribute to pstglia/android_external_boringssl development by creating an account on GitHub.
github.com
# system/core
GitHub - pstglia/system-core at DELL_VENUE_LOS_14.1
system/core repo (forked from Android-x86.org). Contribute to pstglia/system-core development by creating an account on GitHub.
github.com
# external/tinyalsa
GitHub - pstglia/android_external_tinyalsa: tinyalsa 1.0.2
tinyalsa 1.0.2. Contribute to pstglia/android_external_tinyalsa development by creating an account on GitHub.
github.com
# external/icu
https://github.com/pstglia/android_external_icu/tree/DELL_VENUE_LOS_14.1
# external/external/apache-http
GitHub - pstglia/android_external_apache-http: android_external_apache-http
android_external_apache-http. Contribute to pstglia/android_external_apache-http development by creating an account on GitHub.
github.com
NOTES:​- openssl 3.0 (Mint 21.1 - Vera) will not generate a compatible x509 sign key for kernel modules.
OpenSSL 1.1.1f generates an accepted key
Credits / Thanks:
- The LineageOS Team
- Android-x86 Team / Chih-Wei Huang for the amazing project and repositories (used one of them here so far)
- vampirefo for providing CWM recovery and valuable information
- Social-Design-Concepts for providing unlocked firmwares (required to boot custom Image)
- Fabio Júnior Chaves da Silva (again, owner of this tablet)
- Dell for providing kernel source (wouldn't hurt to include some AOSP code also, but it's better than nothing )
- AlaskaLinuxUser AKLU from Youtube. Lot's of explanations about Android & Lineage.
[1] - https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/
How can one Help?
ikram.senguen said:
How can one Help?
Click to expand...
Click to collapse
Hi,
This is the list of missing features / issues:
Choose one of your preference and hands on!
update 2022-05-31: Audio and Rotation were fixed.
kernel display driver was updated. Experience is smoother
-[FIXED] Wi-fi is not working:
Help wanted: Fix code and make it work:
Status so far: Fixed.
It will work on boot if you keep it enabled. If you disable Wi-fi from settings and try to re-enable (or switch on/off airplane mode), it will stop working until you boot it again.
update 2022-06-02: Discovered that you can't ioctl wlan0 to up state when you disable it (using root + proper capabilities).
However, if you rmmod bcm4330 and insmod it again, you can enable it.
It seems a driver issue.
update 2022-06-03: Using stock kernel module for network, no issues with ioctl after disbling wi-fi
update 2023-06-13: Using T00F bcmdhd source with some changes to enable 4330, it runs ok.Now it's using compiled drivers for wi-fi instead of stock ones (except for firmwares)
-[FIXED] Sound is not working:
Help wanted: Investigate what's wrong and fix it
Status: Fixed [working since updated 2022-05-29]
Note: libaudio from stock image couldn't be loaded, so generated one from Android-x86 libaudio code (see [2]).
Maybe adjusts are needed on source, config and Boardconfig files.
update 2022-05-22: all libs are being loaded, but there are some errors when trying to load codecs. Config files must be checked (as well libs);
- [FIXED] Navigation menu is not being displayed:
Help wanted: Discover why is not being shown and fix it
Status: Fixed (created a overlay on device tree and made "def_force_show_navbar" to be enabled - see commit 8768b512c08b5fc60a7d7674ffce7c3a23a7857a)
- Camera is not working:
Help wanted: Make it work
Status so far: HALs must be copied. Possibly lot's of shims and Voodoos/Mojos required.
- [FIXED] Sensors are not working:
Help wanted: Make it work
Status: Fixed (replaced sensor_hal_config files)
- [FIXED] Bluetooth is not working:
Help wanted: Make it work
Status do far: Fixed (used harware/broadcom/libbt instead of vendor lib)
- [FIXED] Port/Enable zram to kernel:
Help wanted: Porting
Status: Enabled from stage tree (it was there all the time).
Seems to be working (at least swap was mounted using it)
- [FIXED] Sometimes backlight doesn't light up after resume
Status: Fixed. This ocurred when an out of range bright level was used ( > 100)
Edited liblights code (device/dell/P801_NoModem/liblights) and included a small check to ensure/force valid values ( from 0 to 100)
- [FIXED] ADB only works using network. Not working using USB
Status: Fixed. Copied drivers/usb/gadget changes from T00F Asus kernel and applied to Venue kernel
- Elevated Battery draining (specially on suspend attempt)
Something is blocking system from suspend. If you check dmesg, it keeps an infinite loop of suspend process (disable tasks, disable CPU's) and abort.
At first, wakeup reason is the "misterious" NETLINK. However, even blocking it and some other wakeup_sources it wakes.
This shows suspend backtrace (got from dump_stack):
Code:
[ 697.149972] Call Trace:
[ 697.149984] [<c19f90f3>] dump_stack+0x16/0x18
[ 697.149990] [<c12bc9c1>] resume_irqs+0xa1/0xe0
[ 697.149996] [<c12bca2f>] resume_device_irqs+0xf/0x20
[ 697.150004] [<c156a151>] dpm_resume_noirq+0x1a1/0x2b0
[ 697.150010] [<c156a8d0>] dpm_resume_start+0x10/0x20
[ 697.150015] [<c1288945>] suspend_enter+0xa5/0x260
[ 697.150022] [<c1a03cbd>] ? sub_preempt_count+0x3d/0x50
[ 697.150028] [<c1a03cbd>] ? sub_preempt_count+0x3d/0x50
[ 697.150034] [<c19f4646>] ? printk+0x3d/0x3f
[ 697.150040] [<c1569adc>] ? dpm_show_time+0xbc/0xf0
[ 697.150046] [<c156b952>] ? dpm_suspend+0x132/0x1e0
[ 697.150052] [<c1288baf>] suspend_devices_and_enter+0xaf/0x220
[ 697.150057] [<c1288fb8>] pm_suspend+0x298/0x300
[ 697.150063] [<c1289935>] try_to_suspend+0xa5/0xc0
[ 697.150069] [<c1a0091d>] ? _raw_spin_unlock_irq+0x1d/0x40
[ 697.150076] [<c125ebad>] process_one_work+0x11d/0x3d0
[ 697.150082] [<c14b091e>] ? __delay+0xe/0x10
[ 697.150088] [<c125f239>] worker_thread+0xf9/0x320
[ 697.150093] [<c1a00966>] ? _raw_spin_unlock_irqrestore+0x26/0x50
[ 697.150099] [<c125f140>] ? rescuer_thread+0x2b0/0x2b0
[ 697.150104] [<c1264cf4>] kthread+0x94/0xa0
[ 697.150112] [<c1a07077>] ret_from_kernel_thread+0x1b/0x28
[ 697.150117] [<c1264c60>] ? kthread_create_on_node+0xc0/0xc0
[ 697.150121] Wakeup from IRQ 32 penwell_otg
/sys/kernel/debug/mid_pmu_states and other files can give hints about the root cause.
Anyway, if you want to adventure yourself on trying to solve the problem, be my guest
[1] - https://github.com/pstglia/linux/tree/DELL_VENUE_LOS_14.1/modules/wlan/PRIVATE/bcm43xx
[2] - https://github.com/pstglia/hardware-libaudio/tree/DELL_VENUE_LOS_14.1
Additional info for those interested on improve this:
1) Added a debug service that collects dmesg & logcat 3 times every boot
output is recorded on /data/log_debug_venue8_3030.txt
2) ADB from usb cable is not working, but is working from network. This way, I suggest you enable these on "Developer options":
- Root acess: Select "ADB only".
- Android debugging
- ADB over network (note: You must connect to a network prior - IP and port will be displayed when enabling this option)
Once done, from PC, you can connect to adb:
# (will connect to tablet)
adb connect TABLET_IP_ADDR
# (will restart adbd on tablet, to root mode)
adb root
# (will connect again, now with root acess)
adb connect TABLET_IP_ADDR
Click to expand...
Click to collapse
3) If you want to make any change to /system on living image, you must remount /system with write privileges:
- Ensure you enabled adb over network as described on step 2
- connect to table and remount /system:
adb shell
mount -o rw,remount /system
Click to expand...
Click to collapse
How difficult would it be to port to the 7840? Or alternatively, would it be possible to help me learn how I could build it myself?
theabnormalguy said:
How difficult would it be to port to the 7840? Or alternatively, would it be possible to help me learn how I could build it myself?
Click to expand...
Click to collapse
Hi,
It has a medium/high level of difficult, depending how "perfect" do you want your port.
And more than difficult, it's *extremelly* time consuming. You must be prepared to spent weeks/ months in order to try to make something work.
And before starting anything, be sure is viable. A crucial point is having kernel source files for your device.
without it, don't waste your time.
In your case, take a look at opensource.dell.com
Learning: As a start, I'd recomend you to watch these videos:
https://www.youtube.com/c/AlaskaLinuxUserAKLU/playlists
You'll need to learn all of these (not limited to):
- Learn some C/C++ and java. You'll have to read source code to understand basicallyhow it works
- Learn Unix/Linux terminal commands. I'll need lots of find, grep, cd, cat, etc....
- Learn shell script
- Learn git
- Learn how to compile and cusomize a kernel
- Understand how Android source code/components are strutured (AOSP)
During your development, you'll need to carefully look at log files, include debugging info on scripts/codes, think,research, deduce, test, retest, test again,back some steps an try new appoaches.
And finally, I won't be working on any other device. After finishing this one I'm working on (or giving it up), not going to waste my time on custom roms sonner.... I have a life to live
Good luck
Project die?
FYA_EXel said:
Project die?
Click to expand...
Click to collapse
Not yet. I'm just looking for courage to go on.
If you see courage nearby, tell her that I'm looking for her
I intent to make bluetooth work and improve battery life. Camera is not a priority.
Remember everyone that source code is available. Everyone is free and invited to help improving this image.
Regards
pstglia
When I flash this rom, I get to the Lock Screen and it hard freezes. Anyone else get this problem? Thanks for all your work @pstglia
Update: I fixed it by wiping the data partition. This is incredible; this tablet has never been so smooth. Any advice on adding GAPPs?
the_Victorian said:
When I flash this rom, I get to the Lock Screen and it hard freezes. Anyone else get this problem? Thanks for all your work @pstglia
Click to expand...
Click to collapse
You are able to boot it but when locking screen you can't return to operation, having to boot it again.
Is this your issue?
If so, it's a known issue where backlight bright level goes to zero. If you blindly move the bright slider, you can have image again (or changing bright values bellow /sys using adb)
pstglia said:
You are able to boot it but when locking screen you can't return to operation, having to boot it again.
Is this your issue?
If so, it's a known issue where backlight bright level goes to zero. If you blindly move the bright slider, you can have image again (or changing bright values bellow /sys using adb)
Click to expand...
Click to collapse
Wow, thanks for your quick reply! I was just dumb and didn't wipe my android 4.4 data before installing; that fixed it. I have been tinkering trying to get GAPPs installed but run into error 70 in CWM when I do. Have you had success?
the_Victorian said:
Wow, thanks for your quick reply! I was just dumb and didn't wipe my android 4.4 data before installing; that fixed it. I have been tinkering trying to get GAPPs installed but run into error 70 in CWM when I do. Have you had success?
Click to expand...
Click to collapse
I have installed opengapps (x86, 7.1, pico). Don't remember having issues installing it.
But makes tablet really slow most of time.
pstglia said:
I have installed opengapps (x86, 7.1, pico). Don't remember having issues installing it.
But makes tablet really slow most of time.
Click to expand...
Click to collapse
Hmm that's interesting. I'm trying the same file but every recovery I try has given me error 7. Will continue tinkering. Something to do with system mount permissions maybe?
the_Victorian said:
Hmm that's interesting. I'm trying the same file but every recovery I try has given me error 7. Will continue tinkering. Something to do with system mount permissions maybe?
Click to expand...
Click to collapse
Afaik error 7 means package doesn't match the device. On Lineage images I bypass it by editing update-binary/updater-script inside META dir.
However I think opengapps does not perform these checks...
Have you tried formatting your cache partition before applying opengapps package?
Which recovery version are you using? Is the thethered one from SDC/Vampirefo?
I thought this moment would never come , I always dreamed of a custom rom for this device, I hope you can continue developing it
quevon24 said:
I thought this moment would never come , I always dreamed of a custom rom for this device, I hope you can continue developing it
Click to expand...
Click to collapse
Hi, I'll try to. But my limited knowledge doesn't allow me to advance the way I wish.
So, do not expect something perfect, fast and stable...
If we had some developer that could help on this, maybe you could have a really nice rom.
Note: All sources are available on github. See 1st post.
If I achieve some progress I'll share here.
The image I have is bootable and you can test anything if you understand the risks of potentially brick your device.
If you have nothing to lose, give a try
pstglia said:
Hi, I'll try to. But my limited knowledge doesn't allow me to advance the way I wish.
So, do not expect something perfect, fast and stable...
If we had some developer that could help on this, maybe you could have a really nice rom.
Note: All sources are available on github. See 1st post.
If I achieve some progress I'll share here.
The image I have is bootable and you can test anything if you understand the risks of potentially brick your device.
If you have nothing to lose, give a try
Click to expand...
Click to collapse
I just install the rom using Windows 11, i have the stock rom(android 4.2.2, 4.3 and 4.4.2) in case i brick the tablet.
I used apkmirror to install chrome x86 version, i can't use youtube because the lack of google play services
quevon24 said:
I just install the rom using Windows 11, i have the stock rom(android 4.2.2, 4.3 and 4.4.2) in case i brick the tablet.
I used apkmirror to install chrome x86 version, i can't use youtube because the lack of google play services
Click to expand...
Click to collapse
You can use opengapps for youtube & google stufff.
But at the current stage of this rom, it will make tablet really slow...
pstglia said:
Hi,
This is the list of missing features / issues:
Choose one of your preference and hands on!
update 2022-05-31: Audio and Rotation were fixed.
kernel display driver was updated. Experience is smoother
-[FIXED] Wi-fi is not working:
Help wanted: Fix code and make it work:
Status so far: Fixed.
It will work on boot if you keep it enabled. If you disable Wi-fi from settings and try to re-enable (or switch on/off airplane mode), it will stop working until you boot it again.
update 2022-06-02: Discovered that you can't ioctl wlan0 to up state when you disable it (using root + proper capabilities).
However, if you rmmod bcm4330 and insmod it again, you can enable it.
It seems a driver issue.
update 2022-06-03: Using stock kernel module for network, no issues with ioctl after disbling wi-fi
-[FIXED] Sound is not working:
Help wanted: Investigate what's wrong and fix it
Status: Fixed [working since updated 2022-05-29]
Note: libaudio from stock image couldn't be loaded, so generated one from Android-x86 libaudio code (see [2]).
Maybe adjusts are needed on source, config and Boardconfig files.
update 2022-05-22: all libs are being loaded, but there are some errors when trying to load codecs. Config files must be checked (as well libs);
- [FIXED] Navigation menu is not being displayed:
Help wanted: Discover why is not being shown and fix it
Status: Fixed (created a overlay on device tree and made "def_force_show_navbar" to be enabled - see commit 8768b512c08b5fc60a7d7674ffce7c3a23a7857a)
- Camera is not working:
Help wanted: Make it work
Status so far: HALs must be copied. Possibly lot's of shims and Voodoos/Mojos required.
- [FIXED] Sensors are not working:
Help wanted: Make it work
Status: Fixed (replaced sensor_hal_config files)
- [FIXED] Bluetooth is not working:
Help wanted: Make it work
Status do far: Fixed (used harware/broadcom/libbt instead of vendor lib)
- [FIXED] Port/Enable zram to kernel:
Help wanted: Porting
Status: Enabled from stage tree (it was there all the time).
Seems to be working (at least swap was mounted using it)
[1] - https://github.com/pstglia/linux/tree/DELL_VENUE_LOS_14.1/modules/wlan/PRIVATE/bcm43xx
[2] - https://github.com/pstglia/hardware-libaudio/tree/DELL_VENUE_LOS_14.1
Click to expand...
Click to collapse
sry, lack of response due to lack of knowledge: thought this is about Venue 7840
ikram.senguen said:
sry, lack of response due to lack of knowledge: thought this is about Venue 7840
Click to expand...
Click to collapse
Nope, this is for Venue 8 3830

Categories

Resources