[DEV][THINK TANK] Two step booting process on the Z2?

Search This thread

Hans.physics

Member
Jul 27, 2012
20
0
So on this two step booting process, is that why I somehow have TWO recoveries installed at the same time? I installed DoomKernel as part of my original rooting process. I then installed Monx Rom, which installed TWRP. Using Rom Manager, I tried to put CWM back. Now, whenever I reboot to recovery, CWM will come up, but when I reboot system from CWM, it boots to TWRP. From there, when I reboot system, it then boots up to system. Some weird side effects to this too. I lose some installed apps when I finally get back to Android. RSA Secure ID and Go Launcger Ex seem to be the two that are constantly being "forgotten" when I go through this cycle. Also, I did a "Erase SD" from the settings menu. All was good, Ext SD was functioning fine, nice and clean. Then, Reboot recovery and go through the who double recovery cycle and WHAM! My ext sd has ALL the data I erased back on it.

So, is this double boot process you speak of responsible for this behavior?

Thanks,

-Hans
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
So on this two step booting process, is that why I somehow have TWO recoveries installed at the same time? I installed DoomKernel as part of my original rooting process. I then installed Monx Rom, which installed TWRP. Using Rom Manager, I tried to put CWM back. Now, whenever I reboot to recovery, CWM will come up, but when I reboot system from CWM, it boots to TWRP. From there, when I reboot system, it then boots up to system. Some weird side effects to this too. I lose some installed apps when I finally get back to Android. RSA Secure ID and Go Launcger Ex seem to be the two that are constantly being "forgotten" when I go through this cycle. Also, I did a "Erase SD" from the settings menu. All was good, Ext SD was functioning fine, nice and clean. Then, Reboot recovery and go through the who double recovery cycle and WHAM! My ext sd has ALL the data I erased back on it.

So, is this double boot process you speak of responsible for this behavior?

Thanks,

-Hans

No

Sent from my D6503 using XDA Free mobile app
 

defsix

Senior Member
Aug 18, 2011
481
85
Sony Xperia 1 III
So on this two step booting process, is that why I somehow have TWO recoveries installed at the same time? I installed DoomKernel as part of my original rooting process. I then installed Monx Rom, which installed TWRP. Using Rom Manager, I tried to put CWM back. Now, whenever I reboot to recovery, CWM will come up, but when I reboot system from CWM, it boots to TWRP. From there, when I reboot system, it then boots up to system. Some weird side effects to this too. I lose some installed apps when I finally get back to Android. RSA Secure ID and Go Launcger Ex seem to be the two that are constantly being "forgotten" when I go through this cycle. Also, I did a "Erase SD" from the settings menu. All was good, Ext SD was functioning fine, nice and clean. Then, Reboot recovery and go through the who double recovery cycle and WHAM! My ext sd has ALL the data I erased back on it.

So, is this double boot process you speak of responsible for this behavior?

Thanks,

-Hans

No

Sent from my D6503 using XDA Free mobile app

LOL !

As for the dual recovery problem, i'd a similar problem on a Sony Tablet S , one boot cycle i had root and X number of apps, on the second boot i had no root and Y number of apps.
Factory reset , full re-flash, factory reset and finally root was the only way I got it back to normal.
 

vishal_android freak

Inactive Recognized Developer / Contributor
Dec 30, 2012
1,898
5,638
Mumbai
So on this two step booting process, is that why I somehow have TWO recoveries installed at the same time? I installed DoomKernel as part of my original rooting process. I then installed Monx Rom, which installed TWRP. Using Rom Manager, I tried to put CWM back. Now, whenever I reboot to recovery, CWM will come up, but when I reboot system from CWM, it boots to TWRP. From there, when I reboot system, it then boots up to system. Some weird side effects to this too. I lose some installed apps when I finally get back to Android. RSA Secure ID and Go Launcger Ex seem to be the two that are constantly being "forgotten" when I go through this cycle. Also, I did a "Erase SD" from the settings menu. All was good, Ext SD was functioning fine, nice and clean. Then, Reboot recovery and go through the who double recovery cycle and WHAM! My ext sd has ALL the data I erased back on it.

So, is this double boot process you speak of responsible for this behavior?

Thanks,

-Hans

Afaik, rom manager will install a recovery. tar format of recovery which works on chargemon hacking. Bcz we don't have a separate partition for recovery here. So that's why cwm exist in your system and twrp in your kernel :p

Sent from my Nexus 5 using Tapatalk
 

waynekirby

Senior Member
Nov 11, 2010
1,047
530
33
Barnsley
Afaik, rom manager will install a recovery. tar format of recovery which works on chargemon hacking. Bcz we don't have a separate partition for recovery here. So that's why cwm exist in your system and twrp in your kernel :p

Sent from my Nexus 5 using Tapatalk

