[Sprint HTC EVO 4G LTE] mikshepard:
** HOW-TO COMPILE THIS YOURSELF **

Here are my notes on how to port Root-Box to our devices, should anyone be interested in compiling their own. I ran into a few headaches when I attempted this, so I’m hoping these notes will save others from that. The point of this tutorial is to teach newbies how to port a ROM, while I could do some things on my end make it easier to compile this ROM, I think it's important to outline all the steps involved in doing this by hand, so the methods may be applied to other ROM ports, not just Root-Box.

I compiled on a Debian Wheezy system, 64bit (squeeze should be the same). A 64-bit computer is required to compile Jellybean (ICS and above for that matter), so don’t attempt this on anything less. If you are unfamiliar with installing Debian, you can use LMDE, it's a live Debian system that you can install with minimal linux knowledge and works pretty nice. However the installation process is pretty easy for vanilla Debian and a good learning process, so give it a shot if you have the time.

Do this all as root

Download dependencies:

apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline6-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2 libxml2-utils schedtool pngcrush xsltproc zlib1g-dev lib32stdc++6 lib32ncurses5 ncurses-libs.i686 libstdc++.i686 libgcc.i686 lib32readline-gplv2-dev lib32z1-dev

Link files:

ln -s /lib32/libncurses.so.5 /lib32/libncurses.so

or for Ubuntu 10.10:

sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

Install Google’s repo script:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod 755 ~/bin/repo

Make your working Directory and start syncing with Root-Box

mkdir ~/rootbox; cd ~/rootbox
repo init -u https://github.com/Root-Box/platform_manifest.git -b jb-mr1
repo sync

Create a local_manifests file with Cyanogenmods sources for our phone and kernel (thanks to Deck’s work). This is porting part.

mkdir ~/rootbox/.repo/local_manifests
echo ‘<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_htc_jewel" path="device/htc/jewel" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_device_htc_msm8960-common" path="device/htc/msm8960-common" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_device_htc_s4-common" path="device/htc/s4-common" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_kernel_htc_msm8960" path="kernel/htc/msm8960" remote="gh" revision="cm-10.1" />
<project name="TheMuppets/proprietary_vendor_htc" path="vendor/htc" remote="gh" revision="cm-10.1" />
</manifest>’ > ~/rootbox/.repo/local_manifests/jewel.xml

Sync the repo again

repo sync

Create your device file for Root-Box (adapted from CM’s cm.mk file):

echo ‘$(call inherit-product, vendor/rootbox/configs/common.mk)

$(call inherit-product, vendor/rootbox/configs/cdma.mk)

# Enhanced NFC
#$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)

# Inherit device configuration
$(call inherit-product, device/htc/jewel/jewel.mk)

# Device naming
PRODUCT_DEVICE := jewel
PRODUCT_NAME := rootbox_jewel
PRODUCT_BRAND := htc
PRODUCT_MODEL := EVO
PRODUCT_MANUFACTURER := HTC

# Set build fingerprint / ID / Product Name ect.
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=htc_jewel BUILD_ID=JRO03C BUILD_FINGERPRINT="htc/jewel/jewel:4.1.1/JRO03C/147243.3:user/release-keys" PRIVATE_BUILD_DESC="3.16.651.3 CL147243 release-keys"

# Release name
PRODUCT_RELEASE_NAME := jewel

# Boot animation
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720

# PA OVERLAY_TARGET
OVERLAY_TARGET := pa_jewel

# Copy compatible prebuilt files
PRODUCT_COPY_FILES += \
vendor/rootbox/prebuilt/bootanimation/bootanimation_1280_720.zip:system/media/bootanimation.zip

-include vendor/rootbox/configs/common_versions.mk’ > ~/rootbox/vendor/rootbox/products/jewel.mk

edit /vendor/rootbox/products/AndroidProducts.mk and add a \ to the last line and then add $(LOCAL_DIR)/jewel.mk under that. So every line but the last ends in “\”. It should look something like this at the end of the file when done.

then add our device to the vendorsetup.sh file

echo “add_lunch_combo rootbox_jewel-userdebug” >> ~/rootbox/vendor/rootbox/vendorsetup.sh

