Skip to contentSkip to conversation

scripts: add new script

PATCH Superseded Ed Bartosh 6 participants 12 messages Sep 28, 2016 – Oct 6, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 scripts: add new script

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

---
 scripts/native | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100755 scripts/native
scripts/native new file +48 -0
new file mode 100755
index 0000000..5e904b0
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2016,  Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" == '--help' -o "$1" == '-h' ]; then
+    echo "Usage: $0 <native tool> [parameters]"
+    exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+        echo "Error: Unable to find oe-find-native-sysroot script"
+        exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT
+
+OLDPATH=$PATH
+
+# look for a tool only in native sysroot
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool=`/usr/bin/which $1 2>/dev/null`
+
+if [ -n "$tool" ] ; then
+    # add old path to allow usage of host tools
+    PATH=$PATH:$OLD_PATH $@
+else
+    echo "Error: Unable to find '$1' in native sysroot"
+    exit 1
+fi
Signature · 1 line
2.1.4
#1 lore raw
Quoted 7 lines · Ed Bartosh

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

‘add new script’ is not a useful commit message summary. You don’t even mention what script you add until the message body.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
author
#2 lore raw

PATCH v2 1/1 scripts: add new script 'native'

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

---
 scripts/native | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100755 scripts/native
scripts/native new file +48 -0
new file mode 100755
index 0000000..496e34f
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2016,  Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+    echo "Usage: $0 <native tool> [parameters]"
+    exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+        echo "Error: Unable to find oe-find-native-sysroot script"
+        exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT
+
+OLDPATH=$PATH
+
+# look for a tool only in native sysroot
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool=`/usr/bin/which $1 2>/dev/null`
+
+if [ -n "$tool" ] ; then
+    # add old path to allow usage of host tools
+    PATH=$PATH:$OLD_PATH $@
+else
+    echo "Error: Unable to find '$1' in native sysroot"
+    exit 1
+fi
Signature · 1 line
2.1.4
#3 lore raw

Re: [PATCH v2] scripts: add new script 'native'

"native" might be a bit too generic...

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

Jérémy Rosen

Quoted 65 lines · Ed Bartosh

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

---
  scripts/native | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 48 insertions(+)

create mode 100755 scripts/native

scripts/native new file +48 -0
new file mode 100755
index 0000000..496e34f
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2016,  Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+    echo "Usage: $0 <native tool> [parameters]"
+    exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+        echo "Error: Unable to find oe-find-native-sysroot script"
+        exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT
+
+OLDPATH=$PATH
+
+# look for a tool only in native sysroot
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool=`/usr/bin/which $1 2>/dev/null`
+
+if [ -n "$tool" ] ; then
+    # add old path to allow usage of host tools
+    PATH=$PATH:$OLD_PATH $@
+else
+    echo "Error: Unable to find '$1' in native sysroot"
+    exit 1
+fi
#4 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 9 lines · Jérémy Rosen

"native" might be a bit too generic...

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

Jérémy Rosen

I think overly namespacing things that aren't likely to clash in practice gets annoying. I would've gone for "run-native" (more descriptive and English-like, less generic), but how about something simple and easy to type like "oe-native" or "oe-run-native" if a prefix is added? That's consistent with the naming scheme used for many other scripts in scripts/ too.

Cheers,
Ulf

Quoted 78 lines · Ed Bartosh
Quoted 57 lines

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

---
  scripts/native | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 48 insertions(+)

create mode 100755 scripts/native

scripts/native new file +38 -0
new file mode 100755
index 0000000..496e34f
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2016,  Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+    echo "Usage: $0 <native tool> [parameters]"
+    exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+        echo "Error: Unable to find oe-find-native-sysroot script"
+        exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT
+
+OLDPATH=$PATH
+
+# look for a tool only in native sysroot
 

scripts/native line 48

Quoted 10 lines
scripts/native new file +10 -0
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool=`/usr/bin/which $1 2>/dev/null`
+
+if [ -n "$tool" ] ; then
+    # add old path to allow usage of host tools
+    PATH=$PATH:$OLD_PATH $@
+else
+    echo "Error: Unable to find '$1' in native sysroot"
+    exit 1
+fi

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 18 lines · Ulf Magnusson
Quoted 9 lines · Jérémy Rosen

"native" might be a bit too generic...

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

Jérémy Rosen

I think overly namespacing things that aren't likely to clash in practice gets annoying. I would've gone for "run-native" (more descriptive and English-like, less generic), but how about something simple and easy to type like "oe-native" or "oe-run-native" if a prefix is added? That's consistent with the naming scheme used for many other scripts in scripts/ too.

Quoted 2 lines

Cheers,
Ulf

I just noticed that the script's already in though, so not much point arguing. ;)

Cheers,
Ulf

Quoted 79 lines
Quoted 79 lines · Ed Bartosh
Quoted 57 lines

Added 'native' convenience shell script to run native tools. Example of usage:

Quoted 2 lines

bitbake bmap-tools-native
native bmaptool --version

