[Q] Building your own kernel - Legend General

Hey all. This is my first post here on XDA.
I've been thinking of compiling my own kernel image for my HTC Legend. I've spent hours googling and reading different forums and blog's. But without greater success, most of the guidelines are not spot on and some things are not cristal. So I have a few questions regarding this.
I have read that a specific radio image is just "comptabile" for compilation with a specific kernel version. So let's say I have HTC_LEGEND_RADIO_7_083521_sign.zip, how do I know what kernel version this is made for? In my ears this sounds pretty strange . I would not be able to build a kernel from that radio image and the 2.6.35.5 Linux kernel?
I've also tried to figure out what exactly the radio image is from various boguos posts on different forums, and what I belive it is from the tiny bits of information I've found is that It's modules for the phones hardware?
Oh, and what is the latest radio image version available for the HTC Legend?
Hope someone can help me clear some of my questions

I can only answer the very last question lol, it's 7.08.35.21
Latest RUU:
RUU_Legend_Vodafone_AU_2.10.178.1_Radio_47.39.35.09_7.08.35.21_release_138238_signed.exe
First seen in:
RUU_Legend_HTC_WWE_2.03.405.3_Radio_47.39.35.09_7.08.35.21_release_130330_signed.exe

Hi tonper,
First... where did you get that radio has something to do with kernel??? Radio image is basically a firmware (operating system of its own that interacts with radio hw) and has nothing to do with Android kernel which is in fact patched Linux kernel. One can access all functions of radio through userspace Android apps that communicate with radio via native libraries. That's all that it is to say about radio in conjunction with kernel.
To be able to build a kernel one should first master basics of Unix/Linux system principles and first try to build own kernel for some Linux distro. One need to know also how to boot this kernel and use it with the rest of the operating system. Last thing to master is cross-compiling as you will be building kernel for ARM architecture most possibly on your x86 PC. In short the topics to search for would be:
* knowing Linux (principles)
* booting Linux (process)
* compiling Linux kernel
* cross-compiling
Android powah!

Thanks for your answer BlaY0!
Will check into it some more this weekend with this new information.
BlaY0 said:
* knowing Linux (principles)
* booting Linux (process)
* compiling Linux kernel
* cross-compiling
Click to expand...
Click to collapse
Been running Linux for 10 years and Debian for 7 years. So got the basic knowledge I just can't find any good documentation on this topic

Cyanogenmod wiki have some guides
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source

snakehult said:
Cyanogenmod wiki have some guides
Click to expand...
Click to collapse
How could I have missed that page? Have been googling like a maniac. That was pretty much exactly what I was looking for. Thanks alot snake

tonper said:
Been running Linux for 10 years and Debian for 7 years. So got the basic knowledge I just can't find any good documentation on this topic
Click to expand...
Click to collapse
OK, then you're set m8 you just need to grab some ARM cross-compiling toolchain for x86. Your first bet would be Android NDK. You can also use CodeSourcery or even build your own toolchain with Buildroot... but for compiling kernel really doesn't matter which one U use.
Happy compiling

Related

What is a kernel?

