yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] kokotas:
Hi guys,

Thank you arif-ali!

I'll try to do my best even though I've never considerer myself suitable to handle such a project. Anyways this should be fun:)

Ok, now I got it. Consider it already added.

I did a little search on ntfs and I have added the necessary code for choosing between vfat / ntfs for mmcblk0p1. But it is not functional! I mean in order to call it functional we should be able to:

Create the ntfs partition

Mount/unmount the partition

Till now I'm not able to cross compile the mkntfs binary, for (a).

Here I found the ntfs-3g bin which is all we want for (b).

Will keep on trying...

Thanks for pointing that out. And for searching on your own:good:

This is the code responsible for getting the file system from the backup's name:

// Parse backup filename to extract the file system before wiping
first_period = Backup_FileName.find(".");
if (first_period == string::npos) {
LOGE("Unable to find file system (first period).\n");
return false;
}
Restore_File_System = Backup_FileName.substr(first_period + 1, Backup_FileName.size() - first_period - 1);
second_period = Restore_File_System.find(".");
if (second_period == string::npos) {
LOGE("Unable to find file system (second period).\n");
return false;
}
Restore_File_System.resize(second_period);
LOGI("Restore file system is: '%s'.\n", Restore_File_System.c_str());
Current_File_System = Restore_File_System;

Since that intermediate folder is the default way official TWRP works I believe I should leave it like that to avoid any issues like this in the next version.

Regards!
[HD2 Android NAND Development] Dark_Avenger:
Hi kokotas,

TWRP v2.3.3.0 is out. Could you please build both original (maybe with bug fixes) and modified by you (with extended functionality) versions for our HD2?

Thanks in advance
[HD2 Android NAND Development] NYLimited:
I assume Tytung's ROM can mount an ntfs partition. Can anyone confirm this? I have not looked in his init.rc recently but I do not recall any ntfs mentions in there off-hand. That is where he would have to mount the partition if he was to do it I believe. Anyway, as I said, it has been a while since I played with that file.

Well, it would be prettier without it but I suspect you are correct. Not a major issue one way or the other. HOWEVER, I am not convinced that the current version of Titanium Backup will read the files correctly regardless of the path used.
[HD2 Android NAND Development] MarkAtHome:
+1
[HD2 Android NAND Development] pathologo:
Seems the new versions are broken as .android_secure is being shown with 0 MB and nothing of it will be backed up.

The former versions by arif-ali didn't have that problem.

Any chance to fix that?
[HD2 Android NAND Development] Dark_Avenger:
It's working for me. I've moved one application to sdcard and .android_secure is not empty any more. Backup is successful. Do you have something in your .android_secure folder (check with PC after mounting the sdcard)?
[HD2 Android NAND Development] pathologo:
I didn't think I have to mention it, but yes, the folder is not empty.;) The folder contents is even shown in TWRP's file manager.

But the backup screen is always showing .android_secure(0) and the backup file and-sec.vfat.win is only a few bytes in size.
[HD2 Android NAND Development] Dark_Avenger:
Probably the recovery.log will help kokotas to track down the problem. Please attach recovery.log here.

BTW... did you try "Refresh sizes" button in "Backup" page?
[HD2 Android NAND Development] pathologo:
OK, here are some parts of the log:

Finished running boot script.
I:Processing '/boot'
I:Processing '/cache'
I:Processing '/data'
I:Processing '/misc'
I:Processing '/recovery'
I:Processing '/sdcard'
I:Created '/and-sec' folder.
I:Processing '/system'
I:Processing '/sd-ext'
Updating partition details...

