[G1 Android Development] Scrip:
Compile CM6

Quick and Dirty guide to compiling CM6

I have read people saying you can't compile CM6 anymore because it is broken.

I thought I would take a look.

What follows is a quick guide to make it all work

I warn you now

Froyo takes longer to build than Gingerbread
​

I will be using sed to make the required changes

If you have already synced gingerbread then make sure you have pushed any local changes as described in the change kernel in post 1

but don't worry too much about that

alternatively if you have plenty of disk space copy the /Android/CM dir to /Android/CM6

cp -a /Android/CM /Android/CM6
cd /Android/CM6

Now that you are happy you won't lose anything let us begin

Delete the current projects

Make certain you are in the correct directory before doing this!​

You can just skip this bit, but I think it is nice to start clean.

# you can skip this if you are starting from scratch
tar -c vendor/htc/dream_sapphire -f ../vendor_htc_dream_sapphire.tar
# skip the above if you are starting from scratch
# but it will do no harm
rm -rf *

we made a backup of our prop blobs so we don't need to mess about later​

Initialise the froyo repo

repo init -u git://github.com/CyanogenMod/android.git -b froyo

Fix the issue with kernel.org and delete the missing alsa git repos

sed -e 's[git://android.git.kernel.org[https://android.googlesource.com[' \
-e '/alsa/d' \
-i .repo/manifest.xml

repo sync

repo --trace sync -c

Restore our vendor blobs

tar vxf ../vendor_htc_dream_sapphire.tar

If you are starting from scratch, refer to post 1 for how to get the blobs

or look for an attachment at the bottom of this post
​

The cyanogen_vibrant.mk is broken, since we don't care about the vibrant just remove it

sed -i '/vibrant/d' vendor/cyanogen/products/AndroidProducts.mk

The build looks for arm-eabi-4.4.0 in our tooolchain, but we actually have arm-eabi-4.4.3

sed -i 's/arm-eabi-4.4.0/arm-eabi-4.4.3/' build/core/envsetup.mk \
build/core/combo/TARGET_linux-arm.mk \
build/tools/adbs \
build/envsetup.sh

An alternative is to create a symlink

ln -s arm-eabi-4.4.3 prebuilt/linux-x86/toolchain/arm-eabi-4.4.0

CM6 defaults to compiling kernel from source, instead we shall be using one of Ezterry's

http://xdaforums.com/showpost.php?p=14768272&postcount=2427

get Froyo:

ezgb-2636-v1.5.2f_S.zip

md5: 20a010b6cb86a70dc09dbc93d324a150

replace /media/sf_5gb/ezgb-2636-v1.5.2f_S.zip with pathhhhhhhh

unzip /media/sf_5gb/ezgb-2636-v1.5.2f_S.zip -x META* nfo.prop -d device/htc/dream_sapphire/Kernel

The below is an awful mess

set your desired kernel type, 2708, ebi0 or ebi1

ktype=2708

kernel=$(find device/htc/dream_sapphire/Kernel/ -type f -name $ktype-zImage )
case $ktype in
2708) kbase="0x02000000";;
ebi0) kbase="0x10000000";;
ebi1) kbase="0x19200000";;
*) echo "unrecognised kernel type";;
esac

sed -e '/^PRODUCT_SPECIFIC_DEFINES.*KERNEL/s/^/#/' \
-e '/# kernel modules$/,/# kernel modules end$/d \
-i vendor/cyanogen/products/cyanogen_dream_sapphire.mk
# fyi, The 2nd -e above is to clean up after an older version of this guide

sed -e 's[TARGET_PREBUILT_KERNEL :=.*[TARGET_PREBUILT_KERNEL := '$kernel'[' \
-i device/htc/dream_sapphire/BoardConfig.mk

Now add the kernel modules