Now, lets create the PA defaults for the per-app-dpi and hybrid settings. It will build and look fine with these xhdpi defaults, but I suggest you look over the pa_jewel.conf at least, here is where you can change the defaults for how apps and settings will look. Setting the "com.android.systemui.navbar.dpi" to "0" is a good idea since we have hardware buttons (but it's a person preference).

cp ~/rootbox/vendor/rootbox/pa_xhdpi.conf ~/rootbox/vendor/rootbox/pa_jewel.conf
cp -r ~/rootbox/vendor/rootbox/preferences/pa_xhdpi ~/rootbox/vendor/rootbox/preferences/pa_jewel

remove a conflicting file:

/device/htc/msm8960-common/overlay/packages/apps/Settings/res/values/arrays.xml

OPTIONAL: lets add the "Reboot Bootloader" to our reboot menu:

echo '<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<!-- reboot options -->
<string-array name="reboot_options">
<item>@string/reboot</item>
<item>@string/reboot_recovery</item>
<item>@string/reboot_bootloader</item>
</string-array>

<!-- reboot values -->
<string-array name="reboot_values">
<item></item>
<item>recovery</item>
<item>bootloader</item>
</string-array>
</resources>' > ~/root/rootbox/device/htc/s4-common/overlay/framework/base/core/res/res/values/arrays.xml

now we build our environment:

. build/envsetup.sh

build your new ROM for our device:

. build_rootbox.sh jewel `grep 'processor' /proc/cpuinfo | wc -l`

(the last part can be a number instead of the "grep command", it's how many cpu cores you have)

when finished, it’ll be located in ~/rootbox//out/target/product/jewel/

NOTE: If later on, you get a problem when trying to do a repo sync because of files wanting to be overridden, take note of the files. They are most likely the ones we edited to add the jewel device (~/rootbox/vendor/rootbox/products/AndroidProducts.mk, or /vendor/rootbox/vendorsetup.sh), delete them, and re-add the changes back after the sync is done. This will only happen if those files get updated on the git repo. The cleaner way to do this is to fork these to your own git repo and update them from there, however this tutorial is to teach you how to port ROMs, so we are doing it manually here. Let me know if you see any errors and I’ll update this.

EXTRAS:

Compile Bash Shell into ROM:

add two lines into your ~/.repo/local_manifests/jewel.xml so it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_htc_jewel" path="device/htc/jewel" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_device_htc_msm8960-common" path="device/htc/msm8960-common" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_device_htc_s4-common" path="device/htc/s4-common" remote="gh" revision="cm-10.1" />
<project name="CyanogenMod/android_kernel_htc_msm8960" path="kernel/htc/msm8960" remote="gh" revision="cm-10.1" />
<project name="TheMuppets/proprietary_vendor_htc" path="vendor/htc" remote="gh" revision="cm-10.1" />

<!-- add patched bash -->
<project name="mikshepard/android_external_bash" path="external/bash" remote="gh" revision="cm-10.1" />
</manifest>

and edit your ~/device/htc/jewel/jewel.mk and add the following to it (somewhere in the middle is fine):

Extra Commondline Tools
PRODUCT_PACKAGES += \
bash

Compile with GCC 4.7

This is a bit more complicated and should not be attempted until you are comfortable with the above, some debugging may be required.

Add this line to your ~/device/htc/s4-common/BoardConfigCommon.mk

# Use GCC 4.7
TARGET_GCC_VERSION := 4.7

now you need to adjust your TARGET_linux-arm.mk to use some different cflags otherwise you will not be able to connect to the camera. This has been adapted from the work by jrior001 and SlimROMS. Just adjust your ~/build/combo/TARGET_linux-arm.mk to match the following:

https://github.com/mikshepard/android_build/blob/416eae1fb70fcab3b9075fc44699ec2f7d2799f8/core/combo/TARGET_linux-arm.mk

I suggest you look at the comments in there to understand what is being changed.

Now build like normal. PM me if you have problems.

TIP:

If you are into building, checkout my acompile script in my signature, it'll email you when your build is complete using Gmail's snmp and will include the time it took and the last few lines of the output. I find it very useful for knowing when my build is done (especially since they take me about 3+ hours apiece)

SOURCES:

This page helped a lot with a great tutorial on building ROMS

This forum is filled with great people who others with the building of ROMS. A great source when you run into errors you don’t understand.

Hope this helps someone,

-Mike