[Desire HD Android Development] LuHe:
TL;DR: Got CM10 to compile, boot animation is shown, device reboots

I'd like to keep you updated on my efforts to port JB to the Desire HD.

I'm using the jellybean branches of CyanogenMod 10 as base.

repo init -u git://github.com/CyanogenMod/platform_manifest.git -b jellybean

My .repo/local_manifest.xml file contains:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project name="CyanogenMod/android_device_htc_ace"
path="device/htc/ace" remote="github"
revision="refs/heads/ics" />

<project name="CyanogenMod/android_device_htc_common"
path="device/htc/common"
revision="refs/heads/gingerbread" />

<project name="CyanogenMod/android_device_htc_msm7x30-common"
path="device/htc/msm7x30-common" remote="github"
revision="refs/heads/jellybean" />

<project name="CyanogenMod/htc-kernel-msm7x30"
path="kernel/htc/msm7x30" remote="github"
revision="refs/heads/android-msm-2.6.35-ics" />

extract-files.sh extracts my files from the latest - and awesome - IceColdSandwich ROM.

My patches to the source so far:

project build/
diff --git a/core/user_tags.mk b/core/user_tags.mk
index 4beb54a..3ea355b 100644
--- a/core/user_tags.mk
+++ b/core/user_tags.mk
@@ -495,4 +495,11 @@ GRANDFATHERED_USER_MODULES += \
wdsclient \
wpa_supplicant \
yuv420sp2rgb \
-	zipalign
+	zipalign \
+ libOmxCore \
+ libOmxVenc \
+ libOmxVdec \
+ libmm-omxcore \
+ lights.msm7x30 \
+ gralloc.msm7x30 \
+ gps.spade

to fix the "*** user tag detected on new module - user tags are only supported on legacy modules. Stop." error messages

project device/htc/ace/
diff --git a/BoardConfig.mk b/BoardConfig.mk
index e9522d0..8772618 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -32,6 +32,8 @@ USE_CAMERA_STUB := true
-include vendor/htc/ace/BoardConfigVendor.mk

TARGET_BOOTLOADER_BOARD_NAME := spade
+TARGET_KERNEL_SOURCE := kernel/htc/msm7x30
+TARGET_KERNEL_CONFIG := cyanogen_msm7230_defconfig

BOARD_KERNEL_CMDLINE := no_console_suspend=1
BOARD_KERNEL_RECOVERY_CMDLINE := $(BOARD_KERNEL_CMDLINE) msmsdcc_power_gpio=88
@@ -61,7 +63,7 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 4194304
BOARD_FLASH_BLOCK_SIZE := 262144

TARGET_RELEASETOOLS_EXTENSIONS := device/htc/common
-TARGET_PREBUILT_KERNEL := device/htc/msm7x30-common/msm7230/kernel
+# TARGET_PREBUILT_KERNEL := device/htc/msm7x30-common/msm7230/kernel

BOARD_HAS_NO_SELECT_BUTTON := true
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/mmcblk1p1

because i'd like to build my own kernel...

diff --git a/device.mk b/device.mk
index 0c24bad..df45878 100644
--- a/device.mk
+++ b/device.mk
@@ -191,6 +191,6 @@ $(call inherit-product, device/htc/msm7x30-common/msm7x30.mk)
# htc audio settings
$(call inherit-product, device/htc/ace/media_htcaudio.mk)

-$(call inherit-product, frameworks/base/build/phone-hdpi-512-dalvik-heap.mk)
+$(call inherit-product, frameworks/native/build/phone-hdpi-512-dalvik-heap.mk)

$(call inherit-product-if-exists, vendor/htc/ace/device-vendor.mk)

fix path to phone-hdpi-512-dalvik-heap.mk file

