diff options
Diffstat (limited to 'scripts/oe-find-native-sysroot')
-rwxr-xr-x | scripts/oe-find-native-sysroot | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot index b2c22aaf40..9df9b44f42 100755 --- a/scripts/oe-find-native-sysroot +++ b/scripts/oe-find-native-sysroot | |||
@@ -30,31 +30,40 @@ | |||
30 | # with this program; if not, write to the Free Software Foundation, Inc., | 30 | # with this program; if not, write to the Free Software Foundation, Inc., |
31 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 31 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
32 | 32 | ||
33 | if [ -z "$OECORE_NATIVE_SYSROOT" ]; then | 33 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then |
34 | BITBAKE=`which bitbake 2> /dev/null` | 34 | BITBAKE=`which bitbake 2> /dev/null` |
35 | if [ "x$BITBAKE" != "x" ]; then | 35 | if [ "x$BITBAKE" != "x" ]; then |
36 | if [ "$UID" = "0" ]; then | 36 | if [ "$UID" = "0" ]; then |
37 | # Root cannot run bitbake unless sanity checking is disabled | 37 | # Root cannot run bitbake unless sanity checking is disabled |
38 | if [ ! -d "./conf" ]; then | 38 | if [ ! -d "./conf" ]; then |
39 | echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking" | 39 | echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking" |
40 | exit 1 | 40 | exit 1 |
41 | fi | 41 | fi |
42 | touch conf/sanity.conf | 42 | touch conf/sanity.conf |
43 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` | 43 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` |
44 | rm -f conf/sanity.conf | 44 | rm -f conf/sanity.conf |
45 | else | 45 | else |
46 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` | 46 | OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` |
47 | fi | 47 | fi |
48 | else | 48 | else |
49 | echo "Error: Unable to locate your native sysroot." | 49 | echo "Error: Unable to locate bitbake command." |
50 | echo "Did you forget to source the build environment setup script?" | 50 | echo "Did you forget to source the build environment setup script?" |
51 | 51 | ||
52 | if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then | 52 | if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then |
53 | exit 1 | 53 | exit 1 |
54 | fi | 54 | fi |
55 | fi | 55 | fi |
56 | fi | 56 | fi |
57 | 57 | ||
58 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | ||
59 | # This indicates that there was an error running bitbake -e that | ||
60 | # the user needs to be informed of | ||
61 | echo "There was an error running bitbake to determine STAGING_DIR_NATIVE" | ||
62 | echo "Here is the output from bitbake -e" | ||
63 | bitbake -e | ||
64 | exit 1 | ||
65 | fi | ||
66 | |||
58 | # Set up pseudo command | 67 | # Set up pseudo command |
59 | if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then | 68 | if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then |
60 | echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/" | 69 | echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/" |