sed -e '/ifeq.*KERNEL/ i # kernel\n\$(call inherit-product, device\/htc\/dream_sapphire\/Kernel.mk)' \
-e '/ifeq.*KERNEL/,/:kernel$/d' \
-i device/htc/dream_sapphire/full_dream_sapphire.mk
find device/htc/dream_sapphire/Kernel/ -type f | \
awk -F"-$ktype" \
'BEGIN{print "# kernel\nLOCAL_KERNEL := '$kernel'\nBOARD_KERNEL_BASE := '$kbase'\n# kernel modules\nPRODUCT_COPY_FILES += \\"};
/-'$ktype'/ \
{print " "$0":system/lib/modules"$NF" \\"};
END{print "# kernel modules end"}' \
> device/htc/dream_sapphire/Kernel.mk

The GPL license was removed when emulator kernels were moved, instead of re-writing where the build sources it

# this might not work now I changed to Kernel.mk I will find out tonight
install -d prebuilt/android-arm/kernel
curl -o prebuilt/android-arm/kernel/LINUX_KERNEL_COPYING -O https://raw.github.com/ezterry/kernel-biff-testing/ezgb-2636/COPYING

There is a problem with none conforming code, add a cflag

sed -i '/TOOL_CFLAGS/s/$/ -fpermissive/' frameworks/base/libs/utils/Android.mk

CMParts is broken

In the interests of getting something done quick, because I have no idea what is bust, switch to froyo-stable

repo checkout froyo-stable packages/apps/CMParts

in the spirit of kanging, add KANG

