yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] [deXter]:
Do an "adb logcat > logfile.txt" when the phone is powered off. Connect the USB cable to the phone and the PC, power it on and wait for a couple of minutes then press Ctrl+C to end the program. Upload the logfile and link it here so that we can see exactly what's happening in the background.

Of course, you'll have to download and install the android SDK if you haven't done so already. You might also have to install the USB driver if you're on Windows. All instructions are available on the Google site.

http://developer.android.com/sdk/index.html
[Desire Android Development] [deXter]:
Patched libsqlite.so for gingerbread AOSP/CM ROMs

Hi all,

If you're on a Gingerbread AOSP/CM ROM (eg: Oxygen2), you might have realised that the patched libsqlite.so posted here doesn't work, so here's a working version, courtesy of animehq:

http://xdaforums.com/showpost.php?p=10518838&postcount=51
[Desire Android Development] Droidzone:
I'll add a Gingerbread version to the flashable zips, though the current versions do work on GB, only dont have the patch..
[Desire Android Development] melethron:
Well i think charging the phone while its off is a bit different. When its off there is only the powerdrain from the battery itself. If the system is running there is powerdrain from the system on top of that. This means that charging can stop later when the phone is off.

You can see that this is considered by HTC in the Battery driver source. The charging is not only regulated by voltage but also by current.

The battery fix of cm is different. It reduces the current when the battery is considered full and makes a short charge/discharge cycle (charge 100% -> discharge 99% -> charge 100% ....).

There is quite a difference in this. If the battery is charged slow on 100% all the power goes into corroding the anode. What i noticed is that the battery is about 5° C warmer when its on 100% for 3 hours (no usage) than on cms fix.

As i said i dont really care about the (whole) lifetime of the battery and i rather buy a new one than having it at 90% after a overnight charge. But i think that an unnecessary corrosion still should be avoided.

The only issue with cm battfix is ( and that is why coutts and i use yours) is the issue with cardock charging. Maybe snq can fix this.

It's rather easy. HTC calls "/system/bin/shutdown" on "service shutdown" in ramdisk. Instead of calling the binary call a script which does:

stop
sleep 5
sync
[I]unmount commands here[/I]
/system/bin/shutdown

This way the whole android runtime is stopped (so nothing is running that can cause a busy device). Then its unmounted and then the "regular" shutdown is called.

More info:

http://xdaforums.com/showthread.php?t=866981&page=5
[Desire Android Development] sibere:
I'm sure he will! He already fixed a 1st bug on his 1st release when the charging current was always on slow event when connected to AC.
[Desire Android Development] woti23:
that script will probably not work with /data or /system/sd

for one "stop" will only kill system_server, umount /data would not work as long as system processes are running, eg

930 1017 0:00 /system/bin/keystore /data/misc/keystore

or all from network thats still running, that uses something on /data

(ssh eg)

so all you can hope is that shutdown binary does the unmount properly
[Desire Android Development] Droidzone:
Substitute the binary by an open source one which does the same trick? :D
[Desire Android Development] melethron:
You're right. I never tested that myself. Keystore cant be killed and i also have network stuff still running after "stop".

bash-3.2# busybox ps | grep /data
21077 1010 2160 S /system/bin/wpa_supplicant -Dwext -ieth0 -c/data/mis
21429 0 1416 S /data/data/com.funkyfresh.samba/files/nmbd -D
21431 0 3196 S /data/data/com.funkyfresh.samba/files/smbd -D
22328 1017 1736 S /system/bin/keystore /data/misc/keystore

Well but this is when i do "stop" manually. In the thread where that is posted he gets a clean partition so maybe "keystore" and "network stuff" is closed before the shutdown binary is called.

EDIT: I just compared the logcat output when i do a regualar shutdown (through menu) and /system/bin/shutdown. On regular shutdown most stuff is ended before the "stop" is called. So i think it should work fine that way.
[Desire Android Development] woti23:
you can log more when you do in terminal

logcat -f /data/shutdown.log &

before shutdown

(maybe shows something interesting after usb connection and network has gone)
[Desire Android Development] ownhere:
this is my shutdown.sh in ramdisk:

#!/system/bin/sh

sync;sync;sync
cat /proc/mounts|/system/xbin/busybox awk '{if ($1 ~ /(loop|mmcblk|mtdblock5)/) {print "/system/xbin/busybox mount -o ro,remount," $4 " " $1 " " $2 ";sleep 1;/system/xbin/busybox mount -o remount," $4 " " $1 " " $2 }}'|/system/xbin/busybox sh
/system/bin/shutdown "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"

