Tuesday, February 12, 2008

1.1.3 Soft Upgrade " Free Your Apps"


I've been asked, "What is the best way to run Applications post 1.1.3 Upgrade?" First my disclaimer: I am no expert in iPhone engineering, application development or coding. I have had success post 1.1.3 upgrade running my applications from both var/root as well as var/mobile. If your interested, and your comfortable with the command line... Here are a few fixes and tweaks that have worked for me.

Having used The Dev Team's Official Soft Upgrade, I performed a clean restore/jailbreak/upgrade from 1.1.1->1.1.2->1.1.3, no legacy information and no apps. ( Except of course, installer.app, SSH, & BSD subsytem when required) Post upgrade I was left with very little space on my OS partition. Installer.app, BSD subsystem & SSH were pretty much all my OS could support. Situation critical, no space for applications? No place to put them!

After a brief consult with Erica Sudan, she reminded me of her amazingly useful xwidg utility. I immediately installed Erica's Utilities manually into var/root.
Next I created the folder Applications in Var/mobile/Media. After manually installing a few of Erica's 1.1.3 updated apps and Mobile Terminal-vt100 into my media/Applications folder, I ssh'd into the shell of the phone and issued the command:

~/bin/xwidg


Viola! My first symlink was born post 1.1.3. I'm now running my applications safely on the Media partition of my phone 1.1.3!

Having the Terminal app running UNIX directly on my phone is great but some fixes were necessary. The Terminal app was requiring a password? Apparently the newest version BSD subsytem was the culprit. The solution came in the form of a SUID fix, SUID Lib Fix to be exact. Back inside the terminal issuing the commands:

mkdir -p /usr/local/arm-apple-darwin/lib
ln -sf /usr/lib/libgcc_s.1.dylib /usr/local/arm-apple-darwin/lib/libgcc_s.1.dylib


Bonus! I am now able to run applications from root again on the 1.1.3 phone. OK, but not done with the Terminal app fixes. If you are running Terminal app-vt100 version 198 issue:

chmod +s /Applications/Term-vt100.app/Term-vt100


If you are running Terminal appl-vt100 version 207 (new for 1.1.3) issue:

chmod +s /Applications/Term-vt100.app/Term-vt100


Now the Terminal app on the phone is functional and accepts the password: alpine.
*One important footnote to the fixes above; The SUID lib fix symlink can be undone after you created the sysmbolic link, as long as you did not delete the file:

arm-apple-darwin/lib/libgcc_s.1.dylib


(This info may become useful down the road;)
To remove the symlink Issue the command:

rm /usr/local/arm-apple-darwin/lib/libgcc_s.1.dylib

* The SUID Fixes above can be obtained via installer app by adding "www.trejan.com/irepo" to your "Source" list.
** I simply prefer to use the command line myself rather than a program if given a choice.


Onwards and Upwards---->Back in the terminal on my phone issuing:

find / -size +14000 -exec ls -alh {} \;

(lists all files larger than 7 mb) An easy check to make sure the Dev team's Upgrade files are not left on the phone. Ok, Looks like the program cleaned up after itself very nicely. That was the good news. The bad news came after issuing the command:
df -h.

The query displayed that /dev/diskOs1, the OS partition, was 100% full! Needless to say /dev/diskOs2, the media partition, the spot where the music, pics and vids are stored, had a healthy 6.7 gigs! This was the new problem.

I am now able to run applications from /root again due to SUID fix above.... Ok, then why not try the old standby for freeing up OS space from the 1.1.2 and 1.1.1 days? Back to the the command line:

cd /
cp -pr Applications /var/root
mv Applications Applications.old
ln -s private/var/root/Applications /Applications


This will move the entire /Applications directory to /var/root/Applications, and make /Applications a symbolic link that points to private/var/root/Applications You can check this by issuing:
ls -all /

You should see somewhere in the results: Applications -> private/var/root/Applications. If you installed Erica's Utilities and created a symlink to /Widgets invoking the xwidg utility, You should also see: Widgets -> /var/mobile/media/Applications.

Now if all is working properly on the phone, from the command line issue:
(Before issuing this command I copied Applications.Old to my desktop. This may be useful to you down the road;)
cd /
rm -rf Applications.old

This will remove Applications.old and free up some OS space. It will also ensure that the majority of apps from the installer will install in the more spacious portion of your phone.

*Don't forget, you can also manually install your applications 1.1.3 directly into /var/mobile/media/Applications and use the Erica's xwidg utility.

One final note, Applications don't always run well from var/root and can create problems in 1.1.3. Developers are working hard to update their packages to run from /var/mobile. STE Packaging's, Shaun Erickson is working hard to update his repository packages and re-configure his newly donated servers.
If your not sure what to do, why not hang on and see what shakes out?

In my case I found it useful to run and test some older packages. The above mentioned commands have yielded success for me in running Applications from var/root and var/mobile post 1.1.3 upgrade. In the spirit of sharing, I have chosen to document my experience. I do not believe this is a breakthrough approach or the "Way."
What works for one may not work for another... This is simply my experience.

2 comments:

LCH Real Estate said...

This works excellent, but I do believe that I have missed a step... We should be able to run apps from both partitions simultaneously upon executing the xwidg utility right? My root apps are working, but the only app that I can get to work off Widgets is the terminal app. I have tried several apps and chmod'ed them as many ways as possible. Please advise. You are a genius! Thanks

Words & Images said...

They are two different symlinks. The xwidg utility creates a symlink between the Applications folder you created in /var/mobile/Media and the undocumented folder /Widgets.

Unfortunately some apps have not been updated and simply will not run from /var/mobile, they prefer var/root. That is where you can benefit from the old standby /var/root symlink.
The /Applications symlink places apps downloaded from the installer in your media partition and allows them to run from /var/root.

Both serve a specific purpose and both ultimately free up your OS and allow you to install most apps.

please see:
http://blog.psmxy.org/2008/02/16/jailbreakinstallerapp-developers-fix-this-mess-please/

Hope this helps!