How to move games to the phone in 1.1.3 and 1.1.4

Subforum for discussion and help with ScummVM's iPhone port

Moderator: ScummVM Team

User avatar
TomFrost
Posts: 178
Joined: Mon Apr 23, 2007 4:53 pm

How to move games to the phone in 1.1.3 and 1.1.4

Post by TomFrost »

Howdy everyone :) Sorry for not being around so much -- real life has unfortunately taken precedence over ScummVM. I've gotten a few E-mails and PMs about this topic, though, so I figured it was worth posting a guide publicly.

This guide is for those who have upgraded to 1.1.3 or 1.1.4 and used the fantastic jailbreaking program ZiPhone on their device. It also assumes you already have a compatible version of ScummVM downloaded through Installer, as outlined in Vinterstum's 1.1.3 guide.
  1. Go to a private wireless network, such as the one you probably have in your home.
  2. Open Installer and install the following two packages: BSD Subsystem and OpenSSH. I also recommend BossPrefs, which has the ability to turn SSH on and off, as well as some other fantastic features.
  3. On your computer, open an SFTP client. If you don't have one, I recommend WinSCP for Windows, Transmit for Mac, or gFTP for Linux. There are others; those are my favorites.
  4. Now find the WiFi IP address for your phone. If you have BossPrefs, just tap that icon and you'll see it right beside "WiFi". If you don't, tap Settings --> WiFi, then tap the ">" arrow to the right of the WiFi network you're connected to, then look in the IP address field.
  5. Set up a new connection in your computer's SFTP client. The hostname (or server, or whatever it calls the address to connect to) is the IP address you just found. The username is 'root', and the password is 'alpine'. If you've properly selected the "SFTP" protocol, it should already be set to connect to port 22.
  6. Make sure your home screen is active on your phone, and press connect on the SFTP program. It will take up to a minute to make the first connection, but this is the only time you'll experience this delay. During this time, and during any time your computer is communicating with your phone, do not let your screen go blank or the connection may be broken.
  7. Once the SFTP client connects, navigate it to /var/mobile/Media. Here, create a folder for your games. Mine is simply "ScummVM".
  8. Navigate into that folder and drag your game folders there. Don't throw all the loose files in there -- that would be a mess. Make sure each individual game has a folder of its own. Remember not to let the screen blank during transfers!
  9. Enjoy!
There is no need for term-vt100 in this process, and you definitely should not try to change the root password. This was recommended pre-1.1.3, but so far on 1.1.3 and up, changing the password results in corruption that takes a full software restore to fix.

Extra special pro tip:
Software is slowly moving over to be 1.1.3 & 1.1.4 compatible, but there are still programs out there that are completely unaware that they need to use /var/mobile instead of /var/root. This tip will not only allow this software to work transparently, but is also hugely convenient for when you want to upload Scumm games again.

Open a command-line SSH connection to your phone. Linux and Mac users can do this by opening Terminal and typing "ssh root@phone_ip_address_here", pressing enter, then typing 'alpine' for the password. Windows users will need an SSH client such as PuTTY,entering in the phone IP address and same login information that we used above.

Once you have a successful connection, execute the following commands:

Code: Select all

cd /var/root
ln -s /var/mobile/Media Media
exit
Now, any program that looks in root's Media folder will actually be looking in mobile's media folder instead, which is what it should be doing. And now when you connect to your phone to upload Scumm games in the future, you have a quick and easy link to the appropriate folder!


Hopefully this works out for everyone. I'll be checking back in, so please ask questions here rather than via PM or e-mail :)
User avatar
Morty
Posts: 17
Joined: Mon Mar 03, 2008 10:42 am
Location: Paris, France

Post by Morty »