init.rc:

service shutdown /shutdown.sh
user root
group root
disabled
oneshot

I try to remount all data partition to ro mode for save checkpoint, then remount it back to rw, maybe this is useful for safety, at least trying do it.

the reason for mount it back to rw is DHD's HIBERNATE will call shutdown service. Stop/kill service here will lead to wake issue.
[Desire Android Development] Nitin985:
Any instructions on how to flash on coolexe Rom
[Desire Android Development] Lanbase:
Hmmm ... reading the previous posts, modifying ramdisk images is a bit out of my leage yet I guess...moreover because the different opinions whether it should work or not and what could be done best...

But.... No problem, the important thing is that it can be done, now figure out how? :)

..

Grtz
[Desire Android Development] Droidzone:
You guys have to help out too, testing which roms these scripts work on..You can try the aosp version and see if it works. If it doesnt, try the cyanogen one...Though the rom is Sense 2 and not aosp, the branding aosp/cyanogen on the scripts is a branding of compatibility exclusion. The Sense version will work only on Sense. The aosp version will work on most (even sense), and cyanogen will work on some devices on which the aosp version doesnt work, like miui..

Once we go ahead and add the patched libraries, however, it is going to be more difficult maintaining compatibility
[Desire Android Development] Nitin985:
I'll try those at the weekend thanks for the quick reply :)
[Desire Android Development] sibere:
AFAIK code 1 means error. Apparently the process isn't working because it can't find /dev/block/mmcblk0p2 or the FS on this partition is not correct. (could be due to a slow SD)

Did you push an ext4 compatible version of e2fsck ?

To get more information, the thing would be to try to mount the mmcblk0p2 manually in recovery mode and see what happens.

Maybe in miui the 2nd partition is not in /dev/block/ but somewhere else.

Where is FAT32 when you boot miui without data2sd?
[Desire Android Development] woti23:
thank you, now i modified a boot image/ramdisk first time, hehe ;-)

removed the app-cache (frees 8M ram), and the com.android.browser has a directory app_appcache (since when btw?), instead of the symlink before, so i assume the app-cache wouldn't work no more anyway, and is obsolete

btw: i tried the above with the shutdown shell script in ramdisk, but it breaks the DHD's HIBERNATE at least for my configuration/rom
[Desire Android Development] [deXter]:
That's the exact logcat I got when I tried the scripts on my phone. Use the modded script I posted earlier to account for slow initialising of the SD card. Also, yes, exit 1 means some error occured.
[Desire Android Development] woti23:
this is from the manpage

The exit code returned by e2fsck is the sum of the following conditions:

0 - No errors

1 - File system errors corrected

2 - File system errors corrected, system should

be rebooted

4 - File system errors left uncorrected

8 - Operational error

16 - Usage or syntax error

32 - E2fsck canceled by user request

128 - Shared library error

but this doesn't help

the error is in this line, all following occure because of that

I//system/xbin/run-parts( 71): /system/bin/e2fsck: No such file or directory while trying to open /dev/block/mmcblk0p2

either the e2fsck binary has no ext2/3/4 support

or the partition is no ext2/3/4 partition but a reiserfs, jfs ... partition,

this will also give this message.

and if someone tries to fsck a img-file with wrong name, this will also give this message

(for example: e2fsck notexistent.img gives this messages)
[Desire Android Development] [deXter]:
I//system/xbin/run-parts( 71): run-parts: /system/etc/init.d/01data exited with code 1

Actually when a script which doesn't have an explicit exit command returns an exit code, it's just reporting the exit code of the last executed command, which as per the script is "chmod..".

Anyways, you're correct that it could be due to an unsupported filesystem, but my guess is that it's just a slow initialisation of the SD card, as I too had the exact error sequence.
[Desire Android Development] woti23:
you are correct about that, i should have said: the device to be mounted is missing/late initiated, unsupported, wrong fs ...

the first error is a little bit misleading, but linux seems to see blockdevices as files in dev (no such file or directory) and misses the /dev/block/mmcblk0p2

which would be actually the same as no sdcard inserted or not recognised
[Desire Android Development] ownhere:
app-cache be allocate since DHD port, at least I think so.

in my rom, the shutdown.sh is working, either reboot or hibernate. the order of mount/remount is important for loop device.
[Desire Android Development] woti23:
app-chache was only used by com.android.browser

i think with DHD roms the lines in init.bravo.rc can be safely removed
[Desire Android Development] docnasef:
Could someone please confirm which of the following kernels support ext4?

