Category Archives: How to

Nexus One boot before Blackrose install

How to install Blackrose on Nexus One using GNU/Linux

Introduction

Blackrose is a powerful software. It can do a lot of things, but its most useful ability is to resize internal storage. On Nexus One you have to do so in order to install ROMs with greater size as… Ice Cream Sandwich (I’m preparing a guide).

Disclaimer

I AM NOT RESPONSIBLE IF YOU BRICK / RUIN YOUR PHONE IN ANY WAY.
BASIC COMPUTER SKILLS REQUIRED.
PROCEED WITH CAUTION.

Installing is safe, but using Blackrose can wipe out all your data. Proceed at your own risk. Make sure you backup all your data before proceeding.

Prerequisites (my situation)

  • pc with Ubuntu Linux 12.04 64bit
  • adb installed and working
  • USB cable
  • Nexus One data:
    • rooted device (probably not necessary)
    • ClockworkMod recovery installed (probably not necessary)
    • unlocked bootloader
    • HBOOT-0.35.0017 (other hboot are supported, see documentation)
    • RADIO-5.08.00.04
    • S-ON

Needed software

Configure udev

If you get this output, you can skip this section:
$ fastboot devices
HT9CWP81XXXX fastboot

In an Ubuntu environment you cannot access these devices without root user.

If you think it’s annoying (as I do), you can configure udev daemon in order to set appropriate permissions on these device files.

It’s sufficient to create a new udev rule file in /etc/udev/rules.d path:

# cat /etc/udev/rules.d/65-n1.rules
# Nexus One
SUBSYSTEM=="usb", ACTION=="add", \
ENV{ID_MODEL}=="Android_1.0", \
ENV{ID_MODEL_ID}=="0fff", \
ENV{ID_VENDOR}=="htc__Inc", \
MODE="0666"

There is no need to reload any daemon because the rules get reloaded any time a change in rule files occurs.

Step by step guide

  1. phone must be on
  2. phone debug mode must be enabled (check Settings -> Applications -> Development -> USB Debugging)
  3. connect phone to pc with USB cable
  4. unpack archive
    unzip -d blackrose_120421 blackrose_120421.zip
  5. run Blackrose (package contains an executable binary for GNU/Linux)
    cd blackrose_120421
    chmod +x Blackrose
    ./Blackrose

Example output

First use (installation)
-------------------------------
| Nexus One BlackRose 120421 |
| Made by Lecahel(XDA-dla5244) |
| Dok-Do belongs to KOREA |
-------------------------------
Do at your own risk
Don't flash any unsigned radio image
Don't flash eclair rom(eg.EPF30), if you are SLCD Nexus One user
If you are using sense rom, please install HTC Sync and turn off that now
Your N1(USB Debugging ON) should be connected to PC
If your device has already installed latest BlackRose, it will enter into BlackRose menu
Otherwise, BlackRose will be installed or updated automatically
* Waiting for device...
* daemon not running. starting it now *
* daemon started successfully *
* Getting device information...
0 KB/s (2 bytes in 0.040s)
0 KB/s (6 bytes in 0.039s)
0 KB/s (10 bytes in 0.040s)
0 KB/s (1 bytes in 0.040s)
* Installing BlackRose
1707 KB/s (4194304 bytes in 2.399s)
566 KB/s (26172 bytes in 0.045s)
970 KB/s (131072 bytes in 0.131s)
< waiting for device >
sending 'recovery' (4096 KB)... OKAY
writing 'recovery'... OKAY
sending 'hboot' (512 KB)... OKAY
writing 'hboot'... OKAY
rebooting into bootloader... OKAY
* BlackRose has been successfully installed if your HBOOT changed to 7.35.5017

Then your next execution will be as this:
./Blackrose
-------------------------------
| Nexus One BlackRose 120421 |
| Made by Lecahel(XDA-dla5244) |
| Dok-Do belongs to KOREA |
-------------------------------
1 Apply stock/custom BlackRose
2 Disable HBOOT flashing protect
3 Uninstall BlackRose
4 More information
5 Exit
Please make a decision:

References

Raspberry Pi tip: mount Raspbmc images

The problem

When you download a Raspmc (Raspberry Pi Media Center) image it’s a .zip file.
If you want to check the content of the file you must find a way to mount the image.

Prerequisites

  • a pc with GNU/Linux
  • a user with root permissions on the pc
  • the image you want to analyze (download from the site)