sed -i '/ro.modversion=/s/$/-KANG/' vendor/cyanogen/products/*mk

remove RomManger (get from the Market if you want it)

sed -i '/RomManager/s/^/#/' vendor/cyanogen/products/common.mk

Review the changes

repo diff build device/htc/dream_sapphire vendor/cyanogen frameworks/base

You can use just repo diffthat will take longer as it will check every project​

you should see something like this

project build/
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index db76080..3de3678 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -44,7 +44,7 @@ include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
TARGET_TOOLS_PREFIX := \
-	prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
+	prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
endif

TARGET_CC := $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 5f2e8bb..48a8743 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -284,7 +284,7 @@ ifeq ($(TARGET_SIMULATOR),true)
ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES)
else
# this should be copied to HOST_OUT_EXECUTABLES instead
-	ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin
+	ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin
endif
ANDROID_BUILD_PATHS := $(ABP)
ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
diff --git a/envsetup.sh b/envsetup.sh
index 8957e92..c3a8593 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -113,7 +113,7 @@ function setpaths()
# and in with the new
CODE_REVIEWS=
prebuiltdir=$(getprebuilt)
- export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.0/bin
+ export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
export ANDROID_QTOOLS=$T/development/emulator/qtools
export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
diff --git a/tools/adbs b/tools/adbs
index 815ae10..8277790 100755
--- a/tools/adbs
+++ b/tools/adbs
@@ -144,13 +144,13 @@ def SetupToolsPath():
uname = "darwin-ppc"
elif uname == "Linux":
uname = "linux-x86"
- prefix = "./prebuilt/" + uname + "/toolchain/arm-eabi-4.4.0/bin/"
+ prefix = "./prebuilt/" + uname + "/toolchain/arm-eabi-4.4.3/bin/"
addr2line_cmd = prefix + "arm-eabi-addr2line"

if (not os.path.exists(addr2line_cmd)):
try:
prefix = os.environ['ANDROID_BUILD_TOP'] + "/prebuilt/" + uname + \
- "/toolchain/arm-eabi-4.4.0/bin/"
+ "/toolchain/arm-eabi-4.4.3/bin/"
except:
prefix = "";

project device/htc/dream_sapphire/
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 94aa3ad..125ec1d 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -85,4 +85,4 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x05a00000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x127c0000

#TARGET_RECOVERY_UI_LIB := librecovery_ui_sapphire librecovery_ui_htc
-TARGET_PREBUILT_KERNEL := device/htc/dream_sapphire/kernel
+TARGET_PREBUILT_KERNEL := device/htc/dream_sapphire/Kernel/2708-zImage
diff --git a/full_dream_sapphire.mk b/full_dream_sapphire.mk
index 9ec7feb..f18a37f 100644
--- a/full_dream_sapphire.mk
+++ b/full_dream_sapphire.mk
@@ -72,14 +72,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_COPY_FILES += \
device/htc/dream_sapphire/media_profiles.xml:/system/etc/media_profiles.xml

-ifeq ($(TARGET_PREBUILT_KERNEL),)
-	LOCAL_KERNEL := device/htc/dream_sapphire/kernel
-else
-	LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
-endif
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_KERNEL):kernel
+# kernel
+$(call inherit-product, device/htc/dream_sapphire/Kernel.mk)

## (2) Also get non-open-source aspects if available
$(call inherit-product-if-exists, vendor/htc/dream_sapphire/dream_sapphire-vendor.mk)

project device/htc/dream_sapphire/
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 94aa3ad..125ec1d 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -85,4 +85,4 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x05a00000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x127c0000

#TARGET_RECOVERY_UI_LIB := librecovery_ui_sapphire librecovery_ui_htc
-TARGET_PREBUILT_KERNEL := device/htc/dream_sapphire/kernel
+TARGET_PREBUILT_KERNEL := device/htc/dream_sapphire/Kernel/2708-zImage
diff --git a/full_dream_sapphire.mk b/full_dream_sapphire.mk
index 9ec7feb..f18a37f 100644
--- a/full_dream_sapphire.mk
+++ b/full_dream_sapphire.mk
@@ -72,14 +72,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_COPY_FILES += \
device/htc/dream_sapphire/media_profiles.xml:/system/etc/media_profiles.xml

-ifeq ($(TARGET_PREBUILT_KERNEL),)
-	LOCAL_KERNEL := device/htc/dream_sapphire/kernel
-else
-	LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
-endif
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_KERNEL):kernel
+# kernel
+$(call inherit-product, device/htc/dream_sapphire/Kernel.mk)

## (2) Also get non-open-source aspects if available
$(call inherit-product-if-exists, vendor/htc/dream_sapphire/dream_sapphire-vendor.mk)

project frameworks/base/
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index afecdcb..03aa873 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -54,7 +54,7 @@ LOCAL_SRC_FILES:= $(commonSources)

LOCAL_MODULE:= libutils

-LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
+LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
LOCAL_C_INCLUDES += external/zlib

ifeq ($(HOST_OS),windows)

project vendor/cyanogen/
diff --git a/products/AndroidProducts.mk b/products/AndroidProducts.mk
index dc80c13..e98d729 100644
--- a/products/AndroidProducts.mk
+++ b/products/AndroidProducts.mk
@@ -16,6 +16,5 @@ PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/cyanogen_passion.mk \
$(LOCAL_DIR)/cyanogen_sholes.mk \
$(LOCAL_DIR)/cyanogen_supersonic.mk \
- $(LOCAL_DIR)/cyanogen_vibrant.mk \
$(LOCAL_DIR)/cyanogen_vision.mk \
$(LOCAL_DIR)/cyanogen_z71.mk
diff --git a/products/common.mk b/products/common.mk
index e91f4d9..5c11916 100644
--- a/products/common.mk
+++ b/products/common.mk
@@ -87,7 +87,6 @@ PRODUCT_COPY_FILES += \
# vendor/cyanogen/prebuilt/common/etc/init.d/10apps2sd:system/etc/init.d/10apps2sd

PRODUCT_COPY_FILES += \
- vendor/cyanogen/proprietary/RomManager.apk:system/app/RomManager.apk \

# Always run in insecure mode, enables root on user build variants
#ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
diff --git a/products/cyanogen_ace.mk b/products/cyanogen_ace.mk
index abf3c13..5021502 100644
--- a/products/cyanogen_ace.mk
+++ b/products/cyanogen_ace.mk
@@ -35,10 +35,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/ace
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-DesireHD
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-DesireHD-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-DesireHD
+ ro.modversion=CyanogenMod-6.2.0-RC0-DesireHD-KANG
endif

#
diff --git a/products/cyanogen_bravo.mk b/products/cyanogen_bravo.mk
index 21120bf..be4ff67 100644
--- a/products/cyanogen_bravo.mk
+++ b/products/cyanogen_bravo.mk
@@ -44,10 +44,10 @@ WITH_WINDOWS_MEDIA := true
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Desire
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Desire-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Desire
+ ro.modversion=CyanogenMod-6.2.0-RC0-Desire-KANG
endif

#
diff --git a/products/cyanogen_bravoc.mk b/products/cyanogen_bravoc.mk
index c92d738..9c5cd87 100644
--- a/products/cyanogen_bravoc.mk
+++ b/products/cyanogen_bravoc.mk
@@ -33,10 +33,10 @@ WITH_WINDOWS_MEDIA := true
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-BravoC
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-BravoC-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-BravoC
+ ro.modversion=CyanogenMod-6.2.0-RC0-BravoC-KANG
endif

#
diff --git a/products/cyanogen_buzz.mk b/products/cyanogen_buzz.mk
index c9e3e85..8e62c27 100644
--- a/products/cyanogen_buzz.mk
+++ b/products/cyanogen_buzz.mk
@@ -43,8 +43,8 @@ PRODUCT_COPY_FILES += \
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-buzz
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-buzz-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-buzz
+ ro.modversion=CyanogenMod-6.2.0-RC0-buzz-KANG
endif
diff --git a/products/cyanogen_dream_sapphire.mk b/products/cyanogen_dream_sapphire.mk
index 51a2528..7995a13 100644
--- a/products/cyanogen_dream_sapphire.mk
+++ b/products/cyanogen_dream_sapphire.mk
@@ -18,9 +18,9 @@ PRODUCT_MANUFACTURER := HTC
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_ID=FRG83 BUILD_DISPLAY_ID=FRG83 BUILD_FINGERPRINT=tmobile/opal/sapphire/sapphire:2.2.1/FRG83/60505:user/release-keys PRIVATE_BUILD_DESC="opal-user 2.2.1 FRG83 60505 release-keys"

# Build kernel
-PRODUCT_SPECIFIC_DEFINES += TARGET_PREBUILT_KERNEL=
-PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_DIR=kernel-msm
-PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_CONFIG=cyanogen_msm_defconfig
+#PRODUCT_SPECIFIC_DEFINES += TARGET_PREBUILT_KERNEL=device/htc/dream_sapphire/Kernel/2708-zImage
+#PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_DIR=kernel-msm
+#PRODUCT_SPECIFIC_DEFINES += TARGET_KERNEL_CONFIG=cyanogen_msm_defconfig

# Extra DS overlay
PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/dream_sapphire
@@ -38,10 +38,10 @@ PRODUCT_PROPERTY_OVERRIDES += \
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-DS
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-DS-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-DS
+ ro.modversion=CyanogenMod-6.2.0-RC0-DS-KANG
endif

# Use the audio profile hack
@@ -54,3 +54,4 @@ PRODUCT_COPY_FILES += \
vendor/cyanogen/prebuilt/mdpi/media/bootanimation.zip:system/media/bootanimation.zip \
vendor/cyanogen/prebuilt/dream_sapphire/etc/AudioPara_dream.csv:system/etc/AudioPara_dream.csv \
vendor/cyanogen/prebuilt/dream_sapphire/etc/AudioPara_sapphire.csv:system/etc/AudioPara_sapphire.csv
+
diff --git a/products/cyanogen_espresso.mk b/products/cyanogen_espresso.mk
index 28bd3c4..c04c167 100644
--- a/products/cyanogen_espresso.mk
+++ b/products/cyanogen_espresso.mk
@@ -30,10 +30,10 @@ PRODUCT_PACKAGES += Torch
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Slide
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Slide-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Slide
+ ro.modversion=CyanogenMod-6.2.0-RC0-Slide-KANG
endif

#
diff --git a/products/cyanogen_glacier.mk b/products/cyanogen_glacier.mk
index 002789a..d8153b2 100644
--- a/products/cyanogen_glacier.mk
+++ b/products/cyanogen_glacier.mk
@@ -33,10 +33,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/glacier
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-glacier
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-glacier-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-glacier
+ ro.modversion=CyanogenMod-6.2.0-RC0-glacier-KANG
endif

#
diff --git a/products/cyanogen_harmony.mk b/products/cyanogen_harmony.mk
index 68b19f4..c691e79 100644
--- a/products/cyanogen_harmony.mk
+++ b/products/cyanogen_harmony.mk
@@ -21,10 +21,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/harmony
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Harmony
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Harmony-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Harmony
+ ro.modversion=CyanogenMod-6.2.0-RC0-Harmony-KANG
endif

#
diff --git a/products/cyanogen_hero.mk b/products/cyanogen_hero.mk
index c93ce28..022a97c 100644
--- a/products/cyanogen_hero.mk
+++ b/products/cyanogen_hero.mk
@@ -27,10 +27,10 @@ WITH_WINDOWS_MEDIA := true
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Hero
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Hero-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Hero
+ ro.modversion=CyanogenMod-6.2.0-RC0-Hero-KANG
endif

#
diff --git a/products/cyanogen_heroc.mk b/products/cyanogen_heroc.mk
index c11833d..cb920fc 100644
--- a/products/cyanogen_heroc.mk
+++ b/products/cyanogen_heroc.mk
@@ -23,10 +23,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/heroc
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Heroc
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Heroc-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
-	ro.modversion=CyanogenMod-6.2.0-RC0-Heroc
+	ro.modversion=CyanogenMod-6.2.0-RC0-Heroc-KANG
endif

#
diff --git a/products/cyanogen_inc.mk b/products/cyanogen_inc.mk
index 80d9b99..550ab3f 100644
--- a/products/cyanogen_inc.mk
+++ b/products/cyanogen_inc.mk
@@ -29,10 +29,10 @@ PRODUCT_PACKAGES += Torch
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Inc
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Inc-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Inc
+ ro.modversion=CyanogenMod-6.2.0-RC0-Inc-KANG
endif

#
diff --git a/products/cyanogen_legend.mk b/products/cyanogen_legend.mk
index 38227e1..c57ffaa 100644
--- a/products/cyanogen_legend.mk
+++ b/products/cyanogen_legend.mk
@@ -27,10 +27,10 @@ PRODUCT_PACKAGES += Torch
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Legend
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Legend-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Legend
+ ro.modversion=CyanogenMod-6.2.0-RC0-Legend-KANG
endif

#
diff --git a/products/cyanogen_liberty.mk b/products/cyanogen_liberty.mk
index 494a8c9..a9cb4dc 100644
--- a/products/cyanogen_liberty.mk
+++ b/products/cyanogen_liberty.mk
@@ -24,10 +24,10 @@ PRODUCT_SPECIFIC_DEFINES += TARGET_PRELINKER_MAP=$(TOP)/vendor/cyanogen/prelink-

ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Liberty
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Liberty-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Liberty
+ ro.modversion=CyanogenMod-6.2.0-RC0-Liberty-KANG
endif

#
diff --git a/products/cyanogen_one.mk b/products/cyanogen_one.mk
index c9412ae..1d4adb3 100644
--- a/products/cyanogen_one.mk
+++ b/products/cyanogen_one.mk
@@ -30,10 +30,10 @@ PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.dexopt-data-only=1

ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-ONE
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-ONE-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-ONE
+ ro.modversion=CyanogenMod-6.2.0-RC0-ONE-KANG
endif

#
diff --git a/products/cyanogen_passion.mk b/products/cyanogen_passion.mk
index 7477515..8061d3b 100644
--- a/products/cyanogen_passion.mk
+++ b/products/cyanogen_passion.mk
@@ -41,10 +41,10 @@ PRODUCT_PROPERTY_OVERRIDES += \
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-N1
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-N1-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-N1
+ ro.modversion=CyanogenMod-6.2.0-RC0-N1-KANG
endif

#
diff --git a/products/cyanogen_sholes.mk b/products/cyanogen_sholes.mk
index a9a8f07..40a80bc 100644
--- a/products/cyanogen_sholes.mk
+++ b/products/cyanogen_sholes.mk
@@ -18,10 +18,10 @@ PRODUCT_MANUFACTURER := Motorola
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Droid
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Droid-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Droid
+ ro.modversion=CyanogenMod-6.2.0-RC0-Droid-KANG
endif

PRODUCT_BUILD_PROP_OVERRIDES := BUILD_ID=FRG83D BUILD_DISPLAY_ID=FRG83D PRODUCT_NAME=voles TARGET_DEVICE=sholes BUILD_FINGERPRINT=verizon/voles/sholes/sholes:2.2.1/FRG83D/75603:user/release-keys PRODUCT_BRAND=verizon PRIVATE_BUILD_DESC="voles-user 2.2.1 FRG83D 75603 release-keys" BUILD_NUMBER=75603 BUILD_UTC_DATE=1289367602 TARGET_BUILD_TYPE=user BUILD_VERSION_TAGS=release-keys USER=android-build
diff --git a/products/cyanogen_supersonic.mk b/products/cyanogen_supersonic.mk
index 7ea43b7..c6c070b 100644
--- a/products/cyanogen_supersonic.mk
+++ b/products/cyanogen_supersonic.mk
@@ -32,10 +32,10 @@ PRODUCT_PACKAGES += \
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Supersonic
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Supersonic-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Supersonic
+ ro.modversion=CyanogenMod-6.2.0-RC0-Supersonic-KANG
endif

#
diff --git a/products/cyanogen_vibrant.mk b/products/cyanogen_vibrant.mk
index b18db44..ab21c2a 100644
--- a/products/cyanogen_vibrant.mk
+++ b/products/cyanogen_vibrant.mk
@@ -25,10 +25,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/vibrant
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Vibrant
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Vibrant-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Vibrant
+ ro.modversion=CyanogenMod-6.2.0-RC0-Vibrant-KANG
endif

#
diff --git a/products/cyanogen_vision.mk b/products/cyanogen_vision.mk
index 53f316d..75c6997 100644
--- a/products/cyanogen_vision.mk
+++ b/products/cyanogen_vision.mk
@@ -35,10 +35,10 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/cyanogen/overlay/vision
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-vision
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-vision-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-vision
+ ro.modversion=CyanogenMod-6.2.0-RC0-vision-KANG
endif

#
diff --git a/products/cyanogen_z71.mk b/products/cyanogen_z71.mk
index bdbea5a..e2219eb 100644
--- a/products/cyanogen_z71.mk
+++ b/products/cyanogen_z71.mk
@@ -24,10 +24,10 @@ PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=commtiva_z71 BUILD_ID=FRG83 BUILD_D
#
ifdef CYANOGEN_NIGHTLY
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Z71
+ ro.modversion=CyanogenMod-6-$(shell date +%m%d%Y)-NIGHTLY-Z71-KANG
else
PRODUCT_PROPERTY_OVERRIDES += \
- ro.modversion=CyanogenMod-6.2.0-RC0-Z71
+ ro.modversion=CyanogenMod-6.2.0-RC0-Z71-KANG
endif
#

Finally

. build/envsetup.sh && lunch

Select cyanogen_dream_sapphire-eng

No Pigs are harmed compiling CM6​

make otapackage && squisher

Optionally include -j<no. of cores> (-j2)

A Final Note

I don't now if CM6 has updated Root CA

https://play.google.com/store/apps/details?id=info.guardianproject.cacert

to check​