Benee vorkernelSense Kernel

Couttstech 2.6.37 Froyo Kernel ???

I know RichardTrip kernel does support ext4

And Regarding DATA2SD on a stockRooted ROM which of these three Kernels would be best suited??

Thanks a lot guyz!
[Desire Android Development] Droidzone:
Actually, I was just doing a routine monitoring of logcat..The system booted fine..But yes, since there is an error code, there is an error..Wonder where..And actually I'd incorporated your modification for slow cards in that script..:D So that's really weird.!
[Desire Android Development] [deXter]:
Well you could add a "echo $?" after each command in the script to see what error code the previous command returned, that way you'd know exactly which command is giving the "error".
[Desire Android Development] Terepin:
Just tried it with D2SD script and patched libsqlite.so. Phone didn't boot with neither of 'em. And yes, I removed A2SD script first.
[Desire Android Development] Droidzone:
Dhd and desire z are tough nuts. Data2sd won't work on most with default config. Exception is bad news

Swyped away..
[Desire Android Development] teorouge:
Hello, tried the DATA2SD addition to the brand new AuraxTSense 8.3: full wipe, install ROM, install A2SD killer, DATA2SD Installer Sense, reboot, stuck in S-OFF bootscreen. Any thoughts? Each zip flash installed ok. :(
[Desire Android Development] Droidzone:
Yea..Follow the steps!
[Desire Android Development] teorouge:
Thanks, as you may figure, I was following the reinstall instructions from that post... gonna try ASAP! ;)

EDIT: should I complete the ROM initial configuration before reboot and apply Data2SD Installer?
[Desire Android Development] Droidzone:
Reinstall may not work if the Rom was different previously..It may also not work after an update is released to the Rom you were using. It might in most cases though..

Take a logcat and see whats goin wrong..
[Desire Android Development] teorouge:
Thanks, I know it's a "beta-ish" hack but I like to experiment... did you read my EDIT before? What do you say?
[Desire Android Development] Droidzone:
Did u have Sibere's Data2SD on another Rom previously?
[Desire Android Development] teorouge:
Yes, I think it was in one of Ne0phyte's ROM but he dropped that pronto! :)

Anyway I had hundreds of wipes and tried many more ROMs, should there be any leftovers?

About the EDIT, I wonder whether I have to complete first time Android set up before applying DATA2SD Installer zip.
[Desire Android Development] Droidzone:
No I dont think Neo has ever used Sibere's flavour of Data2SD. It was probably ownhere's or melethron's. In that case, you have to redo from scratch.
[Desire Android Development] teorouge:
Thanks for the clarification. However, you didn't answer my EDIT: Do I have to complete first time Android set up before applying DATA2SD Installer zip? You know, choose language, input Google account and so on...
[Desire Android Development] Droidzone:
When you wipe and do an initial install, you definitely do. That's why I made the Data2SD installer step in bold and in Red. :)
[Desire Android Development] Droidzone:
Even if you dont setup all that it doesnt matter. What matters is that you do a reboot after the rom+a2sdkiller install; then wait for system to stabilize before rebooting to apply the data2sdinstaller step
[Desire Android Development] teorouge:
Thank you so much, that was just to let you know I applied the DATA2SD (1GB ext4 partition) and AuraxTSense 8.3 is literally flying and I've got room for ever! Thanks once more! :)
[Desire Android Development] jchoong:
DroidZone, just to let you know that when I update CM7 ROM nightlies, I use Reinstall, and it has been working very well. Many thanks again.
[Desire Android Development] Terepin:
sibere's script doesn't support loop device?
[Desire Android Development] masci81:
hello, can somone submit a link to a guide or show me step by step how to install this script from a miui rom?...in the first page he says to manually delete the script, but how?

thx all!
[Desire Android Development] Droidzone:
Use the MIUI Data2whatever version, remove the data2whatever script from init.d. Then use the cyanogen installer version from my thread.
[Desire Android Development] Terepin:
I'm asking because I have created two ext4 partitions, but the second didn't seems to be used (label was missing).
[Desire Android Development] sibere:
It use to, but it's direct mount now. That is as fast as it was with loop, but it's cleaner and more stable this way.

Anyway if you've created 2 partitions, there is no need for a loop device. Loop was used to mount the former ext2 file (not partition)

Why did you do 2 ext4 partition? Data2SD needs only one. That's why the 2nd one is not used :)

If the 2nd ext4 is not too big , you can always use it as a swap partition.

