Question [KERNEL] Source Released. - Nubia Red Magic 6

We're in business; the kernel sources got released today.
GitHub - ztemt/NX669J-kernel: nubia NX669J Android 11 open source
nubia NX669J Android 11 open source. Contribute to ztemt/NX669J-kernel development by creating an account on GitHub.
github.com
They should be accompanied by other opensource bits shortly.

Good news!
The main question for me: will it be possible to make fp scanner working with unlocked bootloader? (or, at least, to use magisk-patched boot with re-locked bootloader)

I tried to make a kernal with this guide https://www.google.com/amp/s/www.ge...our-own-android-kernel-in-5-simple-steps/amp/ . i got to step 4. I can not find the correct name of config file to change the command needed to compile.

jokono421 said:
I tried to make a kernal with this guide https://www.google.com/amp/s/www.ge...our-own-android-kernel-in-5-simple-steps/amp/ . i got to step 4. I can not find the correct name of config file to change the command needed to compile.
Click to expand...
Click to collapse
Your best bet will be to use the config file found inside the phone, under /proc/config. Just put it in the kernel code under arch/arm64/configs

nice!

kereng77 said:
Your best bet will be to use the config file found inside the phone, under /proc/config. Just put it in the kernel code under arch/arm64/configs
Click to expand...
Click to collapse
jokono421 said:
I tried to make a kernal with this guide https://www.google.com/amp/s/www.ge...our-own-android-kernel-in-5-simple-steps/amp/ . i got to step 4. I can not find the correct name of config file to change the command needed to compile.
Click to expand...
Click to collapse
If you're rooted, check if you can access /proc/config.gz; unzip it to /yourkernelsource/.config

If i take apart the rom, i get config folder with 5-6 different files. All saying similar config. ,config/w, maxwellconfig, deconfg. i tried 3 or 4 but nothing. Although my laptop is only 4gb with linux running on windows. It might not be powerful enough to run.

Ok i got the config.gz out of proc and extracted. Will try so thankyou.

Was anyone able to flash a custom kernel on the RM6?

Related

Flashing Galaxy S kernel from update.zip : template update.zip

