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

Search This thread

itzdarockz

Senior Member
Feb 24, 2012
374
197
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.
 
Last edited:

UtCollector@gmail.com

Senior Member
Nov 7, 2011
244
89
Nice work:cowboy:
I gues i put you´re link in my thread later on here:
xdaforums.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. I´m a bit alone on building for my new device haha.
I´m 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.
 

itzdarockz

Senior Member
Feb 24, 2012
374
197
Nice work:cowboy:
I gues i put you´re link in my thread later on here:
xdaforums.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. I´m a bit alone on building for my new device haha.
I´m 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.
 

UtCollector@gmail.com

Senior Member
Nov 7, 2011
244
89
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.
 

itzdarockz

Senior Member
Feb 24, 2012
374
197
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.
 

godofgeeks

Senior Member
Mar 2, 2012
304
171
www.electronicgurudev.in
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. :D 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 ;)
 

itzdarockz

Senior Member
Feb 24, 2012
374
197
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
 

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
When i compile , i get this :
Code:
Trying dependencies-only mode on a non-existing device tree?
how to fix ?

It will usually say this in my experience if you are using a non-official device tree, for example one you created from scratch using this guide. I wouldn't worry about it unless it results in a compiling error in the process.
 

dadroid98

Senior Member
May 15, 2013
210
194
Reggio Calabria - Calabria - Italy
It will usually say this in my experience if you are using a non-official device tree, for example one you created from scratch using this guide. I wouldn't worry about it unless it results in a compiling error in the process.

Why _?

dadroid98 @ dadroid98 - F3P : ~ / cm9 $ make - jx otapackage
make: the "- j" requires an argument integrated positive
Usage: make [ options] [target ] ...
options:
**-b,- m Ignored for compatibility
**-B , - always -make Generates all targets unconditionally
**-C DIRECTORY , - directory = DIRECTORY
******************************Change to DIRECTORY before doing anything.
**-d show a lot of debugging information.
**- debug [= FLAGS ] Show different types of debugging information.
**-e, - environment -overrides
******************************The environment variables override the makefile.
**-f FILE , - file = FILE , - makefile = FILE
******************************Read FILE as a makefile .
**-h, - help Show this message and exit .
**-i , - ignore -errors Ignore errors command .
**-I DIRECTORY , - include-dir = DIRECTORY
******************************Search DIRECTORY for included makefiles .
**-j [N] , - jobs [ = N] Allow N jobs at once ; infinite if not specified the topic.
**- k, - keep -going Continue running when it is not possible to create some goals.
**-l [N] , - load- average [= N] , - max -load [= N]
******************************Not start multiple processes unless the workload is not under N.
**-L, - check- symlink -times Use the latest mtime between symlinks and target .
**-n, - just- print , - dry-run , - recon
******************************Do not execute any command, the print only .
**-o FILE , - old- file = FILE , - assume -old = FILE
******************************Consider FILE to be very old and does not re-run make.
**-p, - print- data-base Print the internal database to make.
**- q, - question not execute any command , the exit status indicates if it is out of date.
**-r , - no- builtin -rules Disable the internal implicit rules .
**-R , - no- builtin -variables Disable the settings of the internal variables .
**-s, - silent, - quiet Do not display the commands .
**-S , - no- keep- going, - stop
****************************Disable the-k option .
**-t, - touch Touch Runs the objectives instead of recreating them.
**-v, - version Print the version number of make and exit.
**-w , - print- directory Print the current directory.
**- no- print- directory Turn off -w , even if it was turned on implicitly .
**-W FILE , - what-if = FILE , - new- file = FILE , - assume -new = FILE
******************************Consider FILE as brand new.
**- warn - undefined -variables Warn when an undefined variable is referenced .

This program has been compiled for x86_64 -pc -linux -gnu
Report bugs to <bug-make@gnu.org>
 
Last edited:

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
Why _?

dadroid98 @ dadroid98 - F3P : ~ / cm9 $ make - jx otapackage
make: the "- j" requires an argument integrated positive
Usage: make [ options] [target ] ...
options:
**-b,- m Ignored for compatibility
**-B , - always -make Generates all targets unconditionally
**-C DIRECTORY , - directory = DIRECTORY
******************************Change to DIRECTORY before doing anything.
**-d show a lot of debugging information.
**- debug [= FLAGS ] Show different types of debugging information.
**-e, - environment -overrides
******************************The environment variables override the makefile.
**-f FILE , - file = FILE , - makefile = FILE
******************************Read FILE as a makefile .
**-h, - help Show this message and exit .
**-i , - ignore -errors Ignore errors command .
**-I DIRECTORY , - include-dir = DIRECTORY
******************************Search DIRECTORY for included makefiles .
**-j [N] , - jobs [ = N] Allow N jobs at once ; infinite if not specified the topic.
**- k, - keep -going Continue running when it is not possible to create some goals.
**-l [N] , - load- average [= N] , - max -load [= N]
******************************Not start multiple processes unless the workload is not under N.
**-L, - check- symlink -times Use the latest mtime between symlinks and target .
**-n, - just- print , - dry-run , - recon
******************************Do not execute any command, the print only .
**-o FILE , - old- file = FILE , - assume -old = FILE
******************************Consider FILE to be very old and does not re-run make.
**-p, - print- data-base Print the internal database to make.
**- q, - question not execute any command , the exit status indicates if it is out of date.
**-r , - no- builtin -rules Disable the internal implicit rules .
**-R , - no- builtin -variables Disable the settings of the internal variables .
**-s, - silent, - quiet Do not display the commands .
**-S , - no- keep- going, - stop
****************************Disable the-k option .
**-t, - touch Touch Runs the objectives instead of recreating them.
**-v, - version Print the version number of make and exit.
**-w , - print- directory Print the current directory.
**- no- print- directory Turn off -w , even if it was turned on implicitly .
**-W FILE , - what-if = FILE , - new- file = FILE , - assume -new = FILE
******************************Consider FILE as brand new.
**- warn - undefined -variables Warn when an undefined variable is referenced .

