yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
No benefit at all. Because Samsung haven't provided the latest kernel sources for the SM-G9750, this is based on 4.14.78-16082828 and not the newer 4.14.78-16509050.

Use Frija or SamFirm - firmware downloads direct from the Samsung servers

This kernel is also outdated, thanks to Samsung withholding source...

tomatolei fixed the Wi-Fi problem in the wrong way. I saw his defconfig changes. With this kernel, Wi-Fi is enabled as soon as I'm at the lock screen, just like the original kernel.

I'm not a programmer, or an electrical engineer, so the best I can give you is that option's description: EEPROM power down forcely when EEPROM i2c error

The EEPROM chip in question belongs to the camera.

I shoved in the implementation of this feature from the 5G source code, but I've not done any testing of it, other than seeing if the cameras still work (they do).

At this point in time, AOSP doesn't interest me at all, which is why I'm adamantly sticking to TGY :)

My HTC has a LineageOS 16 build available for it if I want to try out AOSP-enhanced. Samsung have done a very good job with OneUI and I suspect I'd miss a lot of features if I switched... Plus, Pie is the current stable version of Android. I'll probably start whistling a different tune once all the Samsung updates dry up...

The last time I built a kernel for a phone was about 7 years ago. A lot's changed... I won't ever release this kernel in binary form, because it's already outdated, and, in all honesty, I don't want the burden of maintaining a kernel for others, dealing with irrelevant requests etc.

Now that the security features of the kernel have been disabled, I'll probably attempt to replace the recovery with tomatolei's TWRP binaries for use on TGY.

https://github.com/qwerty12/SM-G9750

I've included a defconfig that you can use as a base, a fix to make sure Wi-Fi works and, of course, the patch to fix the random reboots among others. Make sure to look at the commit log; you might not like a particular change of mine.

To build the kernel, start with this. However:

* the only edits to build_kernel.sh that should be made are ones to fix the paths of the toolchains.

* You also don't need to fix the Makefile.

* The LLVM compiler used is not from the Qualcomm site; search for llvm on https://opensource.samsung.com and download llvm-arm-toolchain-ship.tar.gz

Once the kernel is built, run

cat out/arch/arm64/boot/Image-dtb-hdr out/arch/arm64/boot/Image > Image

. You can use magiskboot to replace the existing kernel in recovery.img with Image (renaming it to kernel, of course).

The x86 version of magiskboot from the Magisk zip runs in Ubuntu. Or you can transfer Image to the phone and repack and reflash on the phone.
[Samsung Galaxy S10 Guides, News, & Discussion] FPSkillerPC:
Hi Guys,

Could someone please help me out? I'm using the regular S10 SM-G9370 on ASG7 software and this method doesn't seem to be working for me. The furthest I get after rebooting is the Samsung logo which freezes up and the phone keeps rebooting.

I have followed all the steps and tried 3x. Not sure what's wrong :(
[Samsung Galaxy S10 Guides, News, & Discussion] royhanks3:
Hey, can you send me the link to the Chinese forums you're referring to. I just want to see what they have to offer.
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
http://bbs.gfan.com/forum-1725-1.html
[Samsung Galaxy S10 Guides, News, & Discussion] thomas333:
Should this fix also work for an Exynos S10+? Because I also have random reboots and it's really bugging me.
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
Thanks a lot! I've build a kernel successfully but i'm struggling with unpacking recovery.img . My linux/android terminal skills are not enough. I've unpacked x86 and trying to run in Ubuntu "magiskboot unpack recovery.img" but it says

"Magiskboot: command is not found"
[Samsung Galaxy S10 Guides, News, & Discussion] TheUndertaker21:
You guys should work together

Like open a channel.

Seems like the only two that want to develop anything for our device.

I definitely wouldn't mind a fully optimized aosp rom.

We have no roms lol
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
Okay, i`m succeeded in repacking and compiling the kernel but after rebooting back i`m still with previous kernel(the name remaines as in was) I guess since i`ve taken your repo then i should have a new name in setings :P

My steps were:

1) Unpack with magiskboot

2) change kernel and kernel-dtb to new ones

3) repack back

4) flash

PS: Maybe is it because i`m trying to repack tomato's recovery.img ?
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Hi,

