Post Reply

Angry [NOOBFRIENDLY] [HOWTO] Create a device tree for MTD devices

OP itzdarockz

24th November 2012, 12:15 AM   |  #1  
itzdarockz's Avatar
OP Senior Member
Thanks Meter: 162
 
340 posts
Join Date:Joined: Feb 2012
More
What you will need
Windows or Ubuntu
A couple months knowledge about linux and android
Common sense
Notepad ++ (if on windows)
An MTD rooted android phone or tablet

NOTICE: This guide probably will NOT build a rom with no bugs, it will only give you a place to start. You will have to fix the bugs on your own. I will be referring devicename to your phones model id (my phone is samsung conquer 4g and its model id is SPH-D600) I will also be referring manufacturer to your manufacturer (duh!) and source to the source you are trying to build (CyanogenMod, aosp, etc.). As far as I know this only works for CyanogenMod 7.2 and AOSP GB.

First you might want to find out what device is closest to yours (same cpu (arm7, arm6, etc) and platform (msm7k, msm7x30, etc.) and grab its device tree for whatever rom you want to compile. It may have more fixes.

Create a folder where you want with your devices name (mine is SPH-D600). Inside create a files folder and these files

AndroidBoard.mk
AndroidProducts.mk
BoardConfig.mk
devicename.mk
extract-files.sh
proprietary-files.txt
recovery.fstab
setup-makefiles.sh
system.prop
vendorsetup.sh

Look for devicename inside the codes you are pasting

Open up AndroidBoard.mk and paste this:
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := init.devicename.sh
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.devicename.sh
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.rc
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := ueventd.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/ueventd.rc
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := lpm.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/lpm.rc
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.lpm.sh
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.lpm.sh
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.devicename.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.devicename.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)


# include the non-open-source counterpart to this file
-include vendor/samsung/chief/AndroidBoardVendor.mk
These files are in your ramdisk in your boot.img. Use a boot.img unpacker to get these files and paste them in the files folder. Replace devicename with your phones device name. If you do not have one of these files than just erase it from the mk file.

Next open AndroidProducts.mk and paste this:
Code:
PRODUCT_MAKEFILES := \
    $(LOCAL_DIR)/devicename.mk
Next is BoardConfig.mk, You will have to do some research to get these. This is where the cousin devices tree will come in handy. Paste this:
Code:
# inherit from the proprietary version
-include vendor/samsung/devicename/BoardConfigVendor.mk

(get most of this from build.prop)
# Board General info
TARGET_BOOTLOADER_BOARD_NAME := devicename
TARGET_BOARD_PLATFORM := platform
BOARD_HAS_NO_SELECT_BUTTON := true
TARGET_CPU_ABI := cpu
TARGET_CPU_ABI2 := cpu2
TARGET_ARCH_VARIANT := cpu-a-neon
ARCH_ARM_HAVE_TLS_REGISTER := ?
BOARD_USES_QCOM_HARDWARE := ?
BOARD_USES_QCOM_GPS := ?
BOARD_USES_QCOM_LIBS := ?
BOARD_USES_QCOM_LIBRPC := ?
BOARD_USE_QCOM_PMEM := ?

(i cant figure this one out, please pm me if you find it out)
# ril

# audio
HAVE_HTC_AUDIO_DRIVER := ?
BOARD_USES_GENERIC_AUDIO := ?
TARGET_PROVIDES_LIBAUDIO := ?

(get this information from  system/etc and /modules)
# wifi
BOARD_WPA_SUPPLICANT_DRIVER := ?
WPA_SUPPLICANT_VERSION := ?
BOARD_WLAN_DEVICE := ?
WIFI_DRIVER_FW_PATH_STA := "/system/etc/wifi/?"
WIFI_DRIVER_FW_PATH_AP := "/system/etc/wifi/?"
WIFI_DRIVER_MODULE_NAME := "?"
WIFI_DRIVER_MODULE_PATH := "/lib/modules/?"
WIFI_DRIVER_MODULE_ARG := "firmware_path=/system/etc/wifi/? nvram_path=/system/etc/wifi/?"

(get this from system/etc)
# video
BOARD_EGL_CFG := device/manufacturer/devicename/files/?
TARGET_BOARD_PLATFORM_GPU := ?

# Bluetooth
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_BCM := ?

