Hardware/HTC Dream/Kernel Development

From freesmartphone.org
Jump to: navigation, search

Contents

Introduction

The goal of this article is to show how to do kernel development for the htcdream with openembedded

this page is a work in progress

Howto

First you need bitbake 1.10 or trunk with that patch: http://cgit.bec-systems.com/cgit.cgi/bitbake/commit/?h=cbrake/1.10-srctree-fixes&id=c6fe73d986d596dca7f76bd277cf279cd5c21308

Recipe

inherit srctree gitver kernel siteinfo

DESCRIPTION = "Linux Kernel"
SECTION = "kernel"
LICENSE = "GPLv2"

#require recipes/linux/linux.inc
DEPENDS += "android-image-utils-native"

#GITVER_NO_V = "${@'${GITVER}'[1:]}"
#PV = "${GITVER_NO_V}"
#PV = ${GITVER}
PR = "r27"
PV = "2.6.32+${PR}+gitr${GITVER}"

FILE_DIRNAME = "${HOME}/embedded/kernel/htcdream/leviathan-incoming/sources"

COMPATIBLE_MACHINE = "htcdream"
CMDLINE = "console=tty1 root=/dev/mmcblk0p1 rootdelay=8 fbcon=rotate:1 panic=30 mem=110M"

do_configure() {
	:
}


do_deploy() {
        install -d ${DEPLOY_DIR_IMAGE}
        install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
        #package_stagefile_shell ${S}/${KERNEL_OUTPUT}
        #package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin

        if [ -d "${PKGD}/lib" ]; then
                fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${PKGD} lib
                #package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz
        fi

        cd ${DEPLOY_DIR_IMAGE}
        rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
        ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
        #package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_SYMLINK_NAME}.bin

    	touch -f empty
    	mkbootimg --kernel ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin \
              --ramdisk empty \
              --cmdline "${CMDLINE}" \
              --output ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.fastboot
}

How to run the kernel

cd deploy
sudo ./tools/fastboot boot images/htcdream/zImage-2.6.32+r26+gitr0.0-961b479-r26-htcdream.fastboot
Personal tools