As I told you in private, big thanks for your tutorial. Could you please add a noobish approach to the iPhone filetree? For example, disk space availability in which or which directory (yes /var/mobile & /var/root I'm looking at you two).
chrisis
Posts: 150
Joined: Sun Oct 30, 2005 4:06 pm
Location: Austria

Post by chrisis »

this is a great tutorial! could any of the mods make this a sticky so it won't get lost?
User avatar
TomFrost
Posts: 178
Joined: Mon Apr 23, 2007 4:53 pm

Post by TomFrost »

Morty wrote:As I told you in private, big thanks for your tutorial. Could you please add a noobish approach to the iPhone filetree? For example, disk space availability in which or which directory (yes /var/mobile & /var/root I'm looking at you two).
Sure can!

The iPhone uses a standard UNIX file structure with some significant changes. To bring you up to speed if you're not familiar with Mac/Linux/UNIX, Windows is the *only* operating system that has letters like "C:" for drives and lets you access them directly. In everything else, you have one main filesystem on one of your drives, and then every other drive or partition is contained in a folder off of that.

For example, on my Ubuntu Linux computer, '/' is the start of the filesystem. '/home/tom' is where I keep all my files. '/usr/share' is where things go that are shared between all users -- like programs. This is all on one drive. But if you go to /media/windows, all the files you see there are on a completely different hard drive. It works and functions like it's all within the same filesystem, but there are certain "mount points" where other drives or partitions branch off of the main tree.

If you're not following me, that's ok. Because all you need to know is that the iPhone and iPod Touch both have, essentially, two "drives" in them. One is the root '/' drive like you need to have, and the other one branches off of '/private/var'.

What's that mean? Well, it means there's only 200Megs of space on your device unless you go into the /private/var folder. If you're somewhere within /private/var, now you're in the huge space on the device, where iTunes sends songs and movies and photos when you sync. And just to eliminate confusion, '/var' on the iPhone/iPod Touch is the same thing as '/private/var'. '/private/var' is the actual location of the folder, but /var is there as a shortcut -- so it doesn't matter which you use, you end up in that bigger, second "drive" either way.

The next facet of UNIX that you should know is that it has multiple users, and every time you run a program or save a file or anything like that, it has to belong to a certain user. The iDevice has two users: 'root' and 'mobile'. 'root' is the superuser, and that's true for all UNIX-based machines. If you're root, you can do anything with no restrictions whatsoever. You probably already see the problem with this, though -- if you run a third-party program on your phone as the root user, that program will have the permissions it needs to do anything it wants to your phone, good bad or ugly. So Apple, with 1.1.3, introduced the 'mobile' user. The 'mobile' user doesn't have permission to change many of the core system files that root does, so if you run any nasty 3rd party programs as the mobile user, they can't kill your phone.

Now the structure should make a little bit more sense. /var/root is root's "home" folder, and /var/mobile is mobile's. As of 1.1.3, when you use the phone, you're using it 'as' the mobile user. Any program you run runs with mobile's permissions, any files you save are owned by mobile.. so naturally, your music and movies are stored under /var/mobile/Media instead of the older /var/root/Media that pre-1.1.3 devices used. And since the 'mobile' user doesn't have permission to use anything saved under /var/root, it's really important that any files you want for Scumm be saved under /var/mobile somewhere now. And since the two main folders in /var/mobile are Library (used for savings settings, support files, and things of that nature) and Media (where all the major content goes), it only makes sense to put your games somewhere inside /var/mobile/Media.

And now you should understand how my tip in the original post works, too. That ln -s command makes a folder called /var/root/Media that "links" to /var/mobile/Media. So if you would go to /var/root/Media and look at the file list, what you *actually* see is the contents of /var/mobile/Media. Which is fantastic, because old programs are trained to look in /var/root/Media, so they'll go there, they'll still be able to find your files, and they'll all be owned by the 'mobile' user so they'll have no problem accessing them!

I know this was kindof long and drawn out ... let me know if you have other questions :)
User avatar
Morty
Posts: 17
Joined: Mon Mar 03, 2008 10:42 am
Location: Paris, France

Post by Morty »

That's exactly the information I was looking for : mount points. Let's say that partition n°1 (300MB) is / and /private/var is what's lacking. Is that it?
User avatar
TomFrost
Posts: 178
Joined: Mon Apr 23, 2007 4:53 pm

Post by TomFrost »

absolutely :)

If you *do* have term-vt100 (and the password-fix for it.. it's in installer but I forget exactly what they call it), you can run it, type "alpine" for the password, then run the command 'df' and hit enter. It will show you all mount points, their size, the used space, and percentage used space.

When you do that, you get three things. /, /private/var, and the device system that shouldn't be touched.

I believe / is 200MB, then /private/var is whatever's left over.
User avatar
Morty
Posts: 17
Joined: Mon Mar 03, 2008 10:42 am
Location: Paris, France

Post by Morty »

Password fix? Maybe that could help me. I'm still stuck with a randomly changed pass...
User avatar
TomFrost
Posts: 178
Joined: Mon Apr 23, 2007 4:53 pm

Post by TomFrost »

If OpenSSH is activated, you should be able to connect via SFTP with user 'root' and password 'alpine'. The Password Fix is only for local terminal connections.
User avatar
Morty
Posts: 17
Joined: Mon Mar 03, 2008 10:42 am
Location: Paris, France

Post by Morty »

If this is a standard Unix system, why should SFTP and Terminal connections be using different passwords?

I will try via SFTP though, I guess I should try before speaking ;)
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

