Hi everybody,
I'm currently in process of making my first builds of CM13 for my A310F.
The repositories for CM are unofficial, maintained by a user i tried to get in contact with, who didn't respond yet.
Now, while the stock kernel sources of MM are open sourced and a few hacks were already done in the unofficial CM repositories, the CM device/vendor/kernel sources are already a bit deprecated with a few erroneus configurations in the device repo, so I'm on my way to clean it up a bit.
Currently CM itself builds, but after booting most of the hardware features are broken and they were using the 5.1.1 kernel instead of the 6.0.1, and the blobs were not taken over correctly, or not all blobs were taken.
My question is now, how are you managing to get the correct list of the blobs needed? What is the best way to find out which blobs i need to take from the system.img?
I'm wondering the same thing. How do you know which blobs to pull in the first place when you're trying to build up the first rom?
There will be some dlopen errors for missing files in the logcat. After resolving them, it's mainly trial and error
Believe it or not, there is a method to this, and it requires some trial and error and a good sense of knowing what android needs to boot. If you look at the start up classpath and are just generally aware that the modem/network connection and filesystem utils need to be executed first (though for some reason binder and zygote can't start them themselves, despite the fact they are to running under init, but whatevs) so after bootloader hands off to kernel, you can go through the ramdisk and make sure all the on boot, on init on fs related libs/binaries are present. If you use a qcom device, just assume any lib or binary that starts with "libq" or even just the letter "q" is proprietary and required. Qcom is a bit full of themselves (ironic were talking about cm here) but anyways then there's the rild/crypto/fs libs and binaries. rngd, rmt_storage, rild daemons and anything that starts drmsever or netd will be required as well.
You can get significant hints from boot logs as well.
Aside from that, just keep note of what isn't produced by the aosp tree yet is present on the devices stock system, then determine how important it looks for android to able to start up
Related
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
In this post, I would like to explain what kexec-hardboot patch is.
@kernel developers: I would like to ask you to merge this patch to your kernels, because it is essential part of MultiROM - it allows me to boot any kernel without changing the boot partition. I realize that it is no small request, but the patch is not big, touches relatively stable parts of kernel and should not cause any problems. Thank you.
What is kexec?
It is syscall of Linux kernel, which allows you to boot another Linux kernel without restarting the device - "Linux boots itself". The functionality is equivalent to fastboot -c *cmdline* boot zImage initrd.img, but without PC and fastboot. It is fairly known thing, so more info at wikipedia and man kexec.
Standard kexec call unfortunatelly does not work on Nexus 6. It freezes somewhere, and it is very difficult to find out where - probably some of the drivers are not shut down/re-initialized properly, it is a common thing among Android devices, which is why kexec-hardboot was made.
What is the difference between normal and hardboot kexec?
Kexec-hardboot patch adds a real device restart to that process, so that all the drivers can be properly reinitialized. It stores new kernel to RAM, reboots the device as usual, and kernel from boot partition immediately jumps to the one which was stored to RAM before reboot.
Unlike grouper's kexec-hardboot patch, this one only requires the host kernel to be patched. This is one of the improvements I made, and I think it is pretty significant.
To summarize the process:
kexec --load-hardboot.... is called and kernel it loaded into RAM.
kexec -e is called. Special info is written to memory (to area which is not overwritten on reboot) and the device is rebooted.
After reboot, very early in the boot process, kernel checks if that special info is present in RAM and if so, it loads new kernel from RAM and jumps to it.
Kexecd' kernel starts and boots.
For more info, read the original thread.
Patches:
Kernel patch: https://gist.github.com/Tasssadar/757c939f2d028c00d089, 5.1 AOSP kernel repo
This is the kernel patch. Only the host kernel needs to be patched.
Related CONFIG options:
CONFIG_KEXEC=y
# CONFIG_ATAGS_PROC is not set
CONFIG_KEXEC_HARDBOOT=y
CONFIG_PROC_DEVICETREE=y #this one is turned on by default
All these options must be enabled.
Userspace kexec binary: https://github.com/Tasssadar/kexec-tools
I had to change some things in kexec userspace binary because of some kernel bugs, complete description is in that repository.
Usage:
Once you have the kernel patches and kexec userspace binary in place, just run following command to boot into new kernel:
Code:
kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)" --boardname=shamu --dtb
kexec -e
Note the command line parameter - cmdline from bootloader is not added automatically, you have to put it there by yourself.
Authors:
This patch was made by Mike Kasick for Samsung Epic 4G. Since that, it was ported to several devices, one of them is Asus Transformer TF201 - I used patch from TF201 and modified it a bit (basically just changed few SoC specific constants). People at #ubuntu-arm helped me out with that, thanks.
For hammerhead, I've improved the patch a bit - only the host needs to be patched now and I've added support for DTB.
For shamu, it's pretty much the same as for hammerhead.
@Tasssadar, I'm trying to incorporate the patch in my kernel (LiquidSmooth, which I compile in-line with the ROM - sources below), but I'm having issues actually booting into the secondary ROM.
Here is the portion of the log that contains the kexec call failure.
I just can't seem to figure out what my issue is - any ideas?
My device tree
My kernel source
Other potentially relevant info:
- Building the kernel in-line (using "make bootimage" for kernel incremental testing purposes)
- 5.0.2 base for host (my) kernel
- Using standard GCC for builds
- Updated to most recent MR TWRP and zip releases
Any help you might have to offer would be awesome!
CPA Poke said:
@Tasssadar, I'm trying to incorporate the patch in my kernel (LiquidSmooth, which I compile in-line with the ROM - sources below), but I'm having issues actually booting into the secondary ROM.
Here is the portion of the log that contains the kexec call failure.
I just can't seem to figure out what my issue is - any ideas?
My device tree
My kernel source
Other potentially relevant info:
- Building the kernel in-line (using "make bootimage" for kernel incremental testing purposes)
- 5.0.2 base for host (my) kernel
- Using standard GCC for builds
- Updated to most recent MR TWRP and zip releases
Any help you might have to offer would be awesome!
Click to expand...
Click to collapse
Looks like you didn't enable the config options mentioned in the first post. Also, please don't merge my hack to force-enable serial console, it doesn't play well with multirom. Also, you can enable the console by running "fastboot oem config console true", which I didn't know when I made that commit.
Tasssadar said:
Looks like you didn't enable the config options mentioned in the first post. Also, please don't merge my hack to force-enable serial console, it doesn't play well with multirom. Also, you can enable the console by running "fastboot oem config console true", which I didn't know when I made that commit.
Click to expand...
Click to collapse
[emoji33] [emoji40]
I literally can't even right now. Can't believe I missed that...rebuilding now, hopefully that takes care of it.
And thanks for the fastboot tip, I'll revert that hack.
Please keep the thread on topic for the section. If you aren't sure, read this: http://forum.xda-developers.com/nexus-6/devs-only/section-guidelines-read-t2959988
@Tasssadar, would this be better here in dev discussion (where I'm supposed to be an anal retentive moderator) or in "original development"? The reason for my asking is that your message states it's a release, as opposed to a discussion of the process of creating.
In the meantime, I've cleaned the thread...
Take care
Gary (posting as moderator of the dev discussion section.)
I put the patch here because it is quite different from most things posted in original development. It's pretty much for kernel devs only, and putting it in this section ensures it won't get lost (after couple of initial comments, there usually isn't any discussion related to this patch) and filters out most "thx" and "lolwhatsthis" posts (although obviously not all of them). I honestly didn't look up what's the exact goal of this section, it just seemed just right for this kind of thing. If you think it belongs to original development, feel free to move this topic.
Tasssadar said:
I put the patch here because it is quite different from most things posted in original development. It's pretty much for kernel devs only, and putting it in this section ensures it won't get lost (after couple of initial comments, there usually isn't any discussion related to this patch) and filters out most "thx" and "lolwhatsthis" posts (although obviously not all of them). I honestly didn't look up what's the exact goal of this section, it just seemed just right for this kind of thing. If you think it belongs to original development, feel free to move this topic.
Click to expand...
Click to collapse
Hey I don't know if you compile with ndk or cross compile for arm (statically or ndk) but I had to add some missing includes in *kexec/arch/arm/Makefile for kexec-tools to compile with the new board option. Just thought I'd mention.
https://github.com/Surge1223/androi...mmit/4b4629db76d64b7048274748d3e3366b52e1017d
Also, Ignore the other stuff. Testing kexec via module for locked devices so I have quite a bit of changes compared to regular kexec-tools.
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...
Hi everyone,
as title suggests, I'd like to "port" clean AOSP to be able to install and run it on the custom device.
Basically, the situation is following: I got a custom device, based on rockchip rk3288 SoC. The device currently runs Android 5.1 successfully. I'd like to update Android to version 6 (got AOSP sources and AWS builder image up and running), but the company that created Android v5 for us no longer exists.
Thus I am here to ask for advice(s) on how to proceed (or whether it even is a good idea to do that myself, given the fact that I have zero experience with Android ROMs development), possibly a step-by-step guide on what to do.
The question is, do I just find drivers for hardware components present in the device (usb hub, ethernet, etc.) and just somehow "link" those to existing sources (of AOSP) and just run the build with different parameters? Or do I need to build a whole new kernel for the given device-OS combination?
Thank you for any advice or opinion!
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
abtekk said:
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
Thanks for pointing in the right (or at least some) direction! I found some guide on porting ROMs which I followed, basically like you said. So I just replaced some files in System image. Will flash later today, so maybe I will get some results!
abtekk said:
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
So I was following this tutorial, although found some irregularities, let's say: For example, none of those 2 folders contained init.d/ directory, thus I didn't update it. Also, I haven't found META-INF folder therefore haven't updated updater-script.
Basically, when I did (or at least what I think I was doing was that I took /system partition from our current ROM, that is working on that custom device and replaced stuff in there by stuff from the new system I wanted to port. My idea from what I've read was that i took kernel (and boot/recovery) from the original, working ROM and "injected" the new system onto it. Is that correct? Is that what I needed to do? Because the problem is, I cannot boot into the system (might as well be because of Kernel version, because I am trying to port Android 6 on Kernel 3.10. which was used in the current ROM running Android 5). It looks like the device is stuck in bootloader, or "somehow doesn't know what to start" (sorry, I can't put it better), displaying only my device's logo.
When I connect it to the computer via USB cable, running adb devices shows me that device, but when I try to access shell using adb shell I got error saying that /system/bin/sh wasn't found, which made me thinking that somehow the /system partition isn't "linked" properly, like I stated in the beginning.
Was I doing everything correctly? Do I need to do something above that? (maybe do you know about some tutorial). I am trying to port AOSP 6 Android.
Thank you!
I've not built a kernel since my Samsung Galaxy Nexus, so bear with me. I'm trying to learn and see if I can't be of some service somehow.
So I've forked the repository for the kernel source from here, to my Github HERE. After working through learning more than I though I would about gcc and clang toolchains, I attempted to build the kernel. Turns out, I think the kernel is missing at least one folder.
Code:
techpack/oneplus/Makefile:58: "techpack LINUXINCLUDE " -I./arch/arm64/include -I./arch/arm64/include/generated -I./include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -I./techpack/oneplus/include -I./techpack/oneplus/overlay -include ./techpack/oneplus/config/oneplus.h -include ./techpack/oneplus/config/coretech.h -include ./techpack/oneplus/config/oneplus.h -I./techpack/oneplus/include
scripts/Makefile.clean:15: techpack/oneplus/power/Makefile: No such file or directory
When I look in the source code, I see that the techpack/oneplus/power folder is not there, so it would not be able to be made.
Any ideas on how to get it, or if I could bring it from a different oneplus device?
The main idea was to work on some governors and IO Schedulers, but mainly to see if we could disable dm-verity for the TWRP build. Honestly, I don't know how people get into this anymore. Every time I go to build, I get errors such as above, or I try to Make Clean, and I end up with errors that it can't clean. I'll take direction as to where I can go to learn, without attending University.
I think you can flash magisk to disable dm verity. You might be able to manually strip out avb from a boot.img as well (I'm sure guides are somewhere in xda).
Why would you wanna do this for TWRP though?
As for the actual kernel building, I just think OnePlus hasn't shipped out the complete sources, it has happened before. I am no expert though so might be wrong.