If all three patches applied successfully to your phone, then take my apologies. If, however, they did not and you ignored that warning which I've quoted again for the second time, then I certainly take no blame.

In any case, send me an unpatched recovery.img(.lz4) from your firmware and I'll take a look at it.

Sorry, I assume you worked out that you needed to mark the file as executable or that you ran magiskboot on the phone.

Perhaps. The compile time usually doesn't lie - I imagine the timezone in your kernel's build date and time would display as MSK.

You must not replace kernel-dtb (and if the time comes that you do want to replace it, you'll know if have a suitable file to replace it with by that point).

I mean, Samsung do apparently have some sort of mechanism to restore the stock kernel - see topjohnwu's and ianmacd's threads - but I'm running the stock Samsung TGY ROM + Magisk and it's still my kernel running on my phone three days later. Do you install Magisk yourself with tomatolei's ROM? If not, then perhaps not all of Magisk's fixes to Samsung root-unfriendly practices were applied...

How are you flashing the kernel onto the phone? I have a somewhat-decent guide on using magiskboot to repack recovery.img and then flashing the result in the first post of this thread ;)
[Samsung Galaxy S10 Guides, News, & Discussion] FPSkillerPC:
Hi qwerty12,

Thank you for your response

I have attempted this procedure 3 times and all numbers were matching the same as on your guide but no luck.

I will send you the recovery.img file when I'm home :)
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
I`m running an AOSP flashed over twrp+tomato's rom. Every time i have rebooted after flashing new kernel i was having instead of twrp somekind of samsung security thing where OEM lock activated(menu like in download mode).

Probably have to patch new recovery.img or re-apply magisk

I`ve tried to flash the img file with heimdall/twrp
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
I don't know what peculiarities such a setup brings. Are you sure that whatever AOSP build you're running doesn't have the source available for its own kernel? The tree I put up is designed for stock Samsung all the way down.

Since you're probably not running TGY firmware anymore, you can try unsetting CONFIG_MACH_BEYOND2QLTE_CHNZH and setting CONFIG_MACH_BEYOND2QLTE_CHNZC=y in the kernel's defconfig but I don't think it will make a difference.

Again, do not replace kernel_dtb. Start again with a fresh, working recovery.img to make sure you have the correct DTBs for your phone.

I saw that while working on this binary patch, usually when I wasn't paying attention to the hex editor and ended up introducing extra bytes into the file to be flashed, corrupting it and making it larger, instead of overwriting the existing bytes. Something to consider - are you sure you're replacing kernel with an actual kernel image?

I don't think it makes a difference, but I'm doing this on the device - it's much faster to upload new-boot.img to /data/local/tmp through adb and cat it to the recovery partition instead of rebooting into download mode every time.
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
I'm running GSI aosp - it utilizes stock vendor to be able to run it. However I don't know anything about kernel. There is so much questions(like what toolchain to use,etc)

Okay,will try)

I've got a theory since twrp is being build including kernel - maybe there it is not enough just to change the kernel. Anyway have to try with stock patched recovery

I'm using an output of this: cat out/arch/arm64/boot/Image-dtb-hdr out/arch/arm64/boot/Image > Image

Nice hint!
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
Can fix the problem of random restart according to this modification? thank you！I will try！

task_mmu.c

-	mss->swap = shmem_swapped;

+	mss->swap += shmem_swapped;
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Hi,

It's the other addition that fixes it:

task_mmu.c:

+	mss->check_shmem_swap = false;
if (vma->vm_file && shmem_mapping(vma->vm_file->f_mapping)) {

And thank you for your TWRP device tree :)
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
thank you very much，I will try now ！

This is G9750ZCU1ASF1	SM-G9750_CHN_PP_Opensource.zip Compiled Kernel！has fixed task_mmu.c:，I test now

https://1drv.ms/u/s!Ap5pXnpA2A8AvE1Bjrs7dJAdgTZO?e=AoGwqs
[Samsung Galaxy S10 Guides, News, & Discussion] TheUndertaker21:
[MENTION=6424744]tomatolei[/MENTION]

glad to see you here