The "password fix" is just something which allows the Terminal app to actually authenticate you :)

A change in 1.1.3+ is that user apps now run as the 'mobile' user and not as root. Since this user can't access whatever authentication mechanism the device uses (LDAP? I've no idea), Terminal can't either.

The fix is basically to run Terminal as suid root (chmod a+s /Applications/path/to/the/terminal/binary)
Ryan
Posts: 4
Joined: Tue Mar 11, 2008 9:59 am

Loggin into Iphone/Ipod from other networks

Post by Ryan »

Hi guys,

First of all, happy to see so many skilled developers paving the way for using this great piece of software. I recently prepped my ipod (1.1.4.), just to be able to use Scummvm. Now the only problem is my SSH connection. I cannot seem to set timeout intervals longer than 15 seconds, in any SSH client (putty, Filezilla, WinSCP) I get the famous 'connection error: timed out' message. Always after 20 seconds. All of the mentioned clients refuse to change the timeout interval (all fall back to 15 secs). Important detail: my computer and iphone are not on the same (wireless) network. Is this necessary? I use my roommate's wireless network for the iphone connection and have a cable connection for my home PC. It almost looks as if SSH on my Iphone closes the connection after 20 seconds(naturally, I have all the tools installed through installer). Since I am new to this stuff I'd like a newby-sensitive solution, if one exists. I am using firmware 1.1.4.

Thanks in advance

Merijn de Boer
(Netherlands)
User avatar
Robo-X
Posts: 24
Joined: Wed Jul 05, 2006 8:20 am

Re: Loggin into Iphone/Ipod from other networks

Post by Robo-X »

Ryan wrote:Hi guys,

First of all, happy to see so many skilled developers paving the way for using this great piece of software. I recently prepped my ipod (1.1.4.), just to be able to use Scummvm. Now the only problem is my SSH connection. I cannot seem to set timeout intervals longer than 15 seconds, in any SSH client (putty, Filezilla, WinSCP) I get the famous 'connection error: timed out' message. Always after 20 seconds. All of the mentioned clients refuse to change the timeout interval (all fall back to 15 secs). Important detail: my computer and iphone are not on the same (wireless) network. Is this necessary? I use my roommate's wireless network for the iphone connection and have a cable connection for my home PC. It almost looks as if SSH on my Iphone closes the connection after 20 seconds(naturally, I have all the tools installed through installer). Since I am new to this stuff I'd like a newby-sensitive solution, if one exists. I am using firmware 1.1.4.

Thanks in advance

Merijn de Boer
(Netherlands)
If you used iPlus or installed OpenSSH with the installer you have to make sure that the iPhone doesn't go into sleep mode as it will close the ssh connection after a minute or so. But if you can only connect for 20sec then it might be another issue.

For Mac users it's very easy to put the game files on the iPhone. All they have to do is to install AFP with the Installer, restart the iPhone and it should be listed as a volume in the Finder. Login as user mobile and password alpine and mount the root partition. Navigate to /var/mobile/Media/ and create a scumm folder where all the games are stored.

//Rob
FreakyNipples69
Posts: 10
Joined: Sun Mar 25, 2007 8:43 pm

Post by FreakyNipples69 »

I can't find OpenSSH in Installer. How do I add it?
pr1m1t1v3
Posts: 3
Joined: Thu Jul 03, 2008 4:16 pm

Post by pr1m1t1v3 »

Help me ,please

I have downloaded Broken Sword 1 (151Mb) and upload it in var/mobile/... on my iPhone I have found the game, but when I'm trying to launch it - iphone transfer me to the main menu...

Maybe my downloaded game is wrong version for iphone? How can I fix it? Or where I can download iphone quests?

Thanks
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

pr1m1t1v3 wrote:Help me ,please

I have downloaded Broken Sword 1 (151Mb) and upload it in var/mobile/... on my iPhone I have found the game, but when I'm trying to launch it - iphone transfer me to the main menu...

Maybe my downloaded game is wrong version for iphone? How can I fix it? Or where I can download iphone quests?

Thanks
Forum rule #0, no support for warez.
Post Reply