summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-extract-sdk
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
commit8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch)
treeefdc32587159d0050a69009bdf2330a531727d95 /scripts/runqemu-extract-sdk
parentd412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff)
downloadpoky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz
The poky repository master branch is no longer being updated.
You can either: a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs b) use the new bitbake-setup You can find information about either approach in our documentation: https://docs.yoctoproject.org/ Note that "poky" the distro setting is still available in meta-yocto as before and we continue to use and maintain that. Long live Poky! Some further information on the background of this change can be found in: https://lists.openembedded.org/g/openembedded-architecture/message/2179 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-extract-sdk')
-rwxr-xr-xscripts/runqemu-extract-sdk99
1 files changed, 0 insertions, 99 deletions
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
deleted file mode 100755
index db05da25f2..0000000000
--- a/scripts/runqemu-extract-sdk
+++ /dev/null
@@ -1,99 +0,0 @@
1#!/bin/bash
2#
3# This utility extracts an SDK image tarball using pseudo, and stores
4# the pseudo database in var/pseudo within the rootfs. If you want to
5# boot QEMU using an nfsroot, you *must* use this script to create the
6# rootfs to ensure it is done correctly with pseudo.
7#
8# Copyright (c) 2010 Intel Corp.
9#
10# SPDX-License-Identifier: GPL-2.0-only
11#
12
13function usage() {
14 echo "Usage: $0 <image-tarball> <extract-dir>"
15}
16
17if [ $# -ne 2 ]; then
18 usage
19 exit 1
20fi
21
22SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
23if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
24 echo "Error: Unable to find the oe-find-native-sysroot script"
25 echo "Did you forget to source your build system environment setup script?"
26 exit 1
27fi
28. $SYSROOT_SETUP_SCRIPT qemu-helper-native
29PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
30
31ROOTFS_TARBALL=$1
32SDK_ROOTFS_DIR=$2
33
34if [ ! -e "$ROOTFS_TARBALL" ]; then
35 echo "Error: sdk tarball '$ROOTFS_TARBALL' does not exist"
36 usage
37 exit 1
38fi
39
40# Convert SDK_ROOTFS_DIR to a full pathname
41if [[ ${SDK_ROOTFS_DIR:0:1} != "/" ]]; then
42 SDK_ROOTFS_DIR=$(readlink -f $(pwd)/$SDK_ROOTFS_DIR)
43fi
44
45TAR_OPTS=""
46if [[ "$ROOTFS_TARBALL" =~ tar\.xz$ ]]; then
47 TAR_OPTS="--numeric-owner -xJf"
48fi
49if [[ "$ROOTFS_TARBALL" =~ tar\.bz2$ ]]; then
50 TAR_OPTS="--numeric-owner -xjf"
51fi
52if [[ "$ROOTFS_TARBALL" =~ tar\.gz$ ]]; then
53 TAR_OPTS="--numeric-owner -xzf"
54fi
55if [[ "$ROOTFS_TARBALL" =~ \.tar$ ]]; then
56 TAR_OPTS="--numeric-owner -xf"
57fi
58if [ -z "$TAR_OPTS" ]; then
59 echo "Error: Unable to determine sdk tarball format"
60 echo "Accepted types: .tar / .tar.gz / .tar.bz2 / .tar.xz"
61 exit 1
62fi
63
64if [ ! -d "$SDK_ROOTFS_DIR" ]; then
65 echo "Creating directory $SDK_ROOTFS_DIR"
66 mkdir -p "$SDK_ROOTFS_DIR"
67fi
68
69pseudo_state_dir="$SDK_ROOTFS_DIR/../$(basename "$SDK_ROOTFS_DIR").pseudo_state"
70pseudo_state_dir="$(readlink -f $pseudo_state_dir)"
71
72debug_image="`echo $ROOTFS_TARBALL | grep '\-dbg\.rootfs\.tar'`"
73
74if [ -e "$pseudo_state_dir" -a -z "$debug_image" ]; then
75 echo "Error: $pseudo_state_dir already exists!"
76 echo "Please delete the rootfs tree and pseudo directory manually"
77 echo "if this is really what you want."
78 exit 1
79fi
80
81mkdir -p "$pseudo_state_dir"
82touch "$pseudo_state_dir/pseudo.pid"
83PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
84export PSEUDO_LOCALSTATEDIR
85
86echo "Extracting rootfs tarball using pseudo..."
87echo "$PSEUDO $PSEUDO_OPTS tar -C \"$SDK_ROOTFS_DIR\" $TAR_OPTS \"$ROOTFS_TARBALL\""
88$PSEUDO $PSEUDO_OPTS tar -C "$SDK_ROOTFS_DIR" $TAR_OPTS "$ROOTFS_TARBALL"
89
90DIRCHECK=`ls -l "$SDK_ROOTFS_DIR" | wc -l`
91if [ "$DIRCHECK" -lt 5 ]; then
92 echo "Warning: I don't see many files in $SDK_ROOTFS_DIR"
93 echo "Please double-check the extraction worked as intended"
94 exit 0
95fi
96
97echo "SDK image successfully extracted to $SDK_ROOTFS_DIR"
98
99exit 0