Question Kernel edit to run docker on S22 SM-S901B with exynos2200 - Samsung Galaxy S22

My intention is to run docker on android. After some research my attention falls on this thread. It’s a guide to run docker inside termux. To do so you need some features that are disabled by default in Android’s stock kernel. Good thing there is a script to run inside termux (phone rooted) to check the necessary features for docker – listing all missing features and all enabled by default (with stock kernel).
Here are some example features that are necessary:
MACVLAN
VXLAN​
VLAN_8021Q
I was and I’m still a newbie in kernel editing/compiling. I needed a guide that’s simple and understandable. So, I got my hands on the LineageOS build guide for a Samsung S10 (beyond1lte). After some days I finally managed to compile a new kernel with LineageOS 19.1 and got docker running on my Samsung S10.
Next step was to do the same with a Samsung S22 (r0s). At the moment I stuck in bootloop after flashing my self-compiled kernel. Currently I have those two more like same procedures to build a kernel and flashing it.
initial state: phone is rooted with magisk (patched AP with magisk apk)
1 – Loki Kernel (flash with FKM)2 – afaneh92 Kernel (flash with TWRP)cd arch/arm64/configscd arch/arm64/configsedit exynos2200_r0s_defconfig
CONFIG_MACVLAN is not set
to
CONFIG_MACVLAN=yedit afaneh_r0s_defconfig
CONFIG_MACVLAN is not set
to
CONFIG_MACVLAN=yuse build_menu from kernel root
- Build kerneluse build_menu from kernel root
- Build kerneluse build_menu from kernel root
- Make flashable zipsuse build_menu from kernel root
- Make flashable zipsInstall kernel with FKM and rebootInstall kernel with TWRP and rebootbootloopbootloop
If I do the same with other config options, i.e., VXLAN or VLAN_8021Q or even using “make menuconfig” with proper env variables as source I got the same result (bootloop). And I think there is no problem with my toolchains or so, because if I’m compiling default configs from the threads (loki and afaneh92), I can flash those self-compiled kernels and also boot into system without bootloop.
Need some help to clarify some stuff to get this "project" to the next level. I also can provide the complete kernel docker-feature list, as needed. Maybe someone will try it by himself.

Update:
I build a kernel with following additional features and was able to boot into system with that options:
MACVLAN
PID_NS
USER_NS
Unfortunatley I still missing the capability to get more features running, like: CGROUP_DEVICE, IP_VS, POSIX_MQUEUE, etc. I can't find proper guides to figure out which dependencies are required to get the kernel up with one of those options. My approach was kinda "trial and error" or read some other kernel-defconfigs to hit the golden feature to get the kernel booted. After around 30 build kernels I realized that's just a waste of time and if I not find the right explanation I do this procedure the rest of my life.
Someone told me to look inside the /proc/last_kmsg after bootloop, but there are so many lines I can't find the suitable that's responsible for bootloop. I linked the file anyway, maybe someone is really bored and wanna take a look on it. For the moment I stick to my S10 and wait for the next big hint.

Related

[PATCH] Kexec-hardboot patch

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 4. 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 commong thing among Android devices, which is why kexec-hardboot was made.
What is the difference between normal and hardboot exec?
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 sumarize 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/7833796, 4.4 AOSP kernel repo
This is the kernel patch. Only the host kernel needs to be patched.
Related CONFIG options:
CONFIG_KEXEC=y
CONFIG_KEXEC_HARDBOOT=y
CONFIG_PROC_DEVICETREE=y
CONFIG_ATAGS_PROC=n # This one is turned on automatically, but it is not needed, so you can disable it.
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. You can get statically built binary at https://github.com/Tasssadar/multirom/blob/master/install_zip/prebuilt-installer/multirom/kexec​
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)" --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.
Merged, thanks again for the awesome work @Tasssadar!
Good deal.My day is getting better.
@show-p1984 would love to see this in bricked kernel too! ?
@neobuddy89 did you see this?
Sent from Nexus 5 on Slimkat
thanks for the hard work.. thats awesome.
AndroidSlave said:
@neobuddy89 did you see this?
Sent from Nexus 5 on Slimkat
Click to expand...
Click to collapse
Yeah, I saw this.
neobuddy89 said:
Yeah, I saw this.
Click to expand...
Click to collapse
I asked that 6 months ago
Sent from my Nexus 5 using Tapatalk
awesome work bro...
much needed..
AndroidSlave said:
I asked that 6 months ago
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Yeah, I know and I saw that days back..
Enough of OT. :fingers-crossed:
Help with applying the patch
Okay so I have my aosp kernel made. I have my working directory too. Can you just guide me on how do I apply this partch to it?
Is it possible to add that patch from a on the fly flashable zip ?
@Anoopnk since the patch is for the kernel(zImage) its not possible to patch it like that. Or you have to compile the kernel or you need to ask your kernel dev friendly or he can include it in his kernel.
Hello, first I'd like to apologize for dredging up an old thread. Second, I am attempting to build a CM13+kali+kexec compatible kernel, with extra wifi drivers as the base kernel doesnt support my wifi card. Based on that goal, I have a multi-part question for the OP, or anyone else with the know-how to assist me in my quest.
1)Is there a source available for your kernel_kexec_hammerhead_cm13-01-2c39db662.zip listed on the multirom page for nexus 5? I'm attempting to build a new kernel, for kali+CM13+multirom, and your android_kernel_google_msm git only has branches going up to CM12. It would be far easier for me to start with a 'clean' CM13+kexec source then trying to patch myself as per question #2
2) I've attempted to patch a plain old hammerhead_defconfig from CM13 git, however I believe I am doing so wrong. I have managed to compile kexec-tools and aquired the hammerhead 3.4.x patch. Now am I supposed to patch my produced zImage-dtb AFTER build, running the patch from the kexec-tools folder and against the zImage-dtb? Is it something like 'KEXEC.patch -p1 < zimage-dtb'
Any clarification on the use of the kexec-tools patch, or simply a link to github source of a 'clean' CM13 kernel with the kexec patch already applied, would be incredibly helpfull on my journey down the rabbit hole
~EDIT~
Ok so I've managed to figure out the patch and feel like a dumbass. For anyone else looking to get into kernel dev, and wanting to use the kexec patch, heres the basics:
1- run patch within your kernel source directory
2-ensure that the config settings in OP are set (I had to add them to my source by hand as they werent there)
3-when zipping up your kernel, add the sbin and lib/kexec-tools folders from the kexec-tools source build, and be sure your updater-script / updater-binary is set to move these folders into /sbin and /lib respectively.
4-Flash and enjoy Kexec! (check with multirom manager)