(get this from your boot.img unpacking)
# kernel
BOARD_KERNEL_CMDLINE := ?
BOARD_KERNEL_BASE := ?
BOARD_KERNEL_PAGESIZE := ?
TARGET_PREBUILT_KERNEL := devicemanufacturer/devicename/kernel

# Partitioning setup (fix this up by examining /proc/mtd on a running device)
BOARD_BOOTIMAGE_PARTITION_SIZE := ?
BOARD_RECOVERYIMAGE_PARTITION_SIZE := ?
BOARD_SYSTEMIMAGE_PARTITION_SIZE := ?
BOARD_USERDATAIMAGE_PARTITION_SIZE := ?
BOARD_FLASH_BLOCK_SIZE := ?

## PARTITION LAYOUT/INFO ##
BOARD_DATA_DEVICE := /dev/block/mtdblock?
BOARD_DATA_FILESYSTEM := ?
BOARD_DATA_FILESYSTEM_OPTIONS := rw,nosuid,nodev,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_SYSTEM_DEVICE := /dev/block/mtdblock?
BOARD_SYSTEM_FILESYSTEM := ?
BOARD_SYSTEM_FILESYSTEM_OPTIONS := rw,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_CACHE_DEVICE := /dev/block/mtdblock?
BOARD_CACHE_FILESYSTEM := ?
BOARD_CACHE_FILESYSTEM_OPTION := rw,nosuid,nodev,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_MISC_DEVICE := /dev/block/mtdblock?
BOARD_BOOT_DEVICE := /dev/block/mtdblock?
BOARD_RECOVERY_DEVICE := /dev/block/mtdblock?
TARGET_USERIMAGES_USE_EXT4 := ?
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/vold/?


# recovery
BOARD_RECOVERY_HANDLES_MOUNT := true
BOARD_CUSTOM_GRAPHICS:= graphics.c (you might need this so check for it in your recovery source)

# JIT / Optimizations
WITH_DEXPREOPT := true
JS_ENGINE := v8

TARGET_SPECIFIC_HEADER_PATH += device/manufacturer/devicename/files

TARGET_RELEASETOOL_OTA_FROM_TARGET_SCRIPT :=
next is devicename.mk use common sense in this one (chief is now devicename for this one)
Code:
$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
# The gps config appropriate for this device
$(call inherit-product, device/common/gps/gps_us_supl.mk)
# Inherit some common cyanogenmod stuff.
(may or may not have to use this)
$(call inherit-product, vendor/source/products/common_full.mk)

$(call inherit-product-if-exists, vendor/samsung/chief/chief-vendor.mk)

DEVICE_PACKAGE_OVERLAYS += device/samsung/chief/overlay

ifeq ($(TARGET_PREBUILT_KERNEL),)
	LOCAL_KERNEL := device/samsung/chief/kernel
else
	LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif
PRODUCT_COPY_FILES += \
    $(LOCAL_KERNEL):kernel

PRODUCT_PACKAGES += \
    hostap \
    librs_jni \
    gralloc.msm7k \
    overlay.default \
    screencap \
    libOmxCore \
    libOmxVenc \
    libOmxVdec \
    com.android.future.usb.accessory \
    hostapd
    
PRODUCT_PACKAGES += \
    sensors.default \
    lights.msm7k

#kernel modules
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/lib/modules/bthid.ko:root/lib/modules/bthid.ko \
    device/samsung/chief/files/lib/modules/cmc7xx_sdio.ko:root/lib/modules/cmc7xx_sdio.ko \
    device/samsung/chief/files/lib/modules/dhd.ko:root/lib/modules/dhd.ko \
    device/samsung/chief/files/lib/modules/qce.ko:root/lib/modules/qce.ko \
    device/samsung/chief/files/lib/modules/qcedev.ko:root/lib/modules/qcedev.ko \
    device/samsung/chief/files/system/lib/libdiag.so:system/lib/libdiag.so \
    device/samsung/chief/files/lib/modules/qcrypto.ko:root/lib/modules/qcrypto.ko

# Fix Logcat / Misc
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/logcat:system/bin/logcat \
    vendor/samsung/chief/proprietary/lib/libgsl.so:system/lib/libgsl.so

