[Nexus One Q&A, Help & Troubleshooting] Fituate:
Hi all, I wrote a long-winded Tutorial to put Evervolv KitKat on a stock N1. I don't have a stock N1 (I stumbled all the way through this process and got done yesterday, was so excited I wrote this tutorial) and don't know how to get it back to stock, so I'm wondering if anyone who has one and has experience putting new ROMs on other devices would like to test this out and let me know if anything doesn't work as written. Please go ahead if you like and reply your updates! Once it's dialed I'll make it a thread in the N1 ROMs forum.

Here's the text:

How to put KitKat on a Nexus One (And have computing power & space to spare):

Things you'll need:

1. A Windows/Linux computer with internet connection, USB port, and terminal

2. A USB Cable

3. A Nexus One with the most recent stock gingerbread rom (Settings->about, look for Android 2.3.6 or GRK39F, else apply/google updates to get to that version)

Before you begin, note that you're playing with a generally safe form of fire, but when playing with fire, you may brick your phone. The maker of this guide and any sites you visit during the process assume no responsibility, the user assumes full responsibility for lost work and damaged or ruined phones. Your warranty will be voided about six times over. Save all your stuff somewhere, save apps with Titanium Backup (Google it) or something, and do a full Nandroid backup (Goog that too) before you begin. You will be fully wiping your phone and SD card multiple times. Make sure at every step of the process that your battery is at least half full. Running out of battery during an update can cause bricks. In this guide, “Boot” means standard boot, the way it normally turns on. Not hboot or fastboot or recovery.

I did part of this from a Windows7 computer on Cygwin and part on Ubuntu 12.04, each presented some annoyance but by far the greatest was due to my Linux ineptitude with PATH and Root. If you're trying the same, I've made an appendix for that.

It may help to have a brief conceptual overview of what you'll be doing in case you run into snags and have to step out of the walkthrough. Your N1 has a few basic parts: Internal memory that is chopped into 3 partitions: One for the system files (System) , one for the files that they will need to make during the first bootup and use in order to operate, along with your apps and their created files (Data) and one for temporary files that your OS and apps can regenerate (Cache). Somewhere in there it also has space for a Radio (that also includes some critical power functions, flashing a new radio is the easiest way to brick an N1 but we won't), as well as a Recovery partition and an Hboot&Fastboot partition. We will be messing with Recovery and Hboot. The virtual machine that turns all the friendly pseudo-english computer code into 1s and 0s for the processor to deal with is called Dalvik, named after a town in Iceland where some old dev's family is from. It has its own Cache (the VM, not the town, as there are no longer any fish in Iceland :P). It's SOP to wipe Cache & Dalvik before and after applying any updates, and wipe Data (Factory reset) before applying most updates. Sometimes when my phone bogs I reboot to recovery and wipe caches just for funsies. This makes it take longer to boot the phone and to use each app just the first time after that, while the files are created fresh. The phone also should have an SD-Card. You should have or buy an 8+MB, Class 10 SD card. The class relates to read/write speed, anything less than 10 will noticeably slow your Nexus One's operation. Why?

