Monday, May 24, 2010

DMOJiA p3 - Etch Installation Instructions

Oy,

Apparently there are already some good instructions on how to install Debian Etch. Just my luck that I found them when I didn't need them. Maybe someone here will benefit from it. It's pretty good actually. Everything you'd expect from a good walkthrough. Good formatting of text, pretty pictures, detailed instructions, all things I can't be bothered to do despite my distaste for poor documentation. Go figure.

Debian Etch Installation Instructions:

Here's an older version:

He opts for KDE as opposed to GNOME, which was something I hadn't actually considered. It's a nice change of pace from the measly looking GNOME, but I still couldn't figure out the whole wrong-resolution business.

To keep track, I had to run the Debian installer 4 times today. I'm becoming a pro. I tweeted a few days back that I installed Linux at least two dozen times in as many days. I can't say whether that will be the case for you, but I just want to have the platform setup correctly before I move forward. These kind of enterprise-level changes are very costly to do later on, so better to get it right the first time supposedly.

The ethernet problem went away. I just can't keep the ethernet cable plugged during startup. If I connect once startup is done, then all seems to be good.

Also, a neat tip is to remove the cdrom from the list of repositories once you get all set up. It's mentioned in that first link, but I'll repeat it here to emphasize its importance. Sign in as root with
su
Password:
Then type in
pico /etc/apt/sources.list
Comment out the cdrom line by adding "#" at the beginning, or you can just erase the whole line. Never know when you'll need it again. This tweak makes it easier install things like kde. My system kept checking for it in the cdrom, but my "cdrom" was my USB. It obviously didn't detect it, so just get rid of it. Let it download it from the repositories in that sources.list file. I have to say, I think that's one of the coolest things about Linux/Debian/APT. You can install, update or upgrade whatever you want using Terminal and the sources.list file. Just say
apt-get install kde kdm gparted anyprogramreallyprovidedit'sspelledcorrectly
and it just grabs it from whatever repository has the latest version. That's so sweet. It's probably also the most confusing part of it for non-nerds/geeks/dweebs/dorks.

Sunday, May 23, 2010

Developing My Own Jailbroken iPhone App p2

Heyo,

I'm back. I installed Debian Etch AMD64 over Lenny, so now I'm fully operational. Who knew that 2.6.18 referred to the kernel version? I ran into a problem where the ethernet didn't connect. If I didn't connect the ethernet cable during startup and plugged it in after it finished booting, the thing would connect with the network. However, for some reason, the wireless wouldn't work. This page has a few ideas, but I didn't have any energy to test any of it out. So now, I have the correct kernel and such, but internet is a no-go.

Here are links to the installation files:

Pick the appropriate from "installer-version/current/images/hd-media/"
I was also having some troubles understanding some concepts, so I need to pore through this article from saurik's website. From my understanding, you have to download some SDK headers instead of downloading the entire SDK just to extract them. Also, apparently it's kinda not legit to distribute headers for SDK 3.0 or something, which is why it's impossible to find it. I don't understand any of this, so more learning and discovery (and explanation) must follow. I fear I may have to start from the beginning, plus I have lots of Erica Sadun's stuff to go through still.

I'm also going to get a few reference textbooks. One is "Code Complete" by Steve McConnell which is in its second edition. I already have Jonathan Zdziarski's "iPhone Open Application Development, Second Edition", but we'll see what else I can get. I still haven't figured out whether the open toolchain works in C, C++ or Objective-C, but that shall soon come. Regardless, there's http://cplusplus.com/ for part of that, if need be. I don't have much programming experience, as I've mentioned already, so let's see how quickly I can pick up whatever language it is I have to learn.

Who's excited? (Ugh, so much to do...)

Saturday, May 22, 2010

Developing My Own Jailbroken iPhone App

