Help with kernel building - HTC 10 Questions & Answers

I was wondering if someone could help me. I've been playing around with flashing roms and basic stuff for a long time, but I figured I'd like to play around with kernel building, and just generally trying to learn about android/linux/java more. So far the only kernels I've successfully built were for the 6P just because I tried it following google's source website. I've been trying to just see if I could build a stock kernel for the 10, so I could see if I could actually flash it. My builds always fail at the same places, so I tried cloning the repositories of flar2 and tbalden just to see if I could make their kernels and my build fails on the same. Looking at source codes from other devices such as the OnePlus3 I see that it's basically the same, and so I tried building that and it fails exactly for me at the same areas as well.
I'm using an older 2012? Core-i5 laptop that I had laying around, installed Ubuntu 16.04 LTS. I got the newest android NDK, put the path into .bashrc so I could just use CROSS_COMPILE=aarch64-linux-android- without having to type out the full path every time. I'm wondering if there's just something wrong with my build environment and I need to start over? I see all these tutorials, but they're all old and usually covering older 32-bit kernels. They mention all the variations of using sudo apt-get install, followed by a bunch of various packages. So I'm wondering if these are older packages conflicting with something? Does anyone happen to have any guidance on this. I just want to get setup and be able to build a single HTC 10 kernel and then go from there.

duowing said:
I was wondering if someone could help me. I've been playing around with flashing roms and basic stuff for a long time, but I figured I'd like to play around with kernel building, and just generally trying to learn about android/linux/java more. So far the only kernels I've successfully built were for the 6P just because I tried it following google's source website. I've been trying to just see if I could build a stock kernel for the 10, so I could see if I could actually flash it. My builds always fail at the same places, so I tried cloning the repositories of flar2 and tbalden just to see if I could make their kernels and my build fails on the same. Looking at source codes from other devices such as the OnePlus3 I see that it's basically the same, and so I tried building that and it fails exactly for me at the same areas as well.
I'm using an older 2012? Core-i5 laptop that I had laying around, installed Ubuntu 16.04 LTS. I got the newest android NDK, put the path into .bashrc so I could just use CROSS_COMPILE=aarch64-linux-android- without having to type out the full path every time. I'm wondering if there's just something wrong with my build environment and I need to start over? I see all these tutorials, but they're all old and usually covering older 32-bit kernels. They mention all the variations of using sudo apt-get install, followed by a bunch of various packages. So I'm wondering if these are older packages conflicting with something? Does anyone happen to have any guidance on this. I just want to get setup and be able to build a single HTC 10 kernel and then go from there.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1748297
Here you go

Related

Looking for a Dev for Advice in Cooking a ROM