This program has been compiled for x86_64 -pc -linux -gnu
Report bugs to <bug-make@gnu.org>

You need to specify the number of jobs so the command syntax should be something such as:

Code:
make - j4 otapackage

Not make - jx otapackage, you must specify the number of jobs and can't leave it as an x option.
 
  • Like
Reactions: dadroid98

dadroid98

Senior Member
May 15, 2013
210
194
Reggio Calabria - Calabria - Italy
Now I got. zip file of the rom but remains on bootanimation ... I thought I'd take a Logcat but ...

dadroid98@dadroid98-F3P:~$ adb devices
List of devices attached
EDIT ---
i have solved adding this on build.prop

persist.service.adb.enable=1

.. Now i can get logcat ...
 

Attachments

  • logcat.txt
    207.5 KB · Views: 61
Last edited:

shimp208

Inactive Recognized Contributor
Jan 25, 2011
2,613
3,089
Boston
@shimp208
Will this method will work on Samsung galxy grand quattro

The method in this guide for creating a new device tree should work on your device. After looking through the Galaxy Grand Quattro development sections here on XDA, rather then creating a new device tree from scratch I would recommend taking a look a this developers github and seeing if they already have a device tree for your device as they have a build of CM11 in the Galaxy Grand Quattro Orginal Development section. If you can't find it on their github a polite message, inquiring about what device tree they used should be fine. Let me know if you still have questions.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 62
    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.
    3
    Nice work:cowboy:
    I gues i put you´re link in my thread later on here:
    xdaforums.com/showthread.php?t=1935162
    I did make a working recovery but iḿ still stuk building a working rom. I´m a bit alone on building for my new device haha.
    I´m 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.
    3
    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.
    3

    Glad I could help you out, let me know if you have any further questions I'll be happy to help you out best I can.

    Sent from my SCH-I535 using XDA Premium 4 mobile app
    1
    Why _?

    dadroid98 @ dadroid98 - F3P : ~ / cm9 $ make - jx otapackage
    make: the "- j" requires an argument integrated positive
    Usage: make [ options] [target ] ...
    options:
    **-b,- m Ignored for compatibility
    **-B , - always -make Generates all targets unconditionally
    **-C DIRECTORY , - directory = DIRECTORY
    ******************************Change to DIRECTORY before doing anything.
    **-d show a lot of debugging information.
    **- debug [= FLAGS ] Show different types of debugging information.
    **-e, - environment -overrides
    ******************************The environment variables override the makefile.
    **-f FILE , - file = FILE , - makefile = FILE
    ******************************Read FILE as a makefile .
    **-h, - help Show this message and exit .
    **-i , - ignore -errors Ignore errors command .
    **-I DIRECTORY , - include-dir = DIRECTORY
    ******************************Search DIRECTORY for included makefiles .
    **-j [N] , - jobs [ = N] Allow N jobs at once ; infinite if not specified the topic.
    **- k, - keep -going Continue running when it is not possible to create some goals.
    **-l [N] , - load- average [= N] , - max -load [= N]
    ******************************Not start multiple processes unless the workload is not under N.
    **-L, - check- symlink -times Use the latest mtime between symlinks and target .
    **-n, - just- print , - dry-run , - recon
    ******************************Do not execute any command, the print only .
    **-o FILE , - old- file = FILE , - assume -old = FILE
    ******************************Consider FILE to be very old and does not re-run make.
    **-p, - print- data-base Print the internal database to make.
    **- q, - question not execute any command , the exit status indicates if it is out of date.
    **-r , - no- builtin -rules Disable the internal implicit rules .
    **-R , - no- builtin -variables Disable the settings of the internal variables .
    **-s, - silent, - quiet Do not display the commands .
    **-S , - no- keep- going, - stop
    ****************************Disable the-k option .
    **-t, - touch Touch Runs the objectives instead of recreating them.
    **-v, - version Print the version number of make and exit.
    **-w , - print- directory Print the current directory.
    **- no- print- directory Turn off -w , even if it was turned on implicitly .
    **-W FILE , - what-if = FILE , - new- file = FILE , - assume -new = FILE
    ******************************Consider FILE as brand new.
    **- warn - undefined -variables Warn when an undefined variable is referenced .

    This program has been compiled for x86_64 -pc -linux -gnu
    Report bugs to <bug-make@gnu.org>

    You need to specify the number of jobs so the command syntax should be something such as:

    Code:
    make - j4 otapackage

    Not make - jx otapackage, you must specify the number of jobs and can't leave it as an x option.