Wednesday, December 28, 2011

Android: INSTALL_FAILED_INSUFFICIENT_STORAGE error in ADB shell

I came across  INSTALL_FAILED_INSUFFICIENT_STORAGE error when I tried to batch install about 50 apps in sd card directory using adb shell after a full ROM update.
 
$ su
# cd /sdcard/batchInstall
# for x in *.apk; do pm install -r $x; done
 
Some of them installed, but many failed with the error INSTALL_FAILED_INSUFFICIENT_STORAGE. But I had plenty of space in both internal and sdcard. I noticed that all the failed apps had space in their name. I batch renamed them to remove space with '_' and tried again. It all worked this time. Hope this info will help someone with the same problem.

Tuesday, December 27, 2011

F8 key fail: Recover PC to factory state without a backup recovery disc

So I did something stupid. I installed Windows 8 Developer preview on Dell Inspiron Duo tablet PC. I mean, it was not the stupid thing (Windows 8 looks awesome on Duo), but installing it as 'Upgrade' replacing system Win7 OS and without backing up was the stupid thing. I could have done back up with Dell Datasafe Local backup, but I was lazy or daring or stupid or whatever; I didn't do that. Eventually something went wrong; Windows 8 took over the boot process and now I do not have a recovery disc and F8 key one rebooting doesn't work. The Windows recovery environment got really messed up since Windows 8 wrote files on my laptop's recovery partition.


Well, finally I got the system back to the Factory state and F8 is now working. Even better, I've Windows 8 Developer preview on a separate partition and separate recovery environment happily dual booting. I can now precisely control which OS to load and which recovery environment to boot. Some of the tool I found useful are Windows 7 bootable USB, RMPrepUSB, imagex, Minitools partition wizard, Windows Disk Management utility, Hirens Boot CD, 7-zip, Unstoppable copier and Visual BCD.

If you are also in such a situation, what you want to do is  to use imagex in recovery environment, take the Factory.wim in the recovery partition ([Recovery]:\dell\Image\Factory.wim ) and apply it to the C drive. You just need that one file in recovery partition to completely get back to your factory state.


If you need, you can open Factory.wim using 7-zip. You will need to show hidden files and system files to see those files in Windows. If you mount the drive in Windows 7/8, it is not possible to access most of the folders in Recovery partition. (Shows Dell logo and warning )

Learning about these things below helped me on the process
  1. Hard disk partition structure: MBR, partition table, boot sector
  2. Windows boot process and tools: boot manager, BCD, bcdedit.exe, bootrec.exe
  3. Windows Recovery Environment and images: WIM files, ImageX, ReAgen.xml, ReAgetC.exe

It's a too long story to write now, but I would post it sometime for documentation purpose for my future use. I'm planing to make latest OS image and backup to separate partitions and access it by say F5 or something on boot if needed.  I mean, I'll still have access to Factory image by F8, but you know, it'll take a few days to install all the updates over updates and your software etc after factory reset to get the system up and running, (if the system was bought several months back). Well, Dell Datasafe will do that if you upgrade the software. But then, where's the fun of learning?

Saturday, December 24, 2011

Dell Streak 5: Root Gingerbread Android 2.3.3 ROM


UPDATE 16th Jan 2012: This is not a Gingerbread ROM update tutorial. This is a tutorial to gain root access to already updated Dell Streak 5. Please follow my previous post if you want to update from Froyo to Gingerbread. 

Dell Streak 5: How to Install Official Gingerbread ROM (Android 2.3.3)
http://techienetizen.blogspot.com/2011/12/install-gingerbread-233-on-dell-streak.html

The usual disclaimer: Please read the disclaimer on the footer of this page before you attempt anything based on this post.
 
Requirements:



Process overview:
A) Enter fastboot mode and flash to the streakmod custom recovery
B) Reboot to the streakmod recovery and select ‘update from update.zip’ to select superuser apps. Now your DS should get rooted.
A) Enter fastboot mode and flash to the streakmod custom recovery

  • Connect  your DS to PC (You already installed drivers to it) and copy superuser.zip to the DS SD card and rename it as update.zip. (i.e. /sdcard/update.zip)
  • Stop USB connection and power down DS (DS is still physically connected to the PC through the cable)
  • Press and hold down the camera button and then press the power button. Release the button when you see a white screen
  • Select Fast boot mode on the top right on your mobile (DS display will show FASTBOOT_MODE)
  • Now it’s time to do some DOS commands from your PC to communicate with DS through the connected USB cable.
  • On your PC, navigate to the path where you unzipped the fastboot tools.(C:\Fastboot+ADB). You have already copied the streakmod recovery (C:\Fastboot+ADB\recovery.img) to this folder. (see requirements)
  • Press Shift key and from right click menu open a DOS command window on that folder
  • Type  'fastboot -i 0x413c flash recovery recovery.img' without the quotes and hit enter. You can see that your DS screen shows the response.(By the way, you can copy paste the commands to the DOS prompt. Right click on DOS command and paste.)
  • Type 'fastboot -i 0x413c reboot' without the quotes and hit enter.  
