[KERNEL] [A12] Stock Kernel Patched with Magisk - Sony Xperia 5 II Guides, News, & Discussion

This is a flashable stock kernel (boot.img) for Xperia 5 II XQ-AS52 patched with magisk to enable root features
I pulled this kernel from XQ-AS52_Customized UK_58.2.A.10.84 and patched with Magisk Manager
I used XperiFirm to download the firmware, then i used Unsin to convert the kernel
I have also included the original kernel as a boot image which can be flashed to recover from bootloop issues with modules
Please note, due to the limitations of the stock kernel, many modules and features may not work. Please use at your own risk.
Flashing the boot.img will not wipe userdata
How to Flash
Make sure the phone is switched off then hold VOL UP and insert USB cable via your computer [BLUE LED]
Then issue the comand for patched kernel;
fastboot flash boot magisk_patched.img
To flash the original;
Fastboot flash boot boot.img
reboot phone;
fastboot reboot

Related

[KERNEL] About flashing kernel for all Roms

Hi,
Because i like to test many different Roms with kernels, i created my own script to flash properly with the recovery.
Often, the Kernels are available for a Rom in particular, in a zip file containing a boot.img with the kernels modules contained in /system/lib/modules
The problem is that to start, Android does not need that kernel, but also the image of a micro file system (zImage) containing startup instructions, but also a list of parameters to pass to the kernel.
The boot.img is the concatenation of the kernel with its startup parameters, and zImage.
To properly replace a kernel, so we need to retrieve the current settings, the current zImage, and reform the boot.img with the new kernel, and of course, replace the modules.
This recovery script make these step:
- Extract the kernel from the boot.img file
- Get the boot parameters of actual kernel.
- Get the actual zImage
- Rebuild the boot.img with new kernel, old boot parameters, old zImage
- Replace the modules in /system/lib/modules
- Flash the new boot.img
Before do that.
Download the kernel from other Rom, you want to flash
Extract from the zip file, boot.img and /system/lib/modules directory
Get my kernel_flash.zip
Extract it.
Replace the system/lib/modules content with the new one.
Replace the boot.img with the new one.
Rebuild you zip file with 7zip (www.7zip.org)
This zip file containing:
META-INF
boot.img
kernel
system
version.txt
And flash it under recovery.
I tested these method with Senses Roms, with AOKP or AOSP Roms. Always in my system started succefully.
You should be able to flash this kernel on any ROM (except the boot stock that has an offset of 256 bytes incompatible with the script)
As is, this kernel_flash.zip file contains a yoda kernel 2.1, overclocked to 1.5 Ghz, you can test with your ROM.
Sorry for my english.
Thank you to Google for translation assistance
Thank you for the kernel to yoda (my kernel_flash.zip contain 3.0.16-yoda_v2.1)
Thank you to all XDA developers who allowed me to further my understanding
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/details?id=com.joeykrim.flashimagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
gav-collins1983 said:
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/details?id=com.joeykrim.flashimagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
Click to expand...
Click to collapse
For s-on:
After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.
Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
fxjumper said:
For s-on:
After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.
Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
Click to expand...
Click to collapse
would it flash the kernel if you are using 4ext recovery ?
Pacattack said:
would it flash the kernel if you are using 4ext recovery ?
Click to expand...
Click to collapse
My phone is S-OFF
4ext recovery flash the kernel.
I know 4ext dispose a S-ON mode to flash the boot.img on the first boot, but i don't know if it works in this case.
Try it

[Q] Custom Kernel for Desire 200 - How to include modules?

I have compiled a custom Kernel for my HTC Desire 200 unit from htc's source. After my kernel is compiled i get a zImage file. I then use Android Image Kitchen, to take a standard boot.img file and unpack it, replace the original zImage in it, repack and flash it via the fastboot command: "fastboot flash boot boot.img"
Fastboot then flashed the kernel, i reboot the phone and it boots and works to some extend. The changes i make is there (as an example, i can see the name change i have made in the kernel version), however WiFi is not working on the device with this custom kernel, and i believe this is because i need to somehow install the devices needed modules along with the kernel.
And heres my question. How can i create a zip file, that i can flash from Clockwork Mod recovery, that flashes the kernel, along with placing the modules where they belong? OR bundle the modules with a boot.img file that i can flash from fastboot ?
Basicly what i have i a zImage and modules, but i need to bundle it together for easy flash either via recovery (zip) or fastboot (img)
Can you assist me?
Quite surprised that this seems unsolvable yet also seems to be a thing every kernel developer has been dealing with ..

