Rooting Your Desire (and installing a custom rom)

This is a guide for the GSM Desire only.

Follow this entirely at your own risk. It is possible, however unlikely that trying to root your phone can brick it.

Things to download:

  • Download Unrevoked 3.21 (current version) from here.
  • Download HTC Sync from here, install it, then uninstall it. This sounds odd, but it will remove the HTC software (a necessary step), whilst leaving the ADB Drivers on your computer.
  • Download a recovery image, I’m using clockwork which you can get here, but you can use others such as AmonRa.
  • Download a custom rom, and a radio rom. I am using Defrost and the latest radio, available here. Note: This step is not actually necessary, you can run a rooted phone with the original rom.
  • This is the actual rooting part. Run Unrevoked (3.21). Select the recovery image you downloaded above.
  • Plug your Desire in to your PC, sit back, follow the on screen instructions, and then wait a few minutes.
  • Note: It is a good idea at this point to perform a Nandroid backup, available from the Clockwork Recovery Mod Menu.
  • When Unrevoked has finished, reboot into your phone. Load Rom Manager, flash Clockwork to the latest version, and take a backup.
  • Partition your SD card (menu option in Rom Manager). I went for a 512mb ext2 partition, a 64mb swap, and the rest as fat32. Copy your custom rom and Radio image to your SD card.
  • From within Rom Manager, select Install Rom from SD Card and select your custom rom. Let it work its magic. You can then install the radio image from within the Clockwork Recovery menu.
  • Bear in mind if you are going from a Sense based rom to a non-Sense based rom, you will need to select Wipe Data/Settings from within Clockwork in order to be able to flash the custom rom. This should be the only time you need to do it.
  • When the phone reboots, you will be presented with an animated ‘X’, which is really rather pleasant. This is the DeFrost boot screen, and will last for a while. Don’t panic, let it run its course, and it will boot eventually.

Installing the Windows HBoot Drivers