Procedure

  1. first of all unzip the archive$ unzip installer.zip
  2. you’ll notice one file: installer.img that’s an image of a block device:$ file installer.img
    installer.img: x86 boot sector; partition 1: ID=0xc, starthead 0, startsector 2048, 131072 sectors; partition 2: ID=0x83, starthead 3, startsector 133120, 251904 sectors, code offset 0xb8
  3. create a mount point$ mkdir /tmp/mnt-installer
  4. if your “file” output gives you less informations, you can examine the image structure (sizes in Sectors) with the following command$ sfdisk -uS -l installer.img
    Disk installer.img: cannot get geometry
    Disk installer.img: 24 cylinders, 255 heads, 63 sectors/track
    Warning: The partition table looks like it was made
    for C/H/S=*/4/32 (instead of 24/255/63).
    For this listing I'll assume that geometry.
    Units = sectors of 512 bytes, counting from 0
    Device Boot Start End #sectors Id System
    installer.img1 2048 133119 131072 c W95 FAT32 (LBA)
    installer.img2 133120 385023 251904 83 Linux
    installer.img3 0 - 0 0 Empty
    installer.img4 0 - 0 0 Empty
  5. take a note of what you want to mount, i.e. img2 (Linux filesystem) as I highlighted
  6. with root permissions, mount the desired partition on the previous created path (133120 is the Start sector taken from the last output)$ sudo mount -o loop,offset=$(( 512 * 133120)) installer.img /tmp/mnt-installer
  7. check the content$ ls -lAtr /tmp/mnt-installer
    total 96
    drwxr-xr-x 2 root root 4096 Jul 21 2010 selinux
    drwxr-xr-x 2 root root 4096 Mar 27 23:44 sys
    drwxr-xr-x 2 root root 4096 May 7 17:28 proc
    drwxr-xr-x 2 root root 4096 May 7 17:28 mnt
    drwxr-xr-x 2 root root 4096 May 7 17:28 home
    drwxr-xr-x 2 root root 4096 May 7 17:28 boot
    drwx------ 2 root root 16384 Jun 18 02:26 lost+found
    drwx------ 2 root root 4096 Jun 18 02:27 root
    drwxr-xr-x 2 root root 4096 Jun 18 02:27 srv
    drwxr-xr-x 2 root root 4096 Jun 18 02:27 opt
    drwxr-xr-x 2 root root 4096 Jun 18 02:27 media
    drwxr-xr-x 13 root root 4096 Jun 18 02:27 var
    drwxr-xr-x 10 root root 4096 Jun 18 02:27 usr
    drwxrwxrwt 2 root root 4096 Jun 18 02:27 tmp
    drwxr-xr-x 2 root root 4096 Jun 18 02:31 sbin
    drwxr-xr-x 9 root root 12288 Jun 18 02:31 lib
    drwxr-xr-x 43 root root 4096 Jun 18 02:31 etc
    drwxr-xr-x 2 root root 4096 Jun 18 02:31 bin
    drwxr-xr-x 4 root root 4096 Jun 18 02:31 dev
  8. when you have done, unmount the filesystem$ sudo umount /tmp/mnt-installer

HowTo: install ClockworkMod Recovery on Xperia X10 Mini Pro using GNU/Linux

Prerequisites

I can show you my situation, I can’t confirm that my guide is usable in different cases:

  • sim unlocked, stock Xperia X10 Mini Pro device rooted (I used my guide)
  • firmware 2.1.1.A.0.6
  • baseband M76XX-TSNCJOLYM-53404015
  • a pc with Ubuntu 11.10 64bit
  • fully functional adb (find more info here)

Disclaimer you must agree before you proceed

Please double check the requirements I wrote before you proceed and remember that:

  • I am not responsible if you brick / ruin your phone in any way;
  • some computer skills are required;
  • do a full backup of your data NOW, it’s not programmed, but you may loose them

Software requirements

CWMInstaller-Linux-v4.zip: download from here or from my mirror.

Do some backup before changing things

On your pc:
adb shell
on the device
# su
# mount -o remount,rw /dev/block/mtdblock0 /system
# cat /system/bin/chargemon > /system/bin/chargemon.original-backup

It’s time to get the job done

The package is done to allow anyone to easily install the whole thing, but I wasn’t able to use the script.
You can see what I did to manually achieve the result.

On your pc
$ unzip CWMInstaller-Linux-v4.zip
$ cd CWMInstaller-Linux/
$ adb push files/ /data/local/tmp

On the phone
$ su
# mount -o remount,rw /dev/block/mtdblock0 /system
# cat /data/local/tmp/recovery.tar > /system/bin/recovery.tar
# cat /data/local/tmp/busybox > /system/bin/busybox
# cat /data/local/tmp/chargemon > /system/bin/chargemon
# chmod 755 /system/bin/recovery.tar
# chmod 755 /system/bin/chargemon
# chmod 755 /system/bin/busybox
# rm /data/local/tmp/chargemon /data/local/tmp/busybox /data/local/tmp/recovery.tar

Done!
# reboot

Test it making a real backup

When booting your phone and when the “Sony Ericsson” letters appear (not the logo), press and release continuously the “back” button.
Once you are in the CW recovery, use the volume keys to navigate upwards / downwards, the “home” or “camera” button to select, the “back” button to go back.

Go to “backup and restore“, “backup” and wait at least 3 minutes (on an empty device).

Conclusions

Now you are ready to install some new ROMs on your device.

References