14 February 2016

Cyanogen on Nexus 7 (2012)

CyanogenMod is an aftermarket firmware for a number of cell phones based on the open-source Android operating system. It offers features not found in the official Android based firmwares of vendors.

Cyanogen commercially develops operating systems pre-installed on some devices (OnePlus One, YU Yureka, YU Yuphoria, Andromax Q, Lenovo ZUK Z1, Wileyfox Swift, Wileyfox Storm) based upon the CyanogenMod source code.
Initially distinguished with the suffix -S (CyanogenMod 11S), with version 12 Cyanogen rebranded the custom offering as Cyanogen OS.

Unlock the bootloader
# adb reboot bootloader
# fastboot oem unlock

Download latest CM recovery image from cm-grouper.
Installing recovery using fastboot

# adb reboot bootloader
# fastboot erase recovery
# fastboot flash recovery cm-12.1-20150901-SNAPSHOT-YOG4PAO237-grouper-recovery.img
# fastboot reboot-bootloader

Installing CyanogenMod from recovery

http://download.cyanogenmod.org/?type=snapshot&device=grouper
- Enter "Recovery mode""
-- Wipe data/factory reset
-- Wipe cache partition
-- Apply update
--- Choose from internal storage
---- 0
---- "cm-12.1-20150901-SNAPSHOT-YOG4PAO237-grouper.zip"
# fastboot reboot

Open Gapps is the best place for downloading Google apps suit for custom ROMs. Open Gapps packs common Google apps suit including Google Play Store app.
Download latest Open Gapps package from ogapps-nano
Installing Open Gapps 
# adb push open_gapps-arm-5.1-micro-20151002.zip /data/media/0/
# adb push open_gapps-arm-5.1-micro-20151002.zip /sdcard/
Enter "Recovery mode"
- Apply update
-- Choose from internal storage
--- 0
--- "open_gapps-arm-5.1-micro-20151002.zip"
# fastboot reboot

Lock the bootloader
# adb reboot bootloader
# fastboot oem lock

2. Installing from factory image
Download latest Google Nexus image from Nexus 7(2012).
Flashing Nexus image from Google

# adb reboot bootloader
# fastboot oem unlock
# flash-all
# fastboot oem lock

3. Installing from AOSP image
1. Recovery image TWRP 3.0.0.0 from here.
2. Marshmallow 6.0.1_r13 OTA-Package from here
3. Gapps for 6.0 from here.

Flashing Marshmallow image

# adb reboot bootloader
# fastboot oem unlock
#
#
# fastboot flash recovery twrp-3.0.0-0-grouper.img
# fastboot reboot
#
# press holding 'Volume (up)', 'Volume (down)' and 'Power' buttons.
# Enter recovery mode
# or
# adb reboot bootloader
#
(RECOVERY)# adb push aosp_grouper-ota-eng-20160203.ds.zip /sdcard/
(RECOVERY)# adb push benzo-gapps-M-20151011-signed-chroma-r3.zip /sdcard/
#
(RECOVERY)# From Install menu select AOSP OTA image and flash
(RECOVERY)# Reboot System
#
(RECOVERY)# From Install menu select GAPPS image and flash
(RECOVERY)# Reboot System
#
# fastboot oem lock

Reference:
https://en.wikipedia.org/wiki/CyanogenMod
https://wiki.cyanogenmod.org/w/Install_CM_for_grouper
http://download.cyanogenmod.org/?type=snapshot&device=grouper
http://techtrickz.com/download/open-gapps-project-best-place-for-downloading-latest-and-correct-google-apps/
https://developers.google.com/android/nexus/images
http://forum.xda-developers.com/nexus-7/development
http://forum.xda-developers.com/nexus-7/development/android-6-aosp-grouper-t3268172