Project Stable Boot for ICSROM [09 Feb 2013] - Atrix 4G Android Development

Welcome to… Project Stable Boot for ICSROM!​
It all started on 05 Feb 2013 when an xda member reported that the ICSROM boot images featured in Atrix Boot Emporium V3.0: http://forum.xda-developers.com/showthread.php?t=2124668
did not work: Dreaded Big-M followed by blank screen. No boot animation, even after several minutes, and no matter where the ROM was hosted, whether EMMC (standard) or SD (custom).
I started to wonder if “Dual Boot Atrix: Simplified and Standalone” was morphing into “Complicated and Co-dependent”.
So I duplicated the problem and documented my findings here: http://forum.xda-developers.com/showthread.php?t=2124668&page=2
Then I unpacked the ICSROM 146 boot image and tore into the /ramdisk directory. Ramdisk is that part of the Android boot image that initializes your ROM at boot time via multiple “init*.rc” (run command) scripts written in the Android “init” language.
Then, several days later, it happened:
I experienced a significant breakthrough with ICSROM on my AT&T Atrix
​I discovered mainly that:
Ramdisk references approximately twenty different components (functions and services) that do not exist
Ramdisk does not reference several other components that DO exist
Memory allocations in the ICSROM 146 kernel command string differ significantly from default
Perhaps some or all of the missing components are (or were) available via legacy Motorola OTA updates. But if Motorola is done with ICS for Atrix 4g, then I think we’re done with the OTA updates.
So I decided to yank most of the init*.rc code containing broken references.
Also, I noticed that init.olympus.rc launches some encryption-related functions at boot time, whereas MROM ICS does not. So I yanked these as well. Then I quickly repacked the boot image and voila… ICSROM came up. Then I put my phone (and myself) to sleep.
09 Feb, 0430 PST: Disconnected charger, woke the phone and observed battery at 99%. Put phone back to sleep. Fifteen minutes later, woke the phone and observed battery at 98% --- only a 1% drop. Repeated the same test multiple times and got the same results.
I began to dream of 24 hour battery life again, lol.
I also noticed something related --- my phone was running much cooler, even when not in sleep mode. So later in the morning, I conducted several more experiments:
CWM factory reset (wipe /data and /cache), re-flash ICSROM-146-Rebuild.zip and reboot. Big-M followed by blank screen, as expected.
Next, unpack and repack ICSROM 146 boot image. Here’s the effect: Since my “modify-boot” tool set does not include a kernel command line, it effectively wipes any pre-existing command line in boot.img. So the only functional difference between the “stock” ICSROM 146 boot.img and the repacked one is the absence of the following command string:
Code:
Command line: [email protected] [email protected] [email protected] vmalloc=256M video=tegrafb console=null usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=mbr:d00:100:800,kpanic:2100:400:800 security=tomoyo mot_prod=1 androidboot.serialno=TA20703SX2
By contrast, the kernel command line built into my ROM is:
Code:
[email protected]:/ # more /proc/cmdline
more /proc/cmdline
[email protected] [email protected] [email protected] vmalloc=320M video=tegrafb console=null usbcore.old_scheme_first=1 tegraboot=s
dmmc tegrapart=mbr:1100:100:800,kpanic:2500:400:800 security=tomoyo mot_prod=1 androidboot.serialno=TA2070GKY6
[email protected]:/ #
Please correct me if I am wrong, but I think that if no kernel command line is present in boot.img, the ramdisk “init” function reads the ROM default /proc/cmdline string after the kernel boots.
Note that the ICSROM 146 memory allocations differ significantly from those in /proc/cmdline.
Anyway, I repeated my previous experiment: CWM wipe /cache and /data, re-flash 146, power down and fastboot the custom ICSROM 146 boot image --- the only change being the absence of a kernel command line.
Results: ICSROM came up. Power up to Welcome screen was less than 3 minutes on first boot, and 50-55 seconds on subsequent boots.
But my phone ran very warm --- even at idle.
So I decided to incorporate all the ramdisk changes I had made the previous night and to repack (again, no kernel command line) and repeated the previous experiment: CWM wipe /data and /cache, re-flash ICSROM 146, power down and fastboot the repacked image (with no kernel command line).
Results: ICSROM came up in 3 minutes (expected), but THIS time, my phone was running cool.
Subsequent to these results, I ran CF Bench (free) many times. Scores generally hovered around 5000 --- slightly below the HTC Sensation, but still quite respectable for 1.0GHz --- though I think there's a wee bit of overclockin' here.
And now, I share these initial results in the form of an image to boot ICSROM 1.4.6 on EMMC. See links and instructions below.
[UPDATE 10 Feb 2013]: I did fastboot flash Rev00 directly after another failed boot with stock 146 boot.img --- and ICSROM came up. I did not need to wipe /data or /cache.
Fastboot image: http://www.mediafire.com/?bu604jfdm2axfsv
Flashable zip: http://www.mediafire.com/?5qndqe429eu3ltu
Preliminaries:
Rooted phone with unlocked bootloader
CWM Recovery 5.0.2.0 installed (or latest version of TWRP)
Fully charged, healthy battery​
Instructions:
CWM Nandroid backup of current ROM (if you want to save /data and /cache)
CWM "wipe data/factory reset" (leaves existing ROM in place but clears /data and /cache)
CWM flash ICSROM-1.4.6-Rebuild.zip (takes a few minutes)
Do NOT reboot. Power down instead.
Fastboot method: Power up to fastboot and "fastboot flash boot boot-icsrom-146-Rev00.img"
CWM flash method: Power up to Android Recovery and flash boot-icsrom-146-Rev00.zip​
[UPDATE 22 Feb 2013]: I received the go-ahead from ICSROM author upndwn4par to roll my Rev00 boot image into ICSROM 1.4.6
Link: http://www.mediafire.com/?5lbdhga26azhmd7
Instructions:
Already on ICSROM 146 with Rev00 boot image? Nothing to do.
Already on ICSROM 146 with original boot image? Simply flash zip... OR flash my Rev00 boot zip linked in OP (faster)
Coming from different ROM? Nandroid backup (unless you don't mind losing /data), then CWM wipe data/factory reset and flash zip
I cannot guarantee this boot image will work for you. And because of the complexity of ramdisk, I cannot simply provide a tweak configuration file.
All I can say is that with it, my AT&T Atrix runs much cooler, battery life is dramatically improved, and touch screen issues (like a home screen app ceremoniously launching when Power button is pressed) have disappeared.
Pending success of follow-on experiments, I will make an equivalent image available to boot ICSROM on SD card (for dual boot).
Some future planned work:
Continue scouring ICSROM boot.img /ramdisk, and remove “bad actors” as necessary
Study the init memory allocations and tweak if necessary
Try to reduce boot time
Given enough positive responses to boot-icsrom-146-Rev00.img, I will consider rolling it into my next release of Atrix Boot Emporium (presently V3.0)
Blessings.
Credits: upndwn4par (ICSROM).

couldnt you just post the boot.img with proper settings to make us able of using it? lmao
would be nice if you look into it, yet, you really could do what i just said, couldnt?
edit:sorry didnt see the link before DX
can you attach it in the post? im at the work and cant download it thanks to the folks from maintenance...
(in a flashable zip if you could )

So does this theoretically fix all the issues found with the ICS leak? Well except webtop....

jeffreygtab said:
So does this theoretically fix all the issues found with the ICS leak? Well except webtop....
Click to expand...
Click to collapse
no, it MAY fix some issues, including the not booting problem in ICSROM 1.4.6

Thanks for your hard work. It sounds as though it's been quite promising.
Good luck!

Odp: Project Stable Boot for ICSROM [09 Feb 2013]
About cmdline. If kernel is set correctly it reads cmdline from bootloader. It can be overridden in both directions of course (to read from kernel or from bootloader).
Sent from my MB860 using xda app-developers app

krystianp said:
About cmdline. If kernel is set correctly it reads cmdline from bootloader. It can be overridden in both directions of course (to read from kernel or from bootloader).
Sent from my MB860 using xda app-developers app
Click to expand...
Click to collapse
Glad you're checking this out. I hope all our devs have a look.

Boot.img
sendust7 said:
Welcome to… Project Stable Boot for ICSROM!​
It all started on 05 Feb 2013 when an xda member reported that the ICSROM boot images featured in Atrix Boot Emporium V3.0: http://forum.xda-developers.com/showthread.php?t=2124668
did not work: Dreaded Big-M followed by blank screen. No boot animation, even after several minutes, and no matter where the ROM was hosted, whether EMMC (standard) or SD (custom).
I started to wonder if “Dual Boot Atrix: Simplified and Standalone” was morphing into “Complicated and Co-dependent”.
So I duplicated the problem and documented my findings here: http://forum.xda-developers.com/showthread.php?t=2124668&page=2
Then I unpacked the ICSROM 146 boot image and tore into the /ramdisk directory. Ramdisk is that part of the Android boot image that initializes your ROM at boot time via multiple “init*.rc” (run command) scripts written in the Android “init” language.
Then, several days later, it happened:
I experienced a significant breakthrough with ICSROM on my AT&T Atrix
​I discovered mainly that:
Ramdisk references approximately twenty different components (functions and services) that do not exist
Ramdisk does not reference several other components that DO exist
Memory allocations in the ICSROM 146 kernel command string differ significantly from default
Perhaps some or all of the missing components are (or were) available via legacy Motorola OTA updates. But if Motorola is done with ICS for Atrix 4g, then I think we’re done with the OTA updates.
So I decided to yank most of the init*.rc code containing broken references.
Also, I noticed that init.olympus.rc launches some encryption-related functions at boot time, whereas MROM ICS does not. So I yanked these as well. Then I quickly repacked the boot image and voila… ICSROM came up. Then I put my phone (and myself) to sleep.
09 Feb, 0430 PST: Disconnected charger, woke the phone and observed battery at 99%. Put phone back to sleep. Fifteen minutes later, woke the phone and observed battery at 98% --- only a 1% drop. Repeated the same test multiple times and got the same results.
I began to dream of 24 hour battery life again, lol.
I also noticed something related --- my phone was running much cooler, even when not in sleep mode. So later in the morning, I conducted several more experiments:
CWM factory reset (wipe /data and /cache), re-flash ICSROM-146-Rebuild.zip and reboot. Big-M followed by blank screen, as expected.
Next, unpack and repack ICSROM 146 boot image. Here’s the effect: Since my “modify-boot” tool set does not include a kernel command line, it effectively wipes any pre-existing command line in boot.img. So the only functional difference between the “stock” ICSROM 146 boot.img and the repacked one is the absence of the following command string:
Code:
Command line: [email protected] [email protected] [email protected] vmalloc=256M video=tegrafb console=null usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=mbr:d00:100:800,kpanic:2100:400:800 security=tomoyo mot_prod=1 androidboot.serialno=TA20703SX2
By contrast, the kernel command line built into my ROM is:
Code:
[email protected]:/ # more /proc/cmdline
more /proc/cmdline
[email protected] [email protected] [email protected] vmalloc=320M video=tegrafb console=null usbcore.old_scheme_first=1 tegraboot=s
dmmc tegrapart=mbr:1100:100:800,kpanic:2500:400:800 security=tomoyo mot_prod=1 androidboot.serialno=TA2070GKY6
[email protected]:/ #
Please correct me if I am wrong, but I think that if no kernel command line is present in boot.img, the ramdisk “init” function reads the ROM default /proc/cmdline string after the kernel boots.
Note that the ICSROM 146 memory allocations differ significantly from those in /proc/cmdline.
Anyway, I repeated my previous experiment: CWM wipe /cache and /data, re-flash 146, power down and fastboot the custom ICSROM 146 boot image --- the only change being the absence of a kernel command line.
Results: ICSROM came up. Power up to Welcome screen was less than 3 minutes on first boot, and 50-55 seconds on subsequent boots.
But my phone ran very warm --- even at idle.
So I decided to incorporate all the ramdisk changes I had made the previous night and to repack (again, no kernel command line) and repeated the previous experiment: CWM wipe /data and /cache, re-flash ICSROM 146, power down and fastboot the repacked image (with no kernel command line).
Results: ICSROM came up in 3 minutes (expected), but THIS time, my phone was running cool.
Subsequent to these results, I ran CF Bench (free) many times. Scores generally hovered around 5000 --- slightly below the HTC Sensation, but still quite respectable for 1.0GHz --- though I think there's a wee bit of overclockin' here.
And now, I share these initial results in the form of an image to boot ICSROM 1.4.6 on EMMC: http://www.mediafire.com/?bu604jfdm2axfsv
Code:
fastboot flash boot boot-icsrom-146-Rev00.img
I cannot guarantee this boot image will work for you. And because of the complexity of ramdisk, I cannot simply provide a tweak configuration file.
All I can say is that with it, my AT&T Atrix runs much cooler, battery life is dramatically improved, and touch screen issues (like a home screen app ceremoniously launching when Power button is pressed) have disappeared.
Pending success of follow-on experiments, I will make an equivalent image available to boot ICSROM on SD card (for dual boot).
Some future planned work:
Continue scouring ICSROM boot.img /ramdisk, and remove “bad actors” as necessary
Study the init memory allocations and tweak if necessary
Try to reduce boot time
Given enough positive responses to boot-icsrom-146-Rev00.img, I will consider rolling it into my next release of Atrix Boot Emporium (presently V3.0)
Blessings.
Click to expand...
Click to collapse
I believe one of the keys to ICS for Atrix is to remove the broken init*.rc code. I wanted to check out the changes you made.
$ ./extractboot S7boot.img
Page size: 2048 (0x00000800)
Kernel size: 3864576 (0x003af800)
Ramdisk size: 287449 (0x000462d9)
Second size: 0 (0x00000000)
Board name:
Command line:
Writing S7boot.img-kernel ... complete.
Writing S7boot.img-ramdisk.gz ... complete.
gzip: ../../boot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
I had trouble extracting your image. the ramdisk folder was empty. I expected to find the default.prop, multiple init files and ueventd files. I wish you the best of luck, I believe you are on the right track.

Qe process
Check out this link http://www.reddit.com/r/Android/comments/v7dtc/carrier_iq_round_2_motorolas_android_devices_are/
"This morning, Hashcode (a major developer of ROMs for Motorola's Android devices and the Kindle Fire) posted this at droidforums.net:
I took the liberty of disabling "Qe" which logs all of the differences in the current OS compared to how it comes from Motorola. It's a lag monster on the bootup, and an invasion of privacy.
It caught my attention so I asked him more about it and this is what he said:
I first noticed it in the RAZR and Droid 4 GB ROMs. The process "qe" is started during the initial boot services. It does a full scan of the /system dir and stores the md5 of every file. It then compares that information to a file in /pds which contains the md5sum file listing of the stock ROM as it was originally from Motorola. As it diffs the 2 listings, any differences are placed in /data/misc/qer and eventually posted back to Motorola.
You can see the report on any stock phone by looking in there.
There is no way to disable it in the regular phone ROM without using a 2nd init process to change the ramdisk files as the binary "qe" is in /sbin and the service is started in the init.*.rc files.
Does anyone else find this unacceptable? I may be overreacting, but this seems disconcerting to say the least."
Disabling this service should Improve boot time dramatically. I am trying to build a better boot.img, I hope this helps. extracted original leak boot.img, Deleted xbin folder containing qe bianry, qee.dat, qem.dat, remove service calls from Init*rc files and repacking should help with boot process.

@sendust7 your phone have the same tegrapart like mine, do you have screen shaking issues?

The battery drain is the major issue I have, and the only reason not to be my daily rom!
Thanks!
Sent from my MB860 using xda app-developers app

clemare said:
The battery drain is the major issue I have, and the only reason not to be my daily rom!
Thanks!
Sent from my MB860 using xda app-developers app
Click to expand...
Click to collapse
So, what I have to do to test the leaked rom with this modificacion?
Sent from my MB860 using xda app-developers app

Here is the flashable zip
http://db.tt/pC7GXsBP
Happy Flashing[/SIZE]

Nice detective work. One thing to keep in mind is that so many of the problems with ICS are device dependent - something that goes well beyond tegrapart. I often wonder if this played a part in Moto's decision to bail on ICS.
It is interesting to note that some users that were able to run ICSROM v1.4.4 with no problems (other than battery life) suddenly started having boot problems with v1.4.5. The only difference between the two builds is that I added init.d support. I wonder how this fits in to your research?
As always, nice work!

So if I flash icsrom and then the boot img from the post 2 above this one it will be safe? Will I then have ics with better battery life?
Thanks
xda premium hd is rubbish

blttalas said:
Here is the flashable zip
http://db.tt/pC7GXsBP
Happy Flashing[/SIZE]
Click to expand...
Click to collapse
blttalas, your CWM fix package does not work. Still cannot boot release 1.4.6 from ICSRom.

upndwn4par said:
Nice detective work. One thing to keep in mind is that so many of the problems with ICS are device dependent - something that goes well beyond tegrapart. I often wonder if this played a part in Moto's decision to bail on ICS.
It is interesting to note that some users that were able to run ICSROM v1.4.4 with no problems (other than battery life) suddenly started having boot problems with v1.4.5. The only difference between the two builds is that I added init.d support. I wonder how this fits in to your research?
As always, nice work!
Click to expand...
Click to collapse
Thank you so much. I will look into it

jhonnyx said:
blttalas, your CWM fix package does not work. Still cannot boot release 1.4.6 from ICSRom.
Click to expand...
Click to collapse
I can corroborate this. The CWM Package doesn't work, but the boot.img booted with no problems through fastboot flash.

littleemp said:
I can corroborate this. The CWM Package doesn't work, but the boot.img booted with no problems through fastboot flash.
Click to expand...
Click to collapse
So does the new boot.img really enhance battery life; cool the phone and halt reboots?!
Thanks.

jeffreygtab said:
So does the new boot.img really enhance battery life; cool the phone and halt reboots?!
Thanks.
Click to expand...
Click to collapse
littleemp said:
I can corroborate this. The CWM Package doesn't work, but the boot.img booted with no problems through fastboot flash.
Click to expand...
Click to collapse
Rev00 flashable zip: http://www.mediafire.com/?5qndqe429eu3ltu
This project is very new. At this point, all I can say is that it works on my AT&T Atrix --- Boots every time in every configuration I've thrown at it so far.
And as I recall, I have only had one random reboot, and that occurred while I was testing a makeshift variant several days ago.

Related

Safestrap 1.0 Splash Screen Contest [POLL NOW ACTIVE]

VOTE IF YOU'RE INTERESTED: http://rootzwiki.com/topic/8630-vote-for-the-new-safestrap-splash-screen/
Hello!
I put up a contest in the RootzWiki Droid 3 forum to determine what the splash screen for the new Safestrap will look like. This is a screen which will be shown at boot time for about 8 seconds and give the user the option of entering recovery.
Then I realize that I should have posted it here as well, because I plan on releasing an official Bionic Safestrap 1.0.
So, if you're interested in seeing the new the splash screen submissions (and/or making one yourself) head on over:
http://rootzwiki.com/topic/8453-looking-for-a-little-help/
For those of you who don't know what Safestrap is, here's a little background:
When I first got started on the Droid 3, and read up on how the stock 2nd-init Bootstrap worked, I felt like everytime you flashed a ROM, you took a huge leap of faith. By clobbering the system partition, we as users might or might not be able to get back into recovery and/or boot the OS. Leaving us with a fastboot restore.
Safestrap has several improvements over the current stock hijack:
1. The flashing feature in Safestrap Recovery places ROMs onto the /preinstall partition (as a 2nd-system). This protects the hijack necessary for getting into recovery and booting custom ROMs.
2. Several customizations to the 2nd-init process for the Droid 3 and Bionic:
2a. Eliminates several duplicate mounts
2b. Uses an "init" binary which supports the custom Motorola users/groups and system properties necessary to run a 2nd-init custom ROM on our devices.
2c. With the exception of the compiled 2nd-init binary, the entire hijack is written in shell script so that the process is transparent to interested users.
3. Recovery entry via BP-Tools mode in the boot menu (power + M), OR using the menu button during the splash screen.
4. Unlike the stock Bootstrap, Safestrap has a "Remove Recovery" feature to uninstall it's hijack. If you've kept your primary system otherwise pristine (root + safestrap) then you're in great shape to perform an OTA update after the removal.
5. Safestrap 1.0 will work with most ROMs. No special changes will be necessary. (This feature will continue to be tested as time goes on)
Some of you may have seen a video by Deodexed showing him instantly swapping systems and rebooting. This was causing several users to hang at the "M" logo due to differences in the /data structures between CM7 and MotoBlur. So in the new version it performs a mini-backup/restore of your working data sets before swapping between systems.
PS. I apologize for the cross post.
Poll will be up till tomorrow night (11/2).

[RECOVERY][TWRP&CWM][Updated: 6-Feb-2013]Stock Kernel on Official Jellybean

Note: This has been deprecated in favour of LK for Xperia T
This kernel image is based on stock using the FreeXperia ramdisk method of loading stock and recovery. It also includes the new FOTA partition trick by Dees_Troy for easy updates in the future to TWRP.
Dees_Troy and I worked on figuring out the reason recovery binaries would not load on the stock kernel without patches, fixed this up in bionic, and rebuilt recovery linked against the fixed bionic.
F.A.Q
Q. The title says TWRP and CWM but when I boot recovery I only see TWRP. How do I get CWM?
A. TWRP is the default recovery, if you want CWM you should download the CWM update.zip in the second post and flash it with twrp.
Technical Info​
In 3.4 Qualcomm have changed the fb_var_screeninfo struct slightly. They have added an extra field called colorspace which increases the size of the stuct by __u32. When a binary linked against bionic tries to pass a struct the size of the old fb_var_screeninfo to kernelspace the application breaks as the kernel is expecting more data than it was given.
The patch to fix this in kernel solves the problem by removing one of the reserved fields, bringing the struct back to the same size it was prior to the new field being added. While this keeps compatibility with older recovery binaries, it does introduce the problem of needing a custom kernel to run recovery. Sony have not yet released source for 9.1.A.0.489 which means the kernel cannot be rebuilt without issues such as WiFi not working. The patch that Dees_Troy applied to the build system was to add the new colorspace field into the header for bionic which means the new recovery binary can run on an unmodified stock Sony kernel.
Flashing​
Boot device in fastboot mode:
Code:
adb reboot bootloader
Flash image with fastboot:
Code:
fastboot flash boot mint489stock.img
Source for TWRP available from here.​
Updates:
1. Updated image in first post to fix bug where creating a backup would fail and crash twrp.
2. Updated first post to show CWM in title and answer questions about how to get CWM.
Flashable zips:
In the first post it is mentioned about using the FOTAKernel trick by Dees_Troy to offer easy updates. The 2 zips attached to this post are examples of the ease of use.
flashCWM.zip - This will flash CWM to the FOTAKernel and replace TWRP as your recovery.
flashTWRP.zip - This will flash TWRP to the FOTAKernel and replace TWRP that is built into the image that was flashed to your device by fastboot, or to replace CWM with TWRP again if you used the flashCWM.zip
This also makes updates easier as you do not need to replace the kernel image you currently have flashed to your device.
Re: [RECOVERY][TWRP]Stock Kernel on Official Jellybean
Many thanks, can you just clear up one thing please, does Wi-Fi work on this image?
Sent from my LT30p xda premium app.
How do I customise the signature on xda premium app?
gregbradley said:
Many thanks, can you just clear up one thing please, does Wi-Fi work on this image?
Sent from my LT30p xda premium app.
How do I customise the signature on xda premium app?
Click to expand...
Click to collapse
Yes, wifi does work because it is just the stock kernel with TWRP added. I am running it right now with no problems.
I thought so, but I just wanted to make it obvious to all users as it was not 100% clear from the OP. I didnt have time to flash myself and check as I was just abbout to leave for work, now I am at work I will also flash it....
lilstevie said:
This kernel image is based on stock using the FreeXperia ramdisk method of loading stock and recovery. It also includes the new FOTA partition trick by Dees_Troy for easy updates in the future to TWRP.
Dees_Troy and I worked on figuring out the reason recovery binaries would not load on the stock kernel without patches, fixed this up in bionic, and rebuilt recovery linked against the fixed bionic.
Technical Info​
In 3.4 Qualcomm have changed the fb_var_screeninfo struct slightly. They have added an extra field called colorspace which increases the size of the stuct by __u32. When a binary linked against bionic tries to pass a struct the size of the old fb_var_screeninfo to kernelspace the application breaks as the kernel is expecting more data than it was given.
The patch to fix this in kernel solves the problem by removing one of the reserved fields, bringing the struct back to the same size it was prior to the new field being added. While this keeps compatibility with older recovery binaries, it does introduce the problem of needing a custom kernel to run recovery. Sony have not yet released source for 9.1.A.0.489 which means the kernel cannot be rebuilt without issues such as WiFi not working. The patch that Dees_Troy applied to the build system was to add the new colorspace field into the header for bionic which means the new recovery binary can run on an unmodified stock Sony kernel.
Flashing​
Boot device in fastboot mode:
Code:
adb reboot bootloader
Flash image with fastboot:
Code:
fastboot flash boot mint489stock.img
Source for TWRP available from here.​
Click to expand...
Click to collapse
Such a good news!I will port it to TX JellyBean firmware if you don' mind
gregbradley said:
I thought so, but I just wanted to make it obvious to all users as it was not 100% clear from the OP. I didnt have time to flash myself and check as I was just abbout to leave for work, now I am at work I will also flash it....
Click to expand...
Click to collapse
only for unlocked bl, correct?
hi,
i wanted to create with this version a backup, but it doesn't work.
it was just created the folder system,
the other folders such as data and boot not.
the created folder system, that was created after backup, is empty.
the 'backup' also takes only a few seconds, then the 'backup' is done.
what have i done?
installed the .img with instructions above.
boot xt into recovery, push backup, select system, data & boot, choose destination folder and start backup.
where is my failure?
hkjr said:
only for unlocked bl, correct?
Click to expand...
Click to collapse
Yes
MysticEnforcer said:
hi,
i wanted to create with this version a backup, but it doesn't work.
it was just created the folder system,
the other folders such as data and boot not.
the created folder system, that was created after backup, is empty.
the 'backup' also takes only a few seconds, then the 'backup' is done.
what have i done?
installed the .img with instructions above.
boot xt into recovery, push backup, select system, data & boot, choose destination folder and start backup.
where is my failure?
Click to expand...
Click to collapse
Same here....seems backup is not working
MysticEnforcer said:
the 'backup' also takes only a few seconds, then the 'backup' is done.
Click to expand...
Click to collapse
Updated first post with a fixed image.
Thank you very much, this is the best message of day.
Just flashed new image
Doing a backup and it seems to work...will update in few minutes when it is finished
EDIT:
It works
Backup complete in 385 seconds
FYI,
both times on rebooting system from recovery I initially got the grey triangle, both times it was only for 10-15 seconds before the phone rebooted...
Testing it now ....
Edit:
[Backup completed in 461 seconds] External SD card with compression on. No Grey triangle for me.
[Restore completed in 192 seconds] Restored backup without any problems. No grey triangle on second reboot either.
Seems to work great for me.
(only clock seems to be incorrect. 7 hours and 16 minutes behind)
Edit 2: thirth boot up seems to get stuck on grey triangle for about 15 seconds
Edit 3: Seems only the first time reboot after using the recovery the grey triangle is there. Rebooted the phone 4 times and only got the triangle 1 time.
Updated first and second post
USB storage does not work at all both on TWRP and CWM
tested 2nd version, works fine for me & no grey triangle :good:
romcio47 said:
USB storage does not work at all both on TWRP and CWM
Click to expand...
Click to collapse
Noticed that to
romcio47 said:
USB storage does not work at all both on TWRP and CWM
Click to expand...
Click to collapse
This appears to be more of a technical limitation.
The internal storage space is formatted ext4, so only linux would be able to mount that by default so it doesn't offer that.
With the MicroSD the issue seems to be a little more complex and may possibly need a custom kernel.
lilstevie said:
This appears to be more of a technical limitation.
The internal storage space is formatted ext4, so only linux would be able to mount that by default so it doesn't offer that.
With the MicroSD the issue seems to be a little more complex and may possibly need a custom kernel.
Click to expand...
Click to collapse
Thanks for the reply I guess we just have to wait for the kernel sources to be published
Besides another issue - in CWM wiping dalvik-cache does not work.
romcio47 said:
Besides another issue - in CWM wiping dalvik-cache does not work.
Click to expand...
Click to collapse
I can't reproduce this, if I wipe dalvik-cache in CWM it removes /data/dalvik-cache as it should.

[RECOVERY]Safestrap 3.75 for unused partitions (/preinstall & /webtop)

This version of SafeStrap is based on SafeStrap 3.75 but has a lot of differences with it:
- there is not more the splashscreen during the boot, to enter in Safestrap you have to select BP Tools in the Boot Mode Selection Menu(VolUp&&VolDown+PowerOn)
- has been added a Safe Rom slot that uses the unused partitions:
/preinstall (~ 600mb) for /system
/webtop (~ 1,4gb) for /data
/cache is shared with the Stock Rom slot
- in this version you have 6 slots: the Stock Rom slot, the Safe Rom slot and the four virtual slots
- the Safe Rom slot is faster than any virtual slot and safer than the Stock Rom slot
If you are using the original Safestrap you can simply install this new version over it and you will still have your roms in the virtual slots.
This version of Safestrap works like any other version of Safestrap and you can use the Stock Rom slot and the four virtual slots as you are usually do, the only thing that is a bit complicated is to install an aosp rom in the new Safe Rom slot that i provided in it.
DOWNLOAD AND GUIDE TO USE THE SAFE ROM SLOT
HOW TO POST REQUEST FOR HELP:
You have to entirely read this thread, I do NOT answer redundant question.
I do not answer to requests for help in private, I have neither the time nor the interest in doing so.
Any doubts, questions or requests must be posted in this thread in order to answer a single time and help everyone.
XDA:DevDB Information
Safestrap 3.75 for unused partitions (/preinstall & /webtop) , Tool/Utility for the Motorola Droid 4
Contributors
Mentor.37
Version Information
Status: Stable
Created 2015-02-21
Last Updated 2016-01-05
This thread is not about the ramdisks so do not ask about them.
In case of problems you can build the ramdisk as i explained in the main thread.
Super, i wait for some time for someone to make this. I'v tested this with cm12 to safe slot but blank screen. Some progress in this kexec problem ? Also SS revovery splash screen is not so but as turning of device and keys combo pressing.
I rechecked everything more and more times but seem to me that everything is ok, for now I do really have not idea on where could be the problem.
Solved
Good news, I understood where is the problem with the roms that use a kexec kernel and the problem was not in my modded recovery but in the rom's ramdisk. I'm now running the cm11 in my safe slot.
I will correctly describe how to run a kexec rom in my safestrap version in the next days, for now i'm a bit busy.
Mentor.37 said:
Good news, I understood where is the problem with the roms that use a kexec kernel and the problem was not in my modded recovery but in the rom's ramdisk. I'm now running the cm11 in my safe slot.
I will correctly describe how to run a kexec rom in my safestrap version in the next days, for now i'm a bit busy.
Click to expand...
Click to collapse
could the partitions be formated fs2fs ?
Regards
For now they can be formatted only as you can format the stock rom or any slot in the standard safestrap but should not be difficult add this option in safestrap but i can't ensure you that they will work, as far as i know the aosp roms require an ext3 or ext4 fs for /system and /data.
#Postedit
I have never used safestrap before this my project and for this i did not know it well, now i saw that the f2fs is the fs used for the virtual stlots and yes i can format these partitions as f2fs the first time that the safe slot is selected but for now i'm using the cm11 in this slot with the partitions formatted as ext3 and the rom is really really fast.
Final version
I just uploaded the final version in which i also restored the capability to use the virtual slots.
If you are using my previous debug version or if you are using the original safestrap 3.75 you can simply install this new version over them and you will still have your rom in the safe slot or in the virtual slot.
Yes, i know that i told that the previous was the final version but i just uploaded a little update that fixes a problem in the layout of the new safe slot menu.
Mentor.37 said:
For now they can be formatted only as you can format the stock rom or any slot in the standard safestrap but should not be difficult add this option in safestrap but i can't ensure you that they will work, as far as i know the aosp roms require an ext3 or ext4 fs for /system and /data.
#Postedit
I have never use safestrap before this my project and for this i did not know it well, now i saw that the f2fs is the fs used for the virtual stlots and yes i can format these partitions as f2fs the first time that the safe slot is selected but for now i'm using the cm11 in this slot with the partitions formatted as ext3 and the rom is really really fast.
Click to expand...
Click to collapse
I was thinking to add fs2fs support to the kernel and see how it works, like otterx project.
thanks for your work !
regards
Thank you for great work. I'm now trying CM11 in safe slot. Everything looks great, it run very fast compared to cm12. I have one question: How can I edit cm12 ramdisk.img? I've tried "Android Image Kitchen 2.0" with no luck. Thanks for help.
In the cm12's ramdisk.img there is the file safestrapped.cpio before the real ramdisk so you have to split them with an hex editor (1F 8B 08) then you can extract the ramdisk, edit it, repack it and finally recreate the ramdisk.img reconcatenating with the hex editor the file safestrapped.cpio with the edited ramdisk.
Anyway yesterday night i attached at the main thread two flashable zips that install an edited ramdisk.img with an addon.d script that makes it persistent for the cm11 m12 and for the cm12 nightly. In this way anyone can try these roms in the Safe Slot.
I'm trying the cm12 in the safe slot from yesterday and it works flawless, it is faster than the cm11 used in the same slot, i suppose thank to the ART.
Mentor.37 said:
In the cm12's ramdisk.img there is the file safestrapped.cpio before the real ramdisk so you have to split them with an hex editor (1F 8B 08) then you can extract the ramdisk, edit it, repack it and finally recreate the ramdisk.img reconcatenating with the hex editor the file safestrapped.cpio with the edited ramdisk.
Anyway yesterday night i attached at the main thread two flashable zips that install an edited ramdisk.img with an addon.d script that makes it persistent for the cm11 m12 and for the cm12 nightly. In this way anyone can try these roms in the Safe Slot.
I'm trying the cm12 in the safe slot from yesterday and it works flawless, it is fastest than the cm11 used in the same slot, i suppose thank to the ART.
Click to expand...
Click to collapse
Excellent! It works like a charm! Now i can swap SD-card and internal storage etc... Thank you Mentor!
Thanks, Mentor.
This is a brilliant idea, and it works perfectly.
It seems crazy not to use this, if you don't need /preinstall or /webtop.
Mentor.37 said:
In the cm12's ramdisk.img there is the file safestrapped.cpio before the real ramdisk so you have to split them with an hex editor (1F 8B 08) then you can extract the ramdisk, edit it, repack it and finally recreate the ramdisk.img reconcatenating with the hex editor the file safestrapped.cpio with the edited ramdisk.
Anyway yesterday night i attached at the main thread two flashable zips that install an edited ramdisk.img with an addon.d script that makes it persistent for the cm11 m12 and for the cm12 nightly. In this way anyone can try these roms in the Safe Slot.
I'm trying the cm12 in the safe slot from yesterday and it works flawless, it is fastest than the cm11 used in the same slot, i suppose thank to the ART.
Click to expand...
Click to collapse
Can you also add patch for cm 10.2.1 ?
Anyone can build by itself a ramdisk to use a rom in the Safe Rom slot with these passages:
1) unpacking the ramdisk.img with this command:
Code:
gunzip -c ../ramdisk.img | cpio -i
N.B.: for the roms based on LP the procedure is a bit more complex and i explained it some post above
2) editing the file fixboot.sh as explained in the main thread
3) repacking the new ramdisk.img with this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk.img
Excellent work!
Mentor.37 said:
Anyone can build by itself a ramdisk to use a rom in the Safe Rom slot with these passages:
1) unpacking the ramdisk.img with this command:
Code:
gunzip -c ../ramdisk.img | cpio -i
N.B.: for the roms based on LP the procedure is a bit more complex and i explained it some post above
2) editing the file fixboot.sh as explained in the main thread
3) repacking the new ramdisk.img with this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk.img
Click to expand...
Click to collapse
For some strange reason I cannot repack new ramdisk.img for cm 10.2.1
I have a problem - the safe slot is there but, it shows that it has 0 MB (0 MB Free) in Data. I still did try to install CM11 (M12) there. It did installed successfully, but after rebooting it stuck (at least I think it did) on the CM boot animation. It stayed there for good half a hour so I thought there is a problem. So i restarted and went back to stock (have CM12 there, I wanted to test a CM11 a bit if it would be snappier as it probably is more developed and than switch those two as CM12 has nightly updates and there is risk of bricking the phone with daily flashes)
Anyway is showing 0 MB in Data normal and /preinstall and /webtop are used anyway or is it wrong?
Thanks!
dutohlav said:
I have a problem - the safe slot is there but, it shows that it has 0 MB (0 MB Free) in Data. I still did try to install CM11 (M12) there. It did installed successfully, but after rebooting it stuck (at least I think it did) on the CM boot animation. It stayed there for good half a hour so I thought there is a problem. So i restarted and went back to stock (have CM12 there, I wanted to test a CM11 a bit if it would be snappier as it probably is more developed and than switch those two as CM12 has nightly updates and there is risk of bricking the phone with daily flashes)
Anyway is showing 0 MB in Data normal and /preinstall and /webtop are used anyway or is it wrong?
Thanks!
Click to expand...
Click to collapse
Both preinstalled and Webtop should have data in them, before you wipe them, what are total sizes?
Sent from my XT907 using Tapatalk

[RECOVERY] (Un-)tethered TWRP 2.8.7.0 for Asus ZenFone 2 (x86)

Hi folks,
finally we compiled a(n un-)tethered TWRP package for our ZenFone 2 (confirmed on ZE551ML and ZE500ML)!
!!! NOTE: If you want to apply a new OTA update, please flash stock recovery first !!!
Also, if you encounter any errors with the official recovery by TeamWin, please don't ask for support here as this is an unofficial build (done with the hard work of many people collaborating in a great manner!)​
If you don't want to unlock your Bootloader, you can use the tethered recovery.
Tethered (=after a reboot everything is back to normal)​
Features:
- Compiled with CM12 sources (although CM12 and TWRP are not liking each other very much :silly: )
- Optimized for x86 (smooth UI now)
- internal and external storages are mounted correctly
- Backup of boot, system, cache and data possible
- Full Crypto and SELINUX support
Bugs:
- Sometimes Backup and Restore hang. Fortunately it doesn't begin these operations so you don't brick your device (any hints on this are welcome!)
- USB Storage mount doesn't appear to work at all (pretty sure I took the correct path to the LUN file)
How to use:
- Download the tethered CWM package from here (method 2): http://forum.xda-developers.com/zenfone2/general/root-newbie-root-instructions-zenfone-2-t3114063
- replace the recovery.zip in "CWM_Zenfone_2_IntelFB_RecoveryLauncher" with the one you can find in the download section
- start the procedure by using cai_dat_CWM.bat
- type ACCEPT (case sensitive!) and enter
- type T4 and enter
- Set your timezone when booting the first time into the Recovery, maybe this fixes the backup and restore bug (needs to be done just once)
- Unplug your USB cable from the device, too, before flashing, backing up and/or restoring
Untethered (=permanent recovery)​
Features:
- Compiled with CM12 sources
- Optimized for x86 (smooth UI now)
- internal and external storages are mounted correctly
- Backup of boot, system, cache and data possible
- Full Crypto and SELINUX support
- kernel compiled dynamically (thanks to @crpalmer and @jrior001 and all involved for their fantastic work) with permissive Selinux
- USB-OTG support added (Beta supports NTFS file systems)
- Splashscreen can be backed up (to fiddle around and create your own)
- img files flashable now via recovery (thanks to @cangcan, @yakub234go and @vampirefo)
- F2FS support on kernel side
Drawbacks:
- MTP doesn't work
How to use:
Method 1
Get root rights
Unlock your bootloader
Download twrp.img from the download section and put on sd card (or pick the beta version for NTFS support)
Fire up adb or install a terminal emulator and type:
Code:
su
dd if=/sdcard/twrp.img of=/dev/block/by-name/recovery
reboot recovery
Method 2
Download twrp.img from the download section and put in your adb/fastboot directory
Unlock your bootloader
Boot into bootloader (turn off, keep Vol+ pressed and press the power button until it vibrates - then release ONLY the power button and keep volume up pressed until you see the fastboot GUI
Open up fastboot on your PC and type:
Code:
fastboot flash recovery twrp.img
Then press vol down 2 times until "Reboot recovery" shows up and press power 1 time to boot into recovery
Method 3 (if you have an older version of TWRP already installed)
Place img on your internal sdcard, then reboot to recovery, click install zip, then select "Images..." in bottom right, then you see the img. Tick "Recovery" afterwards and then on OK.
Download folder:
Gone
Cheers!
Credits
@social-design-concepts for the great tethering method and the brilliant support and guidance :good:
@vampirefo also his support and guidance :good:
@updateing for the link to the commit for x86 pixelflinger
@jrior001 and @crpalmer for the great work on the kernel source
etc. etc.
Special thanks:
@Drew442 Thanks for the contribution!
Amir J. - thank you too!
TeamWin for their great recovery
XDA:DevDB Information
[RECOVERY][LOLLIPOP ONLY] (Un-)tethered TWRP 2.8.7.0 for Asus ZenFone 2 (x86), Tool/Utility for the Asus ZenFone 2
Contributors
TheSSJ, social-design-concepts, vampirefo, updateing, crpalmer, jrior001, knoneNull, etc etc
Source Code: https://github.com/TheSSJ/device_asus_zenfone2
Version Information
Status: Stable
Current Stable Version: 21_f2fs
Stable Release Date: 2015-07-02
Created 2015-06-04
Last Updated 2016-09-24
Update 07-02-2015
ADB sideload works now (thanks @jrior001 & @crpalmer)! Make sure to download the latest ADB version: http://forum.xda-developers.com/showthread.php?p=42407269, credits for this to @shimp208
Update 06-30-2015
NTFS Support tested extensively and proved to be stable (not elegant, but functional)
Added recovery partition back to recovery.fstab to make it flashable via recovery itself
Update 06-28-2015
Moved to stable state
Added Beta version for NTFS support (twrp_ntfs.img)
Update 06-23-2015b
Upgraded source to TWRP 2.8.7.0
Update 06-23-2015
Functional TWRP with fast wipe/restore (-DNO_SECURE_DISCARD, thanks crpalmer)
ADB works
Just have fun in fiddleing around with the recovery
If no bugs will be reported we can declare this recovery stable
Update 06-10-2015
Boardconfig parameters changed, seems to back up, restore and flash even with USB cable attached
Update 06-04-2015b
Rolled back to 2.8.5.0 as restoring threw out the error that system was not being able to mount rw
Everything works now!
Update 06-04-2015
Built a version optimized for x86, fixes UI lags
Added Crypto Support again
Update 06-02-2015b
Removed TW_INCLUDE_CRYPTO flag as it caused backup operation to freeze
Update 06-02-2015
Moved to Beta stage
Fixed mounting of external SD
Update 06-01-2015
Completely reworked BoardConfig.mk
Removed all modules
Added @vampirefo 's adbd and adbd-recovery binaries from his TWRP builds (dunno why, but there aren't any binaries in my builds?) - thanks!
Graphics work now (still slow, need to fine tune with the correct boardconfig flags), no double backups, no flickering!
Update 05-31-2015
Included USES_ION flag into boardconfig.mk
Removed cpu temperature to reduce redraws
a little more stable now!
Nice I can't wait for the BL to be fully unlocked so we van get native TWRP.
Hello recovery or rest and it just temporary? thank you
jejemc said:
Hello recovery or rest and it just temporary? thank you
Click to expand...
Click to collapse
Hi,
yes, after rebooting no trace of TWRP is left
I have updated the zip now. It is a little stabler after I removed the CPU temperature, but still I have the feeling there are 2 GUIs sharing the same screen. Weird - I have to do more research - maybe I have to write my own UI updater...
Cheers
the gears are slowly moving! i hope BL gets unlocked by the time my ZF2 arrives..
is this for any ZF2 variant or just 551ML (4gb ram/2gb ram versions)?
thanks for taking the time with this (hopefully) awesome device!
This is awesome..thanks for your contribution! I am hoping for some custom roms..the stock ZenUI isn't the greatest :/
TheSSJ said:
Hi folks,
I managed to compile a tethered TWRP package for our ZenFone 2!
Click to expand...
Click to collapse
Do you have a link to your device repo?
Are there specific instructions for using it to build a tethered recovery (I'm familiar with building twrp, including within CM, but I haven't looked much into what the tethered exploit does to boot the recovery).
It seems I have successfully completed a Backup! As mentioned, the interface is painfully slow at times, but this is serious progress. Has anybody tried restoring a backup yet?
Could you please develop twrp or cwm for asus 450cg
NOTE:
1 backup successfully
2 Use Very lag
3 flash zip not work
crpalmer said:
Do you have a link to your device repo?
Are there specific instructions for using it to build a tethered recovery (I'm familiar with building twrp, including within CM, but I haven't looked much into what the tethered exploit does to boot the recovery).
Click to expand...
Click to collapse
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
29y6145 said:
NOTE:
1 backup successfully
2 Use Very lag
3 flash zip not work
Click to expand...
Click to collapse
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
TheSSJ said:
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
Click to expand...
Click to collapse
If you can upload the device config to github I can try to take a look tonight or tomorrow and see if I can see anything wrong that would explain your "double ui".
Either way, it is good to upload it as you'll have a history saved of when it last worked if you screw it all up!
TheSSJ said:
Hi,
unfortunately I don't have any. Basically I wrote a BoardConfig.mk based on the data provided by the Nexus Player (Asus Fugu, which is also Intel based). Then I took 2 modules (one for the display and one for the support of exfat partitions) and compiled a normal TWRP. The output folder holds the compiled img as well as the ramdisk in a simple folder. I put the ramdisk content into a simple zip file and included an update-script to have it unpacked properly. What the recovery-trigger exactly does is not clear to me. It seems it temporarily overwrites the logcat binary with itself and then gets executed at a reboot directly. The recovery trigger just unpacks the zip and executes the recovery binary if I understood correctly.
If you want I can upload my device configuration, it's better if there are more ppl looking at this
Thanks for the feedback!
2. Yeah, the lags are a pain, also because it seems to execute every touch twice and I don't know how to fix this at the moment (maybe it is sufficient to increase the time to determine when a longpress is executed and when a normal touch is done, but this is strongly theoretical.
3. I tested flashing a zip and it does work, which error message do you get?
Anyways, today is a new day, so I will get to work on this (I am on vacation right now fortunately).
Cheers!
Click to expand...
Click to collapse
Is your problems due to recovery or modules you added? My tethered twrp doesn't have the problems yours does, so I wonder if it's the modules, your packaging perhaps and not the recovery?
Sent from my T1 using Tapatalk
TheSSJ said:
- Slow graphics, according to @Dees_Troy: "The graphics are a bit laggy because pixelflinger is not very well optimized for x86"
Click to expand...
Click to collapse
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
sorg said:
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
Click to expand...
Click to collapse
tar is the best.
Sent from my T1 using Tapatalk
vampirefo said:
tar is the best.
Sent from my T1 using Tapatalk
Click to expand...
Click to collapse
I know. The problem is how to split the archive. Currently i split by size. In this case you cannot use parts independently. For example, if you want to extract some file, you have to concatenate whole backup first and then extract.
The better way is to split tar at header boundary but so far in many decades of years nobody created such split tool. Also, if there is a file bigger than desired part size, it won't be split and may even produce error if target disk (where backup is saving to) is FAT and file size is bigger than 4GB (extreme case).
sorg said:
Dees_Troy is lying. TWRP graphic engine isn't optimized for any architecture. Even on my SGS4 (ARM) it's slow as snail. Higher resolution - more slower. I see, they've added some code for Qualcomm overlay support. I didn't try it yet, but support only for one CPU manufacturer is nothing. Especially, there is another way to accelerate at around 1000% by SIMD instuctions. Although i've liked TWRP originally, i see developers have no intentions to improve graphics which is the key feature. So, i've decided to throw away TWRP and look at Aroma File Manager.
It has very fast graphics engine with ARM NEON optimization (and with some effort it become SSE4.2 optimized). The only feature missing is backup/restore, but i'm working on that. Actually, Backup/Restore works now. Just thinking about better backup format.
Click to expand...
Click to collapse
@Dees_Troy actually is not lying pixelflinger_static isn't optimize for x86 and Intel used to add libenc to speed up pixelflinger a little, intel later decided to use the more recent version of libminui cause it doesn't use pixelflinger_static and from what i read it a whole lot faster. i imagine @Dees_Troy and team-win are looking into moving away from pixelflinger because of it's draw backs but that is a very big task.
i plan to build against the windriver android-5.0.0_r2.0.1 source this evening cause it includes the icc tool chain when i built the new recovery.launcher against it , it was much much much much much faster hope it has the same affect on twrp
vampirefo said:
Is your problems due to recovery or modules you added? My tethered twrp doesn't have the problems yours does, so I wonder if it's the modules, your packaging perhaps and not the recovery?
Sent from my T1 using Tapatalk
Click to expand...
Click to collapse
I assume maybe I am missing some modules. There is a .ko file named fps_throttle...this led me to the conclusion that maybe the framerate is awefully high (or awefully low ), which could explain this flickering text maybe...
I will include all of the modules in my next build to see if it works better, thanks for the tip!
social-design-concepts said:
@Dees_Troy actually is not lying pixelflinger_static isn't optimize for x86
Click to expand...
Click to collapse
I think, you've missed the point. I've said current TWRP graphics isn't optimized for ALL platforms (besides very specific Qualcomm overlay which i had no chance to try). Nothing to do with x86. Even on ARM device it's very slow. In several years of TWRP existence, i didn't see any progress in GUI, so i don't hope it will be changed anytime soon.
From other side, Aroma File Manager uses NEON(which can be translated to SSE) optimization making interface very fast. Thus, you don't need any special compiler. But due to very different internal GUI engines, it's hard to port TWRP to Aroma GUI. Using 3rd party compiler give you other problems if you try to compile something requiring Android NDK.
Anyway, let me know if your approach with different compiler will make rocket from snail TWRP GUI

[kexec] droid4-kexecboot and booting raw partitions

We can now boot distros with droid4-kexecboot without being locked to the stock initramfs or rootfs :
droid4-kexecboot images
droid4-kexecboot buildroot source
It works by using utagboot generated mmcblk1p8 utags partition to boot the stock kernel to a 4MB buildroot image that can be flashed to the unused mmcblk1p13 bpsw partition. Then it starts kexecboot to use kexec for booting to the selected distro.
Currently supported are recent mainline kernels with the pending LCD patches added. SafeStrap is not necessary but can be booted to. And v3.0.8 legacy kernels installed into SafeStrap rom slots are supported (but need to be manually updated if slot kernels are updated) .
UPDATED: Booting to the stock Android and SafeStrap is now supported out of the box with for pivot_root.
Changes are needed to v3.0.8 kernel config and initramfs to not use CONFIG_CMDLINE_FORCE=y and safestrap/active_slot file and instead just use kernel cmdline to mount the desired rootfs. Distros using the mainline kernel do not have these limitations, and can use the 608MB mmcblk1p22 preinstall, 1.3GB mmcblk1p23 webtop partitions. And the 8GB mmcblk1p25 can also be reformatted to ext4 and used as rootfs if you don't need it for Android. I have not dared to try to reformat mmcblk1p20 system partition, but that too might be usable unless the Motorola bootloader does some checks on it on boot.
There are some experimental patches for initramfs modifications for postmarketos:
https://github.com/postmarketOS/pmbootstrap/pull/1039
But we need also similar Android changes if somebody has time to work on patching and rebuilding LineageOS
Nice, this works with lineage os on slot 1 now. Im currently building postmarketos and a mainline kernel to test
The bootloader refuses to boot with mmcblk1p20 erased. But a empty ext3 partiton is apperently enough to make it happy
IM_back! said:
The bootloader refuses to boot with mmcblk1p20 erased. But a empty ext3 partiton is apperently enough to make it happy
Click to expand...
Click to collapse
Oh interesting I don't think I've seen that. Do you mean the Motorola bootloader refuses to start or kexecboot? Sounds like we should document this and how to fix it if it happens if you can write up something on it for droid4-kexecboot README file.
tmlind said:
Oh interesting I don't think I've seen that. Do you mean the Motorola bootloader refuses to start or kexecboot? Sounds like we should document this and how to fix it if it happens if you can write up something on it for droid4-kexecboot README file.
Click to expand...
Click to collapse
The Motorola booloader goes directly to fastboot if i:
Code:
dd if=/dev/zero of=/dev/block/mmcblk1p20
but
Code:
mkfs.ext3 /dev/block/mmcblk1p20
keeps the Motorola bootloader happy. im not shure if it needs to be ext3 i just whent with that because thats what the stock rom uses. It is extreamly annoying that we can not flash modified system.img's via fastboot. I will experiment a bit more with it and submit a patch to the README file.
I got The mainline kernel to boot, but without a rootfs it dosent do anything usefull of course.
that aside i can't seam to get postmarketos to work. I installed pmos rootfs to the webtop partiton and supplyed kernel command line with PMOS_NO_SAFESTRAP and correct root= but it just boots to a black screen , no uart output either
Do you have something that works that i could take a look at?
IM_back! said:
The Motorola booloader goes directly to fastboot if i:
Code:
dd if=/dev/zero of=/dev/block/mmcblk1p20
but
Code:
mkfs.ext3 /dev/block/mmcblk1p20
keeps the Motorola bootloader happy. im not shure if it needs to be ext3 i just whent with that because thats what the stock rom uses. It is extreamly annoying that we can not flash modified system.img's via fastboot. I will experiment a bit more with it and submit a patch to the README file.
Click to expand...
Click to collapse
Interesting so it seems that the cdt.bin mmcblk1p6 partition tells mbmloader to check some partitions for content and some partitions just for the fs. I wonder if also for example cdrom mmcblk1p16 partition can be modified too that way.
IM_back! said:
I got The mainline kernel to boot, but without a rootfs it dosent do anything usefull of course.
that aside i can't seam to get postmarketos to work. I installed pmos rootfs to the webtop partiton and supplyed kernel command line with PMOS_NO_SAFESTRAP and correct root= but it just boots to a black screen , no uart output either
Do you have something that works that i could take a look at?
Click to expand...
Click to collapse
As a test I only verified that NotKit's kernel mentioned in his postmarketos pull request boots with uart with kexecboot after I noticed he has a patch for gcc6 support and APKBUILD prepare -Werror search and replacement
I enabled CONFIG_EMU_UART_DEBUG=y, disabled CONFIG_CMDLINE_FORCE and configured kexecboot boot.cfg to use CMDLINE=console=ttyO2,115200 [email protected] vram=10300K omapfb.vram=0:8256K,1:4K,2:2040K ro rootwait root=/dev/mmcblk1p13 debug earlyprintk' to boot back to droid4-kexecboot.
tmlind said:
As a test I only verified that NotKit's kernel mentioned in his postmarketos pull request boots with uart with kexecboot after I noticed he has a patch for gcc6 support and APKBUILD prepare -Werror search and replacement
Click to expand...
Click to collapse
FYI, the postmarketos pull request mentioned above has been now merged. And I pushed out updated droid4-kexecboot images last night that now also support booting to the stock Android and SafeStrap.
I will be trying to get this thing to boot for my phone motorola electrify 2. Don't have much of knowledge but atleast trying is not going cost me alot .
mmcblk1p16 partition is usable as alternative ISO storage
tmlind said:
Interesting so it seems that the cdt.bin mmcblk1p6 partition tells mbmloader to check some partitions for content and some partitions just for the fs. I wonder if also for example cdrom mmcblk1p16 partition can be modified too that way.
Click to expand...
Click to collapse
Actually, after some trial and error I managed to turn the cdrom partition (mmcblk1p16) into something more useful. Now my maserati works as a portable "Linux booting device"
When plugged to a computer it behaves by default as a CD-ROM drive, and it's capable of booting a Linux ISO on the PC. Bear in mind that the partition size is slightly above 200 MB, so we have limited space. Apparently if mmcblk1p16 is formatted as ext3, ext4 or contains a filesystem other than ISO, the phone will NOT boot (I had to reinstall the whole Stock firmware a few times).
I could make a mini tutorial with detailed instructions.
So perhaps this partition could be useful for storing a customised read-only distro for the maserati, similar to a Live environment. Or at least capable of booting a minimum environment with essential files.
I'd like to test your kexec files as soon as I can, but still need to understand the whole process. About to receive a second maserati for tests
Cheers!
dinosaur99 said:
Actually, after some trial and error I managed to turn the cdrom partition (mmcblk1p16) into something more useful. Now my maserati works as a portable "Linux booting device"
Click to expand...
Click to collapse
Hey that's great! FYI, one more thing to consider is that I noticed allow-mbmloader-flashing-mbm.bin is more permissive compared to mbm.bin. They seem to parse some permissions table from cdt.bin. I guess it would not be too hard to figure out that format if somebody cares. And I now also wonder if using cdt.bin_patch instead of cdt.bin is even more permissive?
Anyways, do not mess with the mbmloader.bin or allow-mbmloader-flashing-mbm.bin partitions though that can brick the device..
tmlind said:
FYI, the postmarketos pull request mentioned above has been now merged. And I pushed out updated droid4-kexecboot images last night that now also support booting to the stock Android and SafeStrap.
Click to expand...
Click to collapse
Thank you for your excellent work!
Can't boot to safestrap
This is my first approach to boot something other than Android. Not very usable though, but I got this far.
I first installed droid4-kexecboot following instructions on README, and created the boot/boot.cfg on a fresh EXT4 sdcard by copying the sample rom-slot1 and rom-slot2 entries. After reboot, kexecboot shows a very nice graphical menu, and loads successfully all configurations. Unfortunately the slot entries don't work from kexecboot (phone restarts). However I can load Safestrap and boot stock and both ROM slots.
Then I built latest postmarketOS for Droid 4 using pmbootstrap, and selected Weston (one of the lightweight flavours). The result is three files: kernel, initramfs and a disk image containing two partitions. In order to install pmOS into rom-slot2, I wiped all slot2 partitions and installed CM11 as explained here https://wiki.postmarketos.org/wiki/Motorola_Droid_4_(motorola-maserati) . The next steps were done locally on my laptop instead of using ADB (i.e. replace file userdata.img in rom-slot2 directory with the pmOS disk image, and also replace /etc/kexec/ramdisk.img and /etc/kexec/kernel located inside system.img with the new initramfs/kernel). Then rebooted, jumped from kexecboot to Safestrap, and it launched postmarketOS.
USB networking connects right away and SSH works.
The wiki states that Framebuffer graphics works, but I get no screen output. LCD backlight is on. Xwayland and weston are running by default.
All LEDs work.
Touchscreen, vol buttons and keyboard seem to work.
Kernel is 3.0.8.
Finally I managed to boot pmOS with kexecboot. Directory "boot" on mmcblk0p1 contains following files:
Code:
atags # borrowed from safestrap
boot.cfg
devtree # borrowed from safestrap
initramfs-motorola-maserati
vmlinuz-motorola-maserati
Here's a few facts that I don't really understand
kexecboot boots pmOS on rom-slot only if safestrap is configured to boot on that slot, otherwise it boots into something else which responds to ping, but no SSH. Why is this happening if kexecboot overrides safestrap?
Excuse my ignorance, but what is in practice the need for a devtree file, and where am I supposed to obtain it?
The kernel cmdline is apparently overriden by atags file required to boot linux 3.0.8. It seems like boot configuration is hardcoded somehow. But why doesn't it boot regular android slots?
Is it actually possible to pass something like root=/dev/mmcblk0p1 or maybe even get screen working by using a recent kernel?
Sorry if I mixed up too many different topics... just trying to sort the whole thing out.
Thanks!
Is it possible to boot LineageOS with a Linux kernel of 3.20 or higher?
dinosaur99 said:
Here's a few facts that I don't really understand
kexecboot boots pmOS on rom-slot only if safestrap is configured to boot on that slot, otherwise it boots into something else which responds to ping, but no SSH. Why is this happening if kexecboot overrides safestrap?
Excuse my ignorance, but what is in practice the need for a devtree file, and where am I supposed to obtain it?
The kernel cmdline is apparently overriden by atags file required to boot linux 3.0.8. It seems like boot configuration is hardcoded somehow. But why doesn't it boot regular android slots?
Is it actually possible to pass something like root=/dev/mmcblk0p1 or maybe even get screen working by using a recent kernel?
Sorry if I mixed up too many different topics... just trying to sort the whole thing out.
Click to expand...
Click to collapse
Sorry for being slow to respond..
There is an issue with most droid4 images using the 3.0.8 kernel files and init scripts which is the scripts check the SafeStrap config from the mmc for things to mount etc.
This is no longer needed at and the scripts should be just modified to do that only if booted with safestrap. We should now just use standard Linux way meaning
parse the partitions to mount from kernel command line and so on NotKit posted some patches to sort out that as linked in the first post in this thread for the
PostmarketOK pull request. But I don't think those are applied and also the Android Images need to be updated too for LineageOS and then you can just boot
Android from whatever partition you like such as mmcblk0p1 or mmcblk1p25 in the standard Android way.
So omebody just please do standard LineageOS images that don't rely on SafeStrap!
The devtree file is only needed for old 3.0.8 kernels and is non-compatible with the current mainline kernel dtb file omap4-droid4-xt894.dtb. Motorola used custom
device tree properties and it's in big-endian format. The devtree file should be the same as what you have on the eMMC devtree partition mmcblk1p11.
Current mainline kernel still has the LCD patches pending, for v4.19-rc series I posted the pending patches I have to:
https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=droid4-pending-v4.19
Those are still being worked on though because of omapdrm changing over to use generic displays.
andeaker said:
Is it possible to boot LineageOS with a Linux kernel of 3.20 or higher?
Click to expand...
Click to collapse
See the previous post about v4.19-rc5 kernel status. No idea how much work it would be to get LineageOS images working with the
mainline kernel.. Probably at least the graphics would be an issue. Using TI's Android tree with droid4 patches backported to it might
be a good starting point if somebody wants to experiment with that, TI might have SGX540 support there for other SoCs.
how would i go about getting this working n the droid bionic? im wanting to run maemo-leste, but the latest update switched from just safestrap and ddroid, to this. and apparently trying to stupidly flash this as-is didnt work out
tvall said:
how would i go about getting this working n the droid bionic? im wanting to run maemo-leste, but the latest update switched from just safestrap and ddroid, to this. and apparently trying to stupidly flash this as-is didnt work out
Click to expand...
Click to collapse
Hmm you probably need to stick with SafeStrap for bionic, I don't think bionic uses a utags partition that's needed for the kernel cmdline.
tmlind said:
So omebody just please do standard LineageOS images that don't rely on SafeStrap!
Click to expand...
Click to collapse
I finally got around finishing writing some docs for installing LineageOS to raw partitions, please test
Make back-ups as needed first though.
For instructions, see files PARTITIONS and INSTALL at:
https://github.com/tmlind/droid4-kexecboot
hope this is on-topic - is it possible to use this to boot an OS that's installed on the SD card? I don't have D4 yet, but am waiting to receive one in the next few weeks.
sicelo.m said:
hope this is on-topic - is it possible to use this to boot an OS that's installed on the SD card? I don't have D4 yet, but am waiting to receive one in the next few weeks.
Click to expand...
Click to collapse
Yeah you can boot whatever Linux distro(s) you prefer from the SD card with the current mainline kernel and few pending patches.
That's all work in progress though, certainly usable for tinkering though
I doubt that booting Android on the SD card currently works though.

Categories

Resources