First, make sure you have G1 or HTC Dream, a PC, SD card, a good internet connection. Then, you need to root your phone.
After you will complete the rooting process, a message will be displayed on your screen which will state, ‘Now you have root’. After confirming the message, come back here.
Now, go to the Android Market and search for the app ‘Rom Manger’. You can simply download the free version.
Then, install Mod from Rom Manager or Clockwork Recovery.
Make a full Backup with the Rom Manager. It is very important for you to keep full backup so as to avoid any kind of data loss.
In ROMs section or the Rom Manager, you will have to search for ‘CyanogenMod’. If you are asked, tap the correct device.
Now, Flash the ROM with the Rom Manager and your operating system is ready to be used.