For data2sd you only need 2 partitions, 1 FAT32 (1st) and 1 EXT4 (2nd)
[Desire Android Development] Terepin:
I'm used to doing that from ownhere's D2SD script. Anyway, I can't use your script as the performance is terrible.
[Desire Android Development] sibere:
I got you now :D

Year 1 fat32 + 1 ext4 is what you need.

Make sure that the partitions are aligned for better performance. Otherwise Ownhere and melethron use pretty much the same principles. I'm surprised that you're getting a better speed with mine. It's probably because they're putting more emphasis on data safety.
[Desire Android Development] Droidzone:
----------------------------
[Desire Android Development] Terepin:
On the contrary, I have worse performance with your script.
[Desire Android Development] sibere:
witch one are you using?
[Desire Android Development] Terepin:
AOSP.

10char
[Desire Android Development] masci81:
can i use miui deodexed rom and remove the script from init.d? or only with data2whatever version? because i use deodexed+italian pack from nexus lab...thx
[Desire Android Development] Droidzone:
Miui installation with this script is not straightforward. I was able to install it after removing more than a couple of scripts, then manually adding some lines to certain initialization files..Unfortunately I havent kept documentation of it and am too busy atm to go into it again..
[Desire Android Development] sibere:
I meant witch data2sd solution ;)

Sent from my HTC Desire with DATA2SD :)
[Desire Android Development] bbk:
Not works with GingerVillain 0.9 :(
[Desire Android Development] Droidzone:
It definitely does work with Gingervillain. Make sure that you use the aosp/cyanogen one.
[Desire Android Development] bbk:
Yes, i've use the Cyanogen...

i've :

-load GV0.9

-load killer zip

-reboot android

-load data2sd

-reboot android

-adb install applante.apk => reboot immediatly

and reboot on loop
[Desire Android Development] Droidzone:
Then try the aosp version. Your steps seem correct. Point to note is that no installation should be done before Data2SD installer is flashed. Even the Market shouldnt be entered into. I dont know about applante.apk. Maybe try installing other apps too and confirm.
[Desire Android Development] bbk:
I've just test with AOSP version, same problem, my actions:

-boot recovery

-wipe all (from AmonRA 2.0.1)

-load GV0.9

-load A2SDKillerV5.zip

-reboot android

-shutdown

-reboot in recovery AmonRA 2.0.1

-load Data2SDInstallerV5_aosp.zip

-reboot android

-try to install Titanium Backup (free)

==> Reboot, and reboot at each new reboot...
[Desire Android Development] Droidzone:
Ok..I will get to it when I'm free..We're working on a Gingerbread compatible version of Data2SD, but as Sibere mentioned, all aosps are inherently unstable on Data2SD because of unclean unmount.
[Desire Android Development] bbk:
Great idea....
[Desire Android Development] Droidzone:
Ok, there IS an issue with Gingervillian..Bootloops galore
[Desire Android Development] [deXter]:
@bbk / others getting bootloops:

Why don't you guys post a logcat so we can see what's going wrong?

(Btw, it works fine for me on my Oxygen Gingerbread ROM)
[Desire Android Development] blowy666:
Well, had some problems, too.

I tried it on Defrost and Ginger Villain, but after the part of flashing the DATA2SD-Installer, I got a bootloop....only white screen with green HTC, the whole time.

Now I´ve flashed Oxygen...all went fine, but sometimes after a reboot my Homescreens are appearing like after a fresh reset...all Homescreen-settings are gone.

And I dont know why...
[Desire Android Development] Droidzone:
@dexter, I've been able to install GV in the past without an issue..

But I tried last night..

Installed GV, removed the Darktremor scripts, restarted it and it didnt even proceed into the bootanimation screen. A logcat turned out to be....blank! :)

Not sure what this is about...Unless the Darktremor stuff has been injected into the ramdisk...But I actually did that too..I split open boot.img and looked into the init.rc but it seems clean too..
[Desire Android Development] nodiaque:
hmmm... I don't know what's going on for me. I had the old way, ext2 file mounted via a loop. So what I did is mount the ext2 file as /data, tar the file to sdcard, format sd-ext as ext4, untar file to /data now in ext4, install new script from the flashable (also tried doing it by hand), then reboot. Now it boot, but the script doesn't work, I get in android without data2sd.

have leedroid 2.2f with s-off
[Desire Android Development] bbk:
I think that i understood my error. My phone is configured for installing each app on sd-ext part...

