#!/bin/sh echo2 () { echo "$@" >&2; } die () { echo2 "$@"; exit 1; } x () { echo "$@"; "$@"; } case `id` in uid=0*) ;; *) die Only root can install this. ;; esac case $1 in go) ;; *) echo echo This script will extract scratchbox 1.0.7 environment to echo `pwd`/sbox-for-maemo22 echo and symlink that to /scratchbox. echo All kind of checks are done before this can happen. echo echo Enter \'$0 go\' to do the installation. echo exit 0 ;; esac #if :; then :; else f=`ls -d scratchbox sbox-for-maemo22 2>/dev/null` case $f in '') ;; *) die 'File(s)/Directory(ies)' \'$f\' on the way. ;; esac case `ls -d /scratchbox 2>/dev/null` in '') ;; *) die \'/scratchbox\' is on the way\; examine what is that for... ;; esac core=scratchbox-core-1.0.7-i386.tar.gz coresum=de7d72478f6d9019ba6212ea9047a569 libs=scratchbox-libs-1.0.7-i386.tar.gz libssum=2c8c32b4afee77ea0ec64a94faf18cca devkit=scratchbox-devkit-debian-1.0.7.1-i386.tar.gz devkitsum=3a485193cabd5f4a72179cb96e19c01c cputransp=scratchbox-devkit-cputransp-1.0.3-i386.tar.gz cputranspsum=6fcfc3b98854186a9e6e1cc185bc6548 toolch_arm=scratchbox-toolchain-cs2005q3.2-glibc-arm-1.0.5-i386.tar.gz toolch_armsum=bbaa58b63cc6c8e5a501126886a9cea5 toolch_i386=scratchbox-toolchain-cs2005q3.2-glibc-i386-1.0.5-i386.tar.gz toolch_i386sum=20f3c5f4eadf16082f772e0a09eeea88 sumchk () { echo Checking $1 ... case `md5sum $1` in $2' '*) ;; *) die File $1 md5sum is not $2 ;; esac } sumchk $core $coresum sumchk $libs $libssum sumchk $devkit $devkitsum sumchk $cputransp $cputranspsum sumchk $toolch_arm $toolch_armsum sumchk $toolch_i386 $toolch_i386sum rootstrap=Maemo_Dev_Platform_v2.2_armel-rootstrap.tgz rootstrapsum=02722db321d8efd94577c8011c7380f4 sumchk $rootstrap $rootstrapsum gosbox=go-sbox-maemo22.src gosboxsum=870d0e277ea97a3aec7fd7af7f8f4f60 sumchk $gosbox $gosboxsum echo x tar zxf $core x tar zxf $libs x tar zxf $devkit x tar zxf $cputransp x tar zxf $toolch_arm x tar zxf $toolch_i386 x mv scratchbox sbox-for-maemo22 x ln $rootstrap sbox-for-maemo22/packages x ln -s `pwd`/sbox-for-maemo22 /scratchbox x cp $gosbox /scratchbox/go-sbox.sh x chmod 755 /scratchbox/go-sbox.sh echo #fi chkvdso () { case `/scratchbox/tools/bin/echo jee 2>/dev/null` in jee) true ;; *) false ;; esac } chkvdso || { ( set -x test -f /proc/sys/vm/vdso_enabled && echo 0 > /proc/sys/vm/vdso_enabled test -f /proc/sys/kernel/vdso && echo 0 > /proc/sys/kernel/vdso ) } chkvdso || die "Can not disable kernel vdso parameter"; test -x /usr/sbin/getenforce && { case `/usr/sbin/getenforce` in Disabled) ;; *) echo Selinux is active, which may cause problems echo You may want to disable it using \'setenforce\' command. x sleep 2 ;; esac } echo echo Now scratchbox files are installed, but not taken in use yet echo echo Next run \'/scratchbox/run_me_first.sh\' '(accept defaults)' and echo \'/scratchbox/sbin/sbox_adduser ''\' where echo '' is your '(non-root)' login name on this system. echo echo After that, log in using your '' and run \'groups\' echo to see whether \'sbox\' is listed there. echo '(that requires re-login after the above '"'"'sbox_adduser'"'"' is run)' echo echo When this is OK, run /scratchbox/go-sbox.sh login echo echo '('go-sbox.sh is a wrapper for scratchbox setup/login interface. Run echo ' 'it without arguments to see full command usage.')' echo echo The quickest way to setup compilation environment for Nokia Internet Tablets echo is to run the following commands after login: echo echo '' sb-conf setup SDK_ARMEL -c cs2005q3.2-glibc-arm -d debian:cputransp -t qemu-arm echo '' sb-conf select SDK_ARMEL echo '' sb-conf rootstrap SDK_ARMEL /scratchbox/packages/Maemo_Dev_Platform_v2.2_armel-rootstrap.tgz echo '' sb-conf install SDK_ARMEL --etc --devkits --fakeroot echo exit 0