summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-extract-sdk
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu-extract-sdk')
-rwxr-xr-xscripts/runqemu-extract-sdk37
1 files changed, 16 insertions, 21 deletions
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
index 32ddd485b6..db05da25f2 100755
--- a/scripts/runqemu-extract-sdk
+++ b/scripts/runqemu-extract-sdk
@@ -7,18 +7,8 @@
#
# Copyright (c) 2010 Intel Corp.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function usage() {
echo "Usage: $0 <image-tarball> <extract-dir>"
@@ -31,20 +21,20 @@ fi
SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
- echo "Error: Unable to find the oe-find-native-sysroot script"
- echo "Did you forget to source your build system environment setup script?"
- exit 1
+ echo "Error: Unable to find the oe-find-native-sysroot script"
+ echo "Did you forget to source your build system environment setup script?"
+ exit 1
fi
-. $SYSROOT_SETUP_SCRIPT
+. $SYSROOT_SETUP_SCRIPT qemu-helper-native
PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
ROOTFS_TARBALL=$1
SDK_ROOTFS_DIR=$2
if [ ! -e "$ROOTFS_TARBALL" ]; then
- echo "Error: sdk tarball '$ROOTFS_TARBALL' does not exist"
- usage
- exit 1
+ echo "Error: sdk tarball '$ROOTFS_TARBALL' does not exist"
+ usage
+ exit 1
fi
# Convert SDK_ROOTFS_DIR to a full pathname
@@ -53,6 +43,9 @@ if [[ ${SDK_ROOTFS_DIR:0:1} != "/" ]]; then
fi
TAR_OPTS=""
+if [[ "$ROOTFS_TARBALL" =~ tar\.xz$ ]]; then
+ TAR_OPTS="--numeric-owner -xJf"
+fi
if [[ "$ROOTFS_TARBALL" =~ tar\.bz2$ ]]; then
TAR_OPTS="--numeric-owner -xjf"
fi
@@ -64,7 +57,7 @@ if [[ "$ROOTFS_TARBALL" =~ \.tar$ ]]; then
fi
if [ -z "$TAR_OPTS" ]; then
echo "Error: Unable to determine sdk tarball format"
- echo "Accepted types: .tar / .tar.gz / .tar.bz2"
+ echo "Accepted types: .tar / .tar.gz / .tar.bz2 / .tar.xz"
exit 1
fi
@@ -76,10 +69,12 @@ fi
pseudo_state_dir="$SDK_ROOTFS_DIR/../$(basename "$SDK_ROOTFS_DIR").pseudo_state"
pseudo_state_dir="$(readlink -f $pseudo_state_dir)"
-if [ -e "$pseudo_state_dir" ]; then
+debug_image="`echo $ROOTFS_TARBALL | grep '\-dbg\.rootfs\.tar'`"
+
+if [ -e "$pseudo_state_dir" -a -z "$debug_image" ]; then
echo "Error: $pseudo_state_dir already exists!"
echo "Please delete the rootfs tree and pseudo directory manually"
- echo "if this is really what you want."
+ echo "if this is really what you want."
exit 1
fi