---
  scripts/native | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 48 insertions(+)

create mode 100755 scripts/native

scripts/native new file +38 -0
new file mode 100755
index 0000000..496e34f
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (c) 2016,  Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+    echo "Usage: $0 <native tool> [parameters]"
+    exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+        echo "Error: Unable to find oe-find-native-sysroot script"
+        exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT
+
+OLDPATH=$PATH
+
+# look for a tool only in native sysroot
 

scripts/native line 48

Quoted 10 lines
scripts/native new file +10 -0
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool=`/usr/bin/which $1 2>/dev/null`
+
+if [ -n "$tool" ] ; then
+    # add old path to allow usage of host tools
+    PATH=$PATH:$OLD_PATH $@
+else
+    echo "Error: Unable to find '$1' in native sysroot"
+    exit 1
+fi

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#6 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 2 lines · On Sun, 02 Oct 2016 16:44:01 Ulf Magnusson wrote:
Quoted 1 line · Ulf Magnusson

On Sun, Oct 2, 2016 at 4:15 PM, Jérémy Rosen <[email protected]>

Quoted 14 lines · wrote:
Quoted 7 lines
Quoted 6 lines

"native" might be a bit too generic...

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

Quoted 6 lines

I think overly namespacing things that aren't likely to clash in practice gets annoying. I would've gone for "run-native" (more descriptive and English-like, less generic), but how about something simple and easy to type like "oe-native" or "oe-run-native" if a prefix is added? That's consistent with the naming scheme used for many other scripts in scripts/ too.

Quoted 2 lines

I just noticed that the script's already in though, so not much point arguing. ;)

There is - just because it got merged doesn't mean it can't be renamed, in fact if we are going to rename it then now is the time to do that, rather than waiting until people are used to the current name.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#7 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 7 lines · Paul Eggleton
Quoted 7 lines

"native" might be a bit too generic...

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

I also prefer an oe prefix.
oe-native, oe-run-native, or oe-exec-native would work for me.

Signature · 2 lines
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350 | 350 Terry Fox Drive, Suite 200, Ottawa, ON, Canada, K2K 2W5
#8 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 11 lines · On Tue, 04 Oct 2016 12:22:56 Randy MacLeod wrote:
Quoted 7 lines · Paul Eggleton
Quoted 7 lines

"native" might be a bit too generic...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted
with a reasonable prefix...

I also prefer an oe prefix.
oe-native, oe-run-native, or oe-exec-native would work for me.

Well, someone needs to send a patch, any volunteers?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#9 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 10 lines · Paul Eggleton
Quoted 9 lines · On Tue, 04 Oct 2016 12:22:56 Randy MacLeod wrote:
Quoted 7 lines · Paul Eggleton
Quoted 7 lines

"native" might be a bit too generic...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted
with a reasonable prefix...

Quoted 7 lines
Quoted 2 lines

I also prefer an oe prefix.
oe-native, oe-run-native, or oe-exec-native would work for me.

Well, someone needs to send a patch, any volunteers?

Cheers,
Paul

Sent one (and caved in to peer pressure re. the prefix).

Cheers,
Ulf

#10 lore raw

Re: [PATCH v2] scripts: add new script 'native'

Quoted 16 lines · On Thu, 06 Oct 2016 05:20:20 Ulf Magnusson wrote:

On Thu, Oct 6, 2016 at 5:02 AM, Paul Eggleton

Quoted 13 lines · <[email protected]> wrote:
Quoted 11 lines · On Tue, 04 Oct 2016 12:22:56 Randy MacLeod wrote:
Quoted 7 lines · Paul Eggleton
Quoted 7 lines

"native" might be a bit too generic...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted
with a reasonable prefix...

I also prefer an oe prefix.
oe-native, oe-run-native, or oe-exec-native would work for me.

Quoted 6 lines
Quoted 4 lines

Well, someone needs to send a patch, any volunteers?

Cheers,
Paul

Sent one (and caved in to peer pressure re. the prefix).

Thanks!

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
author
#11 lore raw

Re: [PATCH v2] scripts: add new script 'native'

In reply to Ulf Magnusson
Quoted 9 lines · Ulf Magnusson
Quoted 8 lines · Jérémy Rosen

"native" might be a bit too generic...

could I suggest oe_native-run or bitbake-native ?

something that says it's yocto-galaxy specific and can be autocompleted with a reasonable prefix...

Quoted 9 lines
Quoted 1 line

Jérémy Rosen

I think overly namespacing things that aren't likely to clash in practice gets annoying. I would've gone for "run-native" (more descriptive and English-like, less generic), but how about something simple and easy to type like "oe-native" or "oe-run-native" if a prefix is added? That's consistent with the naming scheme used for many other scripts in scripts/ too.

I'm ok to rename it. I agree that 'native' may look too generic, but I don't know about any existing tool with this name.

Anyway, let me know which name I should rename it to. Feel free to send a patch too. I personally like 'oe-native' more than other proposals.

--
Regards,
Ed