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.