[Recovery] TWRP 2.8.7.x for the G925T on 5.1.1 (OF6) + [Kernel]Aou's OH6 Stock Kernel

Intro:
I've put in a serious number of hours poking around my G925T that I've upgraded to the official G925TUVU2COH6 firmware, trying to get TWRP installed and working on our device. With help from @bigbiff, @_that, and several testers in this thread, we finally have something working solid for our device. Before continuing, please take a moment to read through the extremely-relevant warnings below:
WARNING: Intentionally modifying your System partition from TWRP recovery, without first flashing a custom kernel (kernel must have no "verify" mount parameter in fstab), will likely cause a soft-brick (boot-loop). Before flashing this (or any) custom recovery/kernel, it is advised that you know how to restore your phone back to OH6 stock using Odin.
Note: Flashing a custom kernel (while keeping a stock System/ROM) may cause your device to report a security threat. If you proceed without caution, the device will literally attempt to re-flash the stock OH6 kernel again. It is possible to freeze "Security Log Agent" (or uninstall it completely), and this should keep your device from reporting this problem. Other reports say that using "Smart Manager" might also report the security threat, and there are some options out there for replacing it with a patched version.
Rooted Phones: Do NOT allow "com.tmobile.pr.adapt" to obtain root permissions, EVER. This app might be something that T-Mobile uses to determine if your device has ever been rooted. I would recommend freezing/disabling this app.
Unlocked Phones: If you have unlocked your phone, you might run into problems with 5.1.1. There have been reports of phones stuck in a boot-loop when upgrading from 5.0.2 -> 5.1.1 when the phone has been unlocked or EFS/IMEI has been tampered with. Combine this with the new "FRP LOCK" (Factory Reset Protection) in 5.1.1, and you might find yourself with a complete brick with no warranty. This issue may or may not have anything to do with rooting or custom firmware.
WARNING: Flashing any custom firmware to your device will trip the KNOX Warranty Bit. At this time, this is irreversible, and might cause you problems when returning faulty devices to T-Mobile or Samsung. YMMV.
Click to expand...
Click to collapse
How-To-Install (The Short Version):
Recognize that this will trip KNOX.
Be sure you're actually already running the 5.1.1 (OH6) firmware. If you're on 5.0.2 (OCG, for example), this thread is not for you.
Turn on "OEM unlocking" in Settings -> Developer options. This is the dreaded "FRP LOCK" that prohibits custom firmware from being flashed to the G925T/G920T (and maybe others) - it's something new in 5.1.1.
Download and Odin-flash my v13 of TWRP 2.8.7.x.
Download and Odin-flash (or TWRP-flash) my v1 build of the OH6 kernel. G920T users should use the appropriate G920T kernel for their device.
(Optional): Download and TWRP-flash Chainfire's SuperSU v2.49 (.zip format).
(Advice): Use Titanium Backup or some other app to freeze/disable/uninstall "SecurityLogAgent" (remove nagging about security) and "com.tmobile.pr.adapt" (remove nagging about root, helps with sleep, and may be used by T-Mobile to determine your rooted status).
Enjoy TWRP + Root with an almost-completely-stock OH6 kernel/system!
Click to expand...
Click to collapse
Official TWRP for G925T:
It's official! Thanks to all of our hard work in this thread, plus a bunch of work getting things fine-tuned and finalized by @bigbiff, our device is now officially supported by TeamWin! Check out the official page here. Development will continue here on this thread until further notice, and I'll always be building the latest-and greatest from source and making it available in this thread (not to mention this is the go-to place to get the latest version of my kernel).
Click to expand...
Click to collapse
Downloads:
Here's the Odin-flashable OF6 kernel I've built:
Version 1 (6/25/15) - built from OF6 stock kernel source, no modifications
Version 2 (6/27/15) - built from OF6 stock kernel source, fixes boot-loop
Version 3 (6/28/15) - built from OF6 stock kernel source, fixes boot-loop and allows root
Version 4 (6/28/15) - built from OF6 stock kernel source, fixes boot-loop, allows root, and fixes Deep Sleep - also available as a TWRP-flashable .zip or Flashify .img
Here's the Odin-flashable OF8 kernel I've built:
Version 1 (8/10/15) - built from OF8 stock kernel source, fixes boot-loop, allows root, and fixes Deep Sleep - also available as a TWRP-flashable .zip or Flashify .img
Here's the Odin-flashable OH6 kernel I've built:
Version 1 (9/15/15) - built from OH6 stock kernel source, fixes boot-loop, allows root, and fixes Deep Sleep - also available as a TWRP-flashable .zip or Flashify .img
Here's the Odin-flashable TWRP recovery I've put together:
Version 13 (7/10/15) - also available as a Flashify .img
And, in case you need it, here's the stock OF8 recovery as an Odin-flashable:
OF8 Stock Recovery - No guarantees it won't trip KNOX (it shouldn't), but if you're needing this, you've probably already tripped KNOX. Sorry, I'm too lazy to package and upload a flashable OH6 stock kernel.
G920T users! I bring you a gift! I took the G920TUVU2DOH6 Samsung source, built it with the same modifications as I did the G925T kernel to allow modified System partitions (allows root w/o bootloop), and then stuck that into the G920T OH6 stock kernel provided by @icepuente (thanks!). Also, some additional thanks to @icepuente for testing it, too!
Version 1 (9/21/15) - FOR G920T - built from G920TUVU2DOH6 stock kernel source, fixes boot-loop, allows root, and fixes Deep Sleep - also available as a TWRP-flashable .zip or Flashify .img
Click to expand...
Click to collapse
Building this OH6 kernel from source:
Setup your build environment for compiling Android.
Download the latest NDK, unpack, etc., etc.
Download the OH6 source code directly from Samsung.
Update the Makefile's CROSS_COMPILE to use the NDK toolchain. Mine ended up looking like this: /home/aou/android/NDK/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
make exynos7420-zerolte_tmo_defconfig
For some reason, gcc treats CONFIG_ALWAYS_ENFORCE as always defined, and therefore the kernel will, of course, always enable SELinux: Enforcing. This makes it "impossible" to root Android 5.1.1. There is a workaround:
rm -rf security/selinux
svn export https://github.com/glewarne/S6-UniKernel/trunk/security/selinux security/selinux (snags a copy of their security/linux folder...)
Go give the guys over at the UniKernel thread some "Thanks!" for making this workaround in their kernel, especially @AndreiLux - he was the one to author this change to their source that fixes this problem.
Replace drivers/scsi/sd.c with Sujit Reddy Thumma's Deep Sleep fixed version, referenced in the UniKernel's source:
curl https://raw.githubusercontent.com/glewarne/S6-UniKernel/master/drivers/scsi/sd.c > drivers/scsi/sd.c
make -j#
Go snag that juicy arch/arm64/boot/Image - This is your kernel zImage.
Go download the official OH6 Odin package and extract the boot.img (kernel) from it.
Unpack the official kernel using the mkbootimg_tools, available here, replace the kernel file in the unpacked boot.img, and then repack it into a boot.img again. This boot.img would need to be tarballed and md5summed to be Odin flashable.
You'll want to remove the ,verify from both of these files in the ramdisk: fstab.samsungexynos7420 and fstab.samsungexynos7420.fwup
At the bottom of default.prop, you'll want to add these two lines:
Code:
ro.securestorage.support=false
androidboot.selinux=0
Building TWRP from source:
Setup your build environment for compiling Android.
Download the latest NDK, unpack, etc., etc. Mine ended up in ~/android/NDK.
Git clone the TWRP zerolte kernel source somewhere useful. Mine was cloned into ~/android/kernel:
git clone https://github.com/TeamWin/android_kernel_samsung_zerolte.git -b android-5.1 ~/android/kernel
The next several steps The next several steps are performed in & relative to this path.
Update the Makefile's CROSS_COMPILE to use the NDK toolchain. Mine ended up looking like this: /home/aou/android/NDK/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- (to match my NDK path above - note I couldn't use the relative ~ path for /home/aou).
make exynos7420-zerolte_defconfig (ignore warnings about 'jump')
make -j# (replace # with number of CPU cores + 1)
Note the location of the output kernel - you'll need it in a little bit. In my case, it would be ~/android/kernel/arch/arm64/boot/Image.
Setup your Omnirom compile environment. Mine's in ~/android/omni. The next several steps are performed in & relative to this path.
Git clone the TWRP zeroltetmo device source into device/samsung/zeroltetmo:
rm -rf device/samsung/zeroltetmo && git clone https://github.com/TeamWin/android_device_samsung_zeroltetmo.git -b android-5.1 device/samsung/zeroltetmo
For some reason, TWRP doesn't build too well with the Omnirom's version of busybox. Replace the whole external/busybox folder with that from cm-12.1 source:
rm -rf external/busybox && git clone https://github.com/CyanogenMod/android_external_busybox.git -b cm-12.1 external/busybox
Remember that kernel we built? Rename/copy it to replace device/samsung/zeroltetmo/kernAl. In my case:
cp ~/android/kernel/arch/arm64/boot/Image device/samsung/zeroltetmo/kernAl
At this time (7/10/15), we need to cherry-pick a change by Dees Troy from the TWRP Gerrit. This is the stuff about forcing Read-Only mode on first boot, which will help with some of the boot-loop stuff (if you still have a stock kernel). You can grab the changes fairly easily using:
cd bootable/recovery && git fetch https://gerrit.omnirom.org/android_bootable_recovery refs/changes/15/14015/3 && git cherry-pick FETCH_HEAD && cd ../..
Since we're using Omnirom source and we're going to use lunch later, we need to create device/samsung/zeroltetmo/vendorsetup.sh. We can do that like this:
echo add_lunch_combo omni_zeroltetmo-eng > device/samsung/zeroltetmo/vendorsetup.sh
Do a . build/envsetup.sh (note the space between the period and "build" - was important for my environment).
lunch for omni_zeroltetmo-eng
make -j# recoveryimage (again, number of CPU cores +1)
Take that precious out/target/product/zeroltetmo/recovery.img and tarball/md5sum it to be Odin flashable.
Flash away!
Click to expand...
Click to collapse
Notes about accidentally causing a boot-loop:
The OF6/OF8/OH6 kernel, out-of-the-box, checks the hash/signature of your system partition. Modifying your system partition in any way (without flashing a custom kernel that does not perform this check) will cause your device to boot-loop.
Additionally, if you decide to use TWRP to mount your System partition read-write (despite warnings), upon exiting TWRP properly, it will make some changes to your system partition for you (namely, renames /system/recovery-from-boot.p to /system/recovery-from-boot.bak to prevent some systems from re-writing over your custom recovery). This would cause the boot-loop.
You obviously have some options to avoid causing a bootloop!
Option 1a: Flash my v4 kernel above. It does not have the hash/signature checks, plus it sets SELinux to permissive (allowing root!). You'll still need to root the device manually by flashing Chainfire's SuperSU.
Option 1b: Flash a different custom kernel that does not have these checks. The S6 UniKernel seems to work fine, for example.
Option 2: Don't modify your System partition, and don't let TWRP exit properly while you have the "read-only" checkbox unchecked (in the Mount screen).
Recovering from a boot-loop:
Something go wrong? Skip a step? No big deal. To get our device back in working order, you have a couple options:
Option 1: Flash the official OH6 firmware via Odin again. In my experience, the package DOES NOT wipe your data or sdcard partitions, so it really isn't that big of a deal to do. It just takes downloading a monster-size file, and the foreknowledge on how to flash it. But, caveat, don't blame me if something goes wrong with restoring the stock firmware!
Option 2: See Options 1a & 1b in the first list above. By flashing a custom kernel that doesn't have the hash/signature checks included, it should fix the boot-loop.
Click to expand...
Click to collapse
More Notes:
Huge thanks to @bigbiff for reading through prior versions of this post and updating the TWRP source code to work without device without the need of heavy modification. Additional thanks to @_that for his invaluable help in this project.
Click to expand...
Click to collapse
Hope this get resolved thanks soo much @Aou !
That's some progress made
Good to hear!
Nice work @Aou
Yay! Progress has been made! Congratulations, @Aou!
http://forum.xda-developers.com/showthread.php?t= check that out looks like root via a odin able unified kernel pre rooted and twrp
Sent from my SM-G925T using XDA Free mobile app
@tylerholbrook - I'm not sure what you're linking to? (broken link?)
And, to update everyone following this post, I've just uploaded v7 and a custom OF6 kernel, and replaced my DIY instructions with what I've done this time around. MUCH simpler with 2.8.7.0!
Also:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Is this proof enough for anyone that 5.1.1 does NOT lock the bootloader?
Aou said:
@tylerholbrook - I'm not sure what you're linking to? (broken link?)
And, to update everyone following this post, I've just uploaded v7 and a custom OF6 kernel, and replaced my DIY instructions with what I've done this time around. MUCH simpler with 2.8.7.0!
Also:
Is this proof enough for anyone that 5.1.1 does NOT lock the bootloader?
Click to expand...
Click to collapse
http://forum.xda-developers.com/gal...-stockmod-kernel-t3100395/page50#post61551321
try that one,, sorry, on my computer now. Its in the unified development section for the unified kernel.. They have a working TWRP for the non edge and there is a patched kernel that should give root for us when flashed in odin. If I read correctly. I'm still on 5.0.2 or I would test it, I just dont want to upgrade and it not work and be stuck having to flash the whole factory image. I need root for tethering ect..
---------- Post added at 08:34 AM ---------- Previous post was at 08:30 AM ----------
tylerholbrook said:
http://forum.xda-developers.com/gal...-stockmod-kernel-t3100395/page50#post61551321
try that one,, sorry, on my computer now. Its in the unified development section for the unified kernel.. They have a working TWRP for the non edge and there is a patched kernel that should give root for us when flashed in odin. If I read correctly. I'm still on 5.0.2 or I would test it, I just dont want to upgrade and it not work and be stuck having to flash the whole factory image. I need root for tethering ect..
Click to expand...
Click to collapse
@Aou somehow Sunderwear got another mysterious update OTA that was prerooted to my understanding... more info on that is in the TMobile galaxy s6 thread in the general section.
tylerholbrook said:
http://forum.xda-developers.com/gal...-stockmod-kernel-t3100395/page50#post61551321
try that one,, sorry, on my computer now. Its in the unified development section for the unified kernel.. They have a working TWRP for the non edge and there is a patched kernel that should give root for us when flashed in odin. If I read correctly. I'm still on 5.0.2 or I would test it, I just dont want to upgrade and it not work and be stuck having to flash the whole factory image. I need root for tethering ect..
---------- Post added at 08:34 AM ---------- Previous post was at 08:30 AM ----------
@Aou somehow Sunderwear got another mysterious update OTA that was prerooted to my understanding... more info on that is in the TMobile galaxy s6 thread in the general section.
Click to expand...
Click to collapse
I'll have to mess with those tomorrow. Thanks!
(okay, now I really need to go to bed! Work in the morning...)
Aou said:
I'll have to mess with those tomorrow. Thanks!
(okay, now I really need to go to bed! Work in the morning...)
Click to expand...
Click to collapse
Ha yeah no problem. Really hoping it works for us but they had success on the 920x versions as well as a fully working TWRP that could probably be used to branch and get yours fully working. Fingers crossed :good: Thanks for your hard work!
Bam. 5.1.1 root
Did you see bigbiff released a TWRP for the other guys where everything works. Should I test out v7? I just don't want a bootloop lol
ktetreault14 said:
Did you see bigbiff released a TWRP for the other guys where everything works. Should I test out v7? I just don't want a bootloop lol
Click to expand...
Click to collapse
For the other guys? Mind linking me up?
Adizzzle said:
For the other guys? Mind linking me up?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=3080940
The only missing piece of the puzzle
Thank you for having this so I didn't I'm have to reodin
Sorry a little confused here does that mean we have a new TWRP image available for the G925T/W8
Well I can't take a backup but it doesn't screw my boot up
ktetreault14 said:
Well I can't take a backup but it doesn't screw my boot up
Click to expand...
Click to collapse
Really? It didn't screw up your boot? Interesting...
In any event, the v7 I had uploaded last night was not actually v7. It was some bastardized hybrid of v6 and v7. I re-uploaded the REAL v7.
Still breaks System at this time, but I'm working on it. The TWRP for the international S6 seems to have pretty much all the same source as mine, at least what they're showing right now. I'll double check and verify some stuff.
As for root, great! I'm looking into baking the same thing into my kernel, so those who want to say closer to TMO stock can do so without fear. It's possible that the SuperSU flashable zip would work on 5.1.1 if we just set SEAndroid to "permissive" which is what I see that those guys are doing, primarily. The rest is just convenience - taking advantage of:
a) some emergency-flash feature that samsung has baked in (lets the device flash or execute something on boot, if it needs to), and
b) some modified int.rc script and injecting root and starting it with every boot.
I'm looking into this, and fixing my TWRP. Also looking into the feasibility of flashing/repairing the System partition from my existing v7 broken TWRP...
Aou said:
Really? It didn't screw up your boot? Interesting...
In any event, the v7 I had uploaded last night was not actually v7. It was some bastardized hybrid of v6 and v7. I re-uploaded the REAL v7.
Still breaks System at this time, but I'm working on it. The TWRP for the international S6 seems to have pretty much all the same source as mine, at least what they're showing right now. I'll double check and verify some stuff.
As for root, great! I'm looking into baking the same thing into my kernel, so those who want to say closer to TMO stock can do so without fear. It's possible that the SuperSU flashable zip would work on 5.1.1 if we just set SEAndroid to "permissive" which is what I see that those guys are doing, primarily. The rest is just convenience - taking advantage of:
a) some emergency-flash feature that samsung has baked in (lets the device flash or execute something on boot, if it needs to), and
b) some modified int.rc script and injecting root and starting it with every boot.
I'm looking into this, and fixing my TWRP. Also looking into the feasibility of flashing/repairing the System partition from my existing v7 broken TWRP...
Click to expand...
Click to collapse
Yeah it didn't break system. It also didn't let me backup. Though. Haven't tried other yet.

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][OREO] [SM-T830/T835] [2019-11-21] Modesty 1.0.0 [Linux 4.4.202] [ARK4]