Because we're going to put some of your operating system on the SD card. We're going to use a special recovery system (aka recovery ROM) called “4ext” to partition your SD card. Mine is 16GB, partitioned to 14GB for storage and 2GB to use as fake internal memory, where my system's Data and Cache live. The KitKat System files that normally live on internal memory's System partition are too big for a normal N1, so we'll use a special Hboot called BlackRose to repartition your internal memory so you can fit KitKat, and then after you first boot it up we'll use an app called Mounts2SD to install a startup script so that every other time you boot it up after that, it will know to find Data and Cache on the SD card. In order to install BlackRose, you'll need to be running CyanogenMod Rom as your main OS, and in order to do that you'll need ClockWorkMod Recovery ROM. So the installation order will be: ClockworkMod recovery->Cyanogen7OS (Gingerbread based)->4ext recovery to partition SD card->BlackRoseHboot to repartition internal memory->Evervolv KitKat-based N1 ROM-> run Mounts2sd for startup scripts ->reboot to your new life among the anatomically modern cyborgs (and then you're on your own for getting all your apps and music and contacts and stuff back on the phone from wherever you saved it).

Ready? Here we go!

1. Install the Android SDK on your computer.

1. Get the appropriate version here: http://developer.android.com/sdk/index.html

2. Unzip it.

3. Run the setup.exe (if using windows)

4. When asked which packages to install, choose “Android SDK Tools”, “SDK Platform Android 2.1″, and “Usb Driver package” (If you use eclipse, check that last link for instructions on using the ADT plugin (Not the same ADT that cuts your paycheck, much less inept))

5. Make sure the USB drivers installed properly (windows).

1. Go to printers and devices in the control panel, or device manager

2. If you see an android device with no warnings, you're golden. If it has warnings, right click it and go properties->update driver (driver can be found in your android sdk directory where you unzipped the sdk bundle, in \usb_driver).

6. Boot up your N1 and plug it in to the computer. If the computer recognizes it and they play nice, you're set with the sdk. To extra check, open terminal and cd to the sdk's platform-tools folder that should contain the adb utility. Type #adb devices and see if it comes up with a message telling you that it's running a daemon on a port like 5037, and then lists something like HT9CPP800063 device. This is your phone, it's telling you you're beyond connected. You've got the sdk working. Else have your friend Google help you get the SDK properly installed.

2. Root the phone so it will let you dig in.

1. Put your N1 in USB debugging mode (Settings > Applications > Development > USB Debugging)

2. In the terminal, in the platform-tools folder, type #adb reboot bootloader. (((My phone has a power hardware issue and will not reboot while plugged in ever to any mode ever at all ever, if yours does too you can unplug (first type #adb kill-server to make it ok to unplug) the usb cable, power down, wait five seconds, and hold the trackball and power button to power back up into the bootloader, then plug in again. There was a lot of unplugging, waiting fifteen seconds, booting while holding buttons, plugging in, adb devices -ing that I will omit henceforth due to low likelihood that you have the same problem.)))

3. Using the onscreen directions on the phone and the hard buttons, navigate to fastboot mode. It may be unresponsive and throw some not-found messages for five seconds before it lets you do anything.

4. In the terminal on your computer, in the platform-tools folder, type #fastboot devices to see if your devices is connected (it should come up with the same HT#XXX###### number).

5. This step will gain Root access, unlock the bootloader, and WIPE ALL YOUR ****. Now type #fastboot oem-unlock . You may have to accept the warranty voiding. If for whatever reason it doesn't work, use this method http://code.google.com/p/bexboot/, and unzip the files to the platform-tools folder.

6. Using the phone buttons, reboot. Your little lock logo during the bootup should be unlocked now.

7. Power down and boot again for good measure. Re-enable usb debugging in the phone app dev settings.

3. Get ClockworkMod Recovery.

1. Download koush's ClockworkMod Recovery from : recovery-clockwork-5.0.2.0-passion.img and put it in the platform-tools folder.

2. To make sure the file is not corrupted and will not brick your goods, check the md5sum. This is the result of a complicated equation that easily reveals even a single flipped bit in the file by vastly changing the output. Google how to do this, in windows you'll need to download a tool like winmd5free. The output for this particular file should be: md5: 45716c8d51ed2375873f01f0b14b2184 If it's anything else don't use it.

3. Reboot to the bootloader again, either by #adb reboot bootloader or by powering up while holding the trackball, and navigate to fastboot.

4. Verify that you're connected with #fastboot devices

5. Flash ClockworkMod Recovery by typing #fastboot flash recovery recovery-clockwork-5.0.2.0-passion.img

6. It should give a success message. Reboot to recovery from the fastboot menu. It should be a sweet new blue and white ClockWorkMod recovery. Power down and reboot to recovery by holding volume up as you power up, just for good measure.

4. Get CyanogenMod7 ROM.

1. On your computer, go to http://download.cyanogenmod.org/?device=passion&type=stable and download the latest stable CM7 zip. Put it in the platform-tools folder.

2. Check its md5 as you did in part 3.

3. Do #adb-devices, which should give you that serial again, and the word recovery.

4. Place the zip file on the root of your SD card by doing #adb push cm-7.2.0-passion.zip /sdcard/

5. If that last step failed, try running #adb shell mount /sdcard or #adb kill-server then #adb devices then #adb shell mount /sdcard, then try the push again. Or mount the sdcard through the recovery menu before running that push command. Or use your computer's file system to drag and drop the .zip to the root (lowest) folder of the sd card.

6. Using the recovery menu, in backup and restore options, backup your current ROM.

7. In the format menu, do a wipe data/factory reset. Wipe the cache and dalvik cache while you're at it.

8. Back in the main recovery menu, do install zip → choose zip from sd card.

9. Select that CM7 zip file.

10. Return to the main menu and reboot the system. It should come up with a totally different looking leaner meaner version of Gingerbread, that gives you more control and speed and saves battery. But even with this system, given modern app sizes, you'll soon run out of room on the internal memory if you stop now. And besides, you're having too much fun.

5. Get 4EXT recovery

1. Go to 4ext.net and download the free .apk file: http://www.4ext.net/get.php?apk Congratulations if you're about to install your first not market app (apps are now .apk, not just something you get from the store's GUI.). Save it in platform-tools. Or, to be really nice to Max, you can just buy the app in the play store and skip the next two steps.

2. Enable USB debugging, plug in and #adb-devices.

3. # adb install 4EXTRecoveryUpdater.apk. You should get back a success message in a fistful of seconds.

4. At this point you may need to back out to regular settings, turn on wifi, and hook up to your wifi router.

5. Open the 4ext recovery updater app. Go to settings. Allow superuser permissions and everything else. It should detect Nexus One, connect to the internet, and boot you back to the main menu.

6. Go to online install. They're all release candidates and no stable versions, so just go with the newest one. Select install.

7. Wait for it to finish and then reboot to recovery, either by # adb reboot recovery or manually. You should have a beautiful new touchscreen recovery.

6. Partition your SD Card

1. In recovery, go to tools->partition sd card->remove all partitions and start from scratch.

2. For the first Ext partition, where you'll be keeping a good chunk of your OS, The consensus online is not to go above either 1.5GB or 2GB. I'm working fine with 2GB aka 2048MB.

3. You can skip the 2nd Ext partition.

4. The internet says Swap size should be 0.

5. Internet says File system should be ext4. This should do the partitioning, the rest of your SD card will still be great for storage as before.

7. Repartition internal memory using BlackRose:

1. I have never used BlackRose on Windows, but here goes: go here : http://xdaforums.com/showthread.php?t=1270589 and download this zip archive: http://xdaforums.com/attachment.php?attachmentid=1016437&d=1334971685; It has windows and linux files. The site also has a manual in case this walkthrough lets you down.

2. Unzip it into a folder in your platform-tools. Execute it with a ./ in linux or a .exe in win. It should say waiting for devices.

3. Reboot your phone manually. BlackRose should hijack the startup, install itself, and quit. Boot your phone up again.

4. Blackrose is rumored to have an interactive guide to partitioning, but it didn't work for me and at least some other genius on the internet, but being an industrious Austrian, he figured out the fix: Run Blackrose in Editor mode. Type resize as prompted.

5. The post here http://xdaforums.com/showthread.php?t=2540366 on Evervolv KitKat implies that 250MB for System works with enough space for Gapps (Google does not allow their standard apps like Play Store to be included with Mod roms anymore, so you will need to install them from recovery too, but they distribute them bundled so it's not hard.), and some commenter said 260MB, but that didn't work for me long enough to run startup scripts and move some of it off. So I had to redo it and I went with 265MB for System and 10MB for Cache, which is working fine. Give it a name, I went with Kat.

6. BlackRose will shut down, but it will leave a golden turd in the form of a file called hboot_brcust.nb0 probably in the folder called “other.” That's what you want.

7. Put that file in the same folder as the Blackrose utilities fastboot-l and fastboot-w if it's not already there. Then boot your phone into fastboot again, via adb or manually. I think. Maybe try this from being standard booted up if the next part doesn't work.

8. Run # fastboot-l flash hboot hboot_brcust.nb0 . Windozers should use fastboot-w instead. Blackroot will wait for the device again.

9. Reboot your phone into the bootloader manually, by holding the trackball while powering up. The image should install on this boot, resizing your phone's internal memory partitions.

10. Run # fastboot -w. Your Bootloader should be loaded up, with the 1st line saying something about BlackRose and the 2nd line saying 265/10/161. This is how you know it worked. That 265 is where it's at for KitKat. Your main OS had been destroyed, but your Recovery ROM should still work.

8. Install Evervolv KitKat.

1. Go here http://evervolv.com/devices/passion and download the latest stable release. At press time that's the 4.0.0p4.2 version. Save it to platform-tools.

2. Reboot to Recovery from the menu in the BlackRose bootloader.

3. Do # adb devices. Then do # adb push ev_passion-4.0.0p4.2-perdo-squished.zip /sdcard/ . If it doesn't work, try using the touch recovery menu to toggle mount USB, then push, then unmount. Or mount USB, use the computer's file system to move the file to the root of the sd card, then unmount USB. Or try as root if you're using linux.

4. From the main recovery menu, select install zip from SD card → choose zip → select the ev_passion-4... zip. Wait up, it could take a while.

5. Success!! Right? Right. #adb kill-server, you can unplug now and won't need to plug back in! Reboot the phone, you're getting perilously close! This boot could take five plus minutes, or just one, but be patient.

9. Install Gapps.

1. You are such a lucky dog. Gapps bundled updates are available through the Evervolv toolbox. So you can get Play Store and everything else will come easy. Go to settings → wifi, turn it on, hook it up to your wifi router.

2. Back up to settings, and go Evervolv Toolbox → Updates and swipe over to the Gapps section. Tapp the most recent Gapps-kk zip. Tap the down arrow to download.

3. Reboot manually to recovery.

4. From the main recovery menu, select install zip from SD card → choose zip → select the gapps-kk... zip. This could also take a sec.

5. Reboot again! You're almost done! When it's all loaded up, Play Store should now be installed, as well as various google options that you can enable through the Evervolv settings.

10. Install Mounts2sd.

1. Go to the Play Store and get Mounts2sd.

2. Hit the top right corner for application settings. You'll need to install a startup script. Agree, give it permanent superuser status.

3. Reboot.

4. Go back into Mounts2sd, and go to the Tool menu (Wrench). Note that boxes aren't checked unless they're green-checked.

5. Enable the Cache to move cache partition to data or sd-ext. Storage threshold is up to you. Make sureApplications, Libraries, Data, and Media are all checked. Dalvik should stay unchecked, System apps can too.

6. Reboot again.

11. You're done!!! Or at least we're done. You still have to restore your apps and put all that music back on and figure out how to resync your contacts and... Good Luck.

12. If you want to get extra tricky, it's believed to be possible to leave app data on the real internal memory by default, and use Titanium Backup to move the data of most of your apps to the SD-ext, thereby leaving the data of your favorite apps on real internal memory. Use at your own risk.

ENJOY!!

Appendix 1:

Linux PATH env: I put all my android stuff in a file called androidy, so my path to my platform-tools was /androidy/adt/sdk/platform-tools, and my blackrose was in there too. So to set my PATH, I used: $ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/sean/androidy/adt/sdk/platform-tools:/home/sean/androidy/adt/sdk/platform-tools/blackrose_120421/binary"

In order to make sure that while using it as root (as was necessary for some fastbot operations), I referenced the same PATH instead of the messed up root PATH, I used sudo env PATH = $PATH a few times.

Appendix 2:

The only actual bug I've noticed in a few days with this ROM is that my Chrome bookmarks don't add shortcuts to the homescreen when I tell them to from within Chrome. The widget-adder (longpress homescreen) has a bookmark option though, so if you bookmark it you can put it on the homescreen from there.

Huge Thanks to everyone involved with ClockworkMod, Cyanogen, 4Ext, BlackRose, and Evervolv!

Sources:

http://wiki.cyanogenmod.org/w/Install_CM_for_passion

http://nexusonehacks.net/nexus-one-...n-how-to-unlock-bootloader-on-your-nexus-one/

http://marian.schedenig.name/2012/07/22/installing-android-4-ics-on-the-google-nexus-one/

http://xdaforums.com/showthread.php?t=2540366&page=24