# system/etc/init's
PRODUCT_COPY_FILES += \
    device/samsung/chief/init.cdma-pppd:system/etc/init.cdma-ppd \
    device/samsung/chief/init.gprs-pppd:system/etc/init.gprs-ppd \
    device/samsung/chief/init.qcom.bt.sh:system/etc/init.qcom.bt.sh \
    device/samsung/chief/init.qcom.coex.sh:system/etc/init.qcom.coex.sh \
    device/samsung/chief/init.qcom.fm.sh:system/etc/init.qcom.fm.sh \
    device/samsung/chief/init.qcom.sdio.sh:system/etc/init.qcom.sdio.sh \
    device/samsung/chief/init.qcom.wifi.sh:system/etc/init.qcom.wifi.sh \
    device/samsung/chief/files/SPH-D600.rle:root/SPH-D600.rle \
    device/samsung/chief/files/charging.rle:root/charging.rle

# wifi files
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/egl.cfg:system/lib/egl/egl.cfg \
    device/samsung/chief/files/system/etc/wifi/bcm4329_sta.bin:/system/etc/wifi/bcm4329_sta.bin \
    device/samsung/chief/files/system/etc/wifi/bcm4329_aps.bin:/system/etc/wifi/bcm4329_aps.bin \
    device/samsung/chief/files/system/etc/wifi/nvram_net.txt:system/etc/wifi/nvram_net.txt \
    device/samsung/chief/files/system/etc/wifi/bcm4329_mfg.bin:/system/etc/wifi/bcm4329_mfg.bin \
    device/samsung/chief/files/system/etc/wifi/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
    device/samsung/chief/files/system/etc/dhcpcd/dhcpcd.conf:system/etc/dhcpcd/dhcpcd.conf \
    device/samsung/chief/files/system/bin/BCM4329B1_002.002.023.0746.0871.hcd:system/bin/BCM4329B1_002.002.023.0746.0871.hcd

# video drivers
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_command_control.fw:/system/etc/firmware/vidc_720p_command_control.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_mp4_dec_mc.fw:/system/etc/firmware/vidc_720p_mp4_dec_mc.fw \
    device/samsung/chief/files/system/etc/firmware/yamato_pfp.fw:/system/etc/firmware/yamato_pfp.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_h263_dec_mc.fw:/system/etc/firmware/vidc_720p_h263_dec_mc.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_mp4_enc_mc.fw:/system/etc/firmware/vidc_720p_mp4_enc_mc.fw \
    device/samsung/chief/files/system/etc/firmware/yamato_pm4.fw:/system/etc/firmware/yamato_pm4.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_h264_dec_mc.fw:/system/etc/firmware/vidc_720p_h264_dec_mc.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_vc1_dec_mc.fw:/system/etc/firmware/vidc_720p_vc1_dec_mc.fw \
    device/samsung/chief/files/system/etc/firmware/vidc_720p_h264_enc_mc.fw:/system/etc/firmware/vidc_720p_h264_enc_mc.fw 
    
# misc firmware
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/system/etc/firmware/wlan/cfg.dat:system/etc/firmware/wlan/cfg.dat \
    device/samsung/chief/files/system/etc/firmware/wlan/qcom_fw.bin:system/etc/firmware/wlan/qcom_fw.bin \
    device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_fw.bin:system/etc/firmware/wlan/volans/WCN1314_qcom_fw.bin \
    device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_wlan_nv.bin:system/etc/firmware/wlan/volans/WCN1314_qcom_wlan_nv.bin \
    device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_cfg.dat:system/etc/firmware/wlan/volans/WCN1314_cfg.dat \
    device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_cfg.ini:system/etc/firmware/wlan/volans/WCN1314_qcom_cfg.ini \
    device/samsung/chief/files/system/bin/pppd_runner:system/bin/pppd_runner \
    device/samsung/chief/files/system/bin/drexe:system/bin/drexe \
    device/samsung/chief/files/system/etc/wifi/wifi.conf:system/etc/wifi/wifi.conf \
    device/samsung/chief/files/system/etc/wifi/wl:system/etc/wifi/wl \
    device/samsung/chief/files/system/etc/wifi/nvram_mfg.txt:system/etc/wifi/nvram_mfg.txt

# Telephony property for CDMA
PRODUCT_PROPERTY_OVERRIDES += \
    ro.config.vc_call_vol_steps=15 \
    ro.telephony.default_network=4 \
    ro.com.google.clientidbase=android-sprint-us \
    ro.cdma.home.operator.numeric=310120 \
    ro.cdma.home.operator.alpha=Sprint \
    net.cdma.pppd.authtype=require-pap \
    net.cdma.pppd.user=user[SPACE]SprintNextel \
    net.cdma.datalinkinterface=/dev/ttyCDMA0 \
    net.interfaces.defaultroute=cdma \
    net.cdma.ppp.interface=ppp0 \
    net.connectivity.type=CDMA1 \
    mobiledata.interfaces=ppp0,uwbr0 \
    ro.telephony.ril_class=samsung \
    ro.ril.samsung_cdma=true