It's an error ?
[Desire Android Development] Droidzone:
For Gingervillain, comment out /system/bin/a2sd, and init.d/04apps2sd
[Desire Android Development] bbk:
I will try today.
[Desire Android Development] blowy666:
Hi!

Well, I tried it an erased the a2sd in the zip-file, then installed the ROM, installed the "old" killer, rebooted, rebooted again and installed the DATA2SD.

With the Cyanogen-version I got a bootloop (white screen with green HTC)...so I reflashed the ROM again (with wipe), and tried the AOSP-version...all went fine.

Then I installed a couple of things, and rebooted...and again bootloop :(
[Desire Android Development] Droidzone:
Shouldnt erase a2sd

Just comment it out:

#nada
[Desire Android Development] blowy666:
Can I enter this comand in the recovery?

And do I have to do this at every boot?
[Desire Android Development] Droidzone:
You have to do it only once. Immediately after rom installation. You should also be able to modify the actual file inside the rom so that you dont have to do it again
[Desire Android Development] blowy666:
Hmm...how should I modify the ROM-file?

Cause you wrote, I should NOT erase the 2 entrys...?
[Desire Android Development] sibere:
From what I see, This ROM is tweaked to use /cache for dalvik cache to save space on /data. I was also doing this before realising that it's a very bad idea! This has to be disabled before making any attempt to install DATA2SD stuff.
[Desire Android Development] blowy666:
Well, I´ve tried this way....instead og flashing the Killer-zip, I started adb shell and entered this lines.

All went fine, Desire was booting well...but then I was downloading Astro-Filemanager from the market and during installation my phone rebooted (but directly to the ROM-Splashscreen...)

I dont know what to do...
[Desire Android Development] blowy666:
Is it difficult to set it back to /data, or can I do this with some adb-commands?
[Desire Android Development] sibere:
The thing is that I don't know how this tweak is coded. Do they use a script in init.d or is it deeper in the init.rc script?

A list of the scripts in init.d could be a good start to figure out.

IMHO, a clean init.d is better for experiencing data2sd on a new rom.

Anyway everything should theoretically be able to be sorted out with adb commands :D
[Desire Android Development] bbk:
I've tried :

-Wipe ALL

-Load GV0.9

-Load A2SDKILLER_Gingervillain

-Reboot => OK

-Load A2SD_Cyanogen

-Reboot => OK

=>A2SD => #Nada : ok

-Installation Quadrant or Applanet from Titanium Backup (Free) => reboot

=> At each installation my phone reboot direct to splashscreen
[Desire Android Development] willy792003:
So what's the best mount option? I didn't see these options in the 1st post. Which IO scheduler does this work best with?
[Desire Android Development] sibere:
You should read OP again, it's at the end. I/O shed CFQ or Deadline is fine.

Sent from my HTC Desire with DATA2SD :)
[Desire Android Development] blowy666:
I´ve found something with dalvik and move to cache in

system/bin/launcha2SD....could this be a reason?
[Desire Android Development] alexcavaco:
Installed and it works fine here!

Thanks sibere for the Data2SD, droidzone for the update zip.

I wanted it the nearest to stock as possible, so I've built my own kernel from the HTC source and enabled EXT4.

Then added init.d from this post.

I'm up and running fine till now :)

Cheers
[Desire Android Development] Droidzone:
On sense, its stable as a rock.
[Desire Android Development] Droidzone:
Ginger villain sure is unstable, mate. I don't recommend running this on it. The whole rom seems to contain dark tremor code. The only way you can make it stable is to reverse ask the steps in dark tremor code.
[Desire Android Development] blowy666:
But I had the same issues with DeFrost, for example...

Flashing worked fine, but when I installed Launcher Pro and restarted, the phone started again with the "base-homescreen", like after a factory reset... :(

Is it possible that it´s a Cyanogen-problem?
[Desire Android Development] Droidzone:
The only way we can have a clean install is when you can get the rom before a2sd is added. Also as sibere mentioned, aosp roms in general have issues with it. I myself prefer sense and haven't stayed with aosp roms beyond testing that the installation of the flash works. But if you can reverse the whole dark tremor setup including removing the code injection from the kernel ram disk, then it should work.
[Desire Android Development] willy792003:
here's the mount option based on the latest file:

rw,noatime,nodiratime,nosuid,nodev,nobh,nouser_xattr

so is this better than this?

rw,nosuid,nodev,noatime,nodiratime,commit=60,barrier=0,nobh,stripe=64,data=writeback,noauto_da_alloc
[Desire Android Development] Terepin:
VR is better.