How to repack mini rom?

i repack miui rom by “make_ext4fs”,i got the system.img, then flash it with fastboot mode, The phone is not boot and is restarted to fastboot mode, so i remove the dm-verify from boot.img by magiskboot and flash boot.img. Now the phone can boot, but wifi does not work. Please tell me which step is wrong. los15.1 works fine by this way. thanks!

how to flash a custom kernel?

I'm a noob.i wanna try out a custom kernel but i got no idea what steps to follow
Backup Boot-Partition with TWRP
Install another Kernel, whipe cache and dalvic
Boot Device
Restore Boot-Partition and the new Kernel is gone / whipe cache and dalvic
Boot Device
https://www.youtube.com/watch?v=rKHswG2Nytw
Ashiq.makkar said:
I'm a noob.i wanna try out a custom kernel but i got no idea what steps to follow
Click to expand...
Click to collapse
1. make sure the kernel of your choice SUPPORTS your DEVICE, flashing wrong kernel means BYE BYE POCO
2. using custom Recovery like twrp/blackpitch/orangeFox etc just flash the Kernel.zip file! and wipe cache/delvik
3. flash Magisk19.3 if you wana root your device!
however we don't flash kernels via fastboot but for your knowledge if you extract the kernel.zip and take the img file from inside and place it in
C:\Program Files (x86)\Minimal ADB and Fastboot
open adb command window and flash kernel with this command
Code:
fastboot flash boot kernel.img
will flash the kernel in /boot section
later you can install mangisk manager and PATCH the boot.img
see METHOD 2 https://www.thecustom droid.com/install-magisk-root-android-devices/
however 99% fellows here uses twrp! its easy and popular!
YasuHamed said:
1. make sure the kernel of your choice SUPPORTS your DEVICE, flashing wrong kernel means BYE BYE POCO
2. using custom Recovery like twrp/blackpitch/orangeFox etc just flash the Kernel.zip file! and wipe cache/delvik
3. flash Magisk19.3 if you wana root your device!
however we don't flash kernels via fastboot but for your knowledge if you extract the kernel.zip and take the img file from inside and place it in
C:\Program Files (x86)\Minimal ADB and Fastboot
open adb command window and flash kernel with this command
will flash the kernel in /boot section
later you can install mangisk manager and PATCH the boot.img
see METHOD 2 https://www.thecustom droid.com/install-magisk-root-android-devices/
however 99% fellows here uses twrp! its easy and popular!
Click to expand...
Click to collapse
thanks.did the twrp method and everything worked out fine

[Unofficial][Q]Twrp Recovery for Xperia 1/5 On Android 10