your rom has some random reboot

other than that it's awesome

you should def post it here
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
Custom Kernel, you can add 2 files to open WIFI automatically

add \data\vendor\conn\.cid.info and .softap.info

then reboot can open WIFI automatically,If WiFi is opened before reboot
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
Yes, I want to solve this problem as soon as possible.
[Samsung Galaxy S10 Guides, News, & Discussion] TheUndertaker21:
I think the new twrp you posted may have fixed it.

I didn't get a reboot yet
[Samsung Galaxy S10 Guides, News, & Discussion] Vuska:
Please make a thread for tomato rom for 855 .... so excited man.. [emoji16]

really hope a custom kernel that support kcal ...
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
it is here

https://xdaforums.com/showpost.php?p=80139807&postcount=1
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
By the way i`ve send an email to samsung with a request for latest source
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
Wow this fix actually works for AOSP gsi too! Ty

Maybe you`ve got the same files for turning on Data
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
If you add ANDROID_VERSION=990000 to the make command line, and fix the BCMDHD options in your defconfig to the original ones:

CONFIG_BCMDHD_FW_PATH="/etc/wifi/bcmdhd_sta.bin"
CONFIG_BCMDHD_NVRAM_PATH="/etc/wifi/nvram_net.txt"

then the firmware is correctly loaded from /vendor

It's possible ;)

But probably not for much longer. Samsung do not share the kernel source for the Hong Kong firmware, so even if I did release my kernel (in binary form, the source has always been available in the hopes someone else would run with it), there's no guarantee it would work with future firmware versions. My kernel is already outdated, based on the superseded G9750ZCU1ASF1 (CHN) source, the last available. I made it work for ASG7 (TGY) but with each and every newer firmware, the differences will become greater in number and there's only so much cajoling one person can do. Plus not to mention that Samsung might have applied various patches to fix known kernel security vulnerabilities.

I sent a request to Samsung a week ago and they ignored me. I see FlatOutRU has sent a request too. Samsung aren't going to bother to do anything when only two people ask so if you SD S10* owners also wish to also send a request for the kernel source pertaining to the latest SM-G9700/30/50_HK firmware, then use the e-Mail button in the top-right corner of this page.

You cannot have working TWRP, for example, without being able to recompile the Samsung kernel to be able to at least turn off RKP and other anal-retentive anti-root features. And as the kernel from the recovery partition is used on these particular phones when rooted and booted with Magisk, it would be ideal if said suitable kernel for TWRP was also up-to-date for use in Android itself. Using an old kernel mightn't be a problem in the TWRP environment, but you're not going to have the most secure and optimised experience when using your phone normally.

Oh, and for those still using the stock kernel, stock TGY firmware and would simply like their phones not to reboot, then I updated the first thread and simplified the instructions (I'm an idiot and magiskboot is present on the phone if you installed Magisk...). I would appreciate a recovery.img(.lz4) from the latest firmware of an SM-G9730 so I can provide a patch for that phone too. Thanks!
[Samsung Galaxy S10 Guides, News, & Discussion] tomatolei:
thank you for your help!
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
Guys,if my s10 plus on tgy software can i install custom rom tomatolei on twrp?

or should I install Chinese firmware through one first?
[Samsung Galaxy S10 Guides, News, & Discussion] TheUndertaker21:
flash twrp then flash the rom after you wipe data

you can't have twrp without chiense rom sadly
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
initially it turns out through one I need to put the Chinese firmware this odin pc and then only sew tvrp?
[Samsung Galaxy S10 Guides, News, & Discussion] FlatOutRU:
You don't need to install Chinese firmware first!)
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
what to flash for recovery? in the archive there are three files, boot, recovery and vbmeta? where is the complete instruction in general?
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
I asked for TvRP, logged into it and spent a slider on changing the system, made a wipe date, installed custom firmware and pressed reboot, my phone popped up on the Samsung logo once, the recovery turned on, I pressed the reboot and the phone turned on before the Samsung logo, the logo is blinking, But the phone does not start further, what did I do wrong ??
[Samsung Galaxy S10 Guides, News, & Discussion] Airpil:
[MENTION=235313]qwerty12[/MENTION]

Hi man, could you please calculate the patch for a s10 ?

SW: G9730ZHU2ASH2

uname -r: 4.14.78-16711480

recovery.img.lz4: https://drive.google.com/file/d/1-6FKAbSP-xyCYfovB7_4KSUmVWOh-hlY/view?usp=sharing
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
Hello friends,please help!tomatolei rom!

OK Google doesn’t work, do not receive notifications from applications until you open them and how to turn off the automatic addition of programs to the desktop after installation from the market?
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Hi,

The first two patches from the first post of this thread remain the same and are still needed but for the third patch, you can try this instead (untested, my S10+ is still on ASG7):

/data/adb/magisk/magiskboot hexpatch kernel F30300AAA1010035F40313AA750640F9890E41F83F7500F103010054AA02098BC1050190407100D121B81591 F30300AA0D000014895240F9DF420239C0035FD600000000D22E40F94E02008BCE2E00F9C0035FD621B81591
[Samsung Galaxy S10 Guides, News, & Discussion] innocence07:
May I ask, any reason why you are sticking with ASG7?
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Just out of pure laziness, really :) I have a kernel built from ASG7 source and I want to (when time allows and if I actually have the knowledge) to integrate linux-stable into it...
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
friend, I'm sorry, please, but could you collect the apk frame file back recomplite? There are errors on my pc, I never did it, but this is a test frame for Chinese firmware so that the location works correctly
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
I rebooted the device via power menu and lost magisk, so i chose to upgrade my base firmware.

