diff options
Diffstat (limited to 'meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs')
-rwxr-xr-x | meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs b/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs new file mode 100755 index 0000000000..3dd47f0f75 --- /dev/null +++ b/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs | |||
@@ -0,0 +1,67 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Yocto ADT Installer | ||
4 | # | ||
5 | # Copyright 2010-2011 by Intel Corp. | ||
6 | # | ||
7 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
8 | # of this software and associated documentation files (the "Software"), to deal | ||
9 | # in the Software without restriction, including without limitation the rights | ||
10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
11 | # copies of the Software, and to permit persons to whom the Software is | ||
12 | # furnished to do so, subject to the following conditions: | ||
13 | |||
14 | # The above copyright notice and this permission notice shall be included in | ||
15 | # all copies or substantial portions of the Software. | ||
16 | |||
17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
23 | # THE SOFTWARE. | ||
24 | |||
25 | extract_rootfs() | ||
26 | { | ||
27 | |||
28 | native_sysroot=$3 | ||
29 | target_sysroot=$2 | ||
30 | PSEUDO_COMMAND="$native_sysroot/usr/bin/pseudo" | ||
31 | PSEUDO_OPTS="-P $natvie_sysroot/usr" | ||
32 | TAR_OPTS="-xjf" | ||
33 | PSEUDO_OPTS="-P $native_sysroot/usr" | ||
34 | |||
35 | |||
36 | rm -rf $PSEUDO_LOCALSTATEDIR | ||
37 | |||
38 | if [ -d "$target_sysroot" ]; then | ||
39 | echo_info "\nTarget sysroot location: $target_sysroot, already exists! If you continue installation, this folder will be re-created." | ||
40 | confirm_install $4 | ||
41 | rm -rf "$target_sysroot" | ||
42 | fi | ||
43 | |||
44 | if [ ! -d "$target_sysroot" ]; then | ||
45 | echo_info "Creating directory $target_sysroot..." | ||
46 | mkdir -p "$target_sysroot" | ||
47 | fi | ||
48 | |||
49 | mkdir -p "$target_sysroot/var/pseudo" | ||
50 | touch "$target_sysroot/var/pseudo/pseudo.pid" | ||
51 | PSEUDO_LOCALSTATEDIR="$target_sysroot/var/pseudo" | ||
52 | export PSEUDO_LOCALSTATEDIR | ||
53 | |||
54 | echo_info "Extracting rootfs: $1, using pseudo..." | ||
55 | $PSEUDO_COMMAND $PSEUDO_OPTS tar -C $2 "$TAR_OPTS" $LOCAL_DOWNLOAD/$1 &>> $YOCTOADT_INSTALL_LOG_FILE | ||
56 | check_result | ||
57 | } | ||
58 | |||
59 | #Main part | ||
60 | . scripts/util | ||
61 | |||
62 | #Parameter detail is listed below: | ||
63 | #Param 4: Silent install or customize install | ||
64 | #Param 3: POKY_NATIVE_SYSROOT | ||
65 | #Param 2: user defined rootfs extraction directory | ||
66 | #param 1: sysroot image name | ||
67 | extract_rootfs $1 $2 $3 $4 | ||