# WiMAX Property setting for checking WiMAX interface
PRODUCT_PROPERTY_OVERRIDES += \
    ro.wimax.interface=uwbr0 \
    net.tcp.buffersize.wimax=4092,87380,1520768,4092,16384,1520768

# misc for now
PRODUCT_COPY_FILES += \
    device/samsung/chief/files/system/etc/apns-conf.xml:system/etc/apns-conf.xml \
    device/samsung/chief/files/system/vendor/lib/libsec-ril.so:system/vendor/lib/libsec-ril.so \
    device/samsung/chief/files/system/bin/qmuxd:system/bin/qmuxd \
    device/samsung/chief/files/system/bin/rmt_storage:system/bin/rmt_storage \
    device/samsung/chief/files/system/bin/netmgrd:system/bin/netmgrd \
    device/samsung/chief/files/system/bin/thermald:system/bin/thermald \
    device/samsung/chief/files/system/bin/geomagneticd:system/bin/geomagneticd \
    device/samsung/chief/files/system/bin/orientationd:system/bin/orientationd \
    device/samsung/chief/files/system/bin/cnd:system/bin/cnd \
    device/samsung/chief/files/system/bin/mfgloader:system/bin/mfgloader \
    device/samsung/chief/files/system/bin/wlandutservice:system/bin/wlandutservice \
    device/samsung/chief/files/system/bin/btld:system/bin/btld \
    vendor/cyanogen/prebuilt/mdpi/media/bootanimation.zip:system/media/bootanimation.zip \
    device/samsung/chief/files/system/etc/01_qcomm_omx.cfg:system/etc/01_qcomm_omx.cfg \
    device/samsung/chief/files/system/etc/cdma-carriers-conf.xml:system/etc/cdma-carriers-conf.xml \
    device/samsung/chief/files/system/etc/loc_parameter.ini:system/etc/loc_parameter.ini \
    device/samsung/chief/files/system/etc/media_profiles.xml:system/etc/media_profiles.xml \
    device/samsung/chief/files/system/etc/wimax_boot.bin:system/etc/wimax_boot.bin \
    device/samsung/chief/files/system/etc/wimaxfw.bin:system/etc/wimaxfw.bin \
    device/samsung/chief/files/system/etc/wimaxloader.bin:system/etc/wimaxloader.bin \
    device/samsung/chief/files/system/etc/thermald.conf:system/etc/thermald.conf

# These are the hardware-specific features
PRODUCT_COPY_FILES += \
    frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
    frameworks/base/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
    frameworks/base/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
    frameworks/base/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
    frameworks/base/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \
    frameworks/base/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \
    frameworks/base/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
    frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
    frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
    frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
    frameworks/base/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
    frameworks/base/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
    frameworks/base/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
    frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
    packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml



$(call inherit-product, build/target/product/full.mk)

PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0

PRODUCT_PROPERTY_OVERRIDES := \
wifi.interface=eth0\
wifi.supplicant_scan_interval=15\
ril.subscription.types=NV

# Perfomance tweaks and misc
PRODUCT_PROPERTY_OVERRIDES += \
    dalvik.vm.execution-mode=int:jit \
    dalvik.vm.heapsize=48m \
    persist.sys.use_dithering=1 \
    ro.compcache.default=0

# Properties taken from build.prop
PRODUCT_PROPERTY_OVERRIDES += \
ro.setupwizard.mode=DISABLED \
ro.com.google.gmsversion=2.3_r9 \
ro.com.google.clientidbase=android-samsung \
ro.com.google.clientidbase.ms=android-sprint-us \
ro.com.google.clientidbase.yt=android-sprint-us \
ro.com.google.clientidbase.am=android-sprint-us \
ro.com.google.clientidbase.gmm=android-samsung 
    
# Set region
PRODUCT_DEFAULT_LANGUAGE := en_US
PRODUCT_DEFAULT_REGION := US

# Chief uses medium-density artwork where available
PRODUCT_LOCALES += mdpi

