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

Search This thread

Mentor.37

Senior Member
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
 
Last edited by a moderator:

jaqjacek

Senior Member
Jan 29, 2011
50
4
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.
 

lucize

Senior Member
Aug 1, 2012
246
166
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.


could the partitions be formated fs2fs ?

Regards
 

Mentor.37

Senior Member
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.
 
Last edited:

Mentor.37

Senior Member
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.
 
Last edited:
  • Like
Reactions: sd_shadow

lucize

Senior Member
Aug 1, 2012
246
166
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.

I was thinking to add fs2fs support to the kernel and see how it works, like otterx project.

thanks for your work !
regards
 

X_Files

Member
Jan 21, 2007
27
5
Těrlcity
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.
 

Mentor.37

Senior Member
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.
 
Last edited:

X_Files

Member
Jan 21, 2007
27
5
Těrlcity
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.

Excellent! It works like a charm! Now i can swap SD-card and internal storage etc... Thank you Mentor!
 

moodroid

Senior Member
Jun 7, 2011
137
31
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.
 

Borchuck

Senior Member
Jul 8, 2014
276
41
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.

Can you also add patch for cm 10.2.1 ?
 

Mentor.37

Senior Member
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
 

Borchuck

Senior Member
Jul 8, 2014
276
41
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

For some strange reason I cannot repack new ramdisk.img for cm 10.2.1
 

dutohlav

New member
Feb 22, 2015
1
0
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!
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,957
2
9,969
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
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!

Both preinstalled and Webtop should have data in them, before you wipe them, what are total sizes?

Sent from my XT907 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    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
    6
    Is the source code to this available anywhere? I would like to experiment with using different combinations of webtop and preinstall as installation partitions and obviously I need to modify the recovery in order to achieve this. It would be nice to be able to build on the work here rather than start from scratch.

    So I eventually got around to this. Here it is: https://github.com/timangus/droid4 . Basically it's a way to use the /webtop partition as /system so that you can fit a gapps package on there easily.
    5
    ramdisks for cm11, cm12.1 and cm13

    A lot of users from the xt894 and xt912 sections asked me in pm an help to build updates ramdisks for cm12.1 and a ramdisk for cm13 because with the old builds and with their own builds they had a phone restart after the kexec vibration, this happened because now the ramdisks have to be built as superuser to not break the new selinux permissions.

    Anyway yesterday I built new ramdisks for the last versions of the cm11 and cm12.1 and a ramdisk for cm13 based on the 22 nightly that will work also on the further updates until some relevant thing will not change in the ramdisk.

    I provided the ramdisks in a zip that can be flashed in recovery that also install a script to make the ramdisk persistent at the rom updates so you don't have to install the ramdisk every time, you only have to update the rom and the ramdisk will be automatically replaced.

    I'm not more using my droid 4 so i haven't personally tested the ramdisks, let me know if there are problems.

    Download
    5
    So, finally here is a working ramdisk for CM 12.1 20150515 :) Attached as ramdisk-update.zip

    Works fine, tested :) @Mentor.37, you can add it to post #2 if you want to.

    Also attached is mini kitchen I created for unpacking and repacking the CM 12 ramdisk as I was tired of the whole process of splitting, unpacking, packing, merging, and packaging into flashable zip - ramdisk-kitchen.zip. How to use:
    Code:
    Kitchen for unpacking and repacking ramdisk for CM 12+
    
    Works on UNIX only. Install zip to have it also automatedly create flashable zip on repack (on Gentoo # emerge zip).
    
    Contents:
    unpack.sh
    repack.sh
    ramdisk.img - ramdisk extracted from cm-12.1-20150515-NIGHTLY-maserati.zip
    update-empty.zip - empty update for Safestrap (based off Mentor.37's ramdisk updates)
    howto-use.txt - this help :)
    
    Usage:
    0. unpack all to some a working directory
    1. if you want to, replace ramdisk.img by ramdisk you want to edit. Provided one is from cm-12.1-20150515-NIGHTLY-maserati.zip
    2. $ sh unpack.sh
    3. now you have the ramdisk unpacked in ./kitchen/table/ and in ./kitchen/ there also are the two files of which the original ramdisk consisted. Edit whatever you want in ./kitchen/table/ and don't delete ./kitchen/safestrapped.cpio
    4. when done editing, run $ sh repack.sh
    5. now ./output/ramdisk.img was created, and if you have zip installed, also ./output/ramdisk-update.zip
    6. install ramdisk-update.zip in Safestrap :) Or put ramdisk.img to update-empty.zip/system/etc/kexec/ and use this one if ramdisk-update.zip not created automatically.
    
    Hope it helps. Created for editing ramdisk for CM 12.1 to be compatible with Mentor.37's Safestrap 3.75 for unused partitions of Motorola Droid 4 (http://xdaforums.com/droid-4/development/wip-safestrap-3-75-unused-partitions-t3023932) by LuH (http://xdaforums.com/member.php?u=566662)

    EDIT: I'm not sure how compatible unpacking is with other versions of combined ramdisk (if any other exist) - it does not search for start of second file, just splits it after 144 bytes. At first I tried to split it by content, but could not find any working way (i.e. this creates over 1800 random parts).

    Looks like all the tools I tried fail to read binary correctly. See "od -xca ramdisk.img | less": ascii output (second line) is right, hexadecimal (first line) is wrong - e.g. on line 0000220:
    Code:
    0000220    8b1f    0008    0000    0000    0300    7dbc    7c09    5553
            037 213  \b  \0  \0  \0  \0  \0  \0 003 274   }  \t   |   S   U
             us  vt  bs nul nul nul nul nul nul etx   <   }  ht   |   S   U
    third and fourth byte are switched in hex, but OK in ASCII and named output (it should be 8b1f 0800 in hex).
    3
    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.