yashsingh1/xdaforums huggingface dataset:
[Motorola Droid 4] Mentor.37:
This is the better and safer way to reuse these unused partitions.

We can't alterate the partitions layout because we can't touch the partition table in the real ramdisk that is in the boot.img because we have a locked bootloader.

Everything that is done by safestrap is virtual.

If for you the Safe Slot is unusable you can mount these partitions in someway with a script init.d, these scripts are executed by the rom and not by safestrap.

If you want setup some symlinks in safestrap in someway you can also do this, you have to edit the safestrap's ramdisk and the rom's ramdisk but you can't do this for the stock rom in the stock slot that uses the real boot.img and you can't touch it, otherwise you should use a kexec kernel with a virtual ramdisk also for the stock rom.

If you want share /data partitions with the Stock Slot and the Safe Slot you can do this but if you do not use the same rom in both then one of the two will be in bootloop because will have incoherent data in /data, at this point why you do not directly install a rom in the Stock Slot?

If you want use /preinstall for data partition in the the Stock Slot and /data for data partition in the Safe Slot also this can be done but if there will be a problem in SafeStrap or if you will uninstall SafeStrap you will have incherent data in the Stock Slot.

If you want create a slot in the internal sdcard this is not a good idea, is more convenient use the external sdcard, you should create your three real partitions and you should completely edit SafeStrap.

Answering at your last question there is not any source for this my version of SafeStrap, i worked reverse engineering the official SafeStrap 3.75.
[Motorola Droid 4] LuH:
Thanks, I think you just adressed problems I would eventually stumble upon :)
[Motorola Droid 4] dreikk91:
and what will happen if you create the internal flash drive partition 2gb size ext3 and mount it as a data partition?
[Motorola Droid 4] Borchuck:
Is it possible to use kexec kernel with stock rom?
[Motorola Droid 4] ferviverus:
[MENTION=5938399]Borchuck[/MENTION]

Probably no, but why u want to do that?

Fervi
[Motorola Droid 4] Borchuck:
Because it' offers new possibilities like overclocking or call recording.
[Motorola Droid 4] ferviverus:
[MENTION=5938399]Borchuck[/MENTION]

You can overclock your stock rom

http://xdaforums.com/droid-4/development/stock-overclock-t3060269

I don't have any news about call recording, but some apps do that

Fervi
[Motorola Droid 4] Borchuck:
I didn't found any app that could properly record both sides on our Droid 4... :(
[Motorola Droid 4] LuH:
Basically the CM12 ramdisk.img are two gzipped archives joined into one file. As Mentor.37 explains in his OP, to make changes thereyou need to split it, unpack and edit the second one, repack it and join again.

Here is my WIP folder (sorry for mess, replying from phone, left my laptop elsewhere and didn't intend it for sharing) where I'm trying to understand how it works to make some changes to have bigger space for data in the safe slot: https://drive.google.com/folder/d/0B4tE7o9KMe1kdm56U1lxWkEzUTQ/edit

You can find the split parts in mentor-ss/cm12's.../system/etc/kexec: ramdisk-safestrapped.img is the first (small) archive that you can ungzip right away and ramdisk-ramdisk.gz is the second archive containing actual ramdisk (unpacked there as well, it's ramdisk-ramdisk).

The files may change as I work with them later on when I get back to my computer - take it as is :)

What I am curious about now is how to edit ramdisk safely - I'm a bit afraid because there's a lot of stuff I don't know. If I just add some lines in the initialization block, won't it break? Is there any integrity check?