Hello dear people !! ^^
Since we have in a short time Android 10
We don't have recovery for it.. Sadly enough but..
I found this on a chinese forum and make a guide of it.
I don't own the Xperia 1.. Not yet but next week i have one,
So i hope all you people understand this guide because i
explained it as far i can do it.
----------------------
.. Requirements ..
Unlocked bootloader
Xperia 1 Or 5
Android 10
Knowledge howto flash
----------------------
Important !!: rename your patched boot.img what you did
with magisk to kernel.img in put it in this zip Here
1: Remember to back up all your data
2: Make a clean install of the firmware,
!! don't boot after flashing !!
3: Turn the phone into fastboot mode
and connect and type this command in cmd window:
fastboot flash boot twrp-xperia1.img
Here the fastboot twrp file
4: fastboot this command of vbmeta:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Here the vbmeta file
5: Press and hold the volume down and power at the same time,
release the powerbutton but keep
pressing volume down button till you enter twrp.
6: Copy the 3 zips:
The boot.zip where your own kernel.img is inside
what you did at the beginnig of these steps
twrp-Xperia1-3.3.x.zip: Here
Magisk-v20.1.zip: Here
to the phone storage, and flash in twrp
7: Start it up and done
Note: If you encountered
damaged internal storage, format internal memory in twrp
and all went just fine.
... Credits ...
M-Rom
​
Res
This doesn't lead to success with an Xperia 5. Once you try to boot into TWRP at step 5, you got a note that the device is corrupt and will shut down in 5 seconds.
Thanks ASap people try this I will install and try it! Know bug? Is this still in very testing version? For the moment I don't want to touch my device.
The clean install is necessary? Any incompatibilities with some magisk modules? Im currently using: smali patcher, taichi, youtube vanced
Why isn't there a Thread in the Xperia 5 Forums? Just found this out of Luck...
Instructions are also bit confusing... Where is the vbmeta.img from? Google? And why do i need a boot.img if we have already a TWRP boot.img? Will the one boot.img not replace the other?
Flashing a new Firmware makes also no sense if you just do "fastboot -w" to erase all Userdata. (If coming from a clean Firmware like i do, or You do right after unlocking Your Device)
Edit: So in a nutshell
-We do boot up the twrp boot.img to be able to flash Zips!?
-We do flash vbmeta to unsecure our booting!?
-We do flash our own boot.img with the Zip that the Device can work right!?
-We do flash the TWRP Zip which edits our Ramdisks to add TWRP
-We do flash Magisk (Optional!?) for only Root? Or also needed Kernel changes!?
Would be nice to also make links to XperiFirm and UnSin to get the boot images...
You could also edit the boot.zip script for "magisk_patched.img" so users don't have to rename it
Just want to support that btw. Thanks for Your work anyways!
---------- Post added at 15:47 ---------- Previous post was at 15:07 ----------
Xperia 5 booted well into TWRP but it freezes everytime i start a flash or wipe. Got the storage to work with fastboot -w after flashing the twrp and vbmeta images. Adb Sideload does also not work. Looking forward to a working version!
TWRP unable to flash zips
Well, the title says it all. I can flash the twrp image, but it freezes when flashing zips or starting sideload. I'm using a J9110. I understand you're not supporting here, but just in case you had some tips. Oh and by the way, hoi vanuit Leiden
EDIT: Found the fix: don't change the language to english before opening twrp, and it will flash just fine!
xperia 5 fix plz
I've installed this, it work but boot in chinese and cant load the usb mtp driver on my pc, I cant move the boot.zip to flash, had it put on sd card, cant find the sd card on this crappy twrp, for me is a no. I'd just stick with patched boot until something better will work.
mtp should work if you follow every instruction and boot twrp in chinese.
Having the same issue as others... it appears as though the internal storage is encrypted, but I have no lock screen enabled in the ROM. No Passwords or Fingerprint either. Tried wiping data from within TWRP froze the system. Performed a wipe from within ROM, and now the ROM shows internal data folders as though they're encrypted. Need a pinch of help here.
This method has problem if 55.1.A.3.149 is flashed. The "Start" screen freeze with no touchscreen function on reboot after the procedures completed.
Is there any update to this?
Hopefully with 3.4 will bring a more stable twrp. It includes changes for devices updated to Android 10
I hope can teach how to get your patched boot.img
It's not too much complex to make it work
download firmware from xperiFirm
unsign the boot.sin to get boot.img for your xperia 1
flash the twrp.img to your boot slot_a/b
boot into twrp
install the boot.img, twrp.zip, magisk.zip
now everything works
benben233 said:
I hope can teach how to get your patched boot.img
Click to expand...
Click to collapse
It's not too hard to get one
Get the origin boot.img from xperiFirm, twrp.zip
boot into any twrp on any device
backup your own boot paritition
install the boot.img, twrp one by one
then backup the boot partition, you get the patched-boot.img
Tenhow.XDA said:
download firmware from xperiFirm
unsign the boot.sin to get boot.img for your xperia 1
flash the twrp.img to your boot slot_a/b
boot into twrp
install the boot.img, twrp.zip, magisk.zip
now everything works
Click to expand...
Click to collapse
On latest android 10 and fw .28 it works ? @Tenhow.XDA
Any sign of Android 11 TWRP for Xperia 1?
MrMmmkay said:
Any sign of Android 11 TWRP for Xperia 1?
Click to expand...
Click to collapse
No

Categories

Resources