this might be a stupid question, but what is a kernel and how do u use them? i know what a rom is and how to install but not a kernel....
Wikipedia definition:
"In computing, the kernel is the central component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components).[1] Usually as a basic component of an operating system, a kernel can provide the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It typically makes these facilities available to applicationprocesses through inter-process communication mechanisms and system calls."
Since Android is based on Linux: (don't know if this relevant)
"The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems.[6] It is one of the most prominent examples of free and open source software.[7]
The Linux kernel is released under the GNU General Public License version 2 (GPLv2),[4] (plus some firmware images with various licenses), and is developed by contributors worldwide. Day-to-day development takes place on the Linux kernel mailing list.
The Linux kernel was initially conceived and created by Finnish computer science student[8] Linus Torvalds in 1991. Linux rapidly accumulated developers and users who adopted code from other free software projects for use with the new operating system.[9] The Linux kernel has received contributions from thousands of programmers.[10] Many Linux distributions have been released based upon the Linux kernel."
I have a question too.
When I boot ubuntu 10.04, the kernel comes up as 2.6.32, I think this is the same number as a previous android kernel. So how close is the android kernel to the linux kernel, us it a fork? When the new linux kernel comes out, will the android kernel be updated to reflect that?
What the little brown things are in a popcorn bag before you pop it XD
I thought it would be better to ask here than start a new thread but i have never installed a kernal before and was wondering how, do you just flash it in recovery? I have the desire rom and would like for my speaker to be a bit louder.
With kernels, I usually do ADB command.
liam.lah said:
So how close is the android kernel to the linux kernel, us it a fork?
Click to expand...
Click to collapse
It's the same with some Android and phone specific patches applied. A config file decides what architecture to build for and what drivers to include. That's what lets us bring in cutting edge features like compcache and BFS quickly.
Nice to think that your phone is running the exact same code that the world's fastest supercomputer is.

[Q] help build cp210x.ko on Iconia A500 3.2.1

Hi,
I really need the cp210x.ko module, but I couldn't successfully build it properly for my Iconia A500 with 3.2.1 and 2.6.36.3+ kernel.. I get the following when I tried insmod my cp210x.ko build using ubuntu cross compiler approach:
cp210x: version magic '2.6.36.3+ preempt mod_unload ARMv5 ' should be '2.6.36.3+ SMP preempt mod_unload ARMv7 '
A little search showed that I need to build it in ARMv7, and need to set the kernel config to build SMP kernel. In this thread I saw a few modules offered but couldn't post reply as a new xda-developers user, so I post here. My A500 has already been rooted via the su (version 3) method posted few days ago.
Please help me build the cp201x.ko module - I am kinda stuck..
Bill
Bill,
Might I suggest you look at loading one of the many custom ROM's that will have what you want? If you are rooted, then install CWM (ACER Recovery from the marketplace) which should allow you to load custom ROM's. In order to load the cp201x.ko module you'd have to recompile the kernel and people doing this type of work normally are building custom ROM's.
Anyway, just my 2ยข
Thanks for the advice. I am testing Thor ROM at the moment. Cool..
From what I can read and see within various ROMs /system/lib/modules, very few (out of total possible) kernel modules made it to these custom ROMs - mostly to get game controller to work, extra filesystems, or networking protocols. USB-to-serial modules are rare and certainly my search didn't turn up cp210x.
Cross-compiling the kernel source on Gentoo is mentioned to be better supported then ubuntu, due to its crossdev toolkit, as I'm trying to figure out how to specify target ARMv7 instead of ARMv5 I'm defaulting to when cross compiling from Ubuntu's arm-linux-gnueabi-*
I'm wondering if various nice ROM cooks have releases of their modified kernel source - or might be willing to help me build the just the cp210x as a .ko module, e.g. in the .config, "CONFIG_USB_SERIAL_CP210X=m" - I've found a post few months ago where a successful build and insertion of cp210x module was done but he had some problems when initiating communication on it - I fear the worst but hope for the best, and would like to try that myself as I've successfully talked to my device through the cp210x module on Linux.
Or, if any tips on how to build kernel (just the modules really) properly e.g. As Thor's ROM version number hints at need for some custom and virtualized build environment, I'm looking for the quick and dirty solution if cooking ROMs/kernel/ko's has steep learning curve..
Any help much appreciated!
Bill
It looks like I was speeding down the the wrong track last few days
Apparently the /proc/config.z copied off the a500 device was missing something - and how strange that is - so I had to enable SMP and choose Tegra 2 ARM processor using "make menuconfig" to get the vermagic on the build module (e.g. modinfo after successful make modules) to show ARMv7 and SMP, build from my Ubuntu cross-compiling setup. I haven't tested this new cp210x.ko on a500 yet (as it's currently running one of the customized ROMs that has different EXTRAVERSION/vermagic to the stock Acer kernel source version 2.6.36.3 that I'm based on.
I think it'd be really wonderful if various Android kernel and kernel module makers release their kernel config, sync'ed to each ROM or kernel release, so people like me may independently build special purpose kernel modules with more efficiency and accuracy (to target their customized kernel), and we can recontribute back to to a growing list of tested and working modules for corresponding devices.
Bill
Hmm... Silly. It looks like Thor's ROM already has cp210x build-in, not as a loadable module but compiled in. My device is reported to attach to ttyUSB0! How nice
Thanks!
Bill
For those who are interested, the cp210x.ko module build using latest mentioned approach, e.g. modified kernel config.z, generate module that appear to insert correctly into lightspeed and taboonay roms (neither has this USB-to-serial module) - with a little modification of the EXTRAVERSION variable in the Makefile.
Bill
CP210x and GT-P7500
Has anyone got CP210x module working with Samsung Tab GT-P7500? My problem is that the connected USB-device doesn't create node dev/ttyUSB*. I have spent lot of time trying to figure this one out.
I have tried 1) Manually compiling the linux kernel that has cp210x support as a module. After compiling the module I tried insmoding the cp210x.ko to a running kernel, but even though it seemed to load and unload all right, it did not give me the wanted results. It does not create device node /dev/ttyUSB*. I have also tried modifying ueventd.rc for adding this row, but I am guessing it is only relevant for permissions after the node is created.
Also 2) loading cyanogenmod 10 (which should have cp210x support) to tablet but it doesnot create the desired /dev/ttyUSB* node. I can see device file under dev/bus/usb/001/ but the node does not exist.
I am going to try making needed files for building custom kernel and inserting to tablet. However, I have 0 experience on this, I think it can be tough one.
Any help would be welcome, thanks.

Anyone have used this RK3066 development Board?

I just searched ebay for RK3066 Development Board, and found one there, I have played the Beagle board.
this one seem good for play with RK3066 firmware and debug rom.
wy6688 said:
I just searched ebay for RK3066 Development Board, and found one there, I have played the Beagle board.
this one seem good for play with RK3066 firmware and debug rom.
Click to expand...
Click to collapse
Not used that one, but I'd caution you away from the RK3066 in general, as I have used a device with RK3066 chipset...
Rockchip don't respect or follow the GPL and give sources with binaries included. This means you cannot compile entirely from source, and can be problematic. Some core drivers like the clock driver are blobbed.
There may be better development boards out there, the ODroid X2 is one I've heard good things about.
I have checked the Latest Linux Kernel source from Kernel.org, all their source code included, using new ARM DTS system (device tree source), so you can compile all your kernel directly from mainstream kernel, except some board level chip driver, which you need to customize from Driver fold, /linux/arch/arm/boot/dts/rk3066a.dtsi, rk3066a-clocks.dtsi
wy6688 said:
I have checked the Latest Linux Kernel source from Kernel.org, all their source code included, using new ARM DTS system (device tree source), so you can compile all your kernel directly from mainstream kernel, except some board level chip driver, which you need to customize from Driver fold, /linux/arch/arm/boot/dts/rk3066a.dtsi, rk3066a-clocks.dtsi
Click to expand...
Click to collapse
Have you got NAND drivers for the rk3066 nand? clock drivers, ddr drivers?
(see files with a .uu extension, it's a uuencoded .o binary)
https://github.com/AndrewDB/rk3066-kernel/tree/master/arch/arm/mach-rk30 (ddr.uu, ddr_freq.uu, clock_data.uu)
https://github.com/AndrewDB/rk3066-kernel/tree/master/drivers/video (fb.uu)
I believe there's also some missing drivers for the nand (https://github.com/AndrewDB/rk3066-kernel/tree/master/drivers/mtd/rknand)
I just got the development broad from ebay and checked the source code, it do missing these source file and although you can build the kernel without issue for 3.0.8.
I believe the latest 3.10.x kernel from kernel org, which included the RK3066 DTS files, can be used to build the generic kernel that can run on RK3066 board and should have no other source code needed.
I'm trying to build this kernel based on 3.10.x, anyone know detail steps that build the generic kernel based on RK3066 DTS?
Thank advance.

[Q] Python Issues when running a certain application

Hi all! First post to xda-developers, hoping for some assistance with an app that ran fine on stock, now not running on OmniROM. The application is Katawa Shoujo Ver5, the 334MB Monolithic release. I logcatted it down to an error that basically tells me that it cannot open _imaging.so and _sqlite3.so. I researched and found that these libraries belonged to a whole laundry list of 32bit libraries that my python 2.7 does not have. So, I have to figure out how to either add these libs manually or import them into python, how would I go about fixing the issue??
Device: SGH-T999L (T-Mobile)
ROM: OmniROM 4.4.4
Kernel: BMS (Not sure of exact, my phone is dead atm, sorry!) Will Update if needed when I get home
Linux Version: 3.4.y
austinyork1 said:
Hi all! First post to xda-developers, hoping for some assistance with an app that ran fine on stock, now not running on OmniROM. The application is Katawa Shoujo Ver5, the 334MB Monolithic release. I logcatted it down to an error that basically tells me that it cannot open _imaging.so and _sqlite3.so. I researched and found that these libraries belonged to a whole laundry list of 32bit libraries that my python 2.7 does not have. So, I have to figure out how to either add these libs manually or import them into python, how would I go about fixing the issue??
Device: SGH-T999L (T-Mobile)
ROM: OmniROM 4.4.4
Kernel: BMS (Not sure of exact, my phone is dead atm, sorry!) Will Update if needed when I get home
Linux Version: 3.4.y
Click to expand...
Click to collapse
Um, Omni does not include python to begin with, so... Issues you're having with third-party apps missing components (from an Omni perspective, python on a mobile device is a third-party app) aren't something relevant to Omni
Oh yeah, your device is also not officially supported. Even of the d2 family were, an alternate kernel means you have a modified configuration and we're not going to waste time on it. Argue that your issue is kernel-related all you want, it shows that you've modified the system so who knows what else you hacked.

Regarding Android 10 on the HP Touchpad

Hello
For the past couple (weeks) I've been trying to compile Android 10 for tenderloin using the Android 9 sources but it's not going so well. First thing I ran into multiple sepolicy errors and I feel as if I fixed them in inappropriate ways but the errors went away. Other errors regarding camera and audio and such, that are regarding that tenderloin no longer uses the legacy audio format. Made me confused because I used the device sources form Evervolv and DIrty unicorns and if i'm correct they built it exactly the same way they uploaded it. After these errors were wrapped up, I got a error at zipping the rom that it could not zip due to failure of being able to read build.prop. This made me believe that the sources are not correctly formatted. If anyone can help me find a manifest, I can build for all you guys. Please keep tenderloin alive!
Now, I did something and I'm getting plenty of perl errors. Maybe I'm just very unlucky. I'm gonna attempt to reinstall on a fresh drive on my server.
If its anyone's concern, I was building lineage 17.1. I noticed for example, Lineage's "qcom-device" repo was shaped completely differently than Evervolvs qcom-device repo.
This led me to thought that Android 10 is going to be extremely difficult because of all the upstream dev changes that was pushed to Q. If any of you would like, I could probably push out March patches Pie rom because over there I'm mostly safe of complying with the source.
My manifest shape
DirtyUnicorn's device-tree
DirtyUnicorn's device-tree-common
DirtyUnicorn's htc-msm8960-kernel
Evervolv's vendor
And dirty unicorn's atheros wlan driver
I have been changing up the device tree so much, it almost looks ridiculous . From what I heard lots of properties on the device tree haven't been touched for years. Maybe tomorrow I can try Evervolv's Q rom. If you guys can help me build up my manifest, we can push out a fully working Q rom for tenderloin. And it would be just in time when Android 11 comes out. Thank you everyone!
I wish that I could offer any help, but I never tried to compile any Android ROM or for the HP_TP.
To my knowledge the only users that I know that could offer some insight on the process would be:
 @flintman
 @elginsk8r
Also the LuneOS project could offer some help:
https://pivotce.com/tag/luneos/
If Android Q(10) can not be ported to the HP_TP, then at least P(9) is a good ROM to keep updating that could provide many years of App support.
Theres no reason why exactly it cant,, because lots of roms I hear were built off the original TP sources (From 2011!). It was only around 2016 when guys around here had to change it up so much that they should've been so surprised that it worked. I can try and temporarily maintain P roms until the boys around here push out sources for Q!
djared704 said:
Theres no reason why exactly it cant,, because lots of roms I hear were built off the original TP sources (From 2011!). It was only around 2016 when guys around here had to change it up so much that they should've been so surprised that it worked. I can try and temporarily maintain P roms until the boys around here push out sources for Q!
Click to expand...
Click to collapse
To my limited knowledge is all about Hardware -->> Drivers -->> ( Kernel ).
The reason that Bluetooth and camera does not work on newer Android version is due to the old (proprietary drivers) and the Kernel. That takes more dedication and work than the ROM. The same rules applies to the desktop, older processors does not support certain features and the Operating System will not run. It is possible to disable the features in the kernel so that it does not check the hardware and make it run, but it will be unstable.
Everything could be possible with plenty of time, knowledge and dedication.
HP_TOUCHPAD said:
To my limited knowledge is all about Hardware -->> Drivers -->> ( Kernel ).
The reason that Bluetooth and camera does not work on newer Android version is due to the old (proprietary drivers) and the Kernel. That takes more dedication and work than the ROM. The same rules applies to the desktop, older processors does not support certain features and the Operating System will not run. It is possible to disable the features in the kernel so that it does not check the hardware and make it run, but it will be unstable.
Everything could be possible with plenty of time, knowledge and dedication.
Click to expand...
Click to collapse
When I look at the tenderloin source, the script to gather the camera driver is disabled. Camera isnt a huge deal though because its only 1.3 MP. However we use the MSM 8960 kernel from HTC and that is the one m7,, but the one m7 is a SD 600 device so it loses sense. I was gonna get some help with one of my kernel developer buddies to dev a kernel for android 10 for tenderloin. If you see the one m7 has Lineage 17.1 available and even though it doesnt have same chipset, if im correct both chipsets went off of the same assembly line process. Lineage 17.1 for the one m7 also packages it as a "uimage" which is what we use. I believe this was only a very small select of devices. Yeah about that ive been getting so many complaints during build about "mkimage" which should've been a prebuilt tool in the lineage source. Don't know why they removed it, or if our developers added it in by their selves, etc. Anyways I fixed that error by just "allowing" mkimage in one of the permission files in my environment. But yeah i went as far as the build packaging the ROM and it complaining it cannot read build.prop. Note the build.props are generated by the environment , not the source (even though the device data is gathered by the source, its not what im talking about). I even go to the directory it was complaining about and it was all there. One of my friends suggested a permission error. I changed permissions to 777 (rw to all users) and it would still output that error. By that point I trashed my build meaning I may of done something wrong early on. I will let someone else continue building 10 but I will continue building 9 with latest patches.
It will be extremely impressive if any kernel developer will update the HP Touchpad Kernel or tweak it for future release, well everything will stop once Android becomes 64 only.
I am sure you are very well aware, but I will suggest using this built:
https://forum.xda-developers.com/hp-touchpad/development/rom-evervolv-hp-touchpad-t3923512
I was able to do the following playing around recompiling the Kernel. I recompile almost all the ROM and incorporated the same kernel changes.
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773
The Ramdisk is also very easy to unpack and repack:
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-novacom-repair-android-t3960435
There is no need to get the original Camera or Bluetooth working, only sound and WiFi.
HP_TOUCHPAD said:
It will be extremely impressive if any kernel developer will update the HP Touchpad Kernel or tweak it for future release, well everything will stop once Android becomes 64 only.
I am sure you are very well aware, but I will suggest using this built:
https://forum.xda-developers.com/hp-touchpad/development/rom-evervolv-hp-touchpad-t3923512
I was able to do the following playing around recompiling the Kernel. I recompile almost all the ROM and incorporated the same kernel changes.
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773
The Ramdisk is also very easy to unpack and repack:
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-novacom-repair-android-t3960435
There is no need to get the original Camera or Bluetooth working, only sound and WiFi.
Click to expand...
Click to collapse
I think I probably stated somewhere, but Evervolvs "device" tree would just spit out hundreds of errors, and I fixed this by switching to Dirty Unicorns device tree. I also tried flintman's device tree and it didn't spit out many errors. Thanks for this though.
djared704 said:
I think I probably stated somewhere, but Evervolvs "device" tree would just spit out hundreds of errors, and I fixed this by switching to Dirty Unicorns device tree. I also tried flintman's device tree and it didn't spit out many errors. Thanks for this though.
Click to expand...
Click to collapse
I have only recompile the Kernel and all of them work, but the correct branch must be use. I can not say about building a ROM, never done it.
But Evervovs Pie by elginsk8r works very well and stable as it uses the same kernel, but the framework is different. I guess elginsk8r will be the only that can guide you on the right direction or flintman.
Have fun learning, it takes a lot of TIME!

Categories

Resources