Backing up Android Secure...
I:Backup command: 'cd /and-sec && tar -cz -f '/sdcard/TWRP/BACKUPS/2012-12-20--14-23-41//and-sec.vfat.win' ./*'
tar: ./*: No such file or directory
tar: error exit delayed from previous errors
I:Partition Backup time: 0
* Generating md5...
* MD5 Created.

With TWRP v2.1.0 it looks like that:

[.ANDROID_SECURE (32 MB)]
...Backing up /sdcard/.android_secure partition.
I:Backup command: 'cd /sdcard/.android_secure && tar -czv -f /sdcard/TWRP/BACKUPS/0000000000000000/2012-12-20--15-17-07/and-sec.vfat.win ./*'
I:Set page: 'clear_vars'
I:Set page: 'backup'
* Done.
* Verifying backup size.
* File size: 31358582 bytes.
* Generating md5...
....MD5 Created.
[.ANDROID_SECURE DONE (19 SECONDS)]

So I don't know why the new version creates the folder /and-sec and why it tries to backup that empty folder instead of /sdcard/.android_secure.
[HD2 Android NAND Development] NYLimited:
A good catch! Looking back at my own captures of the created files I can see something being backed up but not much:

http://xdaforums.com/showpost.php?p=35451238&postcount=288
[HD2 Android NAND Development] Dark_Avenger:
I don't have such problems, but I'm using the original (unmodified) version 2.3.2.3.
[HD2 Android NAND Development] pathologo:
I just flashed that unmodded version and now I see that /sdcard/.android_secure is being mounted on /and-sec and the displayed size and backup of .android_secure is fine.

So some change in the modded version is preventing that mount...

Btw, kokotas, many many thanks for your ongoing work on your projects like cLK and TWRP. That's really great stuff!
[HD2 Android NAND Development] NYLimited:
I am confused. Where did an HD2 specific unmodified 2.3.2 come from? I thought TWRP was no longer making HD2 versions. I don't recall what the last .3 means but I didn't think it stood for the HD2...

---

No one can make you feel inferior without your consent... (via Tapatalk)
[HD2 Android NAND Development] Dark_Avenger:
This version (2.3.2.3) has been compiled by kokotas too. See my signature for a link.
[HD2 Android NAND Development] NYLimited:
I would have seen that if I wasn't using Tapatalk (which doesn't show signatures).. :mad:

More things to play with before the world ends tomorrow! :D Anyway, if I remember correctly that version is not good for Magldr..

---

No one can make you feel inferior without your consent... (via Tapatalk)
[HD2 Android NAND Development] MarkAtHome:
That's great. FWIW, I

never

create partitions via my phone, as it is always done from my PC, so to me, (a) doesn't matter. As long as it can be mounted/unmounted, and written to and read from, I'm happy.
[HD2 Android NAND Development] NYLimited:
Same here but I think the app should remain consistent across the file systems so it should work, I suppose. Who suggested ntfs, anyway? :p

---

No one can make you feel inferior without your consent... (via Tapatalk)
[HD2 Android NAND Development] MarkAtHome:
Moi!
[HD2 Android NAND Development] kokotas:
Hello guys,

Attached below is a new compiled version of TWRP - Extended:

Ported commits from mainline 2.3.3.0.

Changed how the DataOnExt will be handled.

Under "Settings" you'll find a checkbox with which you can "tell" recovery that you're using DataOnExt or not.

In case you're using a modified DataOnExt method you can set the actual path of your /data (i.e. /sd-ext/%RomName%/data) by hitting DataOnExt button.

Probably fixed the .android-secure bug.

Reverted the backup path(BACKUPS/htcleo/).

So you have to create an intermediate folder named "htcleo" under BACKUPS and move your backups inside.

Reverted the max size for splitting archive to 1.5GB.

1st attempt for saving the contents of your ext partition when you change the fs type (will need enough free space on your sdcard for this to work).

Added option to set the number of mounts that will trigger a filesystem check under "Settings".

Added option to wipe Data, Boot and (cLK)sBoot under "wipe" Menu.

Added necessary code for selecting fs type (vfat / ntfs) for /sdcard but since I can't make it function properly I've disabled it in the UI. (Also in case it will work using the ntfsprogs binaries, the size of the recovery will increase to ~ 8MB)

Uploaded all I've done to github repo.

Merry Christmas and Have fun:)

Regards!
[HD2 Android NAND Development] 0719andy:
Merry Christmas! Thank you very much!
[HD2 Android NAND Development] Dark_Avenger:
Merry Christmas, kokotas!

Small bug: this option is not preserved on reboot. Change from default 10 months to 6 months and reboot to recovery - option is again 10 months.
[HD2 Android NAND Development] Nitro_123:
THAAANK YOU :D :D

I sooo wanted this to be ported :D

This is my Christmas present :D

Merry Christmas everyone !
[HD2 Android NAND Development] MarkAtHome:
Thanks for your hard work, Kokotas -- it is appreciated.

I just installed it and have a request. Please put back the original ugly, green HTC logo displayed before (I have not checked, but that would include after) the Team Win logo. That is part of the memory used by HD2's

second

bootscreen (and Tytung's LOGO.RLE, I think), and I use that area for a watermark (have done so forever). I do not believe that recovery should be accessing that portion of memory.

Best regards and Merry Christmas you and yours,

Mark
[HD2 Android NAND Development] g.andy:
How to flash??

Thanks and marry Christmas!!!!!

Inviato dal mio multiboot HD2
[HD2 Android NAND Development] pappt:
flash this one from recovery
[HD2 Android NAND Development] g.andy:
Thanks!!!! In CLK i must resize the partion of recovery? 7mb or 8mb? Actually i have CLK 1.5.1.6 with 6mb for touch recovery

Inviato dal mio multiboot HD2
[HD2 Android NAND Development] pappt:
6 MB is OK...
[HD2 Android NAND Development] NYLimited:
Nice touch on the DALVIK ON NAND switch! I don't use it myself but it will probably be appreciated by others who are. :)

The one thing that seems confusing to me is the DataOnEXT switch. Without this switch I simply select sd-ext and uncheck data before doing a backup. If DataOnEXT is checked in setup the backup screen shows sd-ext selected. Again, it is all the same to me but should not data be selected, showing with sd-ext size? Not sure which will be less confusing to people.

​

The logo remains - When the device is rebooted I see the ugly one again. :) it is seemingly only suppressed when twrp loads...

Happy holidays, everyone!

---

Be yourself; everyone else is already taken... (via Tapatalk)
[HD2 Android NAND Development] pathologo:
Unfortunately no.

Thanks and Merry Christmas!:)
[HD2 Android NAND Development] Dhruna:
Hi,

Can we use the above recovery from SD card itself instead flashing on the ROM as I am using WP7? Or we have to wait for a verison which supports AD SD boot like 4EXT ?

Thanks.

Merry Christmas!
[HD2 Android NAND Development] sunitknandi:
Thanks kokotas for this wonderful recovery.

Just a small request. Could you please make the DataOnExt and other options persistent on reboot in the settings menu?

Every time I reboot recovery, most of the settings I change get lost.

Sent with love from me to you via HTC HD2
[HD2 Android NAND Development] Dark_Avenger:
Did you try "Refresh size" button? It's working for me.
[HD2 Android NAND Development] pathologo:
Sure, but unfortunately it's not working here.

kokotas, I see that TWRP now automatically deselects partitions with 0 size, so the recovery.log now doesn't contain anything about .android_secure - no backup messages but also no errors. No and-sec files in the backup folder.

The interface is still showing .android_secure(0) and /and-sec is still empty because /sdcard/.android_secure is not being mounted to it.

/sdcard/.android_secure does exist and the TWRP file manager is showing some files inside.

Thanks and Merry Christmas!
[HD2 Android NAND Development] Dark_Avenger:
Hi kokotas,

today I've decided to test the new "Partition SD Card" option with sd-ext and sdext2 partitions. I wanted my setup to look like:

- /sdcard (vfat)

- /sd-ext -> 1024 MB (ext4)

- /sdext2 -> 1024 MB (ext4)

- /swap -> 0 MB

When the log shows "Creating 2nd EXT partition..." TWRP restarts itself. After the restart I can wipe (Wipe -> SD-Ext) /sd-ext, but when I tried to do the same (Wipe -> SDExt2) with /sdext2 it failed.

Log shows:

E:Wipe: Unable to find partition for path '/sdext2'

Note that the option for wiping is available - somehow the /sdext2 is detected. Could you try to reproduce and fix it?

Another interesting log:

Creating EXT partition...

I:Command is: 'parted /dev/block/mmcblk0 mkpartfs primary ext2 6086MB 7110MB'

Creating 2nd EXT partition...

I:Command is: 'parted /dev/block/mmcblk0 mkpartfs primary ext2 7110MB 8134MB'

Formatting /dev/block/mmcblk0 as ext4...

I:Formatting sd-ext after partitioning, command: 'mke2fs -t ext4 -m 0 /dev/block/mmcblk0'

mke2fs 1.41.12 (17-May-2010)

/dev/block/mmcblk0 is apparently in use by the system; will not make a filesystem here!

tune2fs: Bad magic number in super-block while trying to open /dev/block/mmcblk0

Couldn't find valid filesystem superblock.

tune2fs 1.41.12 (17-May-2010)

Formatting /dev/block/mmcblk0p3 as ext4...

... and here is the reboot

Without /sdext2 partition the partitioning works fine.

Thanks
[HD2 Android NAND Development] MarkAtHome:
Yes and no. The green logo remains, but just preceding it being displayed, is a white logo (different typeface) -- the exact text escapes me at the moment. The white logo was not there before.
[HD2 Android NAND Development] NYLimited:
Guess I didn't pay enough attention.. :eek:
[HD2 Android NAND Development] kokotas:
Hey guys,

I've compiled a new version to hopefully handle the errors found in the rev1 of 2.3.3.0.

HD2's Extended TWRP 2.3.3.0 rev2 changes:

2nd attempt to fix the .android_secure bug.

1st attempt to fix the crash of sd card's partitioning when adding 2nd ext partition.

Reverted the logo to the default one.

New settings for fs-check and DataOnExt will be saved and not lost after a reset.

Switched the type of release from just an img-file to a flashable-zip with a script to check recovery's partition size before updating.

Regards!
[HD2 Android NAND Development] Dark_Avenger:
Thanks, kokotas.

I can confirm that "sd card's partitioning when adding 2nd ext partition" issue is fixed! The settings for fs-check survives reboot too. Good work.

I want to share with all users of kokotas extended TWRP recovery my theme. It is based on Holo Dark, but I kept the look of the buttons.

To install it create a folder "theme" under TWRP and place the "ui.zip" in there: "/sdcard/TWRP/theme/ui.zip"

Kokotas, if you like my theme you could make it default in the next build.
[HD2 Android NAND Development] NYLimited:
I haven't looked yet - is this to be flashed or... ?
[HD2 Android NAND Development] kikisp:
@ ny limited

no..i think that you should make theme folder in main twrp folder on sd card,and put it there..
[HD2 Android NAND Development] pathologo:
After booting recovery it shows .android_secure(47), but backup of this partition fails and it is then shown as 0.

It is also shown as 0 when you refresh the size before trying to backup.

After unmounting SD card and refreshing the size it is fine again and backup succeeds.

Almost there!:fingers-crossed:
[HD2 Android NAND Development] Suhaib10:
Hey guyz is it possible to make this avaliable for WP7/native-sd users like 4EXT
[HD2 Android NAND Development] pioterek2666:
Dont forget about winmo users too!
[HD2 Android NAND Development] sunitknandi:
I am having trouble backing up or restoring anything. /sdcard is mounted and I can see files in file manager, but I cannot perform any action.

Here's the recovery log.

Sent with love from me to you via HTC HD2
[HD2 Android NAND Development] Dark_Avenger:
sunitknandim,

how did you partition the SD card? Are you using the rev2 version for partitioning?

Your /sd-ext is 2GB and your /sdext2 is 30 GB. It seems that you don't have FAT32 partition (/sdcard). Do the SD partitioning again with TWRP 2.3.3.0 rev2.

---------- Post added at 11:27 AM ---------- Previous post was at 11:04 AM ----------

Create a folder "theme" under TWRP on your SD card and place the ui.zip in there.

"/sdcard/TWRP/theme/ui.zip"
[HD2 Android NAND Development] kokotas:
Thanks for the feedback! I believe it is fixed now. The backup_size was set to 0 and as you noticed TWRP will not backup anything if its backup_size is 0.

if ((*iter)->Backup_Size == 0) {
DataManager::SetValue(TW_HAS_ANDROID_SECURE, 0);
DataManager::SetValue(TW_BACKUP_ANDSEC_VAR, 0);
} else
DataManager::SetValue(TW_HAS_ANDROID_SECURE, 1);

In fact, if I remember right in one of the versions I posted I had removed that part of the code. That's why even though it continued to show (0) for and-sec's size it would backup its contents. Anyways...

Just did a backup and tested "Refresh sizes" button a couple of times and new version is working ok.

I am attaching the sd-version below, BUT I didn't test it. So if you try it, please let us know how it went.

Thank you for the theme and for your helpful feedback:good:

I think I'd better let the default theme as it is. After all, it is soo easy to use any other theme(just a copy-paste of ui.zip).

Hello guys,

A quick fix to last version to close the (annoying:mad:) issue with .android_secure.

Lets see how it goes...

HD2's Extended TWRP 2.3.3.0 rev3 changes:

3rd attempt to fix the .android_secure bug.

SD version is available but untested.

Regards!
[HD2 Android NAND Development] djsolidsnake86:
this program do the same things of 4ext and cwrm right? using the same backup folders?
[HD2 Android NAND Development] sunitknandi:
Nope. My /sdcard is 30 GB and /sd-ext was 2 GB. Works fine in Android and old rev 1 recovery.

Will try rev 3 and report.

Sent with love from me to you via HTC HD2
[HD2 Android NAND Development] pathologo:
All is good now and working as it should.:) Thanks for your effort, very good stuff pal!
[HD2 Android NAND Development] kokotas:
I've been using CWM but never used 4EXT Recovery.

I guess the core functions are more all less the same for the end-user.

The extra features (like built-in NativeSD manager, File-system convertion, etc.) may be missing depending on which recovery type you'd use.

Nope. TWPR uses different folder and different format for the backups.

There was a relevant question regarding this here.

You can convert your CWM backups to be TWRP compatible, BUT you have to do it manually.

Regards!
[HD2 Android NAND Development] jwchips:
Hey kokatos, thanks for another brilliant app for our hd2, your work is always appreciated. Would you mind telling me where I can find the data on ext setting as I've had a good hunt but can't seem to find it. It is an option when you start to back up?
[HD2 Android NAND Development] Dhruna:
Can we have a SD build of this TWRP ? so that we can use it with WP7?

Thanks
[HD2 Android NAND Development] zexmunze:
Seriously,can you read,DON'T BE SO LAZY and use search button next time,go 1 page back and you will find answer to your question....
[HD2 Android NAND Development] Dhruna:
Sorry, I saw that link which is mention in the post .

Thanks you.
[HD2 Android NAND Development] kokotas:
Enter "Settings" and you'll find a checkbox about DataOnExt.

If you have it checked you should also see a new button named "DataOnExt".

By pressing it you can :

(a) set the actual path mounted as /data in case you're using a modified method of DataOnExt,

(b) make TWRP backup userdata partition in case you have something there (like DalvikOnNand)

Did you try it? Does it work ok?

Regards!
[HD2 Android NAND Development] jwchips:
That's what I thought but it isn't there. Screenshot attached.
[HD2 Android NAND Development] Dark_Avenger:
You don't have /sd-ext partition. This option is not visible if sd-ext partition is not detected.

kokotas,

please remove the debug message about android_secure detect/size folder from the log in the next build. Log message starting with "E:" makes me think that something is not working correctly :)

Thank you very much. Appreciate your great work on cLK Black and TWRP.
[HD2 Android NAND Development] jwchips:
You mean TWRP isn't detecting my sd-ext partition =). The device has a 16gb Samsung micro shdc card with a 2gb sd-ext partition that was originally formatted with cwm. Its also running DalvikOnNand on the rom fine so the sd card (and partitions) are present and readable by the device.
[HD2 Android NAND Development] kokotas:
OK, lets see what's the problem here...

I have set it up in such way that it depends on the presence of the ext partition. EDIT-START : Dark_Avenger beat me to it:D /EDIT-END

See the bold condition in the code below:

<object type="checkbox">
[B][U]<condition var1="tw_has_sdext_partition" var2="1" />[/U][/B]
<placement x="%col1_x%" y="%row7_text_y%" />
<font resource="font" color="%text_color%" />
<text>Setup recovery for DataOnExt.</text>
<data variable="tw_data_on_ext" />
<image checked="checkbox_true" unchecked="checkbox_false" />
</object>

If no ext partition is detected then no DataOnExt is possible, so that option won't be shown.

Is this the case here? EDIT-START : Never-mind, just saw your previous post /EDIT-END

If not, then I'll have to check why TWRP doesn't detect correctly the existing partitions and their sizes.

Could you attach the recovery.log here?

Will do in next version. Just forgot about it while trying to fix the relevant problem.

Regards!
[HD2 Android NAND Development] jwchips:
Unfortunately I cannot see the bold formatting on my mobile but I get the idea. But I *do* have a sd-ext partition that works when I'm booted into my ROM. I've tried mounting my sd-ext partition in mount settings of TWRP and it won't work.

I've checked the terminal output in TWRP (middle icon) and after 'finished running boot script' there is a error E:unknown file system: 59aaea38-xxxxxx... (this ID also goes off screen and not onto a new line so I can't grab the whole ID). Of I try to mount sd-ext I get an error :e:mount: unable to find partition for path /sd-... (this error goes off screen again). I'm 100% sure my sd-ext partition is fine as my leo512 shows my 2gb partition in device storage in the ROM.

If there's any more info you need or anything I can do to help you get to the bottom of this let me know.
[HD2 Android NAND Development] Dark_Avenger:
Probably full recovery.log will help here.
[HD2 Android NAND Development] kokotas:
It is probably something with TWRP getting the current partitions and sizes.

The recovery.log could be helpful. Even though I think I can reproduce it by changing the partitions on my spare card using a PC and then inserting it in my device.

Regards!
[HD2 Android NAND Development] jwchips:
Click for log. Sorry I missed your edit. Also I have to wait a few mins for the sd card to be usable in the ROM as it takes a while to check for errors on each boot. Do they know if it has any implications as I thought it only checked the fat partition for errors?
[HD2 Android NAND Development] kokotas:
Thanks! Will check it out.

EDIT-START : Just read it. It seems that the mmcblk0p2 is not accessible while mmcblk0p3 is your 2GB ext partition. Do you have an unknown(?) partition before your ext? [/EDIT-END]

One last thing: 'cat /proc/partitions' when in TWRP

Regards!
[HD2 Android NAND Development] jwchips:
New log here. Umm not as far as I'm aware - this is my girlfriends phone with one of my old cards. Afaik it should just be formatted by Cwm with 2gb sd-ext and 0mb swap.
[HD2 Android NAND Development] kokotas:
I think I know what happened but I am not sure why..

Let me explain what I mean based on your log.

...
I:Processing '/sd-ext'
E:Unknown File System: '59aaea38-d680-49a2-ae07-f12089951eb8'
...

The What :

Regardless of the recovery.fstab settings, TWRP double-checks the file-system by running a simple blkid cmd.

i.e. "blkid /dev/block/mmcblk0p2" has an output like this:

/dev/block/mmcblk0p2: UUID="03e7b28e-1686-46c0-9b07-9a9be7b33b5a" TYPE="ext3"

TWRP processes that output so that we get just the file-system type (in the above example it would return 'ext3').

However, in your case, instead of the file system type, TWRP returned the UUID while parsing the output of blkid.

The Why:

I can't think of a reason now.:confused: You could run "blkid /dev/block/mmcblk0p2" and post the output here.

I could also edit the code so that it would never return the UUID.

Regards!