[KERNEL] NX Kernel | R30 | 07 AUG '20

strobel

Senior Member
Jun 25, 2013
295
130
0
www.strobelartesao.com.br
Hello nice people.

I'm on Horizon One UI ROM and i lose Root when flashing NX30. I've read you have to flash magisk to fix it, so i did it, But I can't make root work! Magisk is there 100% updated but the root doesn't work. Is there a way to make it work or is it a problem I have to ask for solutions in the ROM thread?

Best regards and thanks for the help.
 

Noxxxious

Senior Member
Apr 9, 2012
1,569
3,360
143
As an educational effort (for myself)
Any insight would be most welcomed. Thank you!
That post that quoted you gives you enough insight. Goodluck :good:
Is it possible to install this kernel over a2n kernel without wiping data. I don't like demo version and i want full control over kernel by apps.
Glad it all worked out
Hello nice people.

I'm on Horizon One UI ROM and i lose Root when flashing NX30. I've read you have to flash magisk to fix it, so i did it, But I can't make root work! Magisk is there 100% updated but the root doesn't work. Is there a way to make it work or is it a problem I have to ask for solutions in the ROM thread?

Best regards and thanks for the help.
In twrp you have to flash the kernel and then magisk. Dont flash kernel after magisk, or it will override the ramdisk changes made by magisk again. Kernels that use anykernel for flashing generally dont face this issue. I never used anykernel in my S8 kernel because other kernels mostly use(d) to modify the ramdisk.
 

Magendanz

Senior Member
Mar 25, 2008
667
580
123
Issaquah, WA
www.Vote4Chad.com
@Noxxxious, you seem to be one of the few custom kernel developers who have figured out the workaround to restore WiFi when building Samsung kernels from their posted source. I do this routinely to restore MTP on Galaxy Tab A devices, but have run into this WiFi issue with the Galaxy Tab A 8.0 (2019), which is based on the Snapdragon 429.

Could you point me to any hints on how to best restore WiFi with these custom kernels? The ones that I've built for Exynos devices haven't had this issue, and stock boot images work fine.

Specifically, I'm curious about the more elegant fix you implemented for WiFi in R8. Was this just a matter of swapping out libsecure_storage.so like @ianmacd did here, or was that the first workaround you tried?
 
Last edited:

Noxxxious

Senior Member
Apr 9, 2012
1,569
3,360
143
@Noxxxious, you seem to be one of the few custom kernel developers who have figured out the workaround to restore WiFi when building Samsung kernels from their posted source. I do this routinely to restore MTP on Galaxy Tab A devices, but have run into this WiFi issue with the Galaxy Tab A 8.0 (2019), which is based on the Snapdragon 429.

Could you point me to any hints on how to best restore WiFi with these custom kernels? The ones that I've built for Exynos devices haven't had this issue, and stock boot images work fine.

Specifically, I'm curious about the more elegant fix you implemented for WiFi in R8. Was this just a matter of swapping out libsecure_storage.so like @ianmacd did here, or was that the first workaround you tried?
When compiling the kernel you have to export the proper Android platform version in your makefile, because some drivers like wifi and sensorhub have these checks in place. Swapping libsecurestorage was only a fix to not forget stored bluetooth and wifi passwords. It was an solution to fix an issue introduced with Android MM i believe, but i think that became obsolete on new Samsung devices.
 
Last edited:
  • Like
Reactions: Magendanz

Magendanz

Senior Member
Mar 25, 2008
667
580
123
Issaquah, WA
www.Vote4Chad.com
When compiling the kernel you have to export the proper Android platform version in your makefile, because some drivers like wifi and sensorhub have these checks in place.
That hint probably saved me weeks, @Noxxxious. Thank you!

Since your commit for R8 was to a older repo, I can't see the full scope of the check-in. I'm assuming that lines 481 to 508 of the Makefile would be the relevant section, along with the android-version.sh, android-major-version.sh, find_matching_major.sh, find_matching_version.sh and replace_dir.sh shell scripts that it calls. Is that the full scope, though? Just taking this and bumping PLATFORM_VERSION, ANDROID_VERSION and ANDROID_MAJOR_VERSION to Android 10 didn't seem to restore WiFi.
 

Noxxxious

Senior Member
Apr 9, 2012
1,569
3,360
143
That hint probably saved me weeks, @Noxxxious. Thank you!

Since your commit for R8 was to a older repo, I can't see the full scope of the check-in. I'm assuming that lines 481 to 508 of the Makefile would be the relevant section, along with the android-version.sh, android-major-version.sh, find_matching_major.sh, find_matching_version.sh and replace_dir.sh shell scripts that it calls. Is that the full scope, though? Just taking this and bumping PLATFORM_VERSION, ANDROID_VERSION and ANDROID_MAJOR_VERSION to Android 10 didn't seem to restore WiFi.
I don't think that qualcomm samsung devices use a platform check. Qualcomm chip devices (atleast what I've worked on & non samsung) use a wifi kernel module, which requires a certain workaround to force the loading of modules on custom kernels. The best way is to import the drivers from the CAF source and make them built-in. Anyway I don't know if this applies to Samsung devices as well and whether they are shipped with WiFi drivers.
 
Last edited:
  • Like
Reactions: Magendanz

Magendanz

Senior Member
Mar 25, 2008
667
580
123
Issaquah, WA
www.Vote4Chad.com
I don't think that qualcomm samsung devices use a platform check. Qualcomm chip devices (atleast what I've worked on & non samsung) use a wifi kernel module, which requires a certain workaround to force the loading of modules on custom kernels. The best way is to import the drivers from the CAF source and make them built-in. Anyway I don't know if this applies to Samsung devices as well and whether they are shipped with WiFi drivers.
For this Samsung Qualcomm device, you're definitely correct in that there is no platform check. The workaround in kernel/module.c didn't do anything for me, but I suspect it's because I don't have the stock WiFi kernel modules. In fact, the only kernel modules the public kernel source builds are rdbg.ko, lcd.ko, efivarfs.ko, and br_netfilter.ko. (The Android 9 version also included tcp_htcp.ko and tcp_westwood.ko, but I don't think TCP congestion control is the issue here.) Neither the stock vendor nor system partition contain any .ko files, so I assume everything is built-in.

Is there any way to do an objdump on an android kernel so that I can examine the stock kernel contents?
 

Noxxxious

Senior Member
Apr 9, 2012
1,569
3,360
143
For this Samsung Qualcomm device, you're definitely correct in that there is no platform check. The workaround in kernel/module.c didn't do anything for me, but I suspect it's because I don't have the stock WiFi kernel modules. In fact, the only kernel modules the public kernel source builds are rdbg.ko, lcd.ko, efivarfs.ko, and br_netfilter.ko. (The Android 9 version also included tcp_htcp.ko and tcp_westwood.ko, but I don't think TCP congestion control is the issue here.) Neither the stock vendor nor system partition contain any .ko files, so I assume everything is built-in.

Is there any way to do an objdump on an android kernel so that I can examine the stock kernel contents?
Vmlinux at best. Just start with the basics. First extract the config from your stock boot.img to see which drivers have been compiled. I am sure your source doesnt ship with a full defconfig. If it does compile certain wlan drivers, then check if they use platform checks. For example, the s20 snapdragon uses bcmdhd_101 driver which uses platform checks. You state that the stock kernel works fine, which clearly means there is something wrong on your end. Start debugging the kernel logs. My initial fix just were blobs because I read in the logs that the wifi driver was searching for a "wrong" path. In the end the issue was simply setting the right Android version.
 
  • Like
Reactions: Magendanz