As I've heard some people have problems with working with XIP sections of some ROMs... as for example Asus P525 or other devices, here's a little tiny tutorial about this issue. What's the problem with them? It's their XIP sections are compressed with SRPX algorithm.
In some Asus kitchens in the ROM directory you have a ROM.TPL file. How to use it?
1. Get the OSNBTool from the attachement (it's a fantastic tool from Weisun of PDAclan.com).
2. Do:
Code:
>osnbtool -d rom.tpl 1 xip.bin
OS ROM Partition Tool V1.48 By Weisun :> PDAclan.com
Sector size : 0x00000200
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
**************************************
Signature: SRPX
CompressVersion: 5
Uncompressed size: 2E0000
Deompress processing...
Successfully decompressed to xip.bin
3. Run XIPPort and click "dump xip.bin".
4. Do your work with a XIP section.
5. After you're finished, issue "realloc P" and "build xip_out.bin" in XIPPort.
6. Do:
Code:
>osnbtool -c rom.tpl 1 xip_out.bin
OS ROM Partition Tool V1.48 By Weisun :> PDAclan.com
Sector size : 0x00000200
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
**************************************
Source OS image:
Signature: SRPX
CompressVersion: 5
Uncompressed size: 2E0000
Source Part-1 Size: 1AC400
--------------------------------------
Compress processing...
NEW Uncompressed size: 2D5000
NEW Compressed size: 1A6BF6
New Part Size: 1A71E6
Successfully compressed xip_out.bin into rom.tpl.NEW
7. You're done!
It turns out that a dumprom.exe and buildxip.exe tools handle those XIPs really well, too - and even better, as they do better reallocation of modules.
So, it can go as this:
Code:
>dumprom rom.tpl
IMGFS guidBootSignature: F8 AC 2C 9D E3 D4 2B 4D BD 30 91 6E D8 4F 31 DC
dwFSVersion: 00000001
dwSectorsPerHeaderBlock: 00000001
dwRunsPerFileHeader: 00000001
dwBytesPerHeader: 00000034
dwChunksPerSector: 00000008
dwFirstHeaderBlockOffset: 00000200
dwDataBlockSize: 00001000
szCompressionType: LZX
dwFreeSectorCount: 0000001E
dwHiddenSectorCount: 00000100
dwUpdateModeFlag: 00000000
Address: 00000200, dwBlockSignature: 2F5314CE
dwNextHeaderBlock: 00000000 (size: FFFFFE00)
Header type: FFFFFFFF, Addr: 00000208
Empty header
Header type: FFFFFFFF, Addr: 0000023C
Empty header
Header type: FFFFFFFF, Addr: 00000270
Empty header
Header type: FFFFFFFF, Addr: 000002A4
Empty header
Header type: FFFFFFFF, Addr: 000002D8
Empty header
Header type: FFFFFFFF, Addr: 0000030C
Empty header
Header type: FFFFFFFF, Addr: 00000340
Empty header
Header type: FFFFFFFF, Addr: 00000374
Empty header
Header type: FFFFFFFF, Addr: 000003A8
Empty header
Now you have new files: boot.bin, msflsh.bin and romhdr.bin, and a new folder XIP. Edit your XIP folder as you want.
Now, in ..\temp\dump folder put your .VM and .ROM folders and issue:
Code:
>buildxip
BUILDXIP 0.54 Copyright (c) 2007-2008 bepe 30 Jan 2008
Slot 0 Boundary: 0x01fa0000
Slot 1 Boundary: 0x03e18000
RAMStart: 0x88868000
RAMFree: 0x888c6000 - 0x8c000000 L0373a000
KernelFlags: 0x00000000
FSRamPercent: 0x00000004
Done!
In the end put your new created out.bin file into your tpl file:
Code:
>osnbtool -c rom.tpl 1 out.bin
OS ROM Partition Tool V1.48 By Weisun :> PDAclan.com
Sector size : 0x00000200
Extra data bytes : 0x00000000
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
**************************************
Source OS image:
Signature: SRPX
CompressVersion: 5
Uncompressed size: 2E0000
Source Part-1 Size: 1AC400
--------------------------------------
Compress processing...
New part size larger than old part in source OS image!
Rebuilding partition structure...
NEW Uncompressed size: 2E7000
NEW Compressed size: 1B1664
New Part Size: 1B1C78
Successfully compressed out.bin into rom.tpl.NEW
and you're done!
Hello utak3r.
This info is really important for me as I have an Eten device. Although, I've tried several times to build a XIP using "buildxip" (with or without -b flag - I don't know exactly what it does) but my rom doesn't boot.
I didn't even tried to change anything in XIP folder. Only dumped the XIP using "dumprom" and then build again to test it. Was I supposed to do something in the middle? Any idea?
bgcngm said:
with or without -b flag - I don't know exactly what it does
Click to expand...
Click to collapse
This flag tells if it should take another, external boot.rgu file, or the included one. So, you should do it without this flag.
bgcngm said:
but my rom doesn't boot.
Click to expand...
Click to collapse
The problem may be not in the building it, but in inserting it back. Some devices don't like changing the partition's size, for instance...
Check, what was the original xip.bin size and try to fill your new one with 0xFFs to this size - maybe it will help...
Another thing: give here full outputs from all the steps.
utak3r said:
The problem may be not in the building it, but in inserting it back. Some devices don't like changing the partition's size, for instance...
Click to expand...
Click to collapse
I already thought that the problem was XIP insertion, but then I found XIPKitchen.
With a XIP created by XIPKitchen, I can successfully create a bootable rom, even with a different XIP partition size. I'm happy because those XIP's are working, however XIPKitchen doesn't integrates nicely in a rom kitchen. The user has to manually input the files and select some options in the program and I wanted to build the new XIP silently which is what buildxip does.
Do you know what could be the problem? I might be missing something... like rellocating the modules... But as I said before, I tried to build the XIP without touching it, simply by dumping and then rebuilding it. In that case there was no need to rellocate the modules, right?
utak3r, don't you know what could be the problem?
Hi bro
In some Asus kitchens in the ROM directory you have a ROM.TPL file
Click to expand...
Click to collapse
use tool NB0 KITCHEN mrtoto which extracting&inserting partition xip in file out.bin in to NewROM.tpl
extracting out.bin use XipKitchen or buildrom bepe,ren xip_out_new.bin to out.bin ,move to directory Rom.tpl end push button "Build Template" in NB0 KITCHEN mrtoto
THANKS A LOT !!
Awesome tool, had troubles extracting one of the xip files since a LONG time, this just did the trick and it's nifty features like putting romhdr, o32, e32 headers nicely were also helpful.
Introduction:
The SPro uses DA80 images along with the DA80 Download tool to factory fix/flash SPros.
It's the analog of using QDLtool for the S5/V and the equvilent of NVflash payloads for the S7/S10.
Unlike qdltool or nvflash payloads, DA80 images are not their consitutant files.
In file archiving teminology it's a solid archive with no compression.
File layout:
Code:
DA80 image layout
0x0 - 0x39 empty space
0x40 - 0x7f header
0x80 - 0xbf entry1
0x192 - 0xff entry2
...
0x40+64n - 0x7f+64n entryn
...
0x7f+64n+1 - <file 1 offset>-1 file1
<file 1 offset> - <file 2 offset>-1 file2
...
<file n offset> - <file n offset>-1 filen
entry layout
0x0 - 0x31 filename
0x32 - 0x63 size of file (offset) [in bytes (little-endian)]
(My math in the explanation might be wrong, but it's explaination below is definitely correct)
Explaniation:
20 bytes of empty space at beginning of file
header
Filename equvilent: DA80_android
Filesize equvilent: 0x13 bytes
file entries
File name
Size of file (ie it's offset), in bytes, in little-endian
Actual files
There's no padding at all, each file immediately ends and the next one begins.
There's no absolute addresses for any of the files, it's merely
file1+offset = file2
file2+offset = file3
until the end.
Conclusion:
Overall it's a simple file format with no error checking, encryption, or obfuscation.
As a note: the ext4 files inside DA80 images are actual ext4 sparse files.
They must be run though a tool such as sgs2toext4.jar to be read by some ext4 file readers (such as ext2explore)
Hello.
I'm trying adding several drivers into my SM-N9005 firmware. My phone runs Omega ROM v21, whose kernel doesn't support kernel module drivers, so I decided to recompile Omega's kernel from sources with needed options. The sources were taken from here:
https://github.com/omega-roms/N9005_Omega_Kernel_KK_4.4.2
The compilation was easy, the drivers were compiled too, I have my zImage now.
I downloaded Omega's flashable kernel-only zip N9005_Omega_Kernel_KK_v1.1_XXUFNF4_ramdisk.zip from Omega's repo, unpacked boot.img from the zip and tried disassembling it with split_boot script from bootimg_tools found here:
http://forum.xda-developers.com/showthread.php?t=2319018
I got the following output:
Page size: 2048 (0x00000800)
Kernel size: 8259720 (0x007e0888)
Ramdisk size: 1581598 (0x0018221e)
Second size: 0 (0x00000000)
Board name:
Command line: 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3'
Base address: (0x01dfff00)
Writing boot/boot.img-kernel ... complete.
Writing boot/boot.img-ramdisk.cpio.gz ... complete.
Unpacking ramdisk... complete.
So I got original Omega's kernel boot.img-kernel and ramdisk boot.img-ramdisk.cpio.gz. Next I decided to reassemble it and flush back, coz' if it works - my kernel might work too.
I took mkbootimg tool from the same package and created new boot.img with it, using parameters I got previously from split_boot script:
./mkbootimg --kernel boot/boot.img-kernel --ramdisk boot/boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x01dfff00 --pagesize 2048 -o boot.img
So I got new boot.img with size 9846784 bytes, whereas original Omega's boot is 11149312 bytes.
I packed my boot.img into original Omega's kernel zip N9005_Omega_Kernel_KK_v1.1_XXUFNF4_ramdisk.zip, replacing existing original boot.img inside, renamed the zip and flushed with recovery.
Now my phone falls into download mode, saying 'Could not do normal boot'. Flashing back original Omega's kernel restores the phone to normal state, so the problem is with reassembling boot.img
What am I missing? Please, help.
The answer was easy: Android Image Kitchen v1.6 for Linux from http://forum.xda-developers.com/showthread.php?t=2073775
My kernel is rebuilt and my device is now working ok! Thanks to the authors.
jeweller_by said:
The answer was easy: Android Image Kitchen v1.6 for Linux from http://forum.xda-developers.com/showthread.php?t=2073775
My kernel is rebuilt and my device is now working ok! Thanks to the authors.
Click to expand...
Click to collapse
Thanks!
Greetings to all.
I have a Samsung SM-G531M Galaxy Grand Prime. Android 5.1
By mistake delete a system binary (linker) and now the phone does not start. And every time I try to start it in recovery (loop) mode but I have the FRP lock. Only the downlad mode works for me.
Can you copy the binary linker by odin? Ie edit the stock rom and put only the linker (delete all, just leave / system / bin / linker).
If so, I have tried modifying the stock rom, but I can not extract a file from boot.img (file_contexts from the boot.img \ ramdisk) that it is essential to package the new modified system(using program Auto Tool v3.0 x64).
-My system is windows 7.
-CarlivImageKitchen_x64
Your image: boot.img
Create the boot folder.
*Printing information for "boot.img"
*Unpack image utility by carliv @ xda
*Header:
**Magic: ANDROID!
**Magic offset: 0
**Page size: 50331648 (0x03000000)
**Base address: 0x10000000
**Kernel address: 0x10008000
**Kernel size: 6294484 (0x00600bd4)
**Kernel offset: 0x00008000
*>> kernel written to 'boot / boot.img-kernel' (6294484 bytes)
**Ramdisk address: 0x11000000
**Ramdisk size: 1532010 (0x0017606a)
**Ramdisk offset: 0x01000000
*>> ramdisk written to 'boot / boot.img-ramdisk.unknown' (1532010 bytes)
**Second address: 0x10f00000
**Tags address: 0x0001f800
**Tags offset: 0xf001f800
**Dt size: 268435712 (0x10000100)
*>> device_tree written to 'boot / boot.img-dt' (268435712 bytes)
Compression used: unknown
Unpacking the ramdisk ....
The system can not find the specified batch label: unknown
And the ramdisk folder appears empty.
Thanks in advance.
The X cores GUIDE
About
I have created many bootloop-fix boot images in the past and as the way to do it on your own is (in general) very easy I wanted to write it down so everyone can do it by himself.
The reason? The ILAPO (hardware related bootloop) happens due to overheating and so throttling the device may help in extends the life of your device and can even resurrect your phone when in a bootloop.
Again using a reduced amount of cores will be a temporary fix only as the ILAPO is a hardware issue! Read the bootloop-fixit-list for details.
Maybe you do not need to create one - checkout the current available 4-core boot images here: temporary-bootloop-fix-thread
This requires an unlocked device to flash and use!
Howto
Creating a custom boot image is very easy and done in 5 sec.
you need the tool: abootimg - so Linux or FWUL (included since v3.0)
Code:
abootimg -i boot.img
note and copy the whole cmdline output. Example (in red and bold):
Code:
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B][COLOR="Red"]cmdline = console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR][/B]
* id = 0xf19c37df 0x9734fb7a 0x3c6b45f4 0x3a8d0267 0x32786841 0x00000000 0x00000000 0x00000000
Ok now you need to modify - NOT UNPACK the boot image!! thats 1) not necessary and 2) it will make your boot image unbootable (when using abootimg).
Now modify for your wanted amount of cores.
Let's assume you want to use in Android 4 cores as max and on boot 4 cores max as well:
Code:
abootimg -u boot.img -c "cmdline = [B]maxcpus=4 boot_cpus=0-3[/B] [COLOR="Red"]console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR]"
Noted the bold part: maxcpus=4 boot_cpus=0-3 ? That is the magic which sets the wanted cores.
Noted the red part: console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug ?
Thats just the regular cmdline copied from the original boot image you written done in the first step.
You may noticed that there is another boot_cpus value in that particular case set right? boot_cpus=0-5 in this case. You can remove or leave it as u like.
The reason is: the boot cmdline will be handled like: first match = wins. so when doing as explained you will set boot_cpus and maxcpus at the very beginning of the cmdline and so we will overwrite whatever comes next.
maxcpus=X (recommended value for bootloop devices: 4)
> Maximum number of processors that an SMP kernel should make use of. maxcpus=n : n >= 0 limits the kernel to using 'n' processors. n=0 is a special case, it is equivalent to "nosmp", which also disables the IO APIC. (source)
X can be from 1 to 6 and defines the maximal available amount of cores in Android. If you set it to 4 Android can use 4 only. For Android you must enable them manually which requires always root access (e.g. by an app like Kernel Adiutor)
boot_cpus=Y-Z (recommended value for bootloop devices: "0-3" or if that still bootloops "0-1")
> Rather than attempting to online all possible CPUs at boot time, only online the specified set of CPUs. (source)
Y-Z can be 0-5(!) yes there is no 6! Thats the CPU core "IDs" to use on boot. 0-3 will use 4 cpus (so only the little cores which are: 0,1,2,3 - as 4 and 5 are the big ones causing the ILAPO more) on boot. Note that the setting differs to maxcpus as the numbers here starting from 0 where 0 is the first core. You can set a single core, comma separated core IDs or define ranges here. When you want to set just a single core here it may be required to set boot_cpus=1 instead of boot_cpus=0.
Verify your modified boot image:
Code:
abootimg -i boot.img
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B]cmdline = maxcpus=4 boot_cpus=0-3 console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5[/B]
buildvariant=userdebug
* id = 0x00000160 0x4bd3a2b4 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Whats next?
So now you're prepared to flash your modified X cores boot image via fastboot and see if it boots
Code:
fastboot boot boot.img
This above will *temporary* boot your modified boot image and is meant for testing it only.
To install it permanently use this command in fastboot mode:
Code:
fastboot flash boot boot.img
You can do this on every boot image or recovery image (so yes even on TWRP !)
Cheers
steadfasterX
reserved.
Any way to fix issue in locked device? Still stucked on lollipop with root.
kalanakodicara said:
Any way to fix issue in locked device? Still stucked on lollipop with root.
Click to expand...
Click to collapse
depends on your device and current ARB. I added the aboot TOT flashing method which also works on locked devices but u need to take care of the ARB (all mentioned there including links etc):
https://forum.xda-developers.com/g4/help/guide-ultimate-bootloop-fixit-list-t3667688
,
steadfasterX said:
depends on your device and current ARB. I added the aboot TOT flashing method which also works on locked devices but u need to take care of the ARB (all mentioned there including links etc):
https://forum.xda-developers.com/g4/help/guide-ultimate-bootloop-fixit-list-t3667688
,
Click to expand...
Click to collapse
Its h815 SEA and can i use tot method for v29a or 20p?
How can I extract boot.img from phone or KDZ file, so I can modify it. I tryed to make backup from twrp, but the file is boot.emmc.win...
I have H815 20g_00_0720.kdz, rooted, TWRP
steadfasterX said:
The X cores GUIDE
About
I have created many bootloop-fix boot images in the past and as the way to do it on your own is (in general) very easy I wanted to write it down so everyone can do it by himself.
The reason? The ILAPO (hardware related bootloop) happens due to overheating and so throttling the device may help in extends the life of your device and can even resurrect your phone when in a bootloop.
Again using a reduced amount of cores will be a temporary fix only as the ILAPO is a hardware issue! Read the bootloop-fixit-list for details.
Maybe you do not need to create one - checkout the current available 4-core boot images here: temporary-bootloop-fix-thread
This requires an unlocked device to flash and use!
Howto
Creating a custom boot image is very easy and done in 5 sec.
you need the tool: abootimg - so Linux or FWUL
Code:
abootimg -i boot.img
note and copy the whole cmdline output. Example (in red and bold):
Code:
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B][COLOR="Red"]cmdline = console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR][/B]
* id = 0xf19c37df 0x9734fb7a 0x3c6b45f4 0x3a8d0267 0x32786841 0x00000000 0x00000000 0x00000000
Ok now you need to modify - NOT UNPACK the boot image!! thats 1) not necessary and 2) it will make your boot image unbootable (when using abootimg).
Now modify for your wanted amount of cores.
Let's assume you want to use in Android 4 cores as max and on boot 4 cores max as well:
Code:
abootimg -u boot.img -c "cmdline = [B]maxcpus=4 boot_cpus=0-3[/B] [COLOR="Red"]console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR]"
Noted the bold part: maxcpus=4 boot_cpus=0-3 ? That is the magic which sets the wanted cores.
Noted the red part: console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug ?
Thats just the regular cmdline copied from the original boot image you written done in the first step.
You may noticed that there is another boot_cpus value in that particular case set right? boot_cpus=0-5 in this case. You can remove or leave it as u like.
The reason is: the boot cmdline will be handled like: first match = wins. so when doing as explained you will set boot_cpus and maxcpus at the very beginning of the cmdline and so we will overwrite whatever comes next.
maxcpus=X (recommended value for bootloop devices: 4)
X can be 1-6 and this defines the maximal amount of cores in Android. If you set it to 4 Android can use 4 only.
boot_cpus=Y-Z (recommended value for bootloop devices: "0-3" or if that still bootloops "0-1")
Y-Z can be 0-5(!) yes no 6! Thats the CPU core number to use on boot. 0-3 will use 4 cpus (so only the little ones) on boot. The difference to maxcpus is that the cpu number starting from 0 where 0 is the first core.
Verify your modified boot image:
Code:
abootimg -i boot.img
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B]cmdline = maxcpus=4 boot_cpus=0-3 console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5[/B]
buildvariant=userdebug
* id = 0x00000160 0x4bd3a2b4 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Whats next?
So now you're prepared to flash your modified X cores boot image via fastboot and see if it boots
You can do this on every boot image or recovery image (so yes even on TWRP !)
Cheers
steadfasterX
Click to expand...
Click to collapse
Snapdaragon 808 only!
All you have to do is flashing in twrp
Off the kernel's big core
https://drive.google.com/file/d/1ij-qm5qWezoRykwjoTlg0BcQ-do21QIp/view?usp=drivesdk
DomagojX said:
How can I extract boot.img from phone or KDZ file, so I can modify it. I tryed to make backup from twrp, but the file is boot.emmc.win...
I have H815 20g_00_0720.kdz, rooted, TWRP
Click to expand...
Click to collapse
Use SALT to take a basic backup. You will find the boot image there too.
Use SALT as well to extract a kdz.
lq092009 said:
Snapdaragon 808 only!
All you have to do is flashing in twrp
Off the kernel's big core
https://drive.google.com/file/d/1ij-qm5qWezoRykwjoTlg0BcQ-do21QIp/view?usp=drivesdk
Click to expand...
Click to collapse
Awesome. I have everything prepared to modify boot images on the fly but no time yet to finish it.
Before I started with implementing this I tried unpacking and packaging like you do here (mkbootimg etc) and failed:
Unless you use special versions of unpack image your method will not work for the g4 and results in a soft brick as we need to unpack and pack including the dt.img. Otherwise the kernel will not boot. I tried that already and that was an issue with TWRP long time ago, too.
But thanks anyways and let me know if you can do the same but including the dt
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Use SALT to take a basic backup. You will find the boot image there too.
Use SALT as well to extract a kdz.
Awesome. I have everything prepared to modify boot images on the fly but no time yet to finish it.
Before I started with implementing this I tried unpacking and packaging like you do here (mkbootimg etc) and failed:
Unless you use special versions of unpack image your method will not work for the g4 and results in a soft brick as we need to unpack and pack including the dt.img. Otherwise the kernel will not boot. I tried that already and that was an issue with TWRP long time ago, too.
But thanks anyways and let me know if you can do the same but including the dt
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
It must be flashing before modifying the kernel with a magisk or supersu
lq092009 said:
It must be flashing before modifying the kernel with a magisk or supersu
Click to expand...
Click to collapse
Sure. That's not the problem. I referring to the dt.img which does not get extracted from the boot image the way you do it. Without this the device will not boot as the bootloader aboot needs it!
This has nothing to do with magisk or supersu.
Sent from my LG-H815 using XDA Labs
I've been using this on a phone that was overheating a couple times a day. It's been two days without a reboot/loop. Thanks!
You've given new life for a phone that was sitting in a drawer. This, combined with the bootloader unlock, and the roms are fantastic!
DoughMucker said:
I've been using this on a phone that was overheating a couple times a day. It's been two days without a reboot/loop. Thanks!
You've given new life for a phone that was sitting in a drawer. This, combined with the bootloader unlock, and the roms are fantastic!
Click to expand...
Click to collapse
I'm glad it helps
Sent from my LG-H815 using XDA Labs
Can I do it on Nougat or Oreo based roms? Do I need to flash the rom first and then edit or do it before?
ojcu said:
Can I do it on Nougat or Oreo based roms? Do I need to flash the rom first and then edit or do it before?
Click to expand...
Click to collapse
ANY means ANY right?
You would first first flash your ROM then the modified boot image.
.
steadfasterX said:
ANY means ANY right?
.
Click to expand...
Click to collapse
I know it was one of the noobest questions I could ask but I've never done it before so just making sure. Thanks
I've had a quick look for a way to do this from within android but had no luck. I wonder if there's a kitchen tool in the play store that would work, or some android shell or busybox type add-on.
@steadfasterX Apologies for the noob request, I am not very good with linux , i followed the steps above , and when i try to flash the boot image it raises an error in fastboot remote:image is not a boot image
Kindly assist me.
steadfasterX said:
The X cores GUIDE
About
I have created many bootloop-fix boot images in the past and as the way to do it on your own is (in general) very easy I wanted to write it down so everyone can do it by himself.
The reason? The ILAPO (hardware related bootloop) happens due to overheating and so throttling the device may help in extends the life of your device and can even resurrect your phone when in a bootloop.
Again using a reduced amount of cores will be a temporary fix only as the ILAPO is a hardware issue! Read the bootloop-fixit-list for details.
Maybe you do not need to create one - checkout the current available 4-core boot images here: temporary-bootloop-fix-thread
This requires an unlocked device to flash and use!
Howto
Creating a custom boot image is very easy and done in 5 sec.
you need the tool: abootimg - so Linux or FWUL
Code:
abootimg -i boot.img
note and copy the whole cmdline output. Example (in red and bold):
Code:
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B][COLOR="Red"]cmdline = console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR][/B]
* id = 0xf19c37df 0x9734fb7a 0x3c6b45f4 0x3a8d0267 0x32786841 0x00000000 0x00000000 0x00000000
Ok now you need to modify - NOT UNPACK the boot image!! thats 1) not necessary and 2) it will make your boot image unbootable (when using abootimg).
Now modify for your wanted amount of cores.
Let's assume you want to use in Android 4 cores as max and on boot 4 cores max as well:
Code:
abootimg -u boot.img -c "cmdline = [B]maxcpus=4 boot_cpus=0-3[/B] [COLOR="Red"]console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug[/COLOR]"
Noted the bold part: maxcpus=4 boot_cpus=0-3 ? That is the magic which sets the wanted cores.
Noted the red part: console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5 buildvariant=userdebug ?
Thats just the regular cmdline copied from the original boot image you written done in the first step.
You may noticed that there is another boot_cpus value in that particular case set right? boot_cpus=0-5 in this case. You can remove or leave it as u like.
The reason is: the boot cmdline will be handled like: first match = wins. so when doing as explained you will set boot_cpus and maxcpus at the very beginning of the cmdline and so we will overwrite whatever comes next.
maxcpus=X (recommended value for bootloop devices: 4)
X can be 1-6 and this defines the maximal amount of cores in Android. If you set it to 4 Android can use 4 only.
boot_cpus=Y-Z (recommended value for bootloop devices: "0-3" or if that still bootloops "0-1")
Y-Z can be 0-5(!) yes no 6! Thats the CPU core number to use on boot. 0-3 will use 4 cpus (so only the little ones) on boot. The difference to maxcpus is that the cpu number starting from 0 where 0 is the first core.
Verify your modified boot image:
Code:
abootimg -i boot.img
Android Boot Image Info:
* file name = boot.img
* image size = 29614080 bytes (28.24 MB)
page size = 4096 bytes
* Boot Name = ""
* kernel size = 26722280 bytes (25.48 MB)
ramdisk size = 1668572 bytes (1.59 MB)
* load addresses:
kernel: 0x00008000
ramdisk: 0x01000000
tags: 0x00000100
* [B]cmdline = maxcpus=4 boot_cpus=0-3 console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x37 boot_cpus=0-5[/B]
buildvariant=userdebug
* id = 0x00000160 0x4bd3a2b4 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Whats next?
So now you're prepared to flash your modified X cores boot image via fastboot and see if it boots
You can do this on every boot image or recovery image (so yes even on TWRP !)
Cheers
steadfasterX
Click to expand...
Click to collapse
Hello @steadfasterX
I wanted to request your assistance in creating a custom boot image for my device I tried to do it from your thread a couple of times I really don't know what the issue could be.
It raises the error remote :image is not a boot image when I try to flash it in fastboot
I have attached a link to my boot.bin image file
Thanks.https://mega.nz/#!m8QRXSJJ!R90SoS48O...IJ_Uvdrsp9tYoE
I am on the latest twrp for N posted on your server
izzle47 said:
Hello @steadfasterX
I wanted to request your assistance in creating a custom boot image for my device I tried to do it from your thread a couple of times I really don't know what the issue could be.
It raises the error remote :image is not a boot image when I try to flash it in fastboot
I have attached a link to my boot.bin image file
Thanks.https://mega.nz/#!m8QRXSJJ!R90SoS48O...IJ_Uvdrsp9tYoE
I am on the latest twrp for N posted on your server
Click to expand...
Click to collapse
first of all I have a friendly advice for you never ever quote big posts like mine. Regarding your problem try FWUL to modify it. I have no time at the moment sorry but maybe someone else can help you as well if FWUL doesn't help
Sent from my LG-H815 using XDA Labs
Hi
Thanks for sharing the method. I want to boot with only 1 core and later use 4 cores. How can i write for that:
maxcpus=4 boot_cpus=0-0
OR
maxcpus=4 boot_cpus=0
Also wanted to confirm that when do the maxcpus=4 become functional, i gues that starts to happen right after the LG logo appears or it happens when the boot process has finished.
I am guessing that boot_cpus=0-0 and 0 are not working. I can guess that because of the speed the animated logo appears. WHen it set it like max_cpus=1 it only boots and works on one core.
WHat i want is to boot with one core and later automatically switch to 4 cores when the system has loaded.