B) Reboot to the streakmod recovery and select ‘update from update.zip’ to select superuser apps.
  • On reboot, immediately go in recovery mode (hold both volume buttons while powering on). Don’t let it go to full system boot yet.
  • Select option 2: Update from update.pkg on sdcard. Now this would go to be the custom streakmod recovery. (See version number at lower bottom in yellow font. If not, you are not on StreakMod and you can't proceed) Select update.zip and proceed instructions to root
  • Now the rooting process will start and finish. You should see the messages. On rebooting, your DS will be rooted. 
  • Before rebooting your system again, you may need to do one more thing (optional). read on...
I found later that the official Dell ROM over wrote custom recovery. This post was helpful and you may want to follow that.

Custom Recovery – Prevent Overwriting on Dell Streak
http://www.rdtk.net/2011/06/14/custom-recovery-prevent-overwriting-on-dell-streak/

So before rebooting your system again, I did this one more thing; disabled install-recovery.sh script in /system/etc to prevent recovery overwriting.


You have many ways to do it. But this is the way I did it. 

  • Enable USB debugging. (settings>applications>development).  
  • Go to the DOS command again (C:\Fastboot+ADB\) and type these commands.

> adb devices
You should see some numbers. This is optional and just to check

> adb shell
Now you entered the remote shell; which is actually running in your DS

$ su
(Command to run as root. A pop up will come on DS screen asking for su permission and you should allow it. Now the prompt will change to #. If you see 'Permission denied", your rooting did not work and you cannot proceed )

# busybox mount -o rw,remount /system
(Mount the system with read-write permission.)

# cd /system/etc
(Change path to the location of the file. If you type ‘ls’ now, you can see a file named ‘install-recovery.sh’. The aim is to disable it by renaming)

# chmod 777 install-recovery.sh
(Change permission for renaming)

# mv install-recovery.sh install-recovery.sh.backup
(Rename the file. Now it’s done)

You may reboot the DS now. But if you want to batch install all the saved app collection back to new ROM, you can do it by a single command. Say, you have 50 apk files stored in /sdcard/backup/apps/


# cd /sdcard/backup/apps/
# for x in *.apk; do pm install -r $x; done


 This will install all the apps one by one. The app file names should not have any space in it.
 
Thanks to the smart guys at XDA forum for guides, how-tos, and for sharing all the required files.Check the forum link:
http://forum.xda-developers.com/showthread.php?t=840326 for more details and discussions.

Dell Streak 5: How to Install Official Gingerbread ROM (Android 2.3.3)


I just installed Official Dell Gingerbread (Android 2.3.3) ROM on my Dell Streak 5 (DS) and it works quite well so far. Now the front facing camera works for Skype. Fring used to do this in Froyo, but now more options for Face chat. The launcher is same Dell Stage, so do not expect a very different UI when you boot up. I heard one guy yelling at Dell in one forum.. "Dell cheated.. It is not different from Froyo". Honeycomb will bring the ultimate change, but don't know whether DS development will go that far. Considering that Dell Streak is the only Pentagon approved Android phone for Defense use and Dell provides support to them, we may see some more updates in near future.
__________________________
UPDATE 29th Dec 2011: Please read the disclaimer at the footer of this page. You should know what you are doing. Do your home work, use Google and learn about it. Visit XDA forum tutorials and discussions. The post here is my experience installing into only one Dell Streak 5. Your Dell Streak ROM version could be different. I have no idea what will happen in all those different ROMs and situations. FYI, I was upgrading from US unlocked Froyo 2.2.2, (360) to 2.3.3 (407). Back up your important files and keep a spare phone ready in any unfortunate event. Ok, my disclaimer ends now.

UPDATE 30th Dec 2011: Gingerbread 2.3.3 ROM is significantly snappy and smooth compared to Froyo. I'm very happy with it so far. Only problem I find till now is that USSD code is not working. I can't check the balance by the code. But I use the carrier app to check the balance etc. So it's not an issue for me. (Check T-mobile app in Android market, if you are a T-mobile US customer and if you are not aware about it).

Remember that I don't have any control over the external download links/files. I noticed that the Fastboot+ADB zip file contents have been reorganized by the owner of the file to add new option for different OS platforms. So change the folder accordingly to see fastboot.exe. From one of the fellow netizen's comment, it appears that there could be easier methods at XDA form. Google it. 

UPDATE 12th Feb 2012: Added the Dell driver link and edited to reflect the change in Fastboot+ADB.zip file reorganization. New archive contain files for Linux and OSX also.


UPDATE 8th May 2012: How to fix the USSD code problem? Well, I got it fixed following the instructions at XDA forum. Thanks to hunderteins and TheManii. 
http://forum.xda-developers.com/showthread.php?s=11f3127f9489d2629df1a87349664f5e&t=1558089

UPDATE 12th May 2012: I've posted detailed instructions to fix USSD code problem.
http://techienetizen.blogspot.com/2012/05/dell-streak-5-ussd-code-problem-fix-for.html
__________________________

Here's the process I followed.

Requirements:
  1. A PC and DS USB cable: You should have your Dell Streak drivers installed on your PC. It's available from Dell support site. http://ftp1.us.dell.com/Handheld/R288920.exe
  2. You need fastboot tools
    http://mirror2.streakdroid.com/manii/Tools/Fastboot+ADB.zip

    Unzip to a folder; say C:\Fastboot+ADB
  1. Download official Gingerbread release from Dell. This is a Korean carrier, Olleh, version. But English language is available.
    http://mobileupdate.dell.com/PackageProductionLocations/Streak_407_20707_14.pkg

    Rename the downloaded ROM to update.pkg and transfer it to your phone SD card
  1. Download corresponding recovery image.
    http://mirror2.streakdroid.com/manii/407/recovery.img

    Copy ‘recovery.img’  to fastboot tools directory (i.e. C:\Fastboot+ADB\Win32)


First step is to flash to correct recovery

  • Connect your DS to PC (You already installed drivers to it) and copy Streak_407_20707_14.pkg to the DS SD card and rename it as update.pkg. (i.e. /sdcard/update.pkg)
  • Stop USB connection and power down DS (DS is still physically connected to the PC through the cable)
  • Press and hold down the camera button and then press the power button. Release the button when you see a white screen
  • Select Fast boot mode on the top right on your mobile (DS display will show FASTBOOT_MODE)
  • Now it’s time to do some DOS commands from your PC to communicate with DS through the connected USB cable.
  • On your PC, navigate to the path where you unzipped the fastboot tools.(C:\Fastboot+ADB\Win32). You have already copied the recovery (C:\Fastboot+ADB\Win32\recovery.img) to this folder. (see requirements)
  • Press Shift key and from right click menu on anywhere on the folder (on empty space without selecting any files or folders) open a DOS command window on that folder. Or Start menu > Programs > Accessories > Command Prompt. Now type 'cd C:\Fastboot+ADB\Win32'. Type dir and you should see all the files and folders in C:\Fastboot+ADB\Win32. Type 'fastboot' and you should see a list of command options.
  • type 'fastboot -i 0x413c flash recovery recovery.img' without the quotes and hit enter. You can see that your DS screen shows the response. (Make sure that the DS white screen says 'download done' or something like that.)
  • type 'fastboot -i 0x413c reboot' without the quotes and hit enter. This will reboot your phone. Now on rebooting, immediately enter to recovery mod (hold both volume buttons while powering on).
The update process:
  • Now you are booted to new recovery. Select option 2; software upgrade via Update.pkg on SD card. You will see a warning saying that all your data will be erased. (You already know that, don't you?). Did you see a serial number ending in 40714? (If you used 407 recovery) This step is to make sure that you have flashed 407 recovery properly. If not you may need to press the volume up button to power off and flash again
  • Press the shutter button (camera) to continue and you should see a progress bar. Leave it to do the update. It'll reboot once its done. You should see one more update process with progress bar showing a 'Dec 1' date.
  • Once these are done you will see Olleh logo on boot. Gingerbread now. Play around (if you don't know to read Korean) and change the language to English. (When you touch the Android, the button below right is for language I guess)


Thanks a bunch to the geeks at XDA forum for their fantastic job!


Now how to root this ROM? Check my next post.
______________________________________

Reference:
New ROM :: 407 OFFICIAL GB ROM IS OUT


Dell Streak 5 XDA Wiki

Other links
Dell releases official Gingerbread ROM for Streak 5
http://www.streaksmart.com/2011/12/dell-releases-official-gingerbread-rom-for-dell-streak-5.html







Some background information for beginners
ROM:
A ROM is the actual Android operating system installed on your Dell Streak. Check whether your OS is update by checking the latest release (See reference). Your can see the version, build details etc from Settings > About Phone. The factory installed ROM of my DS when I bought it was version 345, build 15380, Android 2.2.2 Unlocked US version. So the corresponding ROM is Streak_345_15380_00.pkg
You can see all the releases here:


Fastboot:

Fastboot is a protocol used to update the flash file system in Android devices from a host over USB connection (to your PC).You’ll use the DS 40 pin USB connector/charger to do fastmode commands. It allows flashing of partition images. This is one way to load/delete/modify your recovery image. To do any upgrading you need to use fastboot.