3 # PowerVR SGX DDK for Embedded Linux - installation script
5 # Copyright 2004-2006 by Imagination Technologies Limited.
6 # All rights reserved. No part of this software, either
7 # material or conceptual may be copied or distributed,
8 # transmitted, transcribed, stored in a retrieval system
9 # or translated into any human or computer language in any
10 # form by any means, electronic, mechanical, manual or
11 # other-wise, or disclosed to third parties without the
12 # express written permission of Imagination Technologies
13 # Limited, Unit 8, HomePark Industrial Estate,
14 # King's Langley, Hertfordshire, WD4 8LZ, U.K.
16 # Auto-generated for omap3430_android from embedded.pj 1.5.15.2766
19 # PVR Consumer services version number
21 PVRVERSION=1.5.15.2766
23 # Where we record what we did so we can undo it.
25 DDK_INSTALL_LOG=/powervr_ddk_install.log
27 # basic installation function
34 echo "Installation failed" >&2
38 # basic installation function
39 # $1=fromfile, $2=destfilename, $3=blurb $4=chmod-flags
43 DESTFILE=${DISCIMAGE}$2
44 DESTDIR=`dirname $DESTFILE`
47 [ -n "$VERBOSE" ] && echo "skipping file $1 -> $2"
51 # Destination directory - make sure it's there and writable
53 if [ -d "${DESTDIR}" ]; then
54 if [ ! -w "${DESTDIR}" ]; then
55 bail "${DESTDIR} is not writable."
58 $DOIT mkdir -p ${DESTDIR} || bail "Couldn't mkdir -p ${DESTDIR}"
59 [ -n "$VERBOSE" ] && echo "Created directory `dirname $2`"
62 # If it already exists then back it up if there isn't a back-up already.
64 #if [ -f $DESTFILE ]; then
65 # if [ ! -f ${DESTFILE}.old ]; then
66 # $DOIT mv $DESTFILE ${DESTFILE}.old ||
67 # bail "Couldn't back up $DESTFILE";
68 # [ -n "$VERBOSE" ] && echo "Backed up $DESTFILE";
72 # Delete the original so that permissions don't persist.
76 $DOIT cp -f $1 $DESTFILE || bail "Couldn't copy $1 to $DESTFILE"
77 $DOIT chmod 644 ${DESTFILE}
79 $DOIT chmod $4 ${DESTFILE};
81 echo "$3 `basename $1` -> $2"
82 $DOIT echo "file $2" >>${DISCIMAGE}${DDK_INSTALL_LOG}
85 # Install a symbolic link
86 # $1=fromfile, $2=destfilename
90 DESTFILE=${DISCIMAGE}$2
91 DESTDIR=`dirname $DESTFILE`
93 if [ ! -e ${DESTDIR}/$1 ]; then
94 [ -n "$VERBOSE" ] && echo $DOIT "skipping link ${DESTDIR}/$1"
98 # Destination directory - make sure it's there and writable
100 if [ -d "${DESTDIR}" ]; then
101 if [ ! -w "${DESTDIR}" ]; then
102 bail "${DESTDIR} is not writable."
105 $DOIT mkdir -p ${DESTDIR} || bail "Couldn't mkdir -p ${DESTDIR}"
106 [ -n "$VERBOSE" ] && echo "Created directory `dirname $2`"
109 # Delete the original so that permissions don't persist.
111 $DOIT rm -f $DESTFILE
113 $DOIT ln -s $1 $DESTFILE || bail "Couldn't link $1 to $DESTFILE"
114 $DOIT echo "link $2" >>${DISCIMAGE}${DDK_INSTALL_LOG}
115 [ -n "$VERBOSE" ] && echo " linked `basename $1` -> $2"
118 # Tree-based installation function
119 # $1 = fromdir $2=destdir $3=blurb
123 # Make the destination directory if it's not there
125 if [ ! -d ${DISCIMAGE}$2 ]; then
126 $DOIT mkdir -p ${DISCIMAGE}$2 || bail "Couldn't mkdir -p ${DISCIMAGE}$2"
128 if [ "$DONTDOIT" ]; then
129 echo "### tar -C $1 -cf - . | tar -C ${DISCIMAGE}$2 -x${VERBOSE}f -"
131 tar -C $1 -cf - . | tar -C ${DISCIMAGE}$2 -x${VERBOSE}f -
134 echo "Installed $3 in ${DISCIMAGE}$2"
135 $DOIT echo "tree $2" >>${DISCIMAGE}${DDK_INSTALL_LOG}
137 echo "Failed copying $3 from $1 to ${DISCIMAGE}$2"
141 # Uninstall something.
145 if [ ! -f ${DISCIMAGE}${DDK_INSTALL_LOG} ]; then
146 echo "Nothing to un-install."
152 while read type data; do
154 version) # do nothing
155 echo "Uninstalling existing version $data"
159 if [ -z "$VERSION" ]; then
161 echo "No version record at head of ${DISCIMAGE}${DDK_INSTALL_LOG}"
162 elif ! $DOIT rm -f ${DISCIMAGE}${data}; then
165 [ -n "$VERBOSE" ] && echo "Deleted $type $data"
168 tree) # so far, do nothing
171 done < ${DISCIMAGE}${DDK_INSTALL_LOG};
173 if [ $BAD = 0 ]; then
174 echo "Uninstallation completed."
175 $DOIT rm -f ${DISCIMAGE}${DDK_INSTALL_LOG}
177 echo "Uninstallation failed!!!"
181 # Help on how to invoke
185 echo "usage: $0 [options...]"
187 echo "Options: -v verbose mode"
188 echo " -n dry-run mode"
189 echo " -u uninstall-only mode"
190 echo " --no-pvr don't install PowerVR driver components"
191 echo " --no-x don't install X window system"
192 echo " --no-display don't install integrated PowerVR display module"
193 echo " --no-bcdevice don't install buffer class device module"
194 echo " --root path use path as the root of the install file system"
200 $DOIT echo "version 1.5.15.2766" >${DISCIMAGE}${DDK_INSTALL_LOG}
201 # Install the standard scripts
203 install_file rc.pvr /system/bin/sgx/rc.pvr "boot script" a+x
205 # Check the kernel module directory is there
207 if [ ! -d "${DISCIMAGE}" ]; then
209 echo "Can't find on file system installation root"
210 echo -n "There is no kernel module area setup yet. "
211 if [ "$from" = target ]; then
212 echo "On your build machine you should invoke:"
214 echo " $ cd \$KERNELDIR"
215 echo " $ make INSTALL_MOD_PATH=\$DISCIMAGE modules_install"
217 echo "You should invoke:"
219 echo " $ cd $KERNELDIR"
220 echo " $ make INSTALL_MOD_PATH=$DISCIMAGE modules_install"
226 # Install the standard kernel modules
227 # Touch some files that might not exist so that busybox/modprobe don't complain
229 install_file pvrsrvkm.ko /system/bin/sgx/pvrsrvkm.ko "kernel module"
233 if [ -z "$NO_DISPLAYMOD" ]; then
234 install_file omaplfb.ko /system/bin/sgx/omaplfb.ko "kernel module"
238 if [ -z "$NO_BCDEVICE" ]; then
239 install_file bc_example.ko /system/bin/sgx/bc_example.ko "kernel module"
243 # $DOIT touch ${DISCIMAGE}/lib/modules/modprobe.conf
244 # $DOIT touch ${DISCIMAGE}/etc/modules.conf
245 # $DOIT rm -f /tmp/modules.$$.tmp
247 # Install the standard libraries
250 install_file libGLESv1_CM_POWERVR_SGX530_121.so /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_121.so.1.1.15.2766 "shared library"
251 install_link libGLESv1_CM_POWERVR_SGX530_121.so.1.1.15.2766 /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_121.so
253 install_file libGLESv2_POWERVR_SGX530_121.so /system/lib/egl/libGLESv2_POWERVR_SGX530_121.so.1.1.15.2766 "shared library"
254 install_link libGLESv2_POWERVR_SGX530_121.so.1.1.15.2766 /system/lib/egl/libGLESv2_POWERVR_SGX530_121.so
256 install_file libglslcompiler.so /system/lib/libglslcompiler.so.1.1.15.2766 "shared library"
257 install_link libglslcompiler.so.1.1.15.2766 /system/lib/libglslcompiler.so
260 install_file libIMGegl.so /system/lib/libIMGegl.so.1.1.15.2766 "shared library"
261 install_link libIMGegl.so.1.1.15.2766 /system/lib/libIMGegl.so
262 install_file libEGL_POWERVR_SGX530_121.so /system/lib/egl/libEGL_POWERVR_SGX530_121.so.1.1.15.2766 "shared library"
263 install_link libEGL_POWERVR_SGX530_121.so.1.1.15.2766 /system/lib/egl/libEGL_POWERVR_SGX530_121.so
264 install_file libpvr2d.so /system/lib/libpvr2d.so.1.1.15.2766 "shared library"
265 install_link libpvr2d.so.1.1.15.2766 /system/lib/libpvr2d.so
269 install_file libsrv_um.so /system/lib/libsrv_um.so.1.1.15.2766 "shared library"
270 install_link libsrv_um.so.1.1.15.2766 /system/lib/libsrv_um.so
271 install_file libPVRScopeServices.so /system/lib/libPVRScopeServices.so.1.1.15.2766 "shared library"
272 install_link libPVRScopeServices.so.1.1.15.2766 /system/lib/libPVRScopeServices.so
276 install_file gralloc.omap3.so /system/lib/hw/gralloc.omap3.so.1.1.15.2766 "shared library"
277 install_link gralloc.omap3.so.1.1.15.2766 /system/lib/hw/gralloc.omap3.so
279 install_file libfakehal.so /system/lib/libfakehal.so.1.1.15.2766 "shared library"
280 install_link libfakehal.so.1.1.15.2766 /system/lib/libfakehal.so
282 install_file libpvrANDROID_WSEGL.so /system/lib/libpvrANDROID_WSEGL.so.1.1.15.2766 "shared library"
283 install_link libpvrANDROID_WSEGL.so.1.1.15.2766 /system/lib/libpvrANDROID_WSEGL.so
285 install_file libsfutil.so /system/lib/libsfutil.so.1.1.15.2766 "shared library"
286 install_link libsfutil.so.1.1.15.2766 /system/lib/libsfutil.so
289 # Install the standard executables
292 install_file pvrsrvinit /system/bin/pvrsrvinit "binary" a+x
293 install_file sgx_init_test /system/bin/sgx_init_test "binary" a+x
297 # Install the standard unittests
299 install_file gles2test1 /system/bin/gles2test1 "binary" a+x
300 install_file glsltest1_vertshader.txt /system/bin/glsltest1_vertshader.txt "shader" a+x
301 install_file glsltest1_fragshaderA.txt /system/bin/glsltest1_fragshaderA.txt "shader" a+x
302 install_file glsltest1_fragshaderB.txt /system/bin/glsltest1_fragshaderB.txt "shader" a+x
303 install_file gles2_texture_stream /system/bin/gles2_texture_stream "binary" a+x
305 install_file gles1test1 /system/bin/gles1test1 "binary" a+x
306 install_file gles1_texture_stream /system/bin/gles1_texture_stream "binary" a+x
308 install_file services_test /system/bin/services_test "binary" a+x
309 install_file sgx_blit_test /system/bin/sgx_blit_test "binary" a+x
310 install_file sgx_flip_test /system/bin/sgx_flip_test "binary" a+x
311 install_file sgx_render_flip_test /system/bin/sgx_render_flip_test "binary" a+x
312 install_file pvr2d_test /system/bin/pvr2d_test "binary" a+x
313 install_file eglinfo /system/bin/eglinfo "binary" a+x
314 ##GLESUNITTEST(egl_test)dnl
315 ##GLES2UNITTEST(gl2info)dnl
316 ##ifelse(SUPPORT_PVR2D,1,[[UNITTEST(pvr2dtest)]])dnl
317 ##ifdef([[_BUFFER_CLASS_DEVICE_]],
318 ## if [ -z "$NO_BCDEVICE" ]; then
319 ## UNITTEST(sw_camera_ctrl)dnl
320 ## UNITTEST(ogles_camera_ext)dnl
323 install_file hal_client_test /system/bin/hal_client_test "binary" a+x
324 install_file hal_server_test /system/bin/hal_server_test "binary" a+x
325 install_file framebuffer_test /system/bin/framebuffer_test "binary" a+x
326 install_file texture_benchmark /system/bin/texture_benchmark "binary" a+x
327 install_file xmultiegltest /system/bin/xmultiegltest "binary" a+x
328 VENDOR_LIB_NAME=`echo libEGL_POWERVR_SGX530_121.so | sed 's,libEGL_\|\.so,,g'`
329 $DOIT cat >${DISCIMAGE}/system/lib/egl/egl.cfg <<EOF
331 0 1 ${VENDOR_LIB_NAME}
333 $DOIT echo "file /system/lib/egl/egl.cfg" >>${DISCIMAGE}${DDK_INSTALL_LOG}
337 # Work out if there are any special instructions.
372 # Find out where we are? On the target? On the host?
385 if [ -z "$DISCIMAGE" ]; then
386 echo "DISCIMAGE must be set for installation to be possible." >&2
392 if [ -z "$DISCIMAGE" ]; then
393 echo "DISCIMAGE must be set for installation to be possible." >&2
397 *) echo "Don't know host to perform on machine type `uname -m`" >&2;
402 if [ ! -d "$DISCIMAGE" ]; then
403 echo "$0: $DISCIMAGE does not exist." >&2
408 echo "Installing PowerVR Consumer/Embedded DDK 1.5.15.2766 on $from"
410 echo "File system installation root is $DISCIMAGE"
413 # Uninstall whatever's there already.
416 [ -n "$UNINSTALL" ] && exit
418 # Now start installing things we want.
420 [ -z "$NO_PVR" ] && install_pvr
425 echo "Installation complete!"
426 if [ "$host" = 0 ]; then
427 echo "You may now reboot your target."