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 PROD=$($EXECPWR cat /proc/component_version | $EXECPWR grep product | $EXECPWR cut -d" " -f 6)
24 ENVIRONMENT="FREMANTLE"
27 # Unsupported, use the least strict environment (SDK)
34 # Check whether I'm running standalone
36 #if test -n "`pgrep dpkg`" -o "`pgrep apt`"
37 if ! lsof /var/lib/dpkg/lock >> /dev/null; then
38 echo "error: you're running me as a stand-alone application"
39 echo " do not do this, I will be called automatically when"
40 echo " required by busybox-power"
45 # Check whether the user is root
47 if test "`$EXECPWR id -u`" -ne 0; then
48 echo "error: you're not running me as root, aborting"
49 echo " also, DO NOT run me as a stand-alone application"
50 echo " I will be called automatically when required by"