[poky] [PATCH 1/1] Make poky-qemu and related scripts work with arbitrary SDK locations

Richard Purdie rpurdie at linux.intel.com
Thu Dec 9 07:00:26 PST 2010


On Tue, 2010-12-07 at 20:59 -0800, Scott Garman wrote:
> diff --git a/scripts/poky-find-native-sysroot b/scripts/poky-find-native-sysroot
> index d8002f9..2262294 100755
> --- a/scripts/poky-find-native-sysroot
> +++ b/scripts/poky-find-native-sysroot
> diff --git a/scripts/poky-qemu b/scripts/poky-qemu
> index bc312e0..67af439 100755
> --- a/scripts/poky-qemu
> +++ b/scripts/poky-qemu
> @@ -31,9 +31,9 @@ usage() {
>      echo "    serial - enables a serial console on /dev/ttyS0"
>      echo ""
>      echo "Examples:"
> -    echo "  $0 qemuarm"
> -    echo "  $0 qemux86-64 poky-image-sato ext3"
> -    echo "  $0 path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
> +    echo "  $MYNAME qemuarm"
> +    echo "  $MYNAME qemux86-64 poky-image-sato ext3"
> +    echo "  $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
>      exit 1
>  }
>  
> @@ -213,23 +213,29 @@ setup_tmpdir() {
>                  echo "before running this script" >&2;
>                  exit 1; }
>  
> -            # We have bitbake in PATH, get TMPDIR and BUILD_SYS
> -            # from the environment
> +            # We have bitbake in PATH, get TMPDIR from bitbake
>              TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
> -            BUILD_SYS=`bitbake -e | grep BUILD_SYS=\" | cut -d '=' -f2 | cut -d '"' -f2`
>          else
> -            BUILD_ARCH=`uname -m`
> -            BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
> -            BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
>              TMPDIR=$BUILDDIR/tmp
>          fi
> -        if [ -z "$POKY_NATIVE_SYSROOT" ]; then
> -            POKY_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
> -        fi
> -        CROSSPATH=$POKY_NATIVE_SYSROOT/usr/bin
>      fi
>  }

Hmm, you remove CROSSPATH yet still reference it later. I think the code
has become confused. I'm going to merge the patch as it improves the
situation compared to how it is at the moment. I'll give some background
though:

There are three things we really want to reference in PATH:

a) The "native" or "nativesdk" tools
b) The "cross" tools, i.e. TARGET_PREFIX-gcc
c) The "cross" tools without the prefix, e.g. "gcc", replacing the 
   usual gcc you'd find in PATH. This last part is to allow distcc in a 
   image to use the compiler outside the emulation.

The distcc thing did used to work but I doubt it does at the moment as I
think this has just been reduced to the native case accidentally.

The paths in the sysroot corresponding to these are:

/opt/poky/sysroots/HOST-pokysdk-linux/usr/bin
/opt/poky/sysroots/HOST-pokysdk-linux/usr/bin/TARGET-poky-linux
/opt/poky/sysroots/HOST-pokysdk-linux/usr/libexec/TARGET-poky-linux/gcc/TARGET-poky-linux/GCCVERSION/

and there are similar paths in a Poky build directory.

I hope that helps clear things up a bit.

Cheers,

Richard




More information about the poky mailing list