1) Introduction
Here's a longish guide to unlock, root and run Debian on your Nexus One.
It's based on various guides and forum posts around (see embedded links), but with more details, with some missing pieces and corrected mistakes, all compiled into a (hopefully) newb-friendly step by step guide.
Note THIS WILL WIPE THE SETTINGS AND APPS FROM YOUR PHONE, so backup first (I suggest Astro for your apps).
This will not affect Android at all; it will be as it was the first time you turned the phone on.
You will need between 1.5 and 2 GB of free space on your SD card.
I did this after I had applied the first Android patch (Feb 2010), and the patch seemed unaffected (ie. I still had multitouch afterwards)
2) Connect the phone to computer
- Install the Android SDK on your computer.
$ sudo gedit /etc/udev/rules.d/51-android.rules
- Save these two lines into the file:
$ sudo chmod a+rx /etc/udev/rules.d/51-android.rulesCode:SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666" SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
$ sudo service udev restart
Now, for example, if you plug in the phone and run
$ sh android-sdk-linux_86/tools/ddms
you will see the phone listed. (Note: this is not a step in the howto)
3) Unlock the bootloader
- Turn the phone off.
- Hold the trackball down, and turn it back on. The phone will boot into the white bootloader screen with Androids on skateboards.
- Plug the phone into the computer
- The title of the menu on the phone will be FASTBOOT USB.
- Download fastboot.zip from the link in the OP here and open a terminal window wherever you extract it's contents to
$ sh ./fastboot-linux oem unlock
- If you see "< Waiting for device >" you may need to use the power button to select BOOTLOADER and FASTBOOT to switch back and forth between the two menus a couple of times, until the phone connects to the computer.
- The phone will now ask if you want to unlock the bootloader, select yes.
The bootloader is now unlocked, the bootloader screen will have a pink UNLOCKED at the top, and an open lock is displayed in the phone startup graphics.
4) Root the phone
- Check Build Number in Settings > About Phone. Mine was ERE27
- Go here to get the appropriate Superboot image. I used the himem version of ERE27, to make full use of my RAM.
- Turn the phone off, and back on with the trackball held down to get into the bootloader screen
- Plug the phone into the computer
- Unzip the Superboot archive file, and open a terminal window there
$ sh ./install-superboot-linux.sh
- Go to Settings > Applications > Development > allow USB debugging on the phone.
Now if you enter "su" into a terminal app on the phone such as Android Terminal Emulator (don't use Terminal Emulator - no virtual keybd) you will be root. You also have the Superuser Permission icon available in the phone applications
4) Install Busybox
- Get busybox from their website (build from the src if you like, but I just downloaded the 1.16.0 binary for ARMv6l)
- Plug in phone (turned on and running, not in fastboot)
- Rename the busybox-armv6l file to "busybox" and put it in android-sdk-linux_86/tools. Open a terminal window there
$ sh ./adb shell
# su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# exit (repeat if necessary, until out of adb shell)
$ sh ./adb push busybox /data/local
$ sh ./adb shell
# su
# chmod 755 /data/local/busybox
# /data/local/busybox mkdir /system/xbin
# cd /data/local
# ./busybox cp /data/local/busybox /system/xbin
# cd /system/xbin
# chmod 755 busybox
# ./busybox --install -s /system/xbin
# rm /data/local/busybox
# reboot
The phone will reboot, busybox is installed.
5) Install Debian
(Based on this guide, and using the image from it.)
- Download the Debian installer files
(Should download fine, but if not then check this thread for links: http://forum.xda-developers.com/showthread.php?t=529233)
- Extract all the files
- Copy bootdeb, debian.img, debian.sh, mountonly, fsrw, uninonfs to /sdcard/debian/ on the phone (make the directory if needed)
- Copy vnc.apk and swapper.apk to android-sdk-linux_86/tools/
- Plug the phone in
- Open a terminal window in android-sdk-linux_86/tools/
$ adb remount
$ adb install vnc.apk
$ adb install swapper.apk
$ adb shell
# cd /sdcard/debian
# su
# sh ./debian.sh
# exit (repeat until out of adb)
- Fix a line in bootdeb. Replace this line:
with this:Code:mount -o loop,noatime $kit/debian.img $mnt
- On the phone Run swapper. Set swap to 96 MB. Set swappiness to 60. Press "Swap ON"Code:mount -o loop,noatime -t ext2 $kit/debian.img $mnt
- Install "Android Terminal Emulator" (not "Terminal Emulator") on the phone through the market
- Open terminal emulator on the phone
# su
# sh /sdcard/debian/bootdeb
- Press the home button
- open androidVNC
Nickname = anything
Password = android
Address = LocalHost
Port = 5901
Colors = up to you
- Press connect
That's it, you now have Debian running on your N1.
To exit cleanly press and hold the home button, go to the terminal, enter "exit".
Every time you want to start Debian, do swapper, terminal, androidVNC, as above.
AndroidVNC isn't necessary if you don't want a GUI.
4) Conclusion
If you discover any ways, or any packages to install, that make Debian easier or better to use on the N1, please put them in this thread.
Note Debian here is just an image chrooted in Android. It is not running directly on the hardware, but this is possible. However, switching between Android and Debian then becomes painful, and requires a reboot, so I prefer this way.



Adv Reply




Bookmarks