diff --git a/msm8960dt-common/msm8960dt-common-vendor-blobs.mk b/msm8960dt-common/msm8960dt-common-vendor-blobs.mk index caecce2417..1c41e5c98d 100644 --- a/msm8960dt-common/msm8960dt-common-vendor-blobs.mk +++ b/msm8960dt-common/msm8960dt-common-vendor-blobs.mk @@ -182,8 +182,6 @@ PRODUCT_COPY_FILES += \ vendor/motorola/msm8960dt-common/proprietary/etc/firmware/vidc_1080p.fw:system/etc/firmware/vidc_1080p.fw \ vendor/motorola/msm8960dt-common/proprietary/bin/batt_health:system/bin/batt_health \ vendor/motorola/msm8960dt-common/proprietary/bin/dbvc_atvc_property_set:system/bin/dbvc_atvc_property_set \ - vendor/motorola/msm8960dt-common/proprietary/bin/hardware_revisions.sh:system/bin/hardware_revisions.sh \ - vendor/motorola/msm8960dt-common/proprietary/bin/mount_ext4.sh:system/bin/mount_ext4.sh \ vendor/motorola/msm8960dt-common/proprietary/bin/msp430:system/bin/msp430 \ vendor/motorola/msm8960dt-common/proprietary/bin/irsc_util:system/bin/irsc_util \ vendor/motorola/msm8960dt-common/proprietary/lib/libdsutils.so:system/lib/libdsutils.so \ diff --git a/msm8960dt-common/proprietary/bin/hardware_revisions.sh b/msm8960dt-common/proprietary/bin/hardware_revisions.sh deleted file mode 100644 index a2876c6ebf..0000000000 --- a/msm8960dt-common/proprietary/bin/hardware_revisions.sh +++ /dev/null @@ -1,266 +0,0 @@ -#!/system/bin/sh -# -# Copyright (c) 2013, Motorola LLC All rights reserved. -# -# The purpose of this script is to compile information about the hardware -# versions of various devices on each unit. This is useful when searching -# through reported issues for correlations with certain hardware revisions. -# The information is collected from various locations in proc and sysfs (some -# of which are product-specific) and compiled into small, single-line text -# files in the userdata partition, one for each type of device. The format of -# these lines are as follows: -# -# MOTHREV-vX -# hw_name=XXXXX -# vendor_id=XXXXX -# hw_rev=XXXXX -# date=XXXXX -# lot_code=XXXXX -# fw_rev=XXXXX -# (components may also add additional fields to the ones above) -# -# The extact format of each field will be device-specific, but should be -# consistent across a particular hardware platform. Note that each revision -# data file is rewritten every time this script is called. This ensures that -# any future format changes to the revision files are picked up. -# -# While the method used to read the information should be consistent on a given -# platform, the specific path to a device's information may vary between -# products. The hardware_revisions.conf file provides a way to adjust those -# paths from the default. -# - -export PATH=/system/bin:$PATH - -# Output destination and permissions -OUT_PATH=/data/hardware_revisions -OUT_USR=system -OUT_GRP=system -OUT_PERM=0644 -OUT_PATH_PERM=0755 - -# Default paths to hardware information -PATH_RAM=/sys/ram -PATH_NVM=/sys/block/mmcblk0/device -PATH_SDCARD=/sys/block/mmcblk1/device -PATH_TOUCH="/sys/bus/i2c/drivers/"`cd /sys/bus/i2c/drivers && ls */?-*/ic_ver | grep -o .*/` -PATH_DISPLAY=/sys/hardware_revisions/display -PATH_PMIC=/sys/hardware_revisions/pmic - -# Product-specific overrides -[ -e /system/etc/hardware_revisions.conf ] && . /system/etc/hardware_revisions.conf - -# -# Clear out all revision data in this directory. If in the future we decide -# to remove a component, we want to make sure any old files are not present. -rm /data/hardware_revisions/* - -# -# Append one piece of revision data to a given file. If a value is blank, -# then "NOT_AVAILABLE" is written. -# -# $1 - tag -# $2 - value -# $3 - file to write -write_one_revision_data() -{ - if [ -z "${2}" ]; then - VALUE=NOT_AVAILABLE - else - VALUE="${2}" - fi - - echo "${1}=${VALUE}" >> ${3} -} - -# -# Generate the common data contained for -# all hardware peripherals -# -# $1 - file to write to -# $2 - name -# $3 - vendor ID -# $4 - hardware revision -# $5 - date -# $6 - lot code -# $7 - firmware revision -create_common_revision_data() -{ - FILE="${1}" - echo "MOTHREV-v2" > ${FILE} - - write_one_revision_data "hw_name" "${2}" ${FILE} - write_one_revision_data "vendor_id" "${3}" ${FILE} - write_one_revision_data "hw_rev" "${4}" ${FILE} - write_one_revision_data "date" "${5}" ${FILE} - write_one_revision_data "lot_code" "${6}" ${FILE} - write_one_revision_data "fw_rev" "${7}" ${FILE} - -} - -# -# Applies the appropriate file permissions to the -# hardware revision data file. -# -# $1 - file to write to -apply_revision_data_perms() -{ - chown ${OUT_USR}.${OUT_GRP} "${1}" - chmod ${OUT_PERM} "${1}" -} - -mkdir -p ${OUT_PATH} -chown ${OUT_USR}.${OUT_GRP} ${OUT_PATH} -chmod ${OUT_PATH_PERM} ${OUT_PATH} - - -# -# Compile ram -# -FILE="${OUT_PATH}/ram" -HNAME= -VEND= -HREV= -DATE= -FREV= -LOT_CODE= -INFO= -if [ -d "${PATH_RAM}" ] ; then - HNAME=`cat ${PATH_RAM}/type` - VEND=`cat ${PATH_RAM}/info` - VEND="${VEND%%:*:*}" - INFO="$(cat ${PATH_RAM}/mr5),$(cat ${PATH_RAM}/mr6),$(cat ${PATH_RAM}/mr7),\ -$(cat ${PATH_RAM}/mr8)" -fi -create_common_revision_data "${FILE}" "${HNAME}" "${VEND}" "" "" "" "" -write_one_revision_data "config_info" "${INFO}" "${FILE}" -apply_revision_data_perms "${FILE}" - - -# -# Compile nvm -# -FILE="${OUT_PATH}/nvm" -HNAME= -VEND= -HREV= -DATE= -FREV= -LOT_CODE= -if [ -d "${PATH_NVM}" ] ; then - HNAME=`cat ${PATH_NVM}/type` - VEND=`cat ${PATH_NVM}/manfid` - HREV=`cat ${PATH_NVM}/name` - DATE=`cat ${PATH_NVM}/date` - FREV="$(cat ${PATH_NVM}/hwrev),$(cat ${PATH_NVM}/fwrev)" - LOT_CODE="$(cat ${PATH_NVM}/csd)" -fi -create_common_revision_data "${FILE}" "${HNAME}" "${VEND}" "${HREV}" "${DATE}" "${LOT_CODE}" "${FREV}" -apply_revision_data_perms "${FILE}" - - -# -# Compile ap -# -FILE="${OUT_PATH}/ap" -HNAME= -VEND= -HREV= -DATE= -FREV= -LOT_CODE= -if [ -e "/proc/cpuinfo" ]; then - PREVIFS="$IFS" - IFS=" -" - for CPU in `cat /proc/cpuinfo` ; do - KEY="${CPU%:*}" - VAL="${CPU#*: }" - case "${KEY}" in - Processor*) HNAME="${VAL}" ;; - *implementer*) VEND="${VAL}" ;; - *variant*) HREV="${VAL}" ;; - *part*) HREV="${HREV},${VAL}" ;; - *revision*) HREV="${HREV},${VAL}" ;; - esac - done - IFS="$PREVIFS" -fi -create_common_revision_data "${FILE}" "${HNAME}" "${VEND}" "${HREV}" "" "" "" -apply_revision_data_perms "${FILE}" - - -# -# copy pmic data -# -if [ -e "/sys/hardware_revisions/pmic" ]; then - cat /sys/hardware_revisions/pmic > ${OUT_PATH}/pmic -else - create_common_revision_data "${OUT_PATH}/pmic" "" "" "" "" "" "" -fi -apply_revision_data_perms "${OUT_PATH}/pmic" - - -# -# copy display data -# -if [ -e /sys/hardware_revisions/display ]; then - cat /sys/hardware_revisions/display > ${OUT_PATH}/display -else - create_common_revision_data "${OUT_PATH}/display" "" "" "" "" "" "" -fi -apply_revision_data_perms "${OUT_PATH}/display" - - -# -# Compile touchscreen -# -FILE="${OUT_PATH}/touchscreen" -HNAME= -VEND= -HREV= -DATE= -FREV= -LOT_CODE= -if [ -e "${PATH_TOUCH}/name" ]; then - HNAME=`cat ${PATH_TOUCH}/name` - ICVER=`cat -e ${PATH_TOUCH}/ic_ver` - case "${HNAME}" in - melfas*) - VEND="Melfas" - HREV="${ICVER##*'HW Revision:'}" - HREV="${HREV%%\$*}" - FREV="${ICVER##*'Core FW ver:'}" - FREV="${FREV%%\$*}" - ;; - cyttsp*) - VEND="${ICVER##*'Custom ID:'}" - VEND="${VEND%%\$*}" - VEND="Cypress,${VEND}" - HREV="${ICVER##*'TTSP Version:'}" - HREV="${HREV%%\$*}" - FREV="${ICVER##*'Application Version:'}" - FREV="${FREV%%\$*}" - ;; - atmxt*) - VEND="Atmel" - HREV="${ICVER##*'Family ID:'}" - HREV1="${ICVER##*'Variant ID:'}" - HREV="${HREV%%\$*},${HREV1%%\$*}" - FREV="${ICVER##*'Version:'}" - FREV1="${ICVER##*'Build:'}" - FREV="${FREV%%\$*},${FREV1%%\$*}" - ;; - synaptics*) - VEND="${ICVER##*'Product ID: '}" - VEND="${VEND%%\$*}" - FREV="${ICVER##*'Build ID: '}" - FREV="${FREV%%\$*}" - LOT_CODE="${ICVER##*'Config ID: '}" - LOT_CODE="${LOT_CODE%%\$*}" - ;; - esac -fi -create_common_revision_data "${FILE}" "${HNAME}" "${VEND}" "${HREV}" "${DATE}" "${LOT_CODE}" "${FREV}" -apply_revision_data_perms "${FILE}" - diff --git a/msm8960dt-common/proprietary/bin/mount_ext4.sh b/msm8960dt-common/proprietary/bin/mount_ext4.sh deleted file mode 100644 index 5cd007ec69..0000000000 --- a/msm8960dt-common/proprietary/bin/mount_ext4.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/system/bin/sh -export PATH=/system/bin:$PATH -PART_ALIAS=$1 -BLOCK_DEVICE=$2 -MOUNT_POINT=$3 -BLOCK_OPT="" -INODE_OPT="" -SELINUX_CONTEXT="" -UNPACK_IMAGE=/system/${PART_ALIAS}.img.gz -MOUNT_FLAGS="nosuid,nodev,noatime,nodiratime,barrier=1" - -# Check for optional block size -if [ $# -gt 3 ]; then - if [ $4 -gt 0 ]; then - BLOCK_OPT="-b $4" - fi -fi - -# Check for optional inode count -if [ $# -gt 4 ]; then - if [ $4 -gt 0 ]; then - INODE_OPT="-i $5" - fi -fi - -# Check for optional SELinux context -if [ $# -gt 5 ]; then - SELINUX_CONTEXT="-o $6" -fi - -# Wait for device to exist -for i in 1 2 3 4 5 6 7 8 9 10 -do - if [ -e ${BLOCK_DEVICE} ]; then - break; - else - echo "Waiting for ${BLOCK_DEVICE}" - sleep 1 - fi - endif -done - - -if [ -e ${BLOCK_DEVICE} ]; then - if [ -e ${UNPACK_IMAGE} ]; then - echo "found compressed image to unpack: ${UNPACK_IMAGE}" - cat ${UNPACK_IMAGE} | gzip -d | dd of=${BLOCK_DEVICE} bs=131072 - ret=$? - if [ $ret -eq 0 ]; then - mount -t ext4 -o remount,rw /dev/block/system /system - echo "image unpack done, removing image from system" - rm ${UNPACK_IMAGE} - ret=$? - if [ ${ret} -ne 0 ]; then - echo "failed to remove ${UNPACK_IMAGE}, error ${ret}" - fi - mount -t ext4 -o remount,ro /dev/block/system /system - else - echo "image unpack failed: ${ret}" - exit - fi - else - mount -t ext4 -o ${MOUNT_FLAGS} ${SELINUX_CONTEXT} ${BLOCK_DEVICE} ${MOUNT_POINT} - ret=$? - if [ $ret -ne 0 ]; then - # TODO: It would be more polite to try fsck first. - echo "Problem mounting, formatting device. make_ext4fs ${BLOCK_OPT} ${BLOCK_DEVICE}" - make_ext4fs ${BLOCK_OPT} ${INODE_OPT} ${BLOCK_DEVICE} - ret=$? - if [ $ret -eq 0 ]; then - echo "${PART_ALIAS} partition formatted" - else - echo "${PART_ALIAS} partition format failed" - fi - mount -t ext4 -o ${MOUNT_FLAGS} ${SELINUX_CONTEXT} ${BLOCK_DEVICE} ${MOUNT_POINT} - fi - fi -fi