NEWS :
Koush's bmlunlock (a simple IOCTL send to the bml device) is just out and can replace redbend_ua !
http://github.com/CyanogenMod/android_device_samsung_bmlunlock
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is WTFPL
Note : requirement are Java and Android source repo, already build.
Looks awesome!
I have a question though... why do you need to flash the kernel in an update.zip at boot?
As far as I know, the system will read the kernel at boot up time and load it into ram. It won't access the on-disk file again until the next boot. If that is true, then flashing while running should be 100% safe, right?
RyanZA it's an update.zip, not a ramdisk.
The point is getting an easy flashing method, requiring no computer.
And you don't even need to root your phone !
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
Click to expand...
Click to collapse
I don't think the signing tool works on android -- maybe it does? Anyway editing scripts on a phone seems a bit silly!
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
Click to expand...
Click to collapse
Nope actually this is not dumb at all
Yes the flashing part run in updater-script can be started manually.
In the script :
Code:
"redbend_ua", "restore", "zImage", "/dev/block/bml7"
The update.zip presented here mainly targets custom kernel creators in order to give them another way to distribute their work.
This is a working example of how to use redbend_ua programmatically, hopefully it may help new ideas coming. redbend_ua usage is not limited at all to kernel flashing.
PS : you can use this template with windows as well, you'll just need to translate the ulta-basic .sh to a .bat script, or do the signing part manually.
supercurio said:
Hey
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
Click to expand...
Click to collapse
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
is it correct?
thx
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
supercurio said:
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is BSD anyway.
Note : requirement are Java and Android source repo, already build.
I'll add some documentation later.
Click to expand...
Click to collapse
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Thats for the updater-script i believe. In most cases, theres a update-script in the zip's as well and the recovery picks that up in which case it doesn't need the binary and hence works.
Okay !
Answers hour
ykk_five said:
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
Click to expand...
Click to collapse
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
No further complication
Brantyr said:
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Click to expand...
Click to collapse
Yes, to flash a complete ROM (several partitions) one more thing is needed.
On command line, redbend_ua accept only one command.
In order to run several commands successively (ie flash multiple partition like Odin does), you'll need to write them in a file.
The file /cache/ota/command should do the trick, but it's untested right now.
There may be other method to prevent rebooting after flashing (hacking the redbend_ua binary, finding the appropriate command line option or removing the reboot command temporary)
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Right, many update.zip done today are made without knowing anything about how it really works
I studied a bit before creating mine, here is a walk-through this fairly undocumented process :
- recovery mounts /sdcard/
- recovery search for a default file named : META-INF/com/google/android/update-binary in the zip and runs it : see the source in bootable/recovery/install.c
- update-binary is actually updater in sources
- updater looks into the zip file to the script file named updater-script, update-script is obsolete
- updater then runs the commands listed in updater-script : here is the list of commands.
- then reboot
The only documentation I know for this command is the recovery/updater/install.c file itself
supercurio said:
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
Click to expand...
Click to collapse
ok,thx
but one more thing i want to know is, u said the path must be changed to the android repo, so do u mean the source code for the kernel like linux-xxx-2.xxx dir?
Thx
@ykk_five
Content of build-update-zip.sh v1 :
Code:
#!/bin/sh
DROID_HOME="/home/curio/dev/mydroid"
zip -r /tmp/update.zip META-INF/ redbend_ua zImage
java -jar \
$DROID_HOME/out/host/linux-x86/framework/signapk.jar \
$DROID_HOME/build/target/product/security/testkey.x509.pem \
$DROID_HOME/build/target/product/security/testkey.pk8 \
/tmp/update.zip update.zip
rm /tmp/update.zip
adb push update.zip /sdcard/
DROID_HOME="/home/curio/dev/mydroid" : you set here the directory of your Android AOSP directory.
See : http://source.android.com/source/download.html
Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
Run "repo init" to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
$ repo init -u git://android.git.kernel.org/platform/manifest.git
* If you would like to check out a branch other than "master", specify it with -b, like:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
Click to expand...
Click to collapse
This is this mydroid directory
The one that contains Android git source home directory, and compiled files in the out/ subdir
many thx for ur detailed explanation, supercurio!
Thanks curio,
very helpful explanation!
Thanks supercurio for the template!
However, there is no need to spend many hours (depending on hardware and bandwidth) pulling down 100s of megabytes of source and compiling it all if all you want is to sign an update.zip with test keys (if you already have the zImage)!
Just google around for "signapk.jar test keys" and you will get there.
BTW: I know that koush, leshak and wesgamer have Samsung Galaxy S trees up at Github but are they fully merged with AOSP yet?
I'm planning to go build my own kernel for this beast to try to solve the mono FM radio mystery, but last time I checked around it was said that the SGS tree required the use of a custom toolchain to get it to work at all.
Any comments on this?
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
About toolchain, you can use the one indicated by Samsung (CodeSourcery) but you'll face the big and ugly WakeLag.
I recommend you crosstool-ng or buildroot to build toolchains, with gcc 4.3.x march=arm mcpu=cortex-a8 mtune=cortex-a8 (no 4.4.x with march=armv7-v)
The building tutorial will be a part of the documentation I'll publish with my lagfix opensource release
Right now these info are too hard to find.
PS : I send you a mail with attached .config for ct-ng !
supercurio said:
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
Click to expand...
Click to collapse
supercurio said:
PS : I send you a mail with attached .config for ct-ng !
Click to expand...
Click to collapse
Thanks for the info !
Sorry for my ignorance, but does this mean someone can package Froyo in an update.zip and we could update it directly on our phone without needing Samsung Kies or Odin?
@supercurio:
Thanks for this well working template.
In updater-script:
Code:
line 17: package_extract_dir("zImage", "zImage");
should be
Code:
package_extract_file("zImage", "zImage");
But it did work with package_extract_dir, for some reason, too.
Btw, could you send me the config for ct-ng ?
I'm also struggling with this wakelag.

[Q] RIL Development sgh-t999

