Search code examples
bashcross-compilingembedded-linuxscratchbox

How do I test in a shell script whether I'm running inside Scratchbox2


In the old Scratchbox one could do something like:

if [ -f /targets/links/scratchbox.config ]; then 
    echo "here goes my sbox-dependent stuff" 
fi

but what about Scratchbox2, is there a way to find out this?


Solution

  • How about test the environment variable 'LD_PRELOAD'

    if [[ $LD_PRELOAD =~ "sb2" ]]; then 
        true # is running under sb2
    fi