But we have FOTA kernel partition do we not? Wouldn't we be able to utilise that for dualbooting?

Sent from my D6503 using Tapatalk
 

Juan_Largearm

Senior Member
Sep 25, 2011
61
20
But we have FOTA kernel partition do we not? Wouldn't we be able to utilise that for dualbooting?

Sent from my D6503 using Tapatalk

I was just thinking about this while looking at the ROMs on offer at the moment. The googymax kernel I had on my S3 was great as it allowed me to use a stock ROM I could quickly boot in to and record in amazing quality instead of the custom ROM as that used the CM camera which couldn't use the same drivers as the official camera. The kernel also messed with my partitions and uninstalling it led me to have two recoveries, a CWM and a TWRP.

I'd love to see multiboot so I still have the bonus of a custom ROM but still have the option to boot to stock if I want better camera stuff.
 

HenryAdda

Senior Member
Jul 25, 2014
58
5
Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?

i noticed this when i saw that it was taking longer in boot process and it was not showing my custom bootlogo... so i investigated and this is waht i found in the dmesg:
Code:
root@D6503:/ # dmesg | grep logo
dmesg | grep logo
<6>[    3.378925] Skip drawing logo. Already drawn in boot.
<3>[    9.679902] init: cannot open '/initlogo.rle'

if i compare it against the Z1:
Code:
root@C6902:/ # dmesg | grep logo
dmesg | grep logo
<6>[    4.366685] Drawing logo.
<3>[   10.875083] init: cannot open '/initlogo.rle'
root@C6902:/ #

i have hacked the code to show my custom bootlogo so i am happy but it might be interesting to see what we can do if we can access that "base kernel"... may be we can explore proper multi-boot solutions?


what do you guys think?




P.S.: this is ment ONLY for DEVELOPERS to discuss... noobs/thank-you posts ARE NOT WELCOME!

only post if you have something useful to contribute...



regards,

DooMLoRD

Do you know how can I disable that sony boot logo?
 
  • Like
Reactions: shahidaffan

svshift

Member
May 21, 2012
7
2
Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?

Did you manage to solve this? Any hints?
 

svshift

Member
May 21, 2012
7
2
Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?
DooMLoRD

@DooMLoRD I was able to locate the boot logo in my Z3C, i think in Z2 it is similar.

It is stored inside the aboot image, as a LZ4-compressed data. , which is decompressed shortly after display is initialized.

I used IDA-pro to dissassemble the aboot image as it is said in http://newandroidbook.com/Articles/aboot.html (strip the header, and provide correct "loading offset" from ImgBase from the header)
then i found "Decompressing logo failed" string in it, and a place where it is printed (dprintf)
right before it there is a call to function, which looks like LZ4_decompose_safe() and a little before it there are its arguments -- pointer to compressed data and size
(in my case: 7545 bytes at 0x0004a67c in the aboot image file)

some sorces of LK-loader and grub4android sources helped me a lot.

so, i see a way to replace it as:
1. compress the logo by LZ4
2. if it smaller than 7545 bytes, you can replace the original one, and fix the size constant (dword at 12 bytes before it)
3. or append the custom logo at the end of the image and fix the aboot headers, and data adresses inside the code.

I DID NOT test it yet, but I'll post the results as soon as get to this.
 
Last edited:

svshift

Member
May 21, 2012
7
2
well, look like sony does not like tempering with aboot at all. It is impossible to reflash it via fastboot command,
and once i did it on the device with dd command, it simply bricked. completely. not even the fastboot. and i am sure, that i did not break any code section. I modified only the necessary constants and image data, i double checked.
now i'll have to wait to get to the closest JTAG debugger-reflasher, to see what's wrong there ж)
 

Gustavo RD78

Senior Member
May 19, 2011
1,723
2,400
Maringá - PR
@DooMLoRD I was able to locate the boot logo in my Z3C, i think in Z2 it is similar.

It is stored inside the aboot image, as a LZ4-compressed data. , which is decompressed shortly after display is initialized.

I used IDA-pro to dissassemble the aboot image as it is said in http://newandroidbook.com/Articles/aboot.html (strip the header, and provide correct "loading offset" from ImgBase from the header)
then i found "Decompressing logo failed" string in it, and a place where it is printed (dprintf)
right before it there is a call to function, which looks like LZ4_decompose_safe() and a little before it there are its arguments -- pointer to compressed data and size
(in my case: 7545 bytes at 0x0004a67c in the aboot image file)

some sorces of LK-loader and grub4android sources helped me a lot.

so, i see a way to replace it as:
1. compress the logo by LZ4
2. if it smaller than 7545 bytes, you can replace the original one, and fix the size constant (dword at 12 bytes before it)
3. or append the custom logo at the end of the image and fix the aboot headers, and data adresses inside the code.