Does CM12 run /etc/init.d/*.sh scripts, and if so, when?

Cross-thread quote - hope it will work:

As Mentor.37 said few posts earlier here, I should reverse engineer his safestrap if I want to meddle with it, but that's currently too advanced for me. I'll probably try digging into ramdisk and various scripts run by it for now - hot candidate is /system/bin/load-modules.sh.

Understood, thanks :)

I'm not sure whether safestrap sits in system or data. If in data, then my suggestion doesn't make sense, but if in system, then I can wipe stock data and in case of some horrible crash of safe system back it up, wipe and boot into clean (yet with root and safestrap) stock system.

Yes, but again I hope it would somehow settle for boot up like as if it had a ROM update - not to use it regularly, just as an emergency backup.

But could you share the work you compiled into apk, please? I mean specifically your additions/changes you made to stargo's 3.75 that's available at github. I'm hoping I could learn from it how you did it so it would be easier for me to try implementing different changes I have in mind - I never programmed for Android nor compiled an apk so I'm kind of lost here...

My aim is that after I find some meaningful changes to ramdisk or init scripts to utilize D4's internal memory to suit my needs, I want to make Safestrap compatible with it so such system can be backed up and restored by TWRP's integrated backup/restore.
[Motorola Droid 4] lucize:
[MENTION=5003013]Mentor.37[/MENTION] why not mount cache as /system and the small partition as cache ? So in that way there are no problems with gapps

Regards
[Motorola Droid 4] Shani Ace:
I currently got Safestrap 3.75 and CM12 (nightly) running on a virtual slot for which I took as much space as possible (/system 984MB, /data 3740MB and /cache 994MB).

Did I get this right?

I boot to stock, uninstall Recovery via Safestrap, uninstall SS and then install Mentor's SS.

Then after a reboot to recovery I flash the "cm12's ramdisk for safestrap for unused partitions.zip", format /data as ext3 and everything should be working fine + faster?
[Motorola Droid 4] Mentor.37:
To leave untouched the stock slot, this is the main aim of safestrap, otherwise if you don't want leave untouched the stock slot's structure then why not install directly in it?

I remember you that /cache is shared between the stock slot and the safe slot.

You will have a faster system only installing the rom in the safe slot, using any other virtual slot everything will be the same as the original safestrap.

I recommend to anyone who is using this my safestrap version to install this patch to perform the partitions trim at every boot.
[Motorola Droid 4] Shani Ace:
Ah, I thought maybe I could transfer the ROM from the virtual slot to the safe slot. Well then I think I'll just reinstall it into the safe slot.

But otherwise I did get everything right regarding the install procedure?

Trimming is only for people who install their ROM into the stock slot, right?

Since I read that installing CM12 into the stock slot can be dangerous, that's not an option for me.
[Motorola Droid 4] sd_shadow:
Backup Rom in Rom slot, restore it in saferoot, then flash ram fix. Zip
[Motorola Droid 4] Shani Ace:
Ah thanks, so it does work! Just backed everything up and want to start, but where can I find the apk for Mentor's special Safestrap version?
[Motorola Droid 4] sd_shadow:
Post 1 op
[Motorola Droid 4] Mentor.37:
Sure, you can backup and restore as [MENTION=4267571]sd_shadow[/MENTION] told you.

The install procedure is correct.

The trim has sense only on real partitions and not in virtual slots so the trim is for those who are using a rom in the stock slot or in the safe slot.
[Motorola Droid 4] Shani Ace:
Nope, there is no link or file attached.

Never mind though, I found it here: http://www.internauta37.altervista.org/safestrap-375-unused-partitions-preinstall-webtop

But isn't it strange that the tool this thread is about is missing in the #1 post of the OP?

Oh well in that case I'll definitely flash it, thanks for the explanation! :)

Well restoring wasn't successful (all partitions but /system were restored), maybe the file size doesn't match. But that's not a big issue, since I just recently installed the ROM.

But I got another problem: Were in TWRP can I format /data with ext3? I just looked through the menus but couldn't find a format option. On CWM there always was an option to format partitions/drives.
[Motorola Droid 4] sd_shadow:
My bad use the Downloads Tab must use browser (not app, like tapatalk or XDA app)
[Motorola Droid 4] Shani Ace:
Damn, I didn't know there is a download tab! When did the xda-forum implement this? After using the forums for so many years (actually I started way before Android, with Windows Mobile ^^) I didn't expect something like this. ;)

Seems like everything is working No it's not, it seems like Gapps aren't installed properly and I can't access the microSD in CM12 (while I can in Recovery).

I don't know why, but even in CM12 on the virtual slot1 I can't find the microSD anymore...

I flashed the zips in this order:

CM12

BETA-SuperSU-v2.48 (also tried UPDATE-SuperSU-v2.46)

ramdisk CM12

trim

patch cdma to gsm

gapps-lp-20141212-signed (ticked the verify box)

After I got into Android I unlocked dev mode and installed the Safestrap apk.

Which version of CM12 worked recently with ramdisk zip in the OP? Could it have anything to do with that?
[Motorola Droid 4] Shani Ace:
If you really wanted users to attach their SS-logs here, maybe you shouldn't hide this information in such a long posting. I mean, I saw it eventually after reading the OP about ten times, but I doubt that anyone else noticed it.

Between all the code windows and the text, you should at least make it bold and font size 30-50, otherwise no one will every know that there is an option to send logs. Maybe it would even be best to put that info right at the beginning of the OP.

Or you could just help people when your version of SS isn't working properly...

EDIT: Great, now I can't even go back into SS. Tried installing CM11 M12 with the CM11 ramdisk onto the safe slot, after flashing the zips SS said the phone is not rooted and asked me if a wanted to flash SuperSU. I swiped to flash it, but then the phone rebooted immediately. Now it just shows me a black screen on bootup and when I try to get into recovery, it just shows me a broken Android symbol (with a red !-triangle on top). Ok, after getting into the service menu with power + volup + voldown, I managed to get into SS by choosing "BP tools".

It would've been so nice to use the safe slot because the rom slot1 is really slow, but it seems like this safe slot is the opposite of safe - how do I get rid of it?
[Motorola Droid 4] Shani Ace:
Well it seems like even posting a log file as requested doesn't make Mentor.37 help his users, so is anyone else maybe able to help me?

After several tries of installing CM12 or CM11, it seems like my safe slot is f***ed up, so can I just reinstall the normal Safestrap 3.75 to erase the safe slot and the ramdisk, regain the unused partition and then try it again?

Your help would be really appreciated, if that still is worth something to some people...
[Motorola Droid 4] Borchuck:
What is your main point? Do you want to erase /preinstal and /webtop partitions?
[Motorola Droid 4] Shani Ace:
The point is, the safe slot just doesn't work. Everytime I flash the necessary zip files (as I described in my earlier post), I either get problems with Gapps or can't boot entirely into the ROM.

So I'd like to undo everything (getting rid of the defective safe slot) and then try it again from the beginning.

Because I can't touch the stock slot (need it for Webtop mode, my Lapdock just arrived today) and it doesn't work in CM12 on rom slot1) and the rom slot1 is too slow, so I'm determined to get the safe slot and CM12 (or at least CM11) working.
[Motorola Droid 4] Borchuck:
You can erase safe slot just by wiping data and system partition in safestrap (of course you have to avtivate safe slot).

I had succesfully installed cm11 and cm12 on safe slot but didn't try gapps.
[Motorola Droid 4] Mentor.37:
You should pay more attention, a lot of users attached their logs here without problems and thanks to them i have been able to provide the information that are in the OP.

Have you read and understood everything is wrote in the OP and in the Q&A thread? I do not think.

Anyway this is a development thread, its aim is to segnalate problems and not insistently ask for help.

I developed this version of safestrap for my personal use, i made it available for everyone and i documented how to use it, now if you are able to use it you are welcome, otherwise you can post in the Q&A thread and wait that someone has the time to help you or you can use the standard safestrap.

This version of SafeStrap correctly works and in the main thread is explained how to solve every kind of problem. I'm here for passion in my little free time, I do not have time to answer every stupid question.

I'm not here to tell where is the option to format /data as ext3 in SafeStrap or to tell to pay attention at what install in safe slot because its /system is only /600 mb and its /data is only 1,4 gb(it is obvious that you can not install gapps of 180 mb).

If someone has this type of problem then this does not mean that safestrap doesn't work, what is not working is another thing...
[Motorola Droid 4] Shani Ace:
Yes, I did (I'm not an ignorant beginner who doesn't read the entire OP) . Otherwise I wouldn't have discovered the log mention. I just wanted to advise you to make that sentence more visible, because it's hidden between a lot of text and there are many people who don't read the OP as thoroughly as I do.

And I also attached a log file a few posts earlier, but never got an answer to it.

I don't get it, I've been on xda devs for nine years and it never was a problem to get help from developers, whether it was for ROMs or just some tools like this one.

I know it's just a hobby, like it is for everyone here, but most devs were far more kind and showed more decency towards their users. But it seems like you don't even want to help people who use your actually pretty neat tool.

I did everything as was described in the OP, but I always get errors. So I kindly asked for help, nothing more. If you don't want to help people, just say it and no one will ask you for help.

Being able to use the Safe Slot for daily usage would be so awesome (because rom slot1 is too slow), that's why I haven't given up on it yet.

EDIT: At first I wanted to ask you where I can find that Q&A thread, but now I see that it's one of the tabs next to the Downloads tab.

I'm sorry, I'm still new to this changes at xda, not so long ago there weren't any tabs in threads.

Because of that, I thought Mentor.37 wasn't helping anyone of the users, but now I see that he did in the Q&A thread.

It would be nice if one of the mods could move my posts there, if I knew a Q&A thread existed, I would've posted my questions there directly!
[Motorola Droid 4] Mentor.37:
Honestly, the problem was not where you posted your request or the lack of logs but the impatience and the rude tone that you used.

I'm usual to make detailed main thread to avoid my presence necessary here on xda and i usually answer at never answered question in the weekends. Even the logs are not more necessary, the only problem that could occur is that /data in safe slot is seen 0 mb and in the main post is explained how to solve it.

In this case my answer was not necessary considering that there is not a new problem and that everything is wrote in the main thread.

Anyway I will be more clear with you, the correct way to try the cm11 in the safe slot is this:

1) install cm11 m12

2) install ramdisk for cm11 m12

3) install a gapps package considering the dimension of /system and /data

4) install any patch

5) format /data as ext3

If you want install a different version of cm11 or cm12 you have to consider that the ramdisk that i provided are not universal so you have to build your ramdisk as i explained in the main thread.

Do not forget that if a rom has some kind of bug this does not depend from safestrap.
[Motorola Droid 4] sd_shadow:
The tabs are part of the DevDB project, it's been around for over a year, it's the devs choice if they use the DevDB format or not.
[Motorola Droid 4] sd_shadow:
I don't think there is enough System space for any Gapps except a very small version.

There are a few small lollipop Gapps out there.

---------- Post added at 08:19 PM ---------- Previous post was at 08:17 PM ----------

sd_shadow's [Collection] of GApps

Or

http://xdaforums.com/showthread.php?t=3064693

[GAPPS] The Gapps Central - Consolidated Gapps [Updated 29-03-2015]
[Motorola Droid 4] sd_shadow:
I just installed on safe slot

cm-12-20150415-NIGHTLY-maserati.zip (224 MB)

cm12's_ramdisk_for_safestrap_for_unused_partitions.zip

pa_gapps-modular-nano-5.0.1-20150410-signed.zip (127 MB)

Partitions after installing

System: 605mb (69MB Free)

Data: 1312MB (951 MB Free)

It booted fine, it took several mins
[Motorola Droid 4] Shani Ace:
Yeah now I get that, but before it it looked to me as if there was a new problem. But thanks for helping me anyway, at least now I'm sure in which order to install the files (because I thought maybe flashing in the wrong order messed everything up) :)

I'm really sorry if I came off rude or harsh, that wasn't my intention. I guess I was just frustrated because I had this problem since the weekend, was twice in a situation where I initally couldn't boot up the device and had the phone out for hours on several days, because I was trying to get it working.

Oh, really? Now that you mention it, it makes sense! Damn, I hadn't thought of that... :/ Thanks for that hint, it actually could be the solution to my problem. All the time I thought something went wrong with flashing the ram disk (because I took the newest CM12 nightly and wasn't sure if it's compatible as Mentor.37 wrote), because somehow my microSD card didn't show up anymore in any of the ROM slots.

I'll try it now with the pico version of Gapps, because I barely need anything else than Google Play Store in the beginning. I guess I'll install Maps, Keep, Youtube and Gmail (maybe) manually, because I don't need all the other apps in the Full package.

Oh and the thing with the tabs, well that explains why I hadn't seen them before. In the last 12 month I used a Galaxy S4 with a bluetooth keyboard (before that I had the mytouch 4G slide), but after the initial install of the PAC ROM I didn't look further into the forum.

If everything should work, I'll just have to find a way to format /data as ext3 but now I got new faith that I'll manage to accomplish that. :)
[Motorola Droid 4] sd_shadow:
Had to look it up, DevDB is almost 2 years old http://xdaforums.com/showthread.php?t=2349417
[Motorola Droid 4] Shani Ace:
I'm still dazzled how I could miss that.

Now that you mention it, I actually looked up the old threads (from 2012/2013) at the MT4GS dev forums and they didn't use tabs, just that you know were I'm coming from. ;)

http://xdaforums.com/showthread.php?t=2187130

http://xdaforums.com/showthread.php?t=2551715

http://xdaforums.com/showthread.php?t=1912582

But the S4 dev forums obviously have tabs... but setting that device up with a neat ROM was soo painful and easy, I think it never was that easy with any device before or after that. But now I got the maserati with its delicious keyboard and lapdock functionality and want to get as much out of it as I can. :)
[Motorola Droid 4] sd_shadow:
DevDB is still voluntary, and Devs can convert any old thread if they want to
[Motorola Droid 4] Shani Ace:
Yeah they could, but I'm not sure if they are still active there.

Anyway, I flashed everything and it worked! I'm so happy, thank you two again, I can't tell you how much of a relief it is to finally be able to use the phone again without it being a pain in the a** and the constant flashing and trial&error! :)
[Motorola Droid 4] sd_shadow:
I've had issues with SD card and other versions of safestrap before, not sure why.

You know you can mount internal storage to pc and transfer files.

Doesn't help if only copies are on SD card though.
[Motorola Droid 4] Shani Ace:
Yeah that was my workaround while the SD card was out, but then it somehow reappeared, I'm still not sure what happened. ^^ But this time the SD card shows up correctly in CM12.

EDIT: It's noticeably faster than in the rom slot 1, as long as I let the phone have enough free space (currently 290MB). I'm glad I took the pico Gapps package, so I had some place left for bigger apps. Still had to carefully choose between them, but that's no problem at all. It's even more efficient. :) Such an incredible improvement!
[Motorola Droid 4] LuH:
Understood my mistake now, turns out you can wipe stock /system in Safestrap and it still keeps the Safestrap there, so then you can do a clean install of other ROM or whatever else you want in the Safestrap even with stock system not present.

I think Mentor.37 wants to keep his Safestrap totally stock-compatible so once Safestrap is uninstalled, stock doesn't find weird stuff in its cache or other partition. Makes sense if you ever plan on uninstalling Safestrap - not my case though.
[Motorola Droid 4] ferviverus:
[MENTION=566662]LuH[/MENTION]

Can you send me your CM 12.1? I modified ramdisk and it should works, but the ROM reset phone (the kernel is loaded, because phone vibrated on start, but i don't have CM logo)

Fervi
[Motorola Droid 4] LuH:
What do you mean? What do you want me to send? I didn't do any modifications to my system after all, so I run official CM12.1 nightly downloaded from http://download.cyanogenmod.org/?device=maserati

I'm not sure your system actually loads – I suppose the first vibration is done by Safestrap, not by loaded system. I can be wrong though - it's just an assumption.
[Motorola Droid 4] ferviverus:
[MENTION=566662]LuH[/MENTION]

Are your system works on "safe" slot?

Fervi
[Motorola Droid 4] LuH:
Nope, I use stock slot.
[Motorola Droid 4] LuH:
[MENTION=5849725]ferviverus[/MENTION] I just realized what you're asking for :) So the 12.0 ramdisk from mentor's post does not work with 12.1?
[Motorola Droid 4] LuH:
Try attached one - I just edited today's 12.1 nightly's ramdisk.

EDIT: not working. Will post good one in next post.