These drivers are necessary for rooting your phone. You can download them from here.

  • Extract the drivers somewhere memorable.
  • Turn off the phone, and load the boot menu by pressing and holding power and volume down.
  • Connect the phone to your Windows machine with a USB cable and wait for the phone to say HBOOT USB PLUG on screen.
  • Open device manager, and you should see Android 1.0 Device listed under Other Devices.
  • Right click on Android 1.0 and click Update Driver Software. From the next screen, select Browse my computer for driver software, browse to where you extracted the drivers, and select the Android USB Driver folder, click Next, then OK.
  • You should then get an Install Successful message, hit Close.
  • Android Bootloader Interface should now be listed under Android Device. All done.
  • Starcraft II

    Blizzard are master story tellers, and despite their controversial, money based decision to release SCII in chapters, they have scored another hit.

    A truly compelling and moving storyline, the single player campaign is beautifully told against the usual complex background. A moving finish, and the usual open door ending to entice players in for the other chapters.

    Personally, I can’t wait.

    MSSQL – How To Output To A File

    There is a very, very simple one liner within MySQL to dump the results of a query into a text file. Nothing so simple exists within MSSQL, but there are fairly easy workarounds. Using BCP, one can use the xp_cmdshell to pass the results into the desired file.

    use <em>DatabaseName</em>
    go
    
    declare @FileName varchar(50)
    declare @bcpCommand varchar(2000)
    
    set @FileName = REPLACE('c:\temp\bcp\postcodes_'+CONVERT(char(8),GETDATE(),1)+'.csv','/','-')
    
    set @bcpCommand = 'bcp "select left(postcode,4), count(*) from DatabaseName..TableName where customersequence = 0 group by left(postcode,4) order by count(*) desc" queryout "'
    set @bcpCommand = @bcpCommand + @FileName + '" -U username -P password -c'
    
    EXEC master..xp_cmdshell @bcpCommand

    This dumps a load of postcode information, based on usage, into a csv file in c:\temp\bcp. What the query is doesn’t really matter, just the bcp commands to provide us with the results in a file of our choosing (.csv in this case).

    The @FileName command simply appends the current date to the file in order to keep track of queries.

    Mounting a network drive in Linux (Ubuntu)

    This is a very simple thing to do, it isn’t however as simple as one might think if you are coming from a Windows background, and are used to mapping a network drive from the Tools menu. As a note this is a guide for Ubuntu, although I have it working fine on both Ubuntu and Fedora, use the appropriate package manager/command line for Fed and the rest is the same.

    First, we need to make sure that samba is installed:

    sudo apt-get install smbfs

    Next, we need to make a directory to mount the drive too. As an example, I’ve just reinstalled my Ubuntu (and Fedora) distribution, and so want to map the music drive on my server. I chose /media/ as the logical place to stick my network drives:

    sudo mkdir /media/music

    Next we need to tell the file system table where the drives are, and where to mount them. We also need to include our login credentials (will cover this later).

    gksudo gedit /etc/fstab

    Scroll to the bottom of the file and add the following:

    #Mounting Network Drives
    //SERVER/SHARE-NAME /MOUNT-POINT smbfs credentials=/credentials-file-location

    To make the above make a bit more sense, here is my configuration:

    //192.168.1.50/Music /media/music smbfs credentials=/home/russell/credentials.smbcredentials
    //192.168.1.50/Videos /media/videos smbfs credentials=/home/russell/credentials.smbcredentials
    //192.168.1.50/Software /media/software smbfs credentials=/home/russell/credentials.smbcredentials

    What this will do is to check within the credentials file (more on this at the bottom) your username and password for your server (I am running a Windows Home Server as an example).

    Next, we need to make the filesystem mount the drive, which we do simply with:

    sudo mount -a

    Finally, we need to make that credentials file. Simply navigate to your chosen directory (I stuck it in my /home/russell directory for ease), create a new file with the following information:

    username=username
    password=password

    And save it with the same filename you gave the /fstab/. Thats it.

    EU Probes Google Antitrust Case

    This is long, long, LONG overdue.

    I was going to write a few things, but this comment on the Times Website succinctly summed it up, so thanks to “I.M. Jolly”.

    The difference between “do no Evil..” Google and Microsoft is, MS are a damn sight less hypocritical about their monopoly postion. And abuse thereof.

    If the simple fact that “Google is rapidly increasing how much it spends on lobbying in the United States..” doesnt tell you anything, I dont know what else will – ok Google fanboys, you can now go back to your Google searches for everything, Your GMail with targeted ads based on the content of your mails and put your head back under the pillow. For the rest of us, I am sure we can agree that some scrutiny of a company which has basically won control of the internet, while gaining a very, very large amount of personal users data and their surfing habits, is entirely overdue.

    Or, maybe, as the Google CEO (Eric Schmidt) himself says, “”If you have something that you don’t want anyone to know, maybe you shouldn’t be doing it in the first place..” – unless of course, that knowledge is personal details of his, obtained by CNET Journalists only via Google searches. Google blacklisted CNET for about a year over this, then again, they really do have to the power to be both evil and hypocritical, whenever it suits. The public have somewhat less choice in blacklisting which Information Google collects from them.

    However, Google only use the info they have collected on YOU to sell ads, dont they? No problem there, then.

    Rsync and Bash

    Have had an interesting morning delving into Bash, on MSN with Jasper, which is not something I get to do often enough.

    The upshot was a nice and fairly sophisticated rsync script to backup some files, which I won’t paste here as it’s Jaspers baby.

    However, I did think up a [much] simpler script to enable a quick and dirty backup of any particular folder to any particular media.

    #!/bin/bash
    sudo rsync -av –progress –delete –log-file=/dir/$(date +%Y%m%d)_rsync.log /dir /media/dirBackup

    You can of course exclude certain files from the backup with:

    –exclude “/dir/.jpg”

    Naturally, no one wants to type it out everytime and so lets make it into an executable script:

    sudo chmod +x /path/rsync-backup.sh

    So you now have an executable script you can call whenever you want, or you can of course create a cron job and have it run automatically.


    Here’s a slightly more sophisticated backup script that revolves on a weekly basis, and then clears out any backups that are older then this.

    #!/bin/sh
    # directory to backup
    BDIR=/home/$USER

    # excludes file
    EXCLUDES=$HOME/cron/excludes

    # name of the backup machine
    BSERVER=server

    # password on the backup server
    export RSYNC_PASSWORD=

    # lets get down to it
    BACKUPDIR=`date +%A`
    OPTS=”–force –ignore-errors –delete-excluded –exclude-from=$EXCLUDES
    –delete –backup –backup-dir=/$BACKUPDIR -a”

    export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

    # the following line clears the last weeks incremental directory
    [ -d $HOME/emptydir ] || mkdir $HOME/emptydir
    rsync –delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
    rmdir $HOME/emptydir

    # now the actual transfer
    rsync $OPTS $BDIR $BSERVER::$USER/current

    Dragon Age: Origins

    I haven’t been excited about a computer game in ages, but this game is fantastic. It has everything. As a spiritual sequel to Baldurs Gate II, Bioware have outdone themselves. There are, naturally, a few issues but given that I’m gaming on a laptop – albeit a super powerful one – the simple fact that it’s been 100% stable is a blessing.

    Have a video: http://www.filefront.com/14913337/highdragon.avi/

    Windows Home Server

    Well I finally got round to installing this on my custom built server, and I’ll tell you something, I quite like it. It’s easy to set up, easy to configure and easy to use. No worrying about what raid to use, just automatic duplication if desired. And automatic backups. Just whack in a few drives and away she goes.