I DID NOT test it yet, but I'll post the results as soon as get to this.

well, look like sony does not like tempering with aboot at all. It is impossible to reflash it via fastboot command,
and once i did it on the device with dd command, it simply bricked. completely. not even the fastboot. and i am sure, that i did not break any code section. I modified only the necessary constants and image data, i double checked.
now i'll have to wait to get to the closest JTAG debugger-reflasher, to see what's wrong there ж)

I'm sorry for brick your device
any news about these tests?
I have also analyzed these files, aboot is directly connected to bootloader
android N preview uses white bootlogo with Sony written in black, which has new bootloader
 

svshift

Member
May 21, 2012
7
2
well, kernel can be unlocked, but aboot is signed. somewhere around here there was a thread about signature keys for old xperia Zs. cant find it now.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?

    i noticed this when i saw that it was taking longer in boot process and it was not showing my custom bootlogo... so i investigated and this is waht i found in the dmesg:
    Code:
    root@D6503:/ # dmesg | grep logo
    dmesg | grep logo
    <6>[    3.378925] Skip drawing logo. Already drawn in boot.
    <3>[    9.679902] init: cannot open '/initlogo.rle'

    if i compare it against the Z1:
    Code:
    root@C6902:/ # dmesg | grep logo
    dmesg | grep logo
    <6>[    4.366685] Drawing logo.
    <3>[   10.875083] init: cannot open '/initlogo.rle'
    root@C6902:/ #

    i have hacked the code to show my custom bootlogo so i am happy but it might be interesting to see what we can do if we can access that "base kernel"... may be we can explore proper multi-boot solutions?


    what do you guys think?




    P.S.: this is ment ONLY for DEVELOPERS to discuss... noobs/thank-you posts ARE NOT WELCOME!

    only post if you have something useful to contribute...



    regards,

    DooMLoRD
    2
    Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?
    DooMLoRD

    @DooMLoRD I was able to locate the boot logo in my Z3C, i think in Z2 it is similar.

    It is stored inside the aboot image, as a LZ4-compressed data. , which is decompressed shortly after display is initialized.

    I used IDA-pro to dissassemble the aboot image as it is said in http://newandroidbook.com/Articles/aboot.html (strip the header, and provide correct "loading offset" from ImgBase from the header)
    then i found "Decompressing logo failed" string in it, and a place where it is printed (dprintf)
    right before it there is a call to function, which looks like LZ4_decompose_safe() and a little before it there are its arguments -- pointer to compressed data and size
    (in my case: 7545 bytes at 0x0004a67c in the aboot image file)

    some sorces of LK-loader and grub4android sources helped me a lot.

    so, i see a way to replace it as:
    1. compress the logo by LZ4
    2. if it smaller than 7545 bytes, you can replace the original one, and fix the size constant (dword at 12 bytes before it)
    3. or append the custom logo at the end of the image and fix the aboot headers, and data adresses inside the code.

    I DID NOT test it yet, but I'll post the results as soon as get to this.
    1
    Can fotakernel has some part of it? If we unpack it we can see general kernel. Also we can flash recovery to fota and it will work (tested on Z1).
    1
    From experience with an old LG device the actual bootloader showed its own logo, then the boot image showed its own logo, then finally the Android boot animation would start.

    On a stock ROM you couldn't tell this as LG used the same image in the bootloader and the boot image. However in the upgrade from Android 2.2 to 2.3 they changed the image, so when flashing CM after upgrading the bootloader you would see two different LG logos.
    1
    Hey guys I dont know how many of you have noticed this but the Xperia Z2 has a "two step" booting process... first an initial kernel is booted, the one which shows the "Sony" logo.. and after that the custom kernel get booting... it might be using some sort of Kexec may be?

    i noticed this when i saw that it was taking longer in boot process and it was not showing my custom bootlogo... so i investigated and this is waht i found in the dmesg:
    Code:
    root@D6503:/ # dmesg | grep logo
    dmesg | grep logo
    <6>[    3.378925] Skip drawing logo. Already drawn in boot.
    <3>[    9.679902] init: cannot open '/initlogo.rle'

    if i compare it against the Z1:
    Code:
    root@C6902:/ # dmesg | grep logo
    dmesg | grep logo
    <6>[    4.366685] Drawing logo.
    <3>[   10.875083] init: cannot open '/initlogo.rle'
    root@C6902:/ #

    i have hacked the code to show my custom bootlogo so i am happy but it might be interesting to see what we can do if we can access that "base kernel"... may be we can explore proper multi-boot solutions?


    what do you guys think?




    P.S.: this is ment ONLY for DEVELOPERS to discuss... noobs/thank-you posts ARE NOT WELCOME!

    only post if you have something useful to contribute...



    regards,

    DooMLoRD

    Do you know how can I disable that sony boot logo?