[G2 and Desire Z General] fastludeh22:
YES YOU NEED TO READ THIS WHOLE POST, PROB MORE THEN ONCE TO MAKE SURE YOU GOT IT. YES I KNOW HOW LONG IT IS, I TYPED IT!

the reason i call it a semi-brick is because a true brick can bot be recovered with out opening the case.

first go here and read this for info: http://xdaforums.com/showthread.php?t=838484

now since your here im going to assume that its too late.

*things you will need.

copy of cwm recovery. get it here (the manual install link): http://xdaforums.com/showpost.php?p=9145724&postcount=28

adb installed and working.

a known good rom, or nandroid backup. here is one: http://xdaforums.com/showthread.php?t=836042 (use odex one)

a wpthis.ko for YOUR specfic kernel (run (adb shell cat /proc/version) that will tell you what kernel you have)

*first thing we need to know is, are you s-off or s-on now?

if your s-off just boot into clockwork mod recovery, wipe the phone and flash a known good rom and be done with it. if you dont have cwm recovery installed. boot into fastboot (vol down+power) you must have the sdk/adb installed and working, and type fastboot flash recovery LocationOfRecovery.img (where LocationOfRecovery.img= where you have the recovery, ie c:\android\recovery.img). once thats installed follow instructions above.

*if you are s-on:

will the phone boot into android? if so your not bad off.

if you want to unroot to return the phone, follow the unroot thread here: http://xdaforums.com/showthread.php?t=835971

if you dont want to unroot then you have a couple of different options. if you have cwm recovery still installed, just follow instructions above and flash a known good rom. ive been told that boot.img (kernel) wont flash if you are s-on. the way to fix this (temporarily) is boot into recovery, but before you flash run these commands:

(put wpthis.ko in sdk folder)

adb remount

adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)

adb shell

# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)

then proceed to flash the rom. once booted into android skip down to, "now to get back to s-off"

*if you have stock or eng-recovery installed.

will the phone attempt to boot android at all? where is it stuck at?

a good min after it starts to try to boot, type these commands:

adb remount

adb shell

if you can get in shell then theres still hope. back out shell for a second and start here:

put the cwm recovery.img and wpthis.ko in your sdk folder

adb remount

adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)

adb push recovery.img /data/local/recovery.img

adb shell

# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)

# dd if=/data/local/recovery.img of=/dev/block/mmcblk0p21 (now wait a min or 2 to give it time to finish)

#sync (give it another min or to just to be safe)

#reboot recovery

at this point you should be in cwm recovery. follow instructions above for flashing with s-on.

*if you cannot get into shell while booting, but have eng-recovery installed, there might be some options.(however this is all theory)

boot into recovery-

if you are on linux using adb, you can try taking sh from /system/bin folder of any custom rom, chmod 0755 it, then push it to /system/bin and adb shell might work.

windows-

boot into recovery.

a system.img compatible with your installed kernel pushed may work. put the system.img into the sdk folder.

adb push system.img /data/block/mmcblk0p25

then reboot and see where you are. if that dont work, grab the modified miscnew.img here: http://www.4shared.com/file/pUPfrGi-/mmcblk0p17.html

rename it misc.img put it in sdk folder and

adb push misc.img /dev/block/mmcblk0p17

then reboot into bootloader with PC10IMG.zip on root of sdcard and it should run though. if it does your fully stock and get to start all over again.

*if you cannot get into shell, and you have stock recovery, im sorry your pretty screwed. as of right now the only thing thats gonna bring it back is a full img/update signed from htc thats equal to or higher then the version currently on the phone. (well and jtag of course)

*well now you've done one of the steps above. your booted into android, you have perm root, and cwm recovery installed, just still s-on. dont worry your almost there!

first take that wpthis.ko for you kernel and push it, and the eng hboot.

adb push wpthis.ko /data/local/

adb push hboot-eng.img /data/local

then from adb shell, or terminal root prompt:

# insmod /data/local/wpthis.ko (again you should get the function not implemented error)

NOW REMEMBER THIS NEXT STEP COULD MEAN DEATH FOR YOU G2 IF TYPED WRONG, AND AFTER ALL THIS HARD WORK!

# dd if=/data/local/hboot-eng.img of=/dev/block/mmcblk0p18

wait a few mins to be sure its done.

# sync

wait a few more just cause.

reboot, you should now be s-off, cwm recovery installed, and free to do whatever you want. just dont go screwing it up again ;)

* as new methods are discovered, or ones here are proven wrong, i will update as necessary. as of the writing post, 2 devices that i know of have been saved!

good luck!

wpthis.ko for bacon bits.03 kernel: http://www.4shared.com/file/OAcd1bix/wpthis-263221-cyanogenmod.html