6

[ROOT][Kernel][TWRP] repack of the stock kernel with dm-verity and SONY RIC off

 2 years ago
source link: https://forum.xda-developers.com/t/root-kernel-twrp-repack-of-the-stock-kernel-with-dm-verity-and-sony-ric-off.3301605/page-164#post-87242813
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

[ROOT][Kernel][TWRP] repack of the stock kernel with dm-verity and SONY RIC off

rumcum

New member
Mar 14, 2019
Xperia X Performance, XZ and XZs ONLY (Xperia X and Xperia X Compact must skip this):
Android Oreo ramdisk patching needs some additional files, and they must be copied from Oreo /system into the rootkernel's filesystem_files folder, prior to run the script, and they are:
Code:
/system/vendor/etc/[B][COLOR="Blue"]fstab.qcom[/COLOR][/B]
/system/vendor/etc/init/hw/[B][COLOR="blue"]init.qcom.rc[/COLOR][/B]
/system/vendor/etc/init/hw/[B][COLOR="blue"]init.target.rc[/COLOR][/B]
(you can pull these files through adb, or even converting system.sin to system.ext4 and take them out from there - just copy them, and DO NOT touch its contents)

Rootkernel's procedure for Oreo kernel ONLY:
1. Download and extract attached Rootkernel V5.23 (UNOFFICIAL 2.5)
2. Download attached flashable zip (DRM-fix_System_Mode.zip) and push it somewhere in your device (internal memory or sdcard)
3. Run rootkernel script with Oreo stock kernel.elf (eg.: rootkernel kernel.elf boot.img)
4. Say yes (Y) to everything - If you want munjeni's TA PoC option, ensure your TA.img (case sensitive) is located at rootkernel's root folder, and say no (N) to DRM fix
5. You're done!

Rootkernel's output should look like this:

Flash patched kernel:
1. Flash Oreo ftf (wiping everything, excluding nothing - except *.ta files - if any)
2. Unplug device and DO NOT turn it on
3. Fastboot newly created boot.img
4. Fastboot TWRP for your device
5. Unplug device and DO NOT turn it on again
6. Enter TWRP recovery and flash: DRM-fix_System_Mode.zip << YOU CAN SKIP THIS STEP IF YOU CHOOSE munjeni's TA PoC OPTION!!
7. You're done!

Root:
- After step 6 above, flash latest Magisk zip (SuperSU seems not to work properly yet)

Known issues:
- Magisk zip installation may fail, and device may also fall in a bootloop
- If you're facing this ^, do whole procedure again, but DO NOT flash Magisk zip, instead, turn device on, install latest Magisk Manager, patch boot.img and flash it (fastboot it)!


As always, TRY IT AT YOUR OWN RISK!

Credits:
@tobias.waldvogel ofc
@sToRm// for additional ramdisk files hint (man, you're insane!)

Enjoy it!
When there is a risk, there is fun!
Your method works fine with me. Good job!

After flash boot.img system starts twice.
The first boot takes about 3-5 minutes.
If the boot lasts more than 5 minutes, you should check the data format in TWRP partition. It should be ext4 (instead of emmc).
That's the way it's supposed to be.

shohabmsk

Senior Member
Jan 24, 2018 Gaibandha
pubg, pubg lite, free fire not working if I patch boot.img with root kernel. the games work fine on both locked and unlocked bootloader. but whenever I rootkernel boot.img and flash, those games gets black screen and doesn't run. just black screen when opening, no logo, not running, anything. (free fire on white screen, same) pubg worked fine till 0.18, until 0.19 update. pubg lite, free fire also worked on earlier versions(past years). dont know if patching boot.img or just modifying boot.img causes the issue, I heard those games checks things at kernel level.
Last edited: Jul 17, 2020

sanekplus

New member
Feb 12, 2017
... Rootkernel V5.23 (UNOFFICIAL 2.5) ...
I tried to use this great package for getting root+TA in my Xperia X Compact (latest Android 8 34.4.A.2.118) but got strange problems:
1) patched kernel during init cannot copy /sbin/TA.img to /data/local/tmp/TA.img
2) after manual copying daemon cannot read /data/local/tmp/TA.img
Code:
08-30 21:20:58.735  9319  9319 I tad     : Trim Area daemon starting.
08-30 21:20:58.735  9319  9319 I tad     : Using trim area info (0,16) from arguments.
08-30 21:20:58.724  9319  9319 W tad_static: type=1400 audit(0.0:419): avc: denied { read write } for name="TA.img" dev="mmcblk0p51" ino=514083 scontext=u:r:tad:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init"
08-30 21:20:58.735  9319  9319 E tad     : Failed to open /data/local/tmp/TA.img (Permission denied)
08-30 21:20:58.735  9319  9319 E tad     : Failed to configure TA library.
It seemed selinux was broken. I made some investigation and finally have found that seinject option in bootimg.exe does not work properly on Windows (without any error messages sadly). Rebuilding kernel on Linux gives me correct selinux settings and working root+TA.

softrulez

New member
Jun 16, 2017
Sorry of topic... Hello dear people. Maby someone with SONY DEV account can help me unlock bootloader? Looks like sony not interested in new developer registration, and i need it only for one OLD Z3+ phone. PM plz.

olekolekolek78

New member
Aug 5, 2022
please i want 376 firmawe kernel i got unlocked bl i want to magisk on 7.0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK