| #!/bin/bash |
| |
| EXTRACT_SCRIPT=extract-imgtec-panda.sh |
| BINARY_DIR=pandaboard-proprietary-blobs |
| DL_URL='https://dl.google.com/dl/android/aosp/imgtec-panda-20120430-67545da7.tgz' |
| DEVICE_MOUNT_POINT=/mnt/ |
| |
| # Get the blobs, if we don't already have them. |
| if [ -e $BINARY_DIR/$EXTRACT_SCRIPT ]; then |
| echo "Using existing Pandaboard blobs." |
| else |
| echo "Fetching Pandaboard blobs." |
| mkdir $BINARY_DIR |
| (cd $BINARY_DIR; |
| wget $DL_URL; |
| tar xzf `basename $DL_URL`; |
| sh $EXTRACT_SCRIPT) |
| echo "Done fetching Pandaboard blobs." |
| fi |
| |
| # Figure out which device to use, if it's unspecified. |
| device="$1" |
| if [ -z "$device" ]; then |
| for i in `cat /proc/partitions | awk '{print $4}' |grep -i 'sd[a-z][1-9]\|mmcblk[0-9]p[1-9]'` |
| do |
| label=`sudo e2label /dev/$i 2>/dev/null` |
| if [ "$label" = "system" ]; then |
| device="/dev/$i" |
| fi |
| done |
| [ -b "$device" ] || { echo "Failed to find system partition" && exit 1; } |
| fi |
| echo Writing blobs to $device. |
| |
| set -e |
| |
| # Put the blobs on the device. |
| cd $BINARY_DIR |
| sudo mount $device ${DEVICE_MOUNT_POINT} |
| sudo mkdir -p ${DEVICE_MOUNT_POINT}vendor/bin/ |
| sudo mkdir -p ${DEVICE_MOUNT_POINT}vendor/lib/egl |
| sudo mkdir -p ${DEVICE_MOUNT_POINT}vendor/lib/hw |
| sudo cp vendor/imgtec/panda/proprietary/pvrsrvinit ${DEVICE_MOUNT_POINT}vendor/bin/pvrsrvinit |
| sudo cp vendor/imgtec/panda/proprietary/pvrsrvinit ${DEVICE_MOUNT_POINT}bin/pvrsrvinit |
| sudo chmod a+x ${DEVICE_MOUNT_POINT}vendor/bin/pvrsrvinit |
| sudo cp vendor/imgtec/panda/proprietary/libEGL_POWERVR_SGX540_120.so ${DEVICE_MOUNT_POINT}vendor/lib/egl/libEGL_POWERVR_SGX540_120.so |
| sudo cp vendor/imgtec/panda/proprietary/libGLESv1_CM_POWERVR_SGX540_120.so ${DEVICE_MOUNT_POINT}vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so |
| sudo cp vendor/imgtec/panda/proprietary/libGLESv2_POWERVR_SGX540_120.so ${DEVICE_MOUNT_POINT}vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so |
| sudo cp vendor/imgtec/panda/proprietary/gralloc.omap4.so ${DEVICE_MOUNT_POINT}vendor/lib/hw/gralloc.omap4.so |
| sudo cp vendor/imgtec/panda/proprietary/libglslcompiler.so ${DEVICE_MOUNT_POINT}vendor/lib/libglslcompiler.so |
| sudo cp vendor/imgtec/panda/proprietary/libIMGegl.so ${DEVICE_MOUNT_POINT}vendor/lib/libIMGegl.so |
| sudo cp vendor/imgtec/panda/proprietary/libpvr2d.so ${DEVICE_MOUNT_POINT}vendor/lib/libpvr2d.so |
| sudo cp vendor/imgtec/panda/proprietary/libpvrANDROID_WSEGL.so ${DEVICE_MOUNT_POINT}vendor/lib/libpvrANDROID_WSEGL.so |
| sudo cp vendor/imgtec/panda/proprietary/libPVRScopeServices.so ${DEVICE_MOUNT_POINT}vendor/lib/libPVRScopeServices.so |
| sudo cp vendor/imgtec/panda/proprietary/libsrv_init.so ${DEVICE_MOUNT_POINT}vendor/lib/libsrv_init.so |
| sudo cp vendor/imgtec/panda/proprietary/libsrv_um.so ${DEVICE_MOUNT_POINT}vendor/lib/libsrv_um.so |
| sudo cp vendor/imgtec/panda/proprietary/libusc.so ${DEVICE_MOUNT_POINT}vendor/lib/libusc.so |
| sudo chmod -R 755 ${DEVICE_MOUNT_POINT}vendor/lib/ |
| sudo umount -f $device |
| echo Successfully installed proprietary blobs. |