But now the kernel version is 4.14.78-16711480 instead of 4.14.78-16509050 and the random reboots still happen, does the same patch still aply to the new kernel?

New recovery image: https://ufile.io/fm2cias0
[Samsung Galaxy S10 Guides, News, & Discussion] fenvy:
hi qwerty, I been following this thread for a bit.

I was wondering for g9730 users, is it possible to have a repository for all the kernel. I imagine each and every user would ask for a different patch, some repeatedly.

or is it specific to each phone?

thank you
[Samsung Galaxy S10 Guides, News, & Discussion] Airpil:
Confirmed. Works fine on s10 TGY. Applied the patch from the on device terminal directly.
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
asd

I can confirm this works for S10E hong kong variant (sm-g9700) running the latest version (ASH2, the one released on 22/8/2019) with kernel version 4.14.78-16711480,
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Sorry, I've had a long week. Your report is appreciated, Airpil.

I personally think building your own kernel is preferable (it's possible!), but (sadly) this patch still has its place because Samsung are incredibly lax in providing the latest kernel source for the HK S10s. Given that fixing this is literally introducing one line, I do wish Samsung would get off their arses.

tomatolei's ROM also has this fixed in the kernel it uses.

Thanks for testing. Generally speaking, if the base kernel version is the same and same compiler version is used by Samsung (clang 6.0.10 I think), and all three patches apply and only once at that, you'll probably be OK. The warning is there to discourage people - better a phone that reboots randomly instead of one that keeps bootlooping with no Odin knowledge to fix it...

Hi,

The problem is I'm terrible at making a clean forum post. I keep previous patches at the bottom of the post, but honestly, I do think everyone is better served by having their phone up to date (advice I would do well to follow myself ...).

The only patch that appears to be phone-specific is the long one. Not because of the new code, but because, for whatever reason, the surrounding four bytes appear to differ. The actual code is the same regardless of the model. I'm hoping it remains that way for a while.
[Samsung Galaxy S10 Guides, News, & Discussion] Vuska:
just information...

This patches also work with S10+ G9750 TGY with ASH2.

thank you.
[Samsung Galaxy S10 Guides, News, & Discussion] bsam55:
BusyBox Requirement

I just want to let anyone having trouble successfully executing these patches know I found the Magisk BusyBox module seems to be required even if BusyBox is already installed on phone. I believe [MENTION=235313]qwerty12[/MENTION] suggested that somewhere in these ten pages but, in my ignorance I tried without it and patching failed. Even though module says it is for architectures built with NDK, it sure seems to be required and performing some necessary function in this situation.

My application is SM-G9730 TGY running ASH2 firmaware and I'll mention [MENTION=235313]qwerty12[/MENTION]'s latest third patch for this seems to be working fine so far. Thanks [MENTION=235313]qwerty12[/MENTION]! :good:

Edit: I was excited enough about successful patching that I maybe didn't test long enough before posting all is well. I am confident patching was successful and phone booted just fine but, unfortunately I still experience spontaneous reboots. Just wanted to let OP know.

By the way [MENTION=235313]qwerty12[/MENTION], thanks for providing this help to other device owners including those that have a different model than your own. It seems to be something you did for yourself and are being generous adapt to other models/firmwares to help others.
[Samsung Galaxy S10 Guides, News, & Discussion] qwerty12:
Busybox actually shouldn't be needed anymore as far as I know. The only reason why it was initially required was because:

I wasn't thinking and didn't know there was a copy of magiskboot on the phone. Busybox's wget module was used to download the Magisk zip separately so that magiskboot could be extracted, but yeah, what a waste of time...

The first patch used to use dd to write to a specific position in the kernel image (toybox's version doesn't appear to support the options used) but later on, magiskboot was able to handle all of it

Sorry to hear that. The next time it reboots, could you see if /proc/last_kmsg contains something along the lines of:

If so, then my patch might be bad...
[Samsung Galaxy S10 Guides, News, & Discussion] bsam55:
Querty, last_kmsg did contain lines like this. I tried for quite awhile to get a screen capture to attach for you but system ui crashed every time I tried to capture screen from within Root Explorer. I have not experienced anything like this before but, absolutely could not get a screen capture. It works fine except for within Root Explorer. Left me pulling my hair out.

Anyway, last_kmsg included a number of lines where within second set of brackets read [2: android.bg: 1951]. I believe this is correct. All three statements you ask about were there as well as about a dozen others. Sorry to be so unprofessional in reporting incident but, screen capture was impossible.

I don't know how much work is involved for you to try another patch but, it's worth noting that at this point we should be a few days away from another update.

As for BusyBox issue, maybe I made some other error on first attempt without busybox module. It is definitely possible.

Thanks again
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
hiw fix reboot on tgy ash2 ?please help me at privat massage!i but understandand english!please help!
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
help please!
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
You don't seem to understand what you are doing, and are not providing information for people to actually help you

What device are you on?, what kernel version does it have?

What have you done on your device?
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
1 galaxy s10 plus with snapdragon 855

2 kernel in setting 4.14.78-16711480 ,sw is ASH2

3 i rooted phone with patch magisk ap file and flash it,but sometimes my phone has random reboot
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
Well, you are on the right topic, why don't you read the first post?
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
Yes, I don’t understand this language, but I went to the instructions and immediately encountered an error

I turned on ec debugging on the phone and connected the phone to the pc

launched cmd and entered the first command uname -r, but nothing happened and an error popped up
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
Those are not cmd commands, they are to be used in the adb shell
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
how start adb shell on pc?

and phone must be off?
[Samsung Galaxy S10 Guides, News, & Discussion] Laikar_:
https://lmgtfy.com/?q=how+to+use+adb+shell

You should learn to use google, it will help you a lot
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
ok,but phone must be off then i work in adb?
[Samsung Galaxy S10 Guides, News, & Discussion] Vuska:
No...

just leave as it...

and usb debugging must set to enable on Developers Setting

and with adb.. test with command :

adb devices
[Samsung Galaxy S10 Guides, News, & Discussion] Vuska:
????

what the meaning ???

please more clear bro..
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
not work(
[Samsung Galaxy S10 Guides, News, & Discussion] Mason76:
why this error?
[Samsung Galaxy S10 Guides, News, & Discussion] Vuska:
i cannot see the image...

error 404 file not found
[Samsung Galaxy S10 Guides, News, & Discussion] redplate:
hi there. I've patched the latest kernel version with the mentioned patch. I didn't get any mismatch error while patching via adb shell.

sadly I run into boot loop, or better stucking bootlogo.

I've refreshed the patches ap+csc file. everything is normal again and rooted.

after the last command to reboot I pressed keycombo vol-, power l and Bixby. could this be the problem it wasn't working for me?

I'm using g9750.