I've been wanting to do this for a while now. In my Electrical Engineering program, I simply haven't learned enough about programming. Many of the jobs I applied for require mastery/competence in some form of programming or another. That's why I'm combining that fact with my enjoyment of my jailbroken iPhone. It's a great platform with many developers making it easier to use every single day. I won't get into the whole "To jailbreak or not to jailbreak" or "iPhone versus Android" cans of worms, except to say that it simply comes down to how the system fits best into your life. Shall we? This will be as much a tutorial as an adventure journal. I have found very little documentation on the matter, so I'm trying to lay at least some form of foundation for that. I have absolutely no idea why there aren't more guides on how to start developing for jailbroken "iDevices" (it's in quotes because, though referring to iPhones, iPod touches and iPads, Apple has many "iDevices," eg. iMac), so I'm trying to make at least some form of comprehensible handbook. It may or may not be improved over time into a bona fide tutorial. If there is some sort of gag rule on guides for developing for jailbroken "iDevices," I simply haven't read anything in my extensive Googling, so on we trudge.

There are a lot of basics that I'm skimming over here. If you have any questions, ask a question in the comments. I'm only providing this documentation as a complement to what I used and whatever else is out there. Don't take this guide to be complete or necessarily correct. I take no responsibility for any damage caused to your system.

For now, I won't say what I'm trying to do for fear of someone with actual skills swooping in and making the app before I get a chance to. I know this isn't in the spirit of sharing and openness, but this is a learning experiment for me (and you). I won't learn as much if someone goes ahead and creates an example of what I'm trying to do. I'd just be copying and differentiating from them. In this way, it will help the reader form some sort of understanding of what it's like to blaze a new trail.

So where am I starting? I have a PC, and I want to keep it that way. Unless I absolutely have to, I don't want to shell out so much money for a MBP. I may be more easily tempted if the 13.3" MBP gets the Core i3. Thus, according to iphone-dev at Google Code, only certain platforms work with the iPhone toolchain. I am going with Debian because that's what saurik uses. I tried installing Etch, but I couldn't figure out how to get that done. I ultimately went with the Lenny version of Debian, so we'll see how that works out later on. Since that was a huge sore in my side, I'll try and break that down in this post.

I installed Debian over USB onto a new partition. I think that means you need a separate partition. Unfortunately, I didn't have a big enough second partition, so I had to back up all my stuff and reinstall Windows 7. You may need to grab a new key if so. Luckily, I got my copy of Windows 7 Professional from the Microsoft Developer Network Academic Alliance, so I got a new key pretty easily. I don't see why you can't reuse the key if you format your hard drive, but it probably has something to do with money. Anyways, so I did that and gave myself about 50GB for my Linux partition. Should probably be enough. We'll see how that turns out.

You need to have Linux installed before you can set it up, so go ahead and install whatever Ubuntu you want on your new partition. I used UNetbootin to install a Ubuntu Live CD to my USB, and that's how I was able to format the new partition to ext3, which is the file system that Linux uses by default. You're supposed to use Debian 2.6.18 according to iphone-dev, but it was so confusing figuring out how to get it installed. I don't understand how Linux source files work, so searching for 2.6.18 was a bit of a bust. I'll just walk through how I installed Lenny, and I'll try to figure out how to get the actual 2.6.18 on my computer later. I'll explain about that when the time comes. For reference, the link the Etch Installation Information can be found here. Boot the USB from the BIOS, install Ubuntu, and update all your packages.

By the way, for the super beginner, apt-get is a sweet package. It will install stuff within your list of sources just by saying
apt-get install the-particular-name-of-whatever-it-is-you-want-to-install
To update anything already installed, type in
apt-get update
This works the same way in MobileTerminal on your iDevice as well. You add sources, install single packages within those sources, and then update them whenever. Cydia is just a graphical version of this process.

As per the Lenny Installation Guide, in order to get the USB boot, get the necessary vmlinuz and initrd.gz files from the server. You should be within Ubuntu by now, so pick whichever platform your computer uses (mine was AMD64), click on installer-(yourplatformhere)/, click on current/ (there were other folders, but it just worked for me by going with the current folder *shrug*), images/, hd-media/, then grab the initrd.gz and vmlinuz. The gtk folder holds the graphical installation files, but I didn't go that way. It was "easy" enough going with the non-graphical version, so do whatever you want. For the sake of following my work, grab the non-gtk files.

Then follow this part of the guide to boot from your USB. Back up whatever is on that USB first. Install GParted to format your USB into FAT16. I recommend installing the Master Boot Record to your USB to save time. When you boot up from your USB from the BIOS, you may see a screen that says
MBR FA:
Click "A" on your keyboard. It stands for Floppy or Advanced, I believe. Then another screen should pop up that says
MBR 1234FA
You should click "1." Then one or two lines will pop up describing something. You might then see something that says
boot:
at which point you should type in
vmlinuz
Then the installer should do the rest. You may or may not see these screens. I saw them sometimes and sometimes I didn't. I think that MBR stuff only showed up for Etch and not for Lenny, but I still had to type in vmlinuz. Moving on.

The non-graphical installer should now pop up. (The installer seemed kinda graphical, but maybe I'm missing out on something even better than BIOS-type graphics.) You have to choose all your settings, plus you need a wired internet connection. Debian doesn't start off with wireless, eh? We'll get to that later. When it asks to connect by DHCP, you need to keep retrying when it asks and plugging your Ethernet cable in and out until it works. Eventually, the installer will ask if you want to install from the CD/USB or from the network, but I just chose to install from the network at this point, even though I had a full CD. This way, you'll be up to date and stuff. That's kinda cool. Yeah, just do that. *shrug* >_> Don't forget to choose the Desktop Environment. I also chose Laptop and Base System, but I'm not sure what Laptop really does. The Desktop gives you the pretty GUI you're used to from Ubuntu. When I installed Etch, it didn't have my laptop's 1366x768 resolution, so things were looking really weird with the 1200x768 resolution. It was also remarkably slow.

You'll also need to set up your wireless connection. As of this writing, the MadWifi project was in transition to ath5k or something, so these instructions might become dated. Anyway, follow these instructions:

http://madwifi-project.org/wiki/UserDocs/FirstTimeHowTo

Some problems came up, but they were resolved using this thread.


See the post at "03/18/09 11:43:02 changed by teetz@gmx.de"

At this point, that's where my development has stopped. I'll let know how things develop. Mind you, this post sums up three weeks of frustration. I've barely even gotten into any of the programming. Alas, good experience for the scholar, yes? I will go back and try to install Etch instead of Lenny, but the process remains almost completely the same. It's just switching out one installation image iso to another almost. We'll see how that goes. See? Everyone's learning. Yay for documentation. Yay for weekend projects. Hope this post helps at least one person. Thanks for tuning in.
 
Website Traffic