Hi everyone,
recently I have built and flashed on my sgh-t999 (galaxy S3 US tmobile version) CM11 Nightly. For my pro0ject however I need to modify two libraries of the Radio Interface Layer (RIL), libril.so and libreference-ril.so. I tried to modify the ones in the forlder /hardware/ril/ and build everything again with no results. Any change that I made to those files (such as ril.cpp in the folder libril) would not affect the functionality of the phone.
Finally yesterday I understood that when I build those libraries for the target cm-d2tmo-eng, those files that I have modified are not considered at all! When the libraries are built indeed, the system automatically takes the libril.so and libreference.so present in the vendor folder!
The problem is that those libraries in the vendor folder and already compiled and I cannot modify them. The question is:
Is there any way that I compile those libraries from the source code that I have modified?
Thanks,
brok85
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Perseus71 said:
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
Click to expand...
Click to collapse
Well, as fisrt I just wanted to insert some log to be able to follow the code execution from the logcat or do something similar.
Perseus71 said:
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
Click to expand...
Click to collapse
Sorry but I am kind of new on this things. I have already downloaded the source code from the device tree and made my modifications in the files ril.cpp contained in [path-to-android-source]/hardware/ril/libril/ril.cpp. What I did was commenting the whole code within the function RIL_onUnsolicitedResponse() and listenCallback() such that in theory, the phone is not able to display incoming calls for example. However after flashing the re-built android I am still able to receve calls. How can I "check in the changes if they boot ok on my device"?
Perseus71 said:
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Click to expand...
Click to collapse
I tried to remove the libril.so in the vendor folder and compile again using
# . build/envsetup.sh
# lunch (and select d2tmo)
# mmm [path-to-android-source]/hardware/ril/libril".
The problem is that when I indicate the target after lunch, the compiler looks for the vendor libraries and stop the build. What I am doing wrong?
Sounds like Compiler Dependacy path is set different from the code base. I will look further before commenting.
For when your changes are for the benefit of the community of users, you check in the changed code back to the Device Tree with detailed comments within the code and while checking in.
Perseus71 said:
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Click to expand...
Click to collapse
Perseus71 said:
Sounds like Compiler Dependacy path is set different from the code base. I will look further before commenting.
For when your changes are for the benefit of the community of users, you check in the changed code back to the Device Tree with detailed comments within the code and while checking in.
Click to expand...
Click to collapse
Actually this is what I get after deleting
libril.so in vendor/samsung/d2tmo/proprietary/lib/
and after executing mmm /hardware/ril/libril :
No private recovery resources for TARGET_DEVICE d2tmo
make: *** No rule to make target `vendor/samsung/d2tmo/proprietary/lib/libril.so', needed by `/home/brok85/Documents/android/system/out/target/product/d2tmo/system/lib/libril.so'. Stop.
make: Leaving directory `/home/brok85/Documents/android/system'
If u want to build from source, delete the line that copies in vendor-blobs.mk
If u want to copy the blob instead of building it from source, keep the line
It'll be better if u provide us the device and vendor trees links
blackbeard said:
If u want to build from source, delete the line that copies in vendor-blobs.mk
If u want to copy the blob instead of building it from source, keep the line
It'll be better if u provide us the device and vendor trees links
Click to expand...
Click to collapse
I am not sure to understand what should I provide Sorry, as I said I'm kind of new here...
Also, I can not find vendor-blobs.mk...Where it should be?
brok85 said:
I am not sure to understand what should I provide Sorry, as I said I'm kind of new here...
Also, I can not find vendor-blobs.mk...Where it should be?
Click to expand...
Click to collapse
You said you built a cm11 for ur device. So for that you needed the device and the vendor trees. Give the link of those, if they are on the git
And vendor-blobs.mk would be present in the vendor folder under your device folder
blackbeard said:
You said you built a cm11 for ur device. So for that you needed the device and the vendor trees. Give the link of those, if they are on the git
Click to expand...
Click to collapse
Well I have followed the guide in the following page
http://wiki.cyanogenmod.org/w/Build_for_d2tmo
The link from where I have obtained the repository is
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
and then
$ breakfast d2tmo
blackbeard said:
And vendor-blobs.mk would be present in the vendor folder under your device folder
Click to expand...
Click to collapse
Actually now I think I was able to compile the library following your instructions. Unfortunatly, when I have built and flashed everything in the galaxy S3, I was not able to use the network. Probably some compatibility issue?
When I compiled libril.so, I have obtained it from the folder /hardware/ril/libril which should contain google source code, maybe not compatibale with my device...is it right?
thanks a lot for the help guys
brok85 said:
Actually now I think I was able to compile the library following your instructions. Unfortunatly, when I have built and flashed everything in the galaxy S3, I was not able to use the network. Probably some compatibility issue?
When I compiled libril.so, I have obtained it from the folder /hardware/ril/libril which should contain google source code, maybe not compatibale with my device...is it right?
Click to expand...
Click to collapse
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Perseus71 said:
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Click to expand...
Click to collapse
No silly question at all
I have compiled CM11 as it is and worked perfectly. I could use the network.
Perseus71 said:
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Click to expand...
Click to collapse
The procedure I have followed is the following one:
1) Delete the llibril.so and libreference-ril.so from the vendor library. These are the pre-compiled vendor libraries that I need to modify.
2) commented the lines from the vendor-blobs.mk that were including those two precompiled libraries.
3) go to android/system/ and run "mmm /hardware/ril/libril" and "mmm /hardware/ril/reference-ril" to obtain the modified libril.so and libreference-ril.so respectively.
4) copied the new libraries just obtained in the vendor folder where the pre-compiled libraries were
5) re-include the lines commented in point 2).
6) run brunch d2tmo
7) flash the .zip obtained
Any mistake?
Perseus71 said:
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Click to expand...
Click to collapse
No silly question at all. Yes I have built everything out of the box and worked perfectly. I could use the network.
Perseus71 said:
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Click to expand...
Click to collapse
I followed the following procedure to include my modified libraries:
1) Eliminate precompiled vendor libraries: libril.so and libreference-ril.so from the vendor folder
2) comment lines in the vendor-blobs.mk that included those two precompiled libraries
3) from /android/system/ executed command "mmm /hardware/ril/librail" and "mmm /hardware/ril/reference-ril" to obtain the modified libril.so and libreference-ril.so
4) copied the new libraries in the vendor folder in the same places were the precompiled libraries were positioned
5) re-include the two lines that were commented in point 2)
6) build everything again with brunch d2tmo
7) flash the .zip obtained
Any mistake?
Unless I am having a brain fart that process seems about right. I wonder if your RIL changes are related to the network
What kind of issues do you see ?
Perseus71 said:
Unless I am having a brain fart that process seems about right. I wonder if your RIL changes are related to the network
What kind of issues do you see ?
Click to expand...
Click to collapse
It cannot even find the network operators. It says that it is impossible to connect and to try later...
mine is the Tmobile version of S3. May this influence?
That would depend on the changes you made. But otherwise not really. The underlying Device tree is unified for all US S3 devices.

Need help compiling sedikernel (or any kernel)

Hello,
In order to debug the bluetooth problem, I'm trying to compile a kernel for the Captivate Glide. I can't get it to boot properly.
@steadfasterX 's SediROM is the highest-version ROM I know of on which bluetooth works so I've got it installed (version 2.1.2) on the phone.
The steps I've taken so far:
1. I have sedikernel from https://github.com/steadfasterX/kernel_samsung_i927 at commit 088aa4109ad144c583f32da5ffba7bac200f0575
2. I copied /proc/config.gz from a running phone, which contains CONFIG_LOCALVERSION="-sediKERNEL-v1.0", ungzipped it and saved it as .config . Haven't changed anything in it yet.
3. I ran `make CROSS_COMPILE=arm-linux-gnueabihf- zImage` (also tried arm-none-eabi- (both from Debian Jessie) as well as ~/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- from the NDK)
4. I also made a TWRP backup of the boot partition, and used split_bootimg.pl from William Enck to split it into a kernel and initrd
5. I then ran mkbootimg with the initrd extracted in step 4 and the kernel obtained in step 3 in arch/arm/boot/zImage
6. Finally I flashed this new boot.img onto the phone with odin (Heimdall, specifically)
I see the white "SAMSUNG" logo (which is normal when booting) with a yellow-triangle with an exclamation mark in it. No further boot stage happens (no bootanim from sediROM). If I re-pack the original kernel with bootimg and flash that via odin, then after the next boot the yellow triangle changes into a blue one and sediROM boots correctly.
I'm a bit stuck at the moment, not sure what's going wrong there. Probably the kernel panics for some reason. Is there a way to read the kernel boot messages before android starts? Any help would be greatly appreciated.
Thanks!
Successful!
Thanks to a lot of help from @steadfasterX on IRC I finally managed to compile a working kernel
Here's a list of steps I had to follow in addition to https://github.com/steadfasterX/android_device_samsung_i927/blob/sediROM_CM-ICS/README.md :
1. as discussed on IRC, `repo sync` was not finding a branch. Needed to add
Code:
revision="refs/heads/ics-release"
in .repo/manifests/default.xml in the line with
Code:
CyanogenMod/android_vendor_qcom_opensource_v8
2. I removed the spurious comma in device/samsung/i927/cm.dependencies
3. In device/samsung/i927/, I changed vendorsetup.sh to point to vendorsetup.sh.nopatching rather than .patching (none of the patches could be applied)
4. lunch target was therefore the one with -eng, not -userdebug
5. I installed java 6 manually (didn't have sudo)
6. I installed schedtool
7. I adjusted the path to Java and my toolchain in build_sediROM.sh (taken from https://github.com/steadfasterX/android_buildtools )
8. I downgraded GNU make from 4.0 to 3.81
9. I installed linux-headers and created a symlink from /usr/include/asm-generic to /usr/include/asm
10. I changed the toolchain prefixes in device/samsung/i927/BoardConfig.mk to have 4.4.3 rather than 4.7
11. I built with
Code:
BUILDID=samsung/i927 LOKIFY=0 ../android_buildtools/build_sediROM.sh bootimage
12. I used the original ramdisk I had extracted from sediROM's boot image, rather than the one that was built (we discussed this on IRC too)
This got me a working kernel, yay
uukgoblin said:
Thanks to a lot of help from @steadfasterX on IRC I finally managed to compile a working kernel
Here's a list of steps I had to follow in addition to https://github.com/steadfasterX/android_device_samsung_i927/blob/sediROM_CM-ICS/README.md :
1. as discussed on IRC, `repo sync` was not finding a branch. Needed to add
Code:
revision="refs/heads/ics-release"
in .repo/manifests/default.xml in the line with
Code:
CyanogenMod/android_vendor_qcom_opensource_v8
2. I removed the spurious comma in device/samsung/i927/cm.dependencies
3. In device/samsung/i927/, I changed vendorsetup.sh to point to vendorsetup.sh.nopatching rather than .patching (none of the patches could be applied)
4. lunch target was therefore the one with -eng, not -userdebug
5. I installed java 6 manually (didn't have sudo)
6. I installed schedtool
7. I adjusted the path to Java and my toolchain in build_sediROM.sh (taken from https://github.com/steadfasterX/android_buildtools )
8. I downgraded GNU make from 4.0 to 3.81
9. I installed linux-headers and created a symlink from /usr/include/asm-generic to /usr/include/asm
10. I changed the toolchain prefixes in device/samsung/i927/BoardConfig.mk to have 4.4.3 rather than 4.7
11. I built with
Code:
BUILDID=samsung/i927 LOKIFY=0 ../android_buildtools/build_sediROM.sh bootimage
12. I used the original ramdisk I had extracted from sediROM's boot image, rather than the one that was built (we discussed this on IRC too)
This got me a working kernel, yay
Click to expand...
Click to collapse
its really long guide. You have to replace kernel modules, wifi wouldnt work without modules.
Imho best is compile kernel, modules, replace zImage + modules in this
file and flash from recovery. You dont need to compile whole android just the kernel, you dont need java and other special things, this method is much more faster.
bubor said:
its really long guide. You have to replace kernel modules, wifi wouldnt work without modules.
Imho best is compile kernel, modules, replace zImage + modules in this
file and flash from recovery. You dont need to compile whole android just the kernel, you dont need java and other special things, this method is much more faster.
Click to expand...
Click to collapse
You are right for the kernel but we discussed on IRC to build ram disk too then you need all that stuff but most important he wants to build CM too.
However I'm always a fan of making it right so building a ram disk is the correct way of creating a bootimage. But to start its ok replacing kernel and modules first.
.
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
correct way is rebuild whole android, and reflash everything, wipe data/cache
You dont want to make new ramdisk without replace system. System and ramdisk bound together.
I hope you find something, and fix bluetooth or voip audio.
good luck
bubor said:
correct way is rebuild whole android, and reflash everything, wipe data/cache
You dont want to make new ramdisk without replace system. System and ramdisk bound together.
I hope you find something, and fix bluetooth or voip audio.
good luck
Click to expand...
Click to collapse
Well no and yes. I build kernels including ram disk without building system. This is not necessary as long both are compatible.
But you are right that booting fails when system and ram disk are not compatible so the correct way depends
However @uukgoblin I hope you get the fix you want :fingers-crossed:
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Well no and yes. I build kernels including ram disk without building system. This is not necessary as long both are compatible.
But you are right that booting fails when system and ram disk are not compatible so the correct way depends
However @uukgoblin I hope you get the fix you want :fingers-crossed:
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
would you tell me an example when kernel doesnt compatible with ramdisk but kernel does compatible with system?
bubor said:
would you tell me an example when kernel doesnt compatible with ramdisk but kernel does compatible with system?
Click to expand...
Click to collapse
No no my friend that's not what I said. :cyclops:
I meant if you have CM 9 as system you can build a boot image which includes kernel and a CM9 based ram disk without building cm9 system again. :laugh:
.
Sent from my LG-H815 using XDA Labs

[KERNEL][WIP][DEV] Quintus Kernel = Kcal

Hi all !
After many years of "xda looting", i'm trying to contribute a little.
I'm a begginer, just learned 3 days ago how to use github ! So be cool guys, not a dev here.
Now i successfully compiled a Kernel, with addition of KCAL for now, but...
I got the Image.gz-dtb and i don't succeed in repacking it in a boot.img, if someone want to try, be my guest. (It's untested obviously, but compilation was without errors/warnings (we are close to stock for now.).
I tried mkboot, anykernel2, lazyflasher.... Always flash error, and i don't have time for the next few days, so if we could put a team together...
Here is the link to my compiled files (arch/arm64/boot) except dto folder. //Update to my Dev folder
Theorically you just have to rename, put it in a stock boot.img, "fastboot boot newboot.img" and test if Kcal is working with ex kernel manager, then more to come (governors, maybe OC, etc.)
Poke @d1ngh, you could help here after your work on twrp ?
Cheers guys, we could have our first custom kernel soon !
----------------------------------------
Source : [url]https://github.com/WiwiWillou/Xiaomi_Kernel_OpenSource.git[/URL]
Defconfig used = defconfig daisy-perf_defconfig (with the kcal=Y addition not commited for now) // branch daisy-o-oss
Thank you very much! That´s what I waited for. Unfortunately 7zip says error: unknown compression method... Perhaps you can repack? Thx.
That is all we need ! A custom kernel thant can handle GSI !
Voodoojonny said:
Thank you very much! That´s what I waited for. Unfortunately 7zip says error: unknown compression method... Perhaps you can repack? Thx.
Click to expand...
Click to collapse
I've updated the link, you should see the uncompressed file in folder !
Or direct link : https://drive.google.com/file/d/1TvihsIa_XbtC66yaWRZ1EPY5UR6LLD5g/view?usp=drivesdk
Thanks
WiwiPouPou said:
Hi all !
After many years of "xda looting", i'm trying to contribute a little.
I'm a begginer, just learned 3 days ago how to use github ! So be cool guys, not a dev here.
Now i successfully compiled a Kernel, with addition of KCAL for now, but...
I got the Image.gz-dtb and i don't succeed in repacking it in a boot.img, if someone want to try, be my guest. (It's untested obviously, but compilation was without errors/warnings (we are close to stock for now.).
I tried mkboot, anykernel2, lazyflasher.... Always flash error, and i don't have time for the next few days, so if we could put a team together...
Here is the link to my compiled files (arch/arm64/boot) except dto folder. //Update to my Dev folder
Theorically you just have to rename, put it in a stock boot.img, "fastboot boot newboot.img" and test if Kcal is working with ex kernel manager, then more to come (governors, maybe OC, etc.)
Poke @d1ngh, you could help here after your work on twrp ?
Cheers guys, we could have our first custom kernel soon !
----------------------------------------
Source : [url]https://github.com/WiwiWillou/Xiaomi_Kernel_OpenSource.git[/URL]
Defconfig used = defconfig daisy-perf_defconfig (with the kcal=Y addition not commited for now) // branch daisy-o-oss
Click to expand...
Click to collapse
Try it with android image kitchen (you first have to get the original bootimage from vendor/factory image, unpack it, exchange your kernel and repack it). recompiled official sources (with UBERTC) and it worked fine like that.
wertus33333 said:
Try it with android image kitchen (you first have to get the original bootimage from vendor/factory image, unpack it, exchange your kernel and repack it). recompiled official sources (with UBERTC) and it worked fine like that.
Click to expand...
Click to collapse
I've tried, maybe my image is bad, strange (I originally tried my stock source too, Google 4.9 toolchain, no luck). Can you test with the one in the link please ?
I will have access to my PC only next week...
Thanks a lot for your feedback !
wertus33333 said:
Try it with android image kitchen (you first have to get the original bootimage from vendor/factory image, unpack it, exchange your kernel and repack it). recompiled official sources (with UBERTC) and it worked fine like that.
Click to expand...
Click to collapse
Could you please share your build script ? Did you use an alternate defconfig ?
Learning here
EDIT : Which UberTC did you use ?
WiwiPouPou said:
Could you please share your build script ? Did you use an alternate defconfig ?
Learning here
EDIT : Which UberTC did you use ?
Click to expand...
Click to collapse
I used the original source code with some small changes (which are now included in official source) to make it compile.
Don't mind about the toolchain for the moment, gcc4.9 is most stable.
I don't have time trying this out atm, busy compiling los 15.1 but if you share exactly how you did it, (terminal log in pastebin and most importantly the exact errors, "doesn't work" doesn't help ) me or someone else might be able to help you (and you don't have to ask next time you get the error.
If you want you can start adjusting the lineage kernel, so i could build with los kernel which could save time towards working custom roms.
I successfully repack. But phone don't boot. (9.11 ROM)
Hello , can you help me with conpiling kernel source code? I tryed a lot of time but same issues , that could find same files.
I successfully repack image of kernel that you publish, but phone don't boot , they reboot in stock kernel(if i write fastboot boot boot.img) and I trying flashing image. They dont boot.
I vary want to create collection of custom kernel's on my device. And of course becouse i vary interested in this sphere, but new this.
Can you describe how you fix issues, or your compiling go without issues.
With best regards. Please help.
artyom5613 said:
Hello , can you help me with conpiling kernel source code? I tryed a lot of time but same issues , that could find same files.
I successfully repack image of kernel that you publish, but phone don't boot , they reboot in stock kernel(if i write fastboot boot boot.img) and I trying flashing image. They dont boot.
I vary want to create collection of custom kernel's on my device. And of course becouse i vary interested in this sphere, but new this.
Can you describe how you fix issues, or your compiling go without issues.
With best regards. Please help.
Click to expand...
Click to collapse
On which roms did you test your kernel?
Voodoojonny said:
On which roms did you test your kernel?
Click to expand...
Click to collapse
8.1 stock. 9.11
I compile stock kernel , repack him , ans this work fine. Now i need help to add kcal support. Author, can you help?
artyom5613 said:
I compile stock kernel , repack him , ans this work fine. Now i need help to add kcal support. Author, can you help?
Click to expand...
Click to collapse
I will, I'm very far from my PC for a few weeks again, I've used some commits :
https://github.com/rama982/android_kernel_xiaomi_msm8953/search?q=kcal&type=Commits
Source for pie is not pushed ?
WiwiPouPou said:
I will, I'm very far from my PC for a few weeks again, I've used some commits :
https://github.com/rama982/android_kernel_xiaomi_msm8953/search?q=kcal&type=Commits
Source for pie is not pushed ?
Click to expand...
Click to collapse
Thanks! O try to add kcal with this commits.
Yea, source for pie is not pushed. Xiaomi cant fix 8.1 kernel... Stock compiled kernel issue: wifi don't work...
WiwiPouPou said:
I will, I'm very far from my PC for a few weeks again, I've used some commits :
https://github.com/rama982/android_kernel_xiaomi_msm8953/search?q=kcal&type=Commits
Source for pie is not pushed ?
Click to expand...
Click to collapse
Can you tell me what version of kernel you use whyle compile kernel? I tryed on new 9.11, but phone dont boot.
Maybe when you compile version be 9.10 or ealier.
becouse ramdisk and kernel image can conflict
I hope this can support settings for "display temperature" so that we dont need app for calibrating warmth or coolness of display
Current state:
Kernel builded.
Kcal included.
Wifi don't work , searching fix
artyom5613 said:
Current state:
Kernel builded.
Kcal included.
Wifi don't work , searching fix
Click to expand...
Click to collapse
Kcal is working ?
Strange for WiFi, module not compiled ?

Question Nethunter Build help [Kernel / System]

Hey xdas,
i just received my new Samsung Galaxy z Fold 4
SAOMC_SM-F936B_OXM_EUX_12_0045 EUX /-/EUX/EUX
Kernel : 5.10.81-afaneh92-gd8d6af751972 (flashed for twrp)
I would like to install nethunter on the device with a working kernel
I tired my best to understand the docu on kali but its not the best
i am also new to compiling kernels at that level so maybe someone can help here
I attached as much as i could
So the steps i took so far is
Unlocked Bootloader
installed the twrp ( like descriped here : https://forum.xda-developers.com/t/recovery-unofficial-twrp-for-galaxy-z-fold4-snapdragon.4498743/ )
installed magisk
Then for nethunter
(https://www.kali.org/docs/nethunter/)
i downloaded the kernel source :
https://opensource.samsung.com/uploadSearch?searchValue=SM-F936 (my device is EUX see infos for device above)
downloaded the proper=? toolchain , there is an readme_kernel inside the kernel_source with a link to the toolchain , i am unsure about this
https://opensource.samsung.com/uploadSearch?searchValue=toolchain
there are two options i took the S22(Exynos) file ( hope thats right ?)
now we come to the difficult part :-(
first i tried to compile via the instructions on kali docs
unpack the kernel file i did and there a subfolders so i decided to use the subfolder common as the root mentioned in the docs:
you can begin by cloning our kernel builder to the root of your kernel’s folder, and prepare the environment:
from common folder i did git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel
cd kali-nethunter-kernel
I did not change the configs as i am new to that so i know there are some exports inside the build config inside the kernel file but i dont know how get them together
./build.sh
S. Setup Environment and download toolchains.
2. Configure & compile kernel from scratch
It found the devconfig so i took it as mentioned in the docs (Select your device’s defconfig, then save and exit to start the building process.)
did not edit the kernel config till jet
and ran into the error attached in the error txt
I would like to understand how i can build the kernel the normal way , without the nethunter tool
and maybe someone could help to make this working with nethunter that would be great !
i want to understand the process and i am willing to help , so i am not asking for a final kernel , more for the way to go in general to also give the community a benefit for the next new kernel we want to port
as mentioned the docs are not the best !
thanks for your time
@yesimxev / @V3rB0se / @afaneh92 need some help here
Which toolchain to you use in nethunter kernel builder? I'd recommend clang-12.
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/tags/android-12.0.0_r12/clang-r416183b1.tar.gz
Download, extract somewhere and add it's path to kali-nethunter-kernel/config (clang-10 is the default). no need for setup environment again.
Any luck with this? i am in the same situation trying to build a nethunter kernel for my zfold4
Wanttoknowthings said:
Hey xdas,
i just received my new Samsung Galaxy z Fold 4
SAOMC_SM-F936B_OXM_EUX_12_0045 EUX /-/EUX/EUX
Kernel : 5.10.81-afaneh92-gd8d6af751972 (flashed for twrp)
I would like to install nethunter on the device with a working kernel
I tired my best to understand the docu on kali but its not the best
i am also new to compiling kernels at that level so maybe someone can help here
I attached as much as i could
So the steps i took so far is
Unlocked Bootloader
installed the twrp ( like descriped here : https://forum.xda-developers.com/t/recovery-unofficial-twrp-for-galaxy-z-fold4-snapdragon.4498743/ )
installed magisk
Then for nethunter
(https://www.kali.org/docs/nethunter/)
i downloaded the kernel source :
https://opensource.samsung.com/uploadSearch?searchValue=SM-F936 (my device is EUX see infos for device above)
downloaded the proper=? toolchain , there is an readme_kernel inside the kernel_source with a link to the toolchain , i am unsure about this
https://opensource.samsung.com/uploadSearch?searchValue=toolchain
there are two options i took the S22(Exynos) file ( hope thats right ?)
now we come to the difficult part :-(
first i tried to compile via the instructions on kali docs
unpack the kernel file i did and there a subfolders so i decided to use the subfolder common as the root mentioned in the docs:
you can begin by cloning our kernel builder to the root of your kernel’s folder, and prepare the environment:
from common folder i did git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel
cd kali-nethunter-kernel
I did not change the configs as i am new to that so i know there are some exports inside the build config inside the kernel file but i dont know how get them together
./build.sh
S. Setup Environment and download toolchains.
2. Configure & compile kernel from scratch
It found the devconfig so i took it as mentioned in the docs (Select your device’s defconfig, then save and exit to start the building process.)
did not edit the kernel config till jet
and ran into the error attached in the error txt
I would like to understand how i can build the kernel the normal way , without the nethunter tool
and maybe someone could help to make this working with nethunter that would be great !
i want to understand the process and i am willing to help , so i am not asking for a final kernel , more for the way to go in general to also give the community a benefit for the next new kernel we want to port
as mentioned the docs are not the best !
thanks for your time
Click to expand...
Click to collapse
Great research bro , same as here.
Difference is I am doing it for M21 .
And to flash the kernel I need to do port twrp for vA12 M21 too.
Great respect bro.
Anyone can help with kernel? u need AR9271 and rtl8188EUS drivers on ysl Android 9
https://forum.xda-developers.com/t/arm64-rom-unofficial-9-0-0-ysl-lineageos-16-0-18-08-2019.3958696/ <----- this rom
Phone: codename-[ysl]
Redmi s2
i have been trying to make it myself but always gets fails
im having the same issue at this step... anyone willing to show the part on how to setup the toolchain properly>?
heres a screenshot of my issue
this is local.config file
kluongo said:
heres a screenshot of my issue
Click to expand...
Click to collapse
It shows the error, do apt install flex
yesimxev said:
It shows the error, do apt install flex
Click to expand...
Click to collapse
Will do, thanks... You know I was looking through the process and missed that line... I suppose next time I should take more time and look more carefully
kluongo said:
Will do, thanks... You know I was looking through the process and missed that line... I suppose next time I should take more time and look more carefully
Click to expand...
Click to collapse
Great, I'll add to the setup env script so it won't be missed. It shouldn't happen in the first place though

Categories

Resources