Hi, litfoo...
The problem could be the bootloader... as seems to be the case from your output...
Code:
sending 'bootloader' (3911 KB)...
OKAY [ 0.484s]
writing 'bootloader'...
FAILED (remote: (InvalidState))
finished. total time: 0.688s
rebooting into bootloader...
As far back as Jellybean 4.3, there have been known issues
fastboot flashing the v4.23 bootloader... specifically the one from Jellybean 4.3 build JWR66Y. See
this thread for more details...
(it results in 'InvalidState' errors).
Since then, KitKat 4.4 and 4.4.2 have made their appearance on the Nexus 7, and it appears that Google have made an even bigger mess of things regarding the v4.23 bootloader that ships with the factory stock images
.
You should read this thread, over on XDA...
[WARNING][URGENT] N7 grouper (2012 WiFi) bootloader .img files from Google.
The upshot of this rather in depth technical thread, is you need to AVOID the v4.23 bootloader from KitKat build KOT49H... and acquire the v4.23 bootloader from Jellybean 4.3 build JWR66V -
(and NOT from build JWR66Y, which has similar problems)... and flash that one instead.
Here's my 'take' on what precisely is going wrong for you...
During the fastboot flash process back to Google factory stock, everything
(except the bootloader) gets erased, after which the new (v4.23) bootloader overwrites the old (v3.34) bootloader.
For you, this is failing to happen... for possible reasons as given above
(ie., it's corrupt, damaged or Google have just screwed it up!).
Since the rest of the factory stock flash process expects to find the new bootloader (v4.23) correctly flashed and in place... AND DOESN'T... it subsequently reports the error...
Code:
Device version-bootloader is '3.34'.
Update requires '4.23'
If you want the v4.23 bootloader ".img" file, get it from any of the JWR66V, KRT16O, KRT16S Google factory images.... and NOT from KOT49H.
A valid MD5 signature for the CORRECT v4.23 bootloader
".img" file for WiFi only
('grouper/nakasi') Nexus 7 devices is...
Code:
MD5: df53028033c9eccf4fe5ba7bc198ce24
A copy of the v4.23 booloader known to work
(ie., fastboot flash without errors) is available at the bottom of this post,
available here.
Download it, and exchange it with the the v4.23 bootloader from KitKat build KOTH49H... and try flashing KitKat again.
Whatever you chose to do... PLEASE BE CARERUL. If the Nexus 7 can be said to have an Achilles Heel or weakness, then it's flasing a new bootloader.
One little mistake... and the device is permanently hard bricked... and from which there is no recovery
.
Take care, and thoroughly read the links I've included above.
Good luck... and hope this helps.
Rgrds,
Ged.