2 # This file contains functions that are used in multiple other scripts, i.e.
3 # shared functions. The purpose of centralising these, is to deduplicate code
4 # and increase maintainability
6 # By Dennis Groenen <tj.groenen@gmail.com>
12 if test $VERBOSE == 1; then
16 # Detect the current environment
18 if test -d /scratchbox; then
21 if test -e /proc/component_version; then
22 PROD=$($EXECPWR cat /proc/component_version | $EXECPWR grep product | $EXECPWR cut -d" " -f 6)
24 PROD=$(/usr/bin/sysinfoclient --get /component/product | $EXECPWR awk '{ print $3 }')
29 ENVIRONMENT="FREMANTLE"
32 ENVIRONMENT="HARMATTAN"
35 # Unsupported, use the least strict environment (SDK)
42 # Check whether the user is root
44 if test "`$EXECPWR id -u`" -ne 0; then
45 echo "error: you're not running me as root"
50 # Get the version string of the package providing /bin/busybox
52 # XXX We assume the package "busybox" provides /bin/busybox
53 /usr/bin/dpkg -s busybox | $EXECPWR awk '/^Version:/ {print $2}'