PRODUCT_COPY_FILES += \
    $(LOCAL_KERNEL):kernel

$(call inherit-product, build/target/product/full.mk)

PRODUCT_NAME := cyanogenmod_chief
PRODUCT_DEVICE := chief
PRODUCT_BRAND := samsung
PRODUCT_MODEL := SPH-D600
PRODUCT_MANUFACTURER := samsung
CDMA_GOOGLE_BASE := android-sprint-us
CDMA_CARRIER_ALPHA := Sprint
CDMA_CARRIER_NUMERIC := 310120
next extract-files.sh
Code:
BASE=../../../vendor/manufacturer/devicename/proprietary
rm -rf $BASE/*

for FILE in `egrep -v '(^#|^$)' proprietary-files.txt`; do
DIR=`dirname $FILE`
  if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
  fi
adb pull /system/$FILE $BASE/$FILE
done

./setup-makefiles.sh
For propietary-files.txt put in the directories of the needed files. Example
Code:
lib/libsec-ril.so
lib/liboncrpc.so
bin/mm-abl-tes
etc.
next setup-makefiles.sh NOTICE: there will be coding such as $DEVICE do NOT replace this with your devices name. This code will be set with what ever you put in the beginning.
Code:
#!/bin/sh

# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DEVICE=devicename
VENDOR=manufacturer
OUTDIR=vendor/$VENDOR/$DEVICE
MAKEFILE=../../../$OUTDIR/$DEVICE-vendor-blobs.mk
mkdir -p ../../../vendor/$VENDOR/$DEVICE

(cat << EOF) > $MAKEFILE
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh

# Prebuilt libraries that are needed to build open-source libraries
#$OUTDIR/proprietary/lib/libcamera.so:obj/lib/libcamera.so \\
#$OUTDIR/proprietary/lib/libcameraservice.so:obj/lib/libcameraservice.so \\
#$OUTDIR/proprietary/lib/libcamera_client.so:obj/lib/libcamera_client.so \\
#$OUTDIR/proprietary/lib/liboemcamera.so:obj/lib/liboemcamera.so \\

PRODUCT_COPY_FILES += \\
$OUTDIR/proprietary/lib/libaudioalsa.so:obj/lib/libaudioalsa.so \\
EOF

LINEEND=" \\"
COUNT=`cat proprietary-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
COUNT=`expr $COUNT - 1`
    if [ $COUNT = "0" ]; then
LINEEND=""
    fi
echo " $OUTDIR/proprietary/$FILE:system/$FILE$LINEEND" >> $MAKEFILE
done

(cat << EOF) > ../../../$OUTDIR/$DEVICE-vendor.mk
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh

# Live wallpaper packages
PRODUCT_PACKAGES := \\
LiveWallpapers \\
LiveWallpapersPicker

# Publish that we support the live wallpaper feature.
PRODUCT_COPY_FILES := \\
packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml

# Pick up overlay for features that depend on non-open-source files
DEVICE_PACKAGE_OVERLAYS := vendor/$VENDOR/$DEVICE/overlay

\$(call inherit-product, vendor/$VENDOR/$DEVICE/$DEVICE-vendor-blobs.mk)
EOF

(cat << EOF) > ../../../$OUTDIR/BoardConfigVendor.mk
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh

USE_CAMERA_STUB := ?
EOF
Next is system.prop, this is basically the props for your device in build.prop
Code:
#
# system.prop for devicename
#
rild.libpath=/system/vendor/lib/?
rild.libargs= ?
Finally vendorsetup.sh
Code:
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This file is executed by build/envsetup.sh, and can use anything
# defined in envsetup.sh.
#
# In particular, you can add lunch options with the add_lunch_combo
# function: add_lunch_combo generic-eng

add_lunch_combo source_devicename-eng
There you go! It may have been a lot of work but its worth it. If you have any questions comment them. I will not be fixing your bugs though. If you find any mistakes please PM them to me. Thank you.
Last edited by itzdarockz; 24th November 2012 at 05:20 PM.
The Following 39 Users Say Thank You to itzdarockz For This Useful Post: [ View ]
24th November 2012, 03:47 PM   |  #2  
Senior Member
Thanks Meter: 68
 
210 posts
Join Date:Joined: Nov 2011
More
Thumbs up
Nice work
I gues i put youre link in my thread later on here:
forum.xda-developers.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. Im a bit alone on building for my new device haha.
Im changing the files i need in proprietary-files.txt at the moment.
Iḿ a bit unsure what files to use.. Use the file from CM ore use the original file.
For example bin/vold use the one that CM gives ore the original device files.

To make my cwm recovery work i did have to use the original init file.
24th November 2012, 05:10 PM   |  #3  
itzdarockz's Avatar
OP Senior Member
Thanks Meter: 162
 
340 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by UtCollector@gmail.com

Nice work
I gues i put youre link in my thread later on here:
forum.xda-developers.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. Im a bit alone on building for my new device haha.
Im changing the files i need in proprietary-files.txt at the moment.
Iḿ a bit unsure what files to use.. Use the file from CM ore use the original file.
For example bin/vold use the one that CM gives ore the original device files.

To make my cwm recovery work i did have to use the original init file.

Thank you. Propietary files are the files in your device not cm. These files include ril files for service and necessary video files to play videos and games. They are pulled from your device when you do ./extract-files.sh on ubuntu. I will add explanations for everything in a little bit.
The Following User Says Thank You to itzdarockz For This Useful Post: [ View ]
25th November 2012, 03:58 PM   |  #4  
Senior Member
Thanks Meter: 68
 
210 posts
Join Date:Joined: Nov 2011
More
Quote:
Originally Posted by itzdarockz

Thank you. Propietary files are the files in your device not cm. These files include ril files for service and necessary video files to play videos and games. They are pulled from your device when you do ./extract-files.sh on ubuntu. I will add explanations for everything in a little bit.

That part about the Propietary files i know.
I just have a hard time finding out what my Propietary files are.

What do i do for this file: etc/media_profiles.xml
At the moment i take the 1 from the device. But cm will build it when if l dont include it..

And many files im nut sure if in the lib dir and sow on.
25th November 2012, 10:14 PM   |  #5  
itzdarockz's Avatar
OP Senior Member
Thanks Meter: 162
 
340 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by UtCollector@gmail.com

That part about the Propietary files i know.
I just have a hard time finding out what my Propietary files are.

What do i do for this file: etc/media_profiles.xml
At the moment i take the 1 from the device. But cm will build it when if l dont include it..

And many files im nut sure if in the lib dir and sow on.

You wouldnt include media_profiles. Try finding a device tree for a device close to urs and see what you may need.
The Following 2 Users Say Thank You to itzdarockz For This Useful Post: [ View ]
1st December 2012, 11:59 PM   |  #6  
Senior Member
Thanks Meter: 68
 
210 posts
Join Date:Joined: Nov 2011
More
Quote:
Originally Posted by itzdarockz

You wouldnt include media_profiles. Try finding a device tree for a device close to urs and see what you may need.

Ill will do that.
13th December 2012, 06:07 AM   |  #7  
Senior Member
Thanks Meter: 282
 
753 posts
Join Date:Joined: Jan 2012
More
hey there mate, thanks for this info,,, would this be current for latest cm???
13th December 2012, 03:40 PM   |  #8  
Senior Member
Thanks Meter: 50
 
135 posts
Join Date:Joined: Feb 2011
Great info, thx
7th January 2013, 08:05 AM   |  #9  
godofgeeks's Avatar
Senior Member
Thanks Meter: 138
 
281 posts
Join Date:Joined: Mar 2012
Donate to Me
More
Quote:
Originally Posted by itzdarockz

What you will need
Windows or Ubuntu
A couple months knowledge about linux and android
Common sense
Notepad ++ (if on windows)
An MTD rooted android phone or tablet

There you go! It may have been a lot of work but its worth it. If you have any questions comment them. I will not be fixing your bugs though. If you find any mistakes please PM them to me. Thank you.

Hey mate thanks for this......however I ran into a problem I am making a rom and I did change ro.custom.build.version @ build.prop but changes are not there.....other changes I made to model and rest are reflecting but this particular isnt changing...any idea....??? thanks in advance
9th January 2013, 10:24 PM   |  #10  
itzdarockz's Avatar
OP Senior Member
Thanks Meter: 162
 
340 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by godofgeeks

Hey mate thanks for this......however I ran into a problem I am making a rom and I did change ro.custom.build.version @ build.prop but changes are not there.....other changes I made to model and rest are reflecting but this particular isnt changing...any idea....??? thanks in advance

Maybe try putting ro.modversion that worked for me, if it doesnt work you can just unzip the rom and put that in the #additional properties

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android by ThreadRank