I've read through the forums, done a lot of reading through a TON of resources over the past few weeks. I know I should learn some Java and probably learn how to build an app or two for Android but I'm a bit short on time with everything going on in my life and want to learn as I go. Trying to learn Java online gives me a headache since I'm sure there is no shortway of learning it and that is all there is online -.-'
I am looking for a developer to help me "cook" up a ROM. I'll start with what I have done and what I know. Maybe someone could add in some information or tips/suggestions/tweaks that I could use that would be helpful. This is the first time I'll be attempting to build my own ROM since my Touch Pro days so please bear with me.
I have tried to look at different resources but most of it gets tossed over to the Hero. I'm not sure how similar they are but I rather not risk it.
What I have done:
Setup Kitchen via Cygwin.
Downloaded Stock RUU For 3.70 base.
Set home folder.
What I know:
What most of the options do in the Kitchen
How to add and remove applications from the working folder.
(SHHH I'M NEW TO THIS!) lol
What I want to know:
How to add themes
How to add radios (included in the ROM)
Dalvik moved to cache instead of eating up main memory
SNQ 4 in 1 Reboot MOD
Power Control Notification Bar MOD
Automatically Zipalign all apps after each boot (Is this just option 6 in the kitchen?)
How to pull the latest .apk files to update my ROM. (Do I just update via the Market on my phone and then go into system/data to get the latest .apk file? Not sure)
How to add kernels (included in the ROM) http://forum.xda-developers.com/showpost.php?p=7628768&postcount=1664
-I found this but I am a bit confused. Lets say I want to use netarchy's 4.3.1-bfs no havs kernel. I looked through the .zip file and saw theres 3 folders. kernel, META-INF, and system. What do I do with these? Or do I just deal with the zip. Need someone to walk me through this or point me in the right direction.
Thanks to everyone who responds in advance. (I hope someone does)
Bumpppppppp
sekigah84 said:
I've read through the forums, done a lot of reading through a TON of resources over the past few weeks. I know I should learn some Java and probably learn how to build an app or two for Android but I'm a bit short on time with everything going on in my life and want to learn as I go. Trying to learn Java online gives me a headache since I'm sure there is no shortway of learning it and that is all there is online -.-'
I am looking for a developer to help me "cook" up a ROM. I'll start with what I have done and what I know. Maybe someone could add in some information or tips/suggestions/tweaks that I could use that would be helpful. This is the first time I'll be attempting to build my own ROM since my Touch Pro days so please bear with me.
I have tried to look at different resources but most of it gets tossed over to the Hero. I'm not sure how similar they are but I rather not risk it.
What I have done:
Setup Kitchen via Cygwin.
Downloaded Stock RUU For 3.70 base.
Set home folder.
What I know:
What most of the options do in the Kitchen
How to add and remove applications from the working folder.
(SHHH I'M NEW TO THIS!) lol
What I want to know:
How to add themes
How to add radios (included in the ROM)
Dalvik moved to cache instead of eating up main memory
SNQ 4 in 1 Reboot MOD
Power Control Notification Bar MOD
Automatically Zipalign all apps after each boot (Is this just option 6 in the kitchen?)
How to pull the latest .apk files to update my ROM. (Do I just update via the Market on my phone and then go into system/data to get the latest .apk file? Not sure)
How to add kernels (included in the ROM) http://forum.xda-developers.com/showpost.php?p=7628768&postcount=1664
-I found this but I am a bit confused. Lets say I want to use netarchy's 4.3.1-bfs no havs kernel. I looked through the .zip file and saw theres 3 folders. kernel, META-INF, and system. What do I do with these? Or do I just deal with the zip. Need someone to walk me through this or point me in the right direction.
Thanks to everyone who responds in advance. (I hope someone does)
Click to expand...
Click to collapse
If I'm not mistaken, most of the things you want to do would probably have to be done manually.
You can zip align and add the radios through dsixda's kitchen but the themes need to be added to the framework. apktool will work for this but this is where knowing java comes in handy.
When looking at a kernel like Net's the zImage file is the actual kernel, you'll want to use the kitchen to add that to the boot.img and the other lib files, etc, you can copy to the ROM.
To add and remove files usually I'll just keep an open copy of the zip and work with it through file explorer. Just rezip & resign it once your done and you should be good to go.
I keep a copy of Ubuntu running in Oracle's VM for the kitchen and mounting image files, it may take a minute to set up if you aren't familiar with linux but it makes it easier to pull stuff out of update zips.
well since you are just starting out, xhausx's info is great and ive used simalar methods b4 for testing. But i reccomend buying first at least 2(or more) Java books and read them, because cooking a rom isnt just gonna hapen in 1 day and takes some knowledge of java to make a rom.
Later down the road i reccomend trying to learn how to make a rom thru Terminal(in Linux) as ive heard can do alot more.
So, if i were u i would use the method above.
All this INFO i posted has either come from other devs or google(Who is your friend), so take what you want from this and learn then begin Building your ROM.
Yeah I'm a Google whore. Been trying to find a few good self-learning books with Java. Tried some online tutorial pages and I have the JDK. Made a "Hello World" program just to see if I could get it to output but maybe I missed something but I can't seem to get it from .java to .class LOL (JAVA NOOB!)
Anyway, I'm probably going to find a few books and get reading. I'm probably also going to be tearing through a few of the ROMs on the forums to see how they set their files up and just do some messing around. I hope to God I don't brick my phone lol.
Didn't really expect to build a ROM anytime soon. Wanted to learn so I could try my hand at developing something. Always wanted to make an app but never had the time to do so. Guess its time now lol.
Thanks for your info guys.
sekigah84 said:
Yeah I'm a Google whore. Been trying to find a few good self-learning books with Java. Tried some online tutorial pages and I have the JDK. Made a "Hello World" program just to see if I could get it to output but maybe I missed something but I can't seem to get it from .java to .class LOL (JAVA NOOB!)
Click to expand...
Click to collapse
Did you add java to the windows PATH?
Sent from my Evo powered by MIUI
Comrade P said:
Did you add java to the windows PATH?
Sent from my Evo powered by MIUI
Click to expand...
Click to collapse
Yeah I figured that out just before you posted this. LOL. O boy. I got a while to go.

4.0.3 CDMA/LTE Binaries

Hey guys, Since the 4.0.3 CDMA/LTE binaries are not available on google's site, I had to find and pull them manually from 4.0.2, using the Maguro GSM sh install log as a reference for the files I needed. So I thought I would save the trouble for anyone else to have to do this and post the files here.
Here are the files:
https://rapidshare.com/files/731354314/toro_403_LTE_bins.zip
the zip includes the files needed, as well as the modified make files needed to tell the compiler to include the libraries in the build.
simply extract to /vendor/samsung/ in your Android Source directory, then build!
Thanks for this!
Doesn't the extract-files.sh script in AOSP do this for you?
I love you. I was about to go home and figure out how to do this, but you posted the binaries for me.
Thanks!
Dude thanks a ton! I was trying to figure out why my roms weren't booting...then I realized that only the graphics binaries were posted by google. Just to make sure, these files are pasted under /device/samsung/toro/files-go-here correct?
binaries usually get put into /vendor, not /device.
I was able to compile a bootable version using only the Google supplied binaries, though it wasn't fully functional (it did boot).
If you have a GN, the better way is to just go into device/samsung/toro, and run the extract files script with your phone connected (it uses ADB to pull them from your phone)
For some reason if I use the extract files script, I can't get the damn thing to boot. I forgot to run it once and built without it...it booted, but the radio wasn't working. So should the binaries that google posted go in /vendor as well?
The script puts the files in the appopriate location (vendor/samsung/toro/proprietary if memory serves)
Coincidentally, the build I compiled from Google provided binaries had the same problem of not having radio connectivity.
To be honest, I have yet to get a functional compile using the extract script as well, though I've heard others have. I didn't do much troubleshooting, instead just kanged AOKP's vendor and device tree from github.
Good to hear I'm not the only one. I just built it again and now I'm stuck at the google logo. I might just go ahead and grab those off git as well.
SoCmodder said:
For some reason if I use the extract files script, I can't get the damn thing to boot. I forgot to run it once and built without it...it booted, but the radio wasn't working. So should the binaries that google posted go in /vendor as well?
Click to expand...
Click to collapse
Yes. They may even be the same exact GPU binaries the script pulls from the phone (I've never checked).
would it be smart to run clobber before trying to build again?
SoCmodder said:
would it be smart to run clobber before trying to build again?
Click to expand...
Click to collapse
Based solely on having seen a warning that says you should after running the extract script, I'd say yes =)
For those of you who can't boot off your builds, are you building 4.0.3_r1? By default that build is configured to require a newer radio and bootloader than what's out officially, so you'll have to modify the board config to get those to boot on production Galaxy Nexuses.
Herp derp, yeah that's what I was trying to do. I just kanged the AOKP one's for now. I suppose I should look into them and learn how to straighten it out myself though.
A little off topic I suppose, but do any of you know if the current SU.zip will work with the new bootloader/radios?
SoCmodder said:
Herp derp, yeah that's what I was trying to do. I just kanged the AOKP one's for now. I suppose I should look into them and learn how to straighten it out myself though.
A little off topic I suppose, but do any of you know if the current SU.zip will work with the new bootloader/radios?
Click to expand...
Click to collapse
All the production bootloader/radio versions should be compatible with each other. Just change device/samsung/toro/board-info.txt to require whichever version is currently on your device and your build should boot.
After digging into it last night and this morning, I found:
- No bootloader issues. The board-info.txt issue was fixed upstream, and is in branch ics-mr1.
- Turns out even though it looked like it was hung at the Google logo, my device was actually up and contactable via adb. Logcat showed a problem initiating the graphics subsystem.
- The extraction script doesn't appear to grab some of the graphics drivers. Notable is that there is no vendor/imgtec, like there is when you use the binaries from Google.
Ultimately, I was able to get what seems to be a fully functional build (4G, sound, wifi, calls confirmed) by NOT using the extraction script, extracting the google binaries, and then extracting the binaries provided by the OP of this thread.

[Q] Toro plus binaries for SPH-L710 AOSP build?

I have built and slightly tweeked CM 10.1 but to be honest, it does drain that battery quite a bit and sometimes it freezes in landscape mode.
So I sync'ed up the source for the AOSP and then I realized that I needed binaries and I don't have the stock ROM to extract them from.
Are these "Galaxy Nexus (Sprint) binaries for Android master (20130603)" the right binaries for SPH-l710 ?
Under the Toroplus section at the very bottom of this page https://developers.google.com/android/nexus/drivers
Basically I just want try moding from stock because of the battery thing, I need to add Arduino support and maybe tweek USB or write an app, so that my phone can hook up over usb to an Arduino board and chit chat. I want the Arduino to control motors while Android gathers sensor data and decides where to go, Arduido will just follow orders. Anyways, battery consumption is huge in this project.
EDIT-1: Also, what version of Android are the 20130603 binaries for?
These are the binaries
https://github.com/themuppets/proprietary_vendor_samsung
d2spr folder.
That's not all you need to build for our device though.
I suggest just building an existing rom rather than syncing AOSP....you're gonna need to make a TON of edits to even get it to build, much less boot. I know because I'm very much involved with a new AOSP rom called omnirom and bring ups for that rom. It's not easy. We're still making edits to the source to even get it to build for non-nexus devices
CNexus said:
These are the binaries
https://github.com/themuppets/proprietary_vendor_samsung
d2spr folder.
That's not all you need to build for our device though.
I suggest just building an existing rom rather than syncing AOSP....you're gonna need to make a TON of edits to even get it to build, much less boot. I know because I'm very much involved with a new AOSP rom called omnirom and bring ups for that rom. It's not easy. We're still making edits to the source to even get it to build for non-nexus devices
Click to expand...
Click to collapse
hmm
I thought it would be a lot easier than it has been to build a stock rom, but I guess not, I am not trying to build kit-kat though, I want to build for 4.1.2 as I think thats where their updates left off but maybe I am way outta the loop.
What about the factory images? Are those flashable with the "flash-all.sh" over fastboot? Idk either way I haven't been able to get fastboot working, I don't think I have even been able to boot into fastboot, when I "adb reboot bootloader" I go to what looks like Odin's download mode, and when I do the volume up+down+power I just boot into "safe mode" and get to the launcher like normal but its in safe mode. I rooted it on Windows about a half a year ago or so using Odin and some dude's tuts on YouTube "High on Android" or something. I haven't really studied rooting so I guess thats my bad not knowing really what I was doing, but I haven't looked back and wouldn't be here now if it wasn't for it.
I'll take your word for it but I am going to keep trying to figure it out, Figureing out all this proprietary stuff is tuff, maybe I should get a device or board targeted to developers lol, didn't know Id ever say that, I thought I was going to major in Chemistry.
Edge-Case said:
hmm
I thought it would be a lot easier than it has been to build a stock rom, but I guess not, I am not trying to build kit-kat though, I want to build for 4.1.2 as I think thats where their updates left off but maybe I am way outta the loop.
What about the factory images? Are those flashable with the "flash-all.sh" over fastboot? Idk either way I haven't been able to get fastboot working, I don't think I have even been able to boot into fastboot, when I "adb reboot bootloader" I go to what looks like Odin's download mode, and when I do the volume up+down+power I just boot into "safe mode" and get to the launcher like normal but its in safe mode. I rooted it on Windows about a half a year ago or so using Odin and some dude's tuts on YouTube "High on Android" or something. I haven't really studied rooting so I guess thats my bad not knowing really what I was doing, but I haven't looked back and wouldn't be here now if it wasn't for it.
I'll take your word for it but I am going to keep trying to figure it out, Figureing out all this proprietary stuff is tuff, maybe I should get a device or board targeted to developers lol, didn't know Id ever say that, I thought I was going to major in Chemistry.
Click to expand...
Click to collapse
All of the downloads on the Google site are for and will only work with nexus devices
Those proprietary files are the bare minimum to "inject" our device's characteristics into a rom. That's how I ported Sense actually
CNexus said:
All of the downloads on the Google site are for and will only work with nexus devices
Those proprietary files are the bare minimum to "inject" our device's characteristics into a rom. That's how I ported Sense actually
Click to expand...
Click to collapse
Makes Sense.
So if I am learning anything... I would need binaries ("blobs"), I am sure Sprint, Google, and Samsung proprietary apps, and the nessiccary make (Android.mk) files, maybe some kernel patches and/or kernel object files, and hopeful to all hell I don't have to do too much XML modification I need to go find a trust-worth factory zip for the sph-l710 and rip everything I need out of that, and the bootloader I need to get it all back to stock eventually in case kit-kat does get updated by the Samsung (I am guessing thats whose hands it is in, I think they have a counter), who knows maybe the open source community will get there first.
Thanks for your help, saved me a ton of hassle.

Upgrading from JSS15Q to LMY48I

Hello all, I haven't been here for about 2 years, got busy with some things. I'm currently running a home compiled JSS15Q that has a touchscreen hack to load in the firmware that works best with my tablet. I'd like to build 5.1.1 LMY48I from source and give it a try. Do I need to upgrade any bootloaders or other stuff before attempting to push the new OS on there?
It's been 2 years since I did any of this stuff so I'm a bit foggy about it all. I had a good handle on it back then, but I've slept a lot since then. I might go with sfhub's locked in firmware this time since I was accomplishing pretty much the same thing just a different way. That's, of course, assuming that the old firmware is compatible with the newer releases of Android OS.
I built the older release in a VirtualBox VM running Ubuntu 12.04. I think I need to upgrade some things to be sure that the compile of 5.1.1 works as it should. I was about out of space on the 12.04 VM and I was going to grow the partition, but I'm thinking it might be smarter to just follow the build-from-source instructions from scratch in a new VM install. It takes a huge amount of space to do a build. AOSP took 20GB and JSS15Q took about 40GB of drive space. I "only" set up a 100GB VM which means I likely don't have enough room to download the newer release source.
If anyone that's done this has any advice, I'd sure appreciate hearing it. Thanks for reading.
Sounds like you already have it figured out.
There is a new bootloader so don't forget that. Sfhubs firmwares work fine.
I forget how big it was when I synced 5.1.1 but if you delete the jellybean code you should be fine.
LOL You're giving me wayyyy too much credit. I'm pretty much stumbling around in the dark here. I went with the new VM using Ubuntu 14.04. I struggled through all the apt-get commands especially the one with libgl1-mesa-glx:i386. It just didn't want to install because of some dependency quirk of some sort with something called cheese. I finally found a solution by doing this:
sudo apt-get install libglew-dev libcheese7 libcheese-gtk23 libclutter-gst-2.0-0 libcogl15 libclutter-gtk-1.0-0 libclutter-1.0-0 xserver-xorg-input-all
God only knows why I had to do all that to get the libgl-mesa-glx installed, but it finally let me do the get for libgl-mesa-glx:i386. Then I could finally create the symlink for the mesa library. After that, I successfully repo synced the source tree; it took up 35GB of disk space. I did the lunch command, picked flo user (11) and started my make command to build. That's running right now.
I was concerned about the proprietary binaries for the broadcomm stuff, but I found a directory under ./device/asus/flo called self-extractors. I'm guessing that stuff takes care of itself now and you don't have to do the steps of finding, downloading and extracting it into the tree. That's my guess anyway. I'm following this "howto":
http://source.android.com/source/requirements.html
I had been looking at an older one on blogspot, but it was for a different device and I figured it would be better to follow the one I'm using instead since it seems more current. I hope this build works okay and doesn't drag badly from bloat. I like my tablet's responsiveness on jellybean. I'm wondering now if I shouldn't have just gone to kitkat instead of all the way to lollipop. Oh well, live and learn. Thanks again for you input and for reading this. Let me know if I'm messing up.
I got it compiled. It took about 2.5 hours. I tried to find the program that I modified before, but I can't find it anywhere in the source tree. They've apparently moved everything around real good. If anyone knows where the touchscreen firmware update takes place, I'd appreciate knowing. It used to be in a program named ektf3k.c That program no longer exists in the build. I can use sfhub's utility to lock in the firmware I need, but I'd still like to know how where they moved the firmware update stuff.
afremont said:
I got it compiled. It took about 2.5 hours. I tried to find the program that I modified before, but I can't find it anywhere in the source tree. They've apparently moved everything around real good. If anyone knows where the touchscreen firmware update takes place, I'd appreciate knowing. It used to be in a program named ektf3k.c That program no longer exists in the build. I can use sfhub's utility to lock in the firmware I need, but I'd still like to know how where they moved the firmware update stuff.
Click to expand...
Click to collapse
I built the whole thing without the proprietary binaries installed. I'm guessing that my build is basically useless. I'm kinda disappointed that they don't bring up the binaries until after they walk you through the lengthy compile process. I guess I have to do a make clobber, unpack the binaries and then do the whole build over again. The build went fine as far as I can tell.
Can anyone verify if I have to do it all over with the binaries unpacked? I'm afraid to try flashing the stuff I built just to see what happens. Would there be any harm in that?

Question Reverting from GrapheneOS

I tried GrapheneOS and it's ok but too many compromises I have to make with several apps I'm using not working and small issues here and there.
Has anybody ever used Android Flash Tool to revert back from GrapheneOS to stock? If so, any issues?
Yeah plenty of times, no issues. Download firmware, extract it then flash-all in CMD
Thanks. No need to download FW or for CMD there, flashing is web based: https://flash.android.com/
Worked flawless.
sabai27 said:
Thanks. No need to download FW or for CMD there, flashing is web based: https://flash.android.com/
Worked flawless.
Click to expand...
Click to collapse
Can't wait to see more devs implement this system. My laptop is borked so it's really cool seeing such a simple alternative emerge
I've been thinking of using GrapheneOS for a bit. What was some stuff that didn't work for you?
Opensystem said:
Can't wait to see more devs implement this system. My laptop is borked so it's really cool seeing such a simple alternative emerge
Click to expand...
Click to collapse
I would definitely love to see this with other manufacturers. I got a Windows ARM laptop that has become unresponsive in BIOS, meaning I can't tell the system to install a new Windows version via the Boot menu. Such a tool would save that device. It should be mandatory to offer decent web flashing tools.
asj0422 said:
I've been thinking of using GrapheneOS for a bit. What was some stuff that didn't work for you?
Click to expand...
Click to collapse
Most things work with Sandboxed Google Play. But a few things don't like Android Auto, Google Pay and Chromecast. But other than that, I haven't had anything not work. They are close to getting Android Auto to work if I remember correctly - and Google Games ( I don't use either but looks like release is imminent). Check the other GrapheneOS threads on here or you can message me if you have any specific questions.
One thing I recommend though, is to leave "oem unlocking" enabled on the device after locking your bootloader. that way if something goes wrong, you can flash factory image. You don't want to brick your new phone. (I always leave my bootloader completely unlocked but that's a personal preference and I know the risks).
In other words, only a bunch of proprietary closed source gooble spyware crap doesn't work. The best thing about going to graphene or other security minded distributions of AOSP, is specifically *to* eradicate all of that.
It can be difficult initially, to clear yourself of all the gooble spyware, but its worth it and you don't even notice it after you get used to it. You're just much more safe and secure.

Categories

Resources