diff --git a/liblights/lights.c b/liblights/lights.c
index 960a2bb..55eec8d 100644
--- a/liblights/lights.c
+++ b/liblights/lights.c
@@ -65,7 +65,7 @@ static int write_int (const char* path, int value) {
fd = open(path, O_RDWR);
if (fd < 0) {
if (already_warned == 0) {
-	LOGE("write_int failed to open %s\n", path);
+	ALOGE("write_int failed to open %s\n", path);
already_warned = 1;
}
return -errno;
@@ -128,7 +128,7 @@ static void set_speaker_light_locked (struct light_device_t *dev, struct light_s
write_int (BLUE_LED_FILE, 0);
break;
default:
-	LOGE("set_led_state colorRGB=%08X, unknown color\n",
+	ALOGE("set_led_state colorRGB=%08X, unknown color\n",
colorRGB);
break;
}
@@ -159,7 +159,7 @@ static void set_speaker_light_locked (struct light_device_t *dev, struct light_s
}
break;
default:
-	LOGE("set_led_state colorRGB=%08X, unknown mode %d\n",
+	ALOGE("set_led_state colorRGB=%08X, unknown mode %d\n",
colorRGB, state->flashMode);
}

@@ -182,7 +182,7 @@ static void set_speaker_light_locked_dual (struct light_device_t *dev, struct li
write_int (AMBER_BLINK_FILE, 1);
write_int (BLUE_LED_FILE, 0);
} else {
-	LOGE("set_led_state (dual) unexpected color: bcolorRGB=%08x\n", bcolorRGB);
+	ALOGE("set_led_state (dual) unexpected color: bcolorRGB=%08x\n", bcolorRGB);
}

}
@@ -220,7 +220,7 @@ static int set_light_backlight(struct light_device_t* dev,
struct light_state_t const* state) {
int err = 0;
int brightness = rgb_to_brightness(state);
-	LOGV("%s brightness=%d color=0x%08x",
+	ALOGV("%s brightness=%d color=0x%08x",
__func__,brightness, state->color);
pthread_mutex_lock(&g_lock);
g_backlight = brightness;
diff --git a/libsensors/AkmSensor.cpp b/libsensors/AkmSensor.cpp
index 0757403..3712aa3 100644
--- a/libsensors/AkmSensor.cpp
+++ b/libsensors/AkmSensor.cpp
@@ -148,7 +148,7 @@ int AkmSensor::enable(int32_t handle, int en)
short flags = newState;
err = ioctl(dev_fd, cmd, &flags);
err = err<0 ? -errno : 0;
- LOGE_IF(err, "ECS_IOCTL_APP_SET_XXX failed (%s)", strerror(-err));
+ ALOGE_IF(err, "ECS_IOCTL_APP_SET_XXX failed (%s)", strerror(-err));
if (!err) {
mEnabled &= ~(1<<what);
mEnabled |= (uint32_t(flags)<<what);
@@ -236,7 +236,7 @@ int AkmSensor::readEvents(sensors_event_t* data, int count)
mInputReader.next();
}
} else {
- LOGE("AkmSensor: unknown event (type=%d, code=%d)",
+ ALOGE("AkmSensor: unknown event (type=%d, code=%d)",
type, event->code);
mInputReader.next();
}
diff --git a/libsensors/LightSensor.cpp b/libsensors/LightSensor.cpp
index e3aac2c..0be9a90 100644
--- a/libsensors/LightSensor.cpp
+++ b/libsensors/LightSensor.cpp
@@ -77,7 +77,7 @@ int LightSensor::enable(int32_t, int en) {
}
err = ioctl(dev_fd, LIGHTSENSOR_IOCTL_ENABLE, &flags);
err = err<0 ? -errno : 0;
- LOGE_IF(err, "LIGHTSENSOR_IOCTL_ENABLE failed (%s)", strerror(-err));
+ ALOGE_IF(err, "LIGHTSENSOR_IOCTL_ENABLE failed (%s)", strerror(-err));
if (!err) {
mEnabled = en ? 1 : 0;
if (en) {
@@ -131,7 +131,7 @@ int LightSensor::readEvents(sensors_event_t* data, int count)
numEventReceived++;
}
} else {
- LOGE("LightSensor: unknown event (type=%d, code=%d)",
+ ALOGE("LightSensor: unknown event (type=%d, code=%d)",
type, event->code);
}
mInputReader.next();
diff --git a/libsensors/ProximitySensor.cpp b/libsensors/ProximitySensor.cpp
index abd8e6b..a97d73a 100644
--- a/libsensors/ProximitySensor.cpp
+++ b/libsensors/ProximitySensor.cpp
@@ -78,7 +78,7 @@ int ProximitySensor::enable(int32_t, int en) {
int flags = newState;
err = ioctl(dev_fd, CAPELLA_CM3602_IOCTL_ENABLE, &flags);
err = err<0 ? -errno : 0;
- LOGE_IF(err, "CAPELLA_CM3602_IOCTL_ENABLE failed (%s)", strerror(-err));
+ ALOGE_IF(err, "CAPELLA_CM3602_IOCTL_ENABLE failed (%s)", strerror(-err));
if (!err) {
mEnabled = newState;
if (en) {
@@ -129,7 +129,7 @@ int ProximitySensor::readEvents(sensors_event_t* data, int count)
numEventReceived++;
}
} else {
- LOGE("ProximitySensor: unknown event (type=%d, code=%d)",
+ ALOGE("ProximitySensor: unknown event (type=%d, code=%d)",
type, event->code);
}
mInputReader.next();
diff --git a/libsensors/SensorBase.cpp b/libsensors/SensorBase.cpp
index e0554e4..0bd2ba7 100644
--- a/libsensors/SensorBase.cpp
+++ b/libsensors/SensorBase.cpp
@@ -51,7 +51,7 @@ SensorBase::~SensorBase() {
int SensorBase::open_device() {
if (dev_fd<0 && dev_name) {
dev_fd = open(dev_name, O_RDONLY);
- LOGE_IF(dev_fd<0, "Couldn't open %s (%s)", dev_name, strerror(errno));
+ ALOGE_IF(dev_fd<0, "Couldn't open %s (%s)", dev_name, strerror(errno));
}
return 0;
}
@@ -117,6 +117,6 @@ int SensorBase::openInput(const char* inputName) {
}
}
closedir(dir);
- LOGE_IF(fd<0, "couldn't find '%s' input device", inputName);
+ ALOGE_IF(fd<0, "couldn't find '%s' input device", inputName);
return fd;
}
diff --git a/libsensors/nusensors.cpp b/libsensors/nusensors.cpp
index 248acc5..e78a9d3 100644
--- a/libsensors/nusensors.cpp
+++ b/libsensors/nusensors.cpp
@@ -95,7 +95,7 @@ sensors_poll_context_t::sensors_poll_context_t()

int wakeFds[2];
int result = pipe(wakeFds);
- LOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
+ ALOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
mWritePipeFd = wakeFds[1];
@@ -120,7 +120,7 @@ int sensors_poll_context_t::activate(int handle, int enabled) {
if (enabled && !err) {
const char wakeMessage(WAKE_MESSAGE);
int result = write(mWritePipeFd, &wakeMessage, 1);
- LOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
+ ALOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
}
return err;
}
@@ -159,14 +159,14 @@ int sensors_poll_context_t::pollEvents(sensors_event_t* data, int count)
// anything to return
n = poll(mPollFds, numFds, nbEvents ? 0 : -1);
if (n<0) {
- LOGE("poll() failed (%s)", strerror(errno));
+ ALOGE("poll() failed (%s)", strerror(errno));
return -errno;
}
if (mPollFds[wake].revents & POLLIN) {
char msg;
int result = read(mPollFds[wake].fd, &msg, 1);
- LOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
- LOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
+ ALOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
+ ALOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
mPollFds[wake].revents = 0;
}
}

these macros got renamed...

diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 43a9d65..02b3b95 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -114,10 +114,10 @@
<integer name="config_defaultNotificationLedOff">9000</integer>

<!-- Component name of the service providing network location support. -->
- <string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
+ <!-- <string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string> -->

<!-- Component name of the service providing geocoder API support. -->
- <string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
+ <!-- <string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string> -->

<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml
index 241ad30..33d7c06 100644
--- a/overlay/packages/apps/Settings/res/values/config.xml
+++ b/overlay/packages/apps/Settings/res/values/config.xml
@@ -16,7 +16,7 @@

<resources>
<!-- LED Flashlight -->
- <bool name="has_led_flash">true</bool>
+ <!-- <bool name="has_led_flash">true</bool> -->

<!-- Whether or not the dock settings are to be displayed for this device when docked -->
<bool name="has_dock_settings">true</bool>

these config values can't be found

project device/htc/msm7x30-common/
diff --git a/include/linux/android_pmem.h b/include/linux/android_pmem.h
index c029196..35b3542 100644
--- a/include/linux/android_pmem.h
+++ b/include/linux/android_pmem.h
@@ -51,6 +51,7 @@
* start of the mapped gpu regs (the vaddr returned by mmap) as the argument.
*/
#define HW3D_REVOKE_GPU	_IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
+#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
#define HW3D_GRANT_GPU	_IOW(PMEM_IOCTL_MAGIC, 9, unsigned int)
#define HW3D_WAIT_FOR_INTERRUPT	_IOW(PMEM_IOCTL_MAGIC, 10, unsigned int)

don't know why this was missing

project hardware/msm7k/
diff --git a/libstagefrighthw/Android.mk b/libstagefrighthw/Android.mk
index a8a4a5f..d36bff7 100644
--- a/libstagefrighthw/Android.mk
+++ b/libstagefrighthw/Android.mk
@@ -14,26 +14,26 @@
# limitations under the License.
#

-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- QComOMXPlugin.cpp \
-
-LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY)
-
-LOCAL_C_INCLUDES:= \
- $(TOP)/frameworks/native/include/media/hardware \
- $(TOP)/frameworks/native/include/media/openmax
-
-LOCAL_SHARED_LIBRARIES := \
- libbinder \
- libutils \
- libcutils \
- libdl \
- libui \
-
-LOCAL_MODULE := libstagefrighthw
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_SHARED_LIBRARY)
+#LOCAL_PATH := $(call my-dir)
+#include $(CLEAR_VARS)
+#
+#LOCAL_SRC_FILES := \
+# QComOMXPlugin.cpp \
+#
+#LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY)
+#
+#LOCAL_C_INCLUDES:= \
+# $(TOP)/frameworks/native/include/media/hardware \
+# $(TOP)/frameworks/native/include/media/openmax
+#
+#LOCAL_SHARED_LIBRARIES := \
+# libbinder \
+# libutils \
+# libcutils \
+# libdl \
+# libui \
+#
+#LOCAL_MODULE := libstagefrighthw
+#LOCAL_MODULE_TAGS := optional
+#include $(BUILD_SHARED_LIBRARY)

doesn't build

project hardware/qcom/display/
diff --git a/liboverlay/mdpWrapper.h b/liboverlay/mdpWrapper.h
index 4cfd3e0..6e3fdf4 100644
--- a/liboverlay/mdpWrapper.h
+++ b/liboverlay/mdpWrapper.h
@@ -247,12 +247,12 @@ inline void dump(const char* const s, const msm_rotator_img_info& rot) {
dump("src_rect", rot.src_rect);
}
inline void dump(const char* const s, const msm_rotator_data_info& rot) {
- ALOGE("%s msm_rotator_data_info sessid=%d verkey=%d",
- s, rot.session_id, rot.version_key);
+ //ALOGE("%s msm_rotator_data_info sessid=%d verkey=%d",
+ // s, rot.session_id, rot.version_key);
dump("src", rot.src);
dump("dst", rot.dst);
- dump("src_chroma", rot.src_chroma);
- dump("dst_chroma", rot.dst_chroma);
+ //dump("src_chroma", rot.src_chroma);
+ //dump("dst_chroma", rot.dst_chroma);
}
inline void dump(const char* const s, const fb_fix_screeninfo& finfo) {
ALOGE("%s fb_fix_screeninfo type=%d", s, finfo.type);

these variables can't be found (and they are only there for debugging reasons, so ignore it...)

project hardware/qcom/media/
diff --git a/mm-video/vidc/vdec/Android.mk b/mm-video/vidc/vdec/Android.mk
index 42ba3c5..a01a45f 100644
--- a/mm-video/vidc/vdec/Android.mk
+++ b/mm-video/vidc/vdec/Android.mk
@@ -61,7 +61,7 @@ libmm-vdec-inc	:= $(LOCAL_PATH)/inc
libmm-vdec-inc	+= $(TARGET_OUT_HEADERS)/mm-core/omxcore

LOCAL_MODULE	:= libOmxVdec
-LOCAL_CFLAGS	:= $(libOmxVdec-def)
+LOCAL_CFLAGS	:= $(libOmxVdec-def) -fpermissive
LOCAL_C_INCLUDES	:= $(libmm-vdec-inc)

LOCAL_SHARED_LIBRARIES	:= liblog libutils libbinder

to fix a build error

http://pastebin.com/ZfSUfuaz

these got renamed too

project kernel/htc/msm7x30/
diff --git a/drivers/net/wireless/bcm4329/Makefile b/drivers/net/wireless/bcm4329/Makefile
index 5a662be..0c84dd5 100644
--- a/drivers/net/wireless/bcm4329/Makefile
+++ b/drivers/net/wireless/bcm4329/Makefile
@@ -3,7 +3,7 @@ DHDCFLAGS = -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 \
-DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 \
-DDHD_FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS \
-DSHOW_EVENTS -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS \
-	-Wall -Wstrict-prototypes -Werror -DOOB_INTR_ONLY -DCUSTOMER_HW2 \
+	-Wall -Wstrict-prototypes -DOOB_INTR_ONLY -DCUSTOMER_HW2 \
-DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DDHD_DEBUG_TRAP -DSOFTAP \
-DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT \
-DGET_CUSTOM_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP -DCSCAN -DHW_OOB \

diff --git a/drivers/net/wireless/bcm4329_204/Makefile b/drivers/net/wireless/bcm4329_204/Makefile
index bef4546..802135f 100644
--- a/drivers/net/wireless/bcm4329_204/Makefile
+++ b/drivers/net/wireless/bcm4329_204/Makefile
@@ -3,7 +3,7 @@ DHDCFLAGS = -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 \
-DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 \
-DDHD_FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS \
-DSHOW_EVENTS -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS \
-	-Wall -Wstrict-prototypes -Werror -DOOB_INTR_ONLY -DCUSTOMER_HW2 \
+	-Wall -Wstrict-prototypes -DOOB_INTR_ONLY -DCUSTOMER_HW2 \
-DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DWLAN_PFN -DWLAN_PROTECT \
-DBCMWAPI_WPI -DWLAN_LOW_RSSI_IND -DCSCAN -DSOFTAP_PROTECT \
-DMMC_RECOVER -DBCM4329_LOW_POWER -DHTC_KlocWork\

to fix another build error

project prebuilts/ndk/
diff --git a/android-ndk-r7/platforms/android-14/arch-arm/usr/include/linux/android_pmem.h b/android-ndk-r7/platforms/android-14/arch-arm/usr/include/linux/android_pmem.h
index 858857e..454078b 100644
--- a/android-ndk-r7/platforms/android-14/arch-arm/usr/include/linux/android_pmem.h
+++ b/android-ndk-r7/platforms/android-14/arch-arm/usr/include/linux/android_pmem.h
@@ -36,6 +36,7 @@ struct pmem_region {
#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, struct pmem_region *)

#define HW3D_REVOKE_GPU _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
+#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
#define HW3D_GRANT_GPU _IOW(PMEM_IOCTL_MAGIC, 9, unsigned int)
#define HW3D_WAIT_IRQ _IOW(PMEM_IOCTL_MAGIC,10, unsigned int)

define the macro here too..