Modesty - a modest custom kernel for the Samsung Tab S4
Modesty aims to provide a mildly appealing and reasonable alternative to the stock 4.4.78 kernel that comes with The Tab S4. In its pursuit of being both mildly appealing and reasonable, it will eschew features that could compromise device stability, whilst gleefully embracing low-risk, self-contained enhancements. In other words, your lowest expectation should be that this kernel will be at least as stable as the stock kernel.
Since there are currently no other custom kernel projects supporting the Tab S4, there isn't really any previous device-specific work to build on. Development of this kernel is therefore likely to be slow and steady.
"Why is this kernel called Modesty? That's crap! Why not Wolverine, Intrepid or Jupiter?"
Because it's just a operating-system kernel, not a turbo-charged supercar or a mission into outer space. Even as operating-system kernels go, this one is pretty dull. Besides, I'm a weary curmudgeon in his fifties, not a teenager.
This project has the modest aim of modestly enhancing the pleasure you derive from your Tab S4 and is therefore modestly named Modesty.
Key characteristics
Supports both the wi-fi only (T830) and wi-fi/LTE (T835) models.
Forked from Samsung's pristine kernel source code (Linux 4.4.78 for ARGH firmware at time of launch).
Regular merging of the upstream Linux kernel's linux-4.4.y branch (4.4.161 at time of public launch).
Regular merging of Samsung's updates to its modified kernel source as they are made available.
Includes @savoca's KCAL advanced colour/gamma control driver.
Includes @flar2's sound control driver to manage headphone and microphone gain.
Disables a huge amount of tracing and logging features inexplicably left enabled by Samsung in the stock release kernel. These debugging features have no place outside engineering builds.
Packed into a boot.img (boot image) taken directly from Samsung's latest stock firmware and kept as close to the original as possible. No obscure boot-time kernel configuration is stashed away here, and no changes are made to any other part of the file system at either install time or run time.
Provides a fully automated installer, with the option of interactive installation to allow manual selection of features and the ability to automatically root the device with Magisk in the post-installation phase.
Includes WireGuard VPN support (version 0.0.20180818 at the time of public launch), which will be updated as available.
Includes @Lord Boeffla's generic kernel wakelock blocker. The conservative default block-list is: qcom_rx_wakelock and NETLINK.
Utilises Westwood+ TCP congestion algorithm by default.
Includes Veno TCP congestion algorithm.
SELinux operates in enforcing mode and cannot be dynamically switched to permissive mode.
FAQ
Q. Is this kernel still actively developed?
A. No. The final ianmacd release was v1.0.0 on 21st November 2019 and no-one else has picked up maintenance of the project.​
Q. Will this kernel also run on Android 9.0 (Pie) devices?
A. No. Modesty targets Android 8.1 (Oreo) and there was never an intention to update it for 9.0 (Pie).​
Q. Can I overclock or underclock the CPU using this kernel?
A. No.​
Q. How does interactive installation mode work?
A. If the ZIP file name contains the string _interactive or a dot-file called .modesty_interactive is present in the root of the external SD card, interactive installation mode is triggered. Please note that this mode overrides any selections implied by the archive name or the presence of dot-files on the file-system.
In interactive mode, you will be asked whether to root the device afterwards with Magisk. Selections are made using the Volume buttons. Just follow the on-screen prompts.​
Q. Can I safely block wakelock X?
A. Perhaps. However, unless you know what a particular wakelock does and are certain that it is causing an actual problem on your device, I suggest you leave it alone.​
Q. Why is this kernel labelled beta? Is it safe to use? And who are you, anyway? Can you be trusted?
A. My T830 has been running this kernel every day since I first rooted it, and I can therefore personally vouch for its stability on this model.
A couple of users have reported Modesty running well on the T835. Initially, it was reported that the kernel did not boot on this model, but after trying several test kernels, the user in question discovered that his machine had a non-standard firmware installation. Once this situation was remedied, Modesty booted and worked as designed.
As the person who built the kernel, I know exactly what's in it, and therefore the only risk I'm exposing myself to when I run it is that of my own incompetence. That's not true for you, however, and you should exercise due caution and at least pause for a moment to consider what you are installing, and the far-reaching powers you are about to grant this unaudited code over your device. Although I link to the source code below, you have only my word for it that this bears any resemblance to the kernel actually provided in the installer.
There are likely to be many iterations of this kernel before it sees a 1.0 release. Features may be added or removed along the way, although there is no clear roadmap at this point in time. Development will go where the needs of the users take it.
Please see the Installation section below for an important note regarding the use of this kernel in combination with stock (i.e. unmodified) Samsung firmware.​
Q. Can I safely root this kernel?
A. Of course. What use would it be if you couldn't? I recommend Magisk for the task. It has a few minor issues, but as a project is very much alive, something that cannot be said about its peers. Magisk has arguably now established itself as the de facto root solution for Android devices.
It just so happens that I also produce my own builds of Magisk, which you are welcome to use. These are release builds (as opposed to debugging builds), produced from my own fork of @topjohnwu's original source, often augmented with patches. You can use anyone's builds, though.
Again, these builds work for me on various Samsung devices, but they are unofficial and you should approach them with fitting caution.​
Q. Can I install Magisk at the same time as Modesty?
A. Yes. The Modesty installer allows you to automatically root your device with Magisk following installation of Modesty..
To make use of this facility, either rename the Modesty zip file to contain the string _magisk or create a file called .modesty_magisk in either the root of your external SD card or in the standard Download directory of the internal SD card. Alternatively, you can utilise interactive installation mode. See above for details.
If any of these trigger conditions is met, the installer will look in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
For example:
Code:
star2lte:/ $ ls -l /storage/0000-0000/.modesty_magisk
-rwxrwx--x 1 root sdcard_rw 0 2018-09-15 14:31 /storage/0000-0000/.modesty_magisk
star2lte:/ $ ls /storage/0000-0000/Magisk/Magisk-* | tail -n 3
/storage/0000-0000/Magisk/Magisk-v17.2-2018091001-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091201-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091501-ianmacd.zip
When you flash the Modesty archive in TWRP, the most recent version of Magisk that could be found will now be used to automatically root your kernel, i.e. Magisk-v17.2-2018091501-ianmacd.zip in this example.​
Q. Why doesn't Modesty have its own Telegram group?
A. Because my experience of Android-themed Telegram groups is that they invariably degenerate into seething cesspits of rudeness, ignorance, superstition and — on a good day — pseudo-science. I don't wish to police such a den of iniquity. Of course, it's a free world (or so I still like to kid myself), so you are at liberty to create your own Telegram group for Modesty if you wish. Just please don't invite me to it.​
Building
Building the kernel from source is beyond the scope of this document. If you want to build this kernel from scratch, for example to change its configuration, start with this handy reference tailored to building kernels for Android.
Download
See posting #2 in this thread for links to the latest and all previous versions.
Known Issues
Bluetooth HID (input) devices do not work.
Versions 0.99.11 to 0.99.22 contained a bug that caused Bluetooth HID (input) devices, such as mice, keyboards and gamepads, not to function. They could be paired with the tablet, but their input was not recognised. This bug was finally traced and fixed in 0.99.23.​
Installation
Make a back-up of your existing boot partition using the custom recovery environment provided by TWRP. If your device doesn't yet have TWRP, you will need to install it first. Then, use it to flash the Modesty ZIP file. The boot image will automatically be installed in the boot partition of your device.
If your device has unmodified Samsung firmware, you will encounter problems with Bluetooth (namely delayed initialisation and forgotten pairings) after installing this or any other custom kernel. To remedy this, you will need to patch your system with modified libsecure_storage.so libraries. Some custom kernel installers actually install these without telling you, overwriting your system libraries and transparently circumventing the problem before you can run into it. This approach necessarily modifies your device's file-system, however, and that may not be what you want. At the very least, the user should be made aware what is happening to his device.
For this reason, I have instead prepared a companion Magisk module that achieves the same goal without modifying the file-system. This will allow you to run a custom kernel (not just this one, but any custom kernel) on pristine stock firmware without any Bluetooth issues. The module can be found in the official Magisk module repository, accessible from Magisk Manager on your tablet. If you install this Magisk module, you may wish to also disable the secure_storage_daemon by editing /system/etc/init/secure_storage_daemon.rc (change start to stop), as it no longer serves a purpose.
In a similar vein, you may encounter authentication errors when connecting to wireless networks after installing this or any other custom kernel. This problem is not serious and easily remedied by re-entering your passphrase for the networks you use.
Finally, if SecurityLogAgent notifies you that unauthorised actions have been detected, do not be alarmed. This is a normal consequence of having installed a custom kernel. You may wish to disable SecurityLogAgent to avoid being repeatedly notified..
Whilst the above issues are the only ones you can expect to encounter when running this kernel vs. the stock Samsung kernel, they may sound like more trouble than they're worth. In that case, you might be happier just sticking to Samsung's stock kernel. The company supplies a perfectly good kernel straight from the factory.
Configuration
You are encouraged to use either @morogoku's excellent MTweaks (a modified version of Kernel Aduitor) or @flar2's EX Kernel Manager to manage the features provided by this kernel.
Source code
Modesty's GitHub repository.
References
A useful guide to CPU governors, I/O schedulers (and more).
For more information on the some of the individual schedulers included in this kernel, you can also look under Documentation/block in the kernel source.
The WireGuard user guide, control app, home page and source code.
Credits
Thank you to everyone in the Linux kernel universe for getting us this far. Within the Android development community, I am grateful to the following people for their time-saving contributions:
@osm0sis for Android Image Kitchen, which has saved me a huge amount of work in packing and unpacking boot images.
An honorary mention must go to @Chainfire, the extent of whose benefaction to the Android community is still not fully understood or appreciated in some quarters.
Change log
v1.0.0 (final ianmacd release) (2019-11-21)
Kernel proclaimed stable. Version number incremented. No code changes since v0.99.49.
v0.99.49 (2019-11-16)
Updated to Linux 4.4.202.
v0.99.48 (2019-11-13)
Updated to Linux 4.4.201.
v0.99.47 (2019-11-11)
Updated to Linux 4.4.200.
v0.99.46 (2019-11-06)
Updated to Linux 4.4.199.
v0.99.45 (2019-10-31)
Updated to Linux 4.4.198.
v0.99.44 (2019-10-19)
Updated to Linux 4.4.197.
v0.99.43 (2019-10-08)
Updated to Linux 4.4.196.
v0.99.42 (2019-10-07)
Updated to Linux 4.4.195.
v0.99.41 (2019-09-22)
Updated to Linux 4.4.194.
v0.99.40 (2019-09-16)
Updated to Linux 4.4.193.
v0.99.39 (2019-09-11)
Updated to Linux 4.4.192.
Fixes unavailability of external SD card in Modesty 0.99.38.
v0.99.38 (2019-09-08) Release withdrawn (External SD card unavailable)
Updated to Linux 4.4.191.
v0.99.37 (2019-08-26)
Updated to Linux 4.4.190.
v0.99.36 (2019-08-12)
Updated to Linux 4.4.189.
v0.99.35 (2019-08-07)
Updated to Linux 4.4.188.
v0.99.34 (2019-08-05)
Updated to Linux 4.4.187.
v0.99.33 (2019-07-23)
Updated to Linux 4.4.186.
v0.99.32 (2019-07-12)
Updated to Linux 4.4.185.
v0.99.31 (2019-06-28)
Updated to Linux 4.4.184.
v0.99.30 (2019-06-22)
Updated to Linux 4.4.183.
v0.99.29 (2019-06-18)
Updated to Linux 4.4.182.
v0.99.28 (2019-06-12)
Updated to Linux 4.4.181.
v0.99.27 (2019-05-17)
Updated to Linux 4.4.180.
v0.99.26 (2019-04-28)
Updated to Linux 4.4.179.
v0.99.25 (2019-04-07)
Updated to Linux 4.4.178.
v0.99.24 (2019-03-26)
Updated to Linux 4.4.177.
Build only the latest revision of the DTB.
v0.99.23 (2019-03-02)
Fixed bug, introduced in v0.99.11, that caused input from Bluetooth HID devices, such as keyboards, mice and gamepads to be ignored.
v0.99.22 (2019-02-23)
Updated to Linux 4.4.176.
v0.99.21 (2019-02-20)
Updated to Linux 4.4.175.
v0.99.20 (2019-02-11)
Updated to Linux 4.4.174.
v0.99.19 (2019-02-08)
Updated to Linux 4.4.173.
v0.99.18 (2019-01-26)
Updated to Linux 4.4.172.
v0.99.17 (2019-01-17)
Updated to Linux 4.4.171.
v0.99.16 (2019-01-13)
Updated to Linux 4.4.170.
v0.99.15 (2018-12-30)
Rebased on ARK4 kernel source code and boot images.
v0.99.14 (2018-12-23)
Updated to Linux 4.4.169.
Merged four more UPSTREAM commits from android-4.4 kernel branch.
v0.99.13 (2018-12-13)
Updated to Linux 4.4.167.
Merged selected BACKPORT and UPSTREAM commits from android-4.4 kernel branch.
v0.99.12 (2018-12-05)
Updated to Linux 4.4.166.
Realtek USB Ethernet driver upgraded from v2.08.0 to v2.10.00.
v0.99.11 (2018-11-29)
Updated to Linux 4.4.165.
KCAL advanced colour/gamma control driver optimisation.
Added @flar2's sound control driver for controlling headphone and microphone gain. (Configure with MTweaks or EX Kernel Manager).
v0.99.10 (2018-11-21)
Updated to Linux 4.4.164.
Added KCAL advanced colour/gamma control driver. (Configure with MTweaks or EX Kernel Manager).
Lots of tracing and debug logging disabled, further reducing kernel size.
CONFIG_DISPLAY_USE_INFO
CONFIG_SEC_DISPLAYPORT_LOGGER
CONFIG_FB_MSM_MDSS_XLOG_DEBUG
CONFIG_SEC_FILE_LEAK_DEBUG
CONFIG_SEC_DEBUG_USER
CONFIG_SEC_DEBUG_SUMMARY
CONFIG_SCSI_UFSHCD_CMD_LOGGING
CONFIG_MSM_SMEM_LOGGING
CONFIG_PROFILING
CONFIG_DEBUG_INFO
CONFIG_SCHED_DEBUG
CONFIG_SEC_PM_DEBUG
CONFIG_CORESIGHT
Built as monolithic kernel (i.e. without CONFIG_MODULES).
Built as relocatable code (CONFIG_RELOCATABLE_KERNEL).
Assembler symbols stripped (CONFIG_STRIP_ASM_SYMS set).
Embedded kernel config (reported via /proc/config.gz) now falsely reports stock settings to allow disabling of superfluous kernel features that otherwise cause grave Android System warning on boot.
v0.99.9 (2018-11-13)
Rebased on ARJ3 kernel source code and boot images.
v0.99.8 (2018-11-10)
Updated to Linux 4.4.163.
More than 100 fixes applied from upstream AOSP android-4.4 and android 4.4-o branches.
Lots of tracing and debug logging disabled:
CONFIG_IPC_LOGGING (debug logging for IPC drivers)
CONFIG_QCOM_RTB (register tracing)
CONFIG_TRACER_PKT (for tracing IPC protocols)
CONFIG_FTRACE (kernel tracing infrastructure)
CONFIG_CPU_FREQ_SWITCH_PROFILER (CPU frequency switch profiler)
CONFIG_TRACING_EVENTS_GPIO (traces GPIO subsystem)
Fixes to allow kernel to build when above logging and tracing options are disabled.
v0.99.7 (2018-10-30)
Rebased on ARH5 kernel source code.
Reworked the v4l2 fix that restores liboemcrypto-dependent apps to working state.
v0.99.6 (2018-10-28)
v4l2 fixes to restore liboemcrypto-dependent apps to working state.
v0.99.5 (2018-10-21)
Updated to Linux 4.4.162.
v0.99.4 (2018-10-19)
Initial public release, based on Linux 4.4.161.
v0.99.3
Internal build, based on Linux 4.4.160.
v0.99.2
Internal build, based on Linux 4.4.159.
v0.99.1
Initial internal build, based on Linux 4.4.78.
It begins! Awesome to finally see a custom kernel for the Tab S4.
I want to test for you once I can get root back
ianmacd said:
Change log
v0.99.4 (2018-10-19)
Initial public release, based on Linux 4.4.161. Caution: This kernel remains completely untested on the T835.
v0.99.3
Internal build, based on Linux 4.4.160.
v0.99.2
Internal build, based on Linux 4.4.159.
v0.99.1
Initial internal build, based on Linux 4.4.78.
Click to expand...
Click to collapse
Flashed on T835 device doesnt even get past the Boot (custom device) screen is there a way to get logs without using a computer?
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Flashed on T835 device doesnt even get past the Boot (custom device) screen is there a way to get logs without using a computer?
Click to expand...
Click to collapse
I'll look into it this evening. I'm just about to get off a plane.
Were there any errors when installing? Was your device properly detected as a T835?
Sent from my SM-G965F using XDA Labs
ianmacd said:
I'll look into it this evening. I'm just about to get off a plane.
Were there any errors when installing? Was your device properly detected as a T835?
Click to expand...
Click to collapse
Installing just fine, correctly detected as well.
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Installing just fine, correctly detected as well.
Click to expand...
Click to collapse
I've gone through the ramdisk of the T835's boot image with a fine-tooth comb and can find nothing untoward. I also verified that I properly removed the dm-verity flag from the T835's device tree.
There are actually very few source code differences between the T830 and T835. Both can be built from a single tree. The only differences lie in the kernel config file and the device tree, but I am building with the default T835 configuration, and with the proper device tree for that device.
Let's try at least ruling out my installer code. Please image-flash this new boot image[/i] to your device and tell me if it boot-loops. If it does, my installer isn't the problem, because it's only used for a ZIP flash. I've already checked the installer code and can't see any bugs, so I don't think the issue lies there.
Can you also please tell me which version of the firmware your device is running? Possibly there's an issue there, too. Samsung has so far released the source to the ARGH kernel only. This seems to work fine on my ARH5 firmware, but it's uncertain whether it would still work on something based on ARI*, and I've seen that a couple of countries do now have ARI firmware available. Mind you, even if it wasn't compatible, it should still get as far as booting.
Anyway, please test that boot image and let me know your firmware version.
While I soldier on with the issues afflicting the T835 build, can anyone else verify the T830 build as working for them?
Don't be shy; I'm running it on my own device, so I'm certain that build boots.
ianmacd said:
While I soldier on with the issues afflicting the T835 build, can anyone else verify the T830 build as working for them?
Don't be shy; I'm running it on my own device, so I'm certain that build boots.
Click to expand...
Click to collapse
Sorry for the noob question if i flash this kernal on my SM-T835 will i lose DEX ? Sorry i'm not quite understanding what KERNEL does ? Thanks in advance!
N1NJATH3ORY said:
Sorry for the noob question if i flash this kernal on my SM-T835 will i lose DEX ? Sorry i'm not quite understanding what KERNEL does?
Click to expand...
Click to collapse
When the kernel is working as intended, you won't lose DeX, but it currently isn't even booting on the T835.
Only those who are able to assist in debugging the current boot failure should install the T835 build at this time.
The T830 build, on the other hand, is rock solid for me, and I encourage anyone who is capable of recovering from an unexpected bootloop to try it out.
Version 0.99.5 released.
This release updates the kernel to the latest upstream Linux.
T830 owners, install at will. T835 owners, beware: The previous release has been reported unbootable on this model, and this release is likely to be similarly afflicted. Investigations are ongoing. Until this issue is resolved, the whole project has been downgraded to alpha status.
Change log
Updated to Linux 4.4.162. Caution: This release is likely to cause a bootloop on the T835.
ianmacd said:
I've gone through the ramdisk of the T835's boot image with a fine-tooth comb and can find nothing untoward. I also verified that I properly removed the dm-verity flag from the T835's device tree.
There are actually very few source code differences between the T830 and T835. Both can be built from a single tree. The only differences lie in the kernel config file and the device tree, but I am building with the default T835 configuration, and with the proper device tree for that device.
Let's try at least ruling out my installer code. Please image-flash this new boot image[/i] to your device and tell me if it boot-loops. If it does, my installer isn't the problem, because it's only used for a ZIP flash. I've already checked the installer code and can't see any bugs, so I don't think the issue lies there.
Can you also please tell me which version of the firmware your device is running? Possibly there's an issue there, too. Samsung has so far released the source to the ARGH kernel only. This seems to work fine on my ARH5 firmware, but it's uncertain whether it would still work on something based on ARI*, and I've seen that a couple of countries do now have ARI firmware available. Mind you, even if it wasn't compatible, it should still get as far as booting.
Anyway, please test that boot image and let me know your firmware version.
Click to expand...
Click to collapse
Firmware Version ist arh5 and after flashing your img the device still constantly reboots on the start screen and doesnt even get to the boot Screen
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Firmware Version ist arh5 and after flashing your img the device still constantly reboots on the start screen and doesnt even get to the boot Screen
Click to expand...
Click to collapse
Thanks. That absolves the installer of any wrongdoing, at least.
Something is fundamentally wrong with the kernel for the T835.
The boot image is taken from stock firmware, and modified just enough to allow a custom kernel to boot. I very much doubt the problem lies there. A virtually identical image works for the T830.
The kernel config used is the one supplied by Samsung. The only modifications made to it are the same ones I made to the T830's.
I think my next step will be to produce a kernel built without downstreaming the 4.4.y Linux branch, so back to 4.4.78. If that works, it will indicate that an error affecting only the T835 was introduced during all of my merging of the upstream kernel.
I'll post again when I've built the kernel, which won't be for a few hours, as I'm on holiday at the moment.
Sent from my SM-G965F using XDA Labs
ianmacd said:
I think my next step will be to produce a kernel built without downstreaming the 4.4.y Linux branch, so back to 4.4.78. If that works, it will indicate that an error affecting only the T835 was introduced during all of my merging of the upstream kernel.
Click to expand...
Click to collapse
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
ianmacd said:
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
Click to expand...
Click to collapse
Thanks, flashing now will report back in a few minutes
Sent from my Samsung SM-G950F using XDA Labs
---------- Post added at 05:44 PM ---------- Previous post was at 05:17 PM ----------
ianmacd said:
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
Click to expand...
Click to collapse
Did not work still the same issue.. flashed via twrp to boot partition. Noob question, the boot backup i got is 64mb while your kernel hardly has 25.. whats going on here?
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Did not work still the same issue.. flashed via twrp to boot partition.
Click to expand...
Click to collapse
Well, that's disappointing. I was hoping that it was my screw-up, rather than Samsung's, but at this point almost everything I've done has been backed out and it still won't boot.
Noob question, the boot backup i got is 64mb while your kernel hardly has 25.. whats going on here?
Click to expand...
Click to collapse
Good question.
Your back-up is of the entire partition, including the area with no data on it, so you're getting a file the same size as the partition itself. My boot image contains just the data segment, so it's smaller.
If you pull the stock boot image from the AP file of Samsung's firmware, you'll see that it's a very similar size to mine (slightly smaller, actually):
Code:
$ unzip -p T835XXU1ARH5_T835OXM1ARH5_PHN.zip AP_T835XXU1ARH5_CL14008523_QB19263559_REV00_user_low_ship_MULTI_CERT_meta.tar.md5| tar xf - -O boot.img.\*lz4 | lz4 -dc > boot.img
$ ls -l boot.img
-rw-rw-r--. 1 ianmacd ianmacd 23593232 Oct 21 22:01 boot.img
$ file boot.img
boot.img: Android bootimg, kernel (0x8000), ramdisk (0x2000000), page size: 4096, cmdline (console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_le)
So, what now?
I'll see which other minor changes I can back out, in an effort to arrive at a kernel built from source that is as close to stock as possible. If you're wondering Why doesn't he just build from pristine sources?, the answer is: Because Samsung's source code won't even build out of the box. Many of the kernel header files are simply not in the expected locations. Alas, this is a fairly common problem with Samsung's kernel source code releases.
I suspect the solution to this problem may actually lie in changes that have yet to be made, rather than changes made that need to be reverted. In other words, the T835 may require some kernel modifications or configuration that the T830 doesn't. Theoretically, a kernel compiled from Samsung's pristine sources should just work, but that's starting to look unlikely now.
I'm hoping that I can enable/disable a few further options in the kernel config, rebuild and produce a kernel that works for you. If, however, the problem is that the source itself is faulty, we may have to wait for a future release by Samsung to give us something that compiles into a working kernel.
But I don't intend to throw in the towel on the T835 just yet. There are still a few more things we can try.
ianmacd said:
Well, that's disappointing. I was hoping that it was my screw-up, rather than Samsung's, but at this point almost everything I've done has been backed out and it still won't boot.
Good question.
Your back-up is of the entire partition, including the area with no data on it, so you're getting a file the same size as the partition itself. My boot image contains just the data segment, so it's smaller.
If you pull the stock boot image from the AP file of Samsung's firmware, you'll see that it's a very similar size to mine (slightly smaller, actually):
So, what now?
I'll see which other minor changes I can back out, in an effort to arrive at a kernel built from source that is as close to stock as possible. If you're wondering Why doesn't he just build from pristine sources?, the answer is: Because Samsung's source code won't even build out of the box. Many of the kernel header files are simply not in the expected locations. Alas, this is a fairly common problem with Samsung's kernel source code releases.
I suspect the solution to this problem may actually lie in changes that have yet to be made, rather than changes made that need to be reverted. In other words, the T835 may require some kernel modifications or configuration that the T830 doesn't. Theoretically, a kernel compiled from Samsung's pristine sources should just work, but that's starting to look unlikely now.
I'm hoping that I can enable/disable a few further options in the kernel config, rebuild and produce a kernel that works for you. If, however, the problem is that the source itself is faulty, we may have to wait for a future release by Samsung to give us something that compiles into a working kernel.
But I don't intend to throw in the towel on the T835 just yet. There are still a few more things we can try.
Click to expand...
Click to collapse
Thanks for explaining everything for me. Id like to help you were i can but i dont have a computer by my hands right now for the next time
Sent from my gts4llte using XDA Labs
dr460nf1r3 said:
Thanks for explaining everything for me. Id like to help you were i can but i dont have a computer by my hands right now for the next time
Click to expand...
Click to collapse
Here's a new build to try. This one reverts the last few changes I originally made to the T835's kernel configuration before building. This is as close to stock as possible, whilst still being able to build.
If this doesn't boot, it pretty much means that Samsung has supplied code for the T835 that simply will not compile into a working kernel. At that point, we'll probably have to wait for updated sources. I already have a request pending with Samsung for the release of the BRI sources.
Just to be clear, the current status quo as I understand it is that the Samsung logo never starts to be written from left to right. You never get past the static screen with the device name and the word Custom. Is that correct?
ianmacd said:
Here's a new build to try. This one reverts the last few changes I originally made to the T835's kernel configuration before building. This is as close to stock as possible, whilst still being able to build.
If this doesn't boot, it pretty much means that Samsung has supplied code for the T835 that simply will not compile into a working kernel. At that point, we'll probably have to wait for updated sources. I already have a request pending with Samsung for the release of the BRI sources.
Just to be clear, the current status quo as I understand it is that the Samsung logo never starts to be written from left to right. You never get past the static screen with the device name and the word Custom. Is that correct?
Click to expand...
Click to collapse
Im sorry to tell you but this doesnt boot either in fact it doesnt even reboot the static screen. Your right about the current status quo sadly.
Sent from my Samsung SM-G950F using XDA Labs

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