summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/installer
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/installer')
-rwxr-xr-xmeta/recipes-devtools/installer/adt-installer/adt_installer419
-rw-r--r--meta/recipes-devtools/installer/adt-installer/adt_installer.conf75
-rw-r--r--meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf6
-rw-r--r--meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf6
-rwxr-xr-xmeta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal300
-rw-r--r--meta/recipes-devtools/installer/adt-installer/scripts/data_define39
-rwxr-xr-xmeta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs67
-rw-r--r--meta/recipes-devtools/installer/adt-installer/scripts/util104
-rw-r--r--meta/recipes-devtools/installer/adt-installer_1.0.bb90
-rw-r--r--meta/recipes-devtools/installer/files/wget_cache.patch12
10 files changed, 1118 insertions, 0 deletions
diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer b/meta/recipes-devtools/installer/adt-installer/adt_installer
new file mode 100755
index 0000000000..f3c05185a1
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/adt_installer
@@ -0,0 +1,419 @@
1#!/bin/bash
2# Yocto ADT Installer
3#
4# Copyright 2010-2011 by Intel Corp.
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22# THE SOFTWARE.
23
24
25usage ()
26{
27
28 INST_ARCH=`uname -m`
29 INST_OS=`uname -o| tr '[A-Z]' '[a-z]'`
30 INST_KR=`uname -r| tr '[A-Z]' '[a-z]'`
31
32 echo_info "#########################################################################"
33 echo_info "# Welcome to Yocto Application Developement Tools (ADT) Installer"
34 echo_info "# "
35 echo_info "# Host Machine:\t\t\t\t"$INST_ARCH
36 echo_info "# OS info:\t\t\t\t$INST_KR"
37 echo_info "# Yocto ADT version to be installed:\t$YOCTOADT_VERSION"
38 echo_info "# supported target architectures:\t$YOCTOADT_SUPPORTED_TARGETS"
39 echo_info "# supported target root_fs images:\t$YOCTOADT_SUPPORTED_ROOTFS"
40 echo_info "#########################################################################\n"
41
42 echo_info "Systemwide installation. Installation will occur under $INSTALL_FOLDER\n"
43 echo_info "############################################################################"
44 echo_info "# Your system installation configurations from adt_installer.conf"
45 echo_info "############################################################################"
46
47 echo_info "# Cross toolchains:\t\t$YOCTOADT_TARGETS"
48 echo_info "# Install Qemu:\t\t\t$YOCTOADT_QEMU"
49 echo_info "# Install NFS utilities:\t$YOCTOADT_NFS_UTIL"
50 #echo_info "# Install bitbake + UI:\t\t$YOCTOADT_BITBAKE"
51 #echo_info "# Install metadata:\t$YOCTOADT_METADATA"
52 #echo_info "############################################################################\n"
53
54 echo_info "\n##############################################################################"
55 echo_info "# Your rootfs image(s) and target sysroot selections from adt_installer.conf"
56 echo_info "##############################################################################"
57prompt=1
58for arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
59 download_images $arch_type $prompt
60done
61 echo_info "############################################################################\n"
62 select_install_type
63}
64
65validate_config()
66{
67
68 for selected_arch_type in $YOCTOADT_TARGETS; do
69 found=0
70 select_machine_var="\$YOCTOADT_TARGET_MACHINE_$selected_arch_type"
71 select_machine=`eval echo $select_machine_var`
72 show_error_banner=0
73
74 for supported_arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
75 if [ "$selected_arch_type" == "$supported_arch_type" ]; then
76 found=1
77 break
78 fi
79 done
80 if [ $found == 0 ]; then
81 echo_info "[ADT_INST] Error: YOCTADT_TARGETS in adt_installer.conf contains invalid entries: $YOCTOADT_TARGETS. Valid values are: $YOCTOADT_SUPPORTED_TARGETS"
82 show_error_banner=1
83 elif [ -z "$select_machine" ]; then
84 echo_info "[ADT_INST] Error: No MACHINE was defined for $selected_arch_type architecture! This is needed to install the toolchain and the correct environment settings."
85 echo_info "[ADT_INST] To do that, in adt-installer.conf, set the following variable: YOCTOADT_TARGET_MACHINE_$selected_arch_type"
86 show_error_banner=1
87 fi
88
89 if [ $show_error_banner == 1 ]; then
90 echo -e "\n#############################################################################"
91 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
92 echo -e "#############################################################################\n"
93 exit -1
94 fi
95 done
96
97 for arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
98 #select_target_var="\$YOCTOADT_TARGET_$arch_type"
99 #select_target=`eval echo $select_target_var`
100
101 #if [ "$select_target" != "Y" ] || [ "$selected_target" != "y" ]; then
102 # continue;
103 #fi
104
105 target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$arch_type"
106 target_sysroot_image=`eval echo $target_sysroot_image_var`
107
108
109 select_rootfs_var="\$YOCTOADT_ROOTFS_$arch_type"
110 select_rootfs=`eval echo $select_rootfs_var`
111
112 if [ "$select_rootfs" == "" ] && [ "$target_sysroot_image" == "" ]; then
113 continue;
114 fi
115
116 for image_type in $select_rootfs; do
117#validate rootfs type defined in YOCTOADT_ROOTFS_{ARCH} is valid and in YOCTOADT_SUPPORTED_ROOTFS
118 found=0
119 for supported_rootfs_type in $YOCTOADT_SUPPORTED_ROOTFS; do
120 if [ "$image_type" == "$supported_rootfs_type" ]; then
121 found=1
122 break
123 fi
124 done
125 if [ $found == 0 ]; then
126#the rootfs type listed for downloading is not valid
127 echo_info "[ADT_INST] Error: Selected YOCTOADT_ROOTFS_$arch_type value: $image_type, is not valid! Valid values are: $YOCTOADT_SUPPORTED_ROOTFS "
128 echo -e "\n#############################################################################"
129 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
130 echo -e "#############################################################################\n"
131 exit -1
132 fi
133 done
134
135 found=0
136 for image_type in $select_rootfs; do
137#validate that rootfs to be extracted must be in the item: YOCTOADT_ROOTFS_${ARCH}
138 if [ "$target_sysroot_image" == "$image_type" ]; then
139 found=1
140 break
141 fi
142 done
143# the rootfs image to be extracted is not selected
144 if [ $found == 0 ]; then
145 echo_info "[ADT_INST] Error: YOCTOADT_TARGET_SYSROOT_IMAGE_$arch_type selection: $target_sysroot_image is not included in YOCTOADT_ROOTFS_$arch_type selections: $select_rootfs"
146 echo -e "\n#############################################################################"
147 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
148 echo -e "#############################################################################\n"
149 exit -1
150 fi
151 done
152}
153
154
155#detect opkg installed or not, for installing sdk, we will use
156#this installed local opkg
157install_opkg()
158{
159if [ ! -x "$LOCAL_OPKG_LOC/bin/opkg-cl" ]; then
160 echo_info "OPKG is not setup, setting up opkg in local, which is required for installing yocto ADT...\n"
161
162 if [ -d $LOCAL_OPKG_LOC ]; then
163 echo_info "Deleting old OPKG folder, which doesn't contain executables... "
164 rm -rf $LOCAL_OPKG_LOC
165 fi
166
167 parent_folder=`pwd`
168 cd $LOCAL_OPKG_FOLDER
169 check_result
170
171 opkg_source_dir=`ls -d opkg-*`
172
173 if [ $opkg_source_dir == "" ]; then
174 echo_info "[ADT_INST] Error: OPKG source directory is not found!"
175 echo -e "\n#############################################################################"
176 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
177 echo -e "#############################################################################\n"
178 exit -1
179 fi
180
181 cd $opkg_source_dir
182 check_result
183
184 echo_info "Configure opkg ...\n"
185 ./autogen.sh --prefix=$parent_folder/$LOCAL_OPKG_LOC --with-opkglibdir=$OPKG_LIBDIR --enable-shared=no --disable-curl --disable-ssl-curl --disable-gpg --disable-shave >> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
186 check_result
187
188 echo_info "Make opkg ...\n"
189 make &>> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
190 check_result
191
192 echo_info "Make Install opkg ...\n"
193 make install &>> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
194 #if meet error when installing opkg, cancel the installation
195 check_result
196
197 cd $parent_folder
198 echo_info "Successfully installed OPKG.\n"
199fi
200}
201
202confirm_download()
203{
204#avoid repeated reminding
205if [ "$override_oldfile" == 1 ]; then
206 return $pre_result
207else
208 override_oldfile=1
209fi
210
211while true; do
212 #echo_info "[ADT_INST] Files [$1] already exists. If you continue downloading, old files will be overrided."
213 #echo_info "[ADT_INST] Further prompts will not be given if there're more existing files to be downloaded."
214 #echo_info "[ADT_INST] Do you want to continue downloading? Please enter Y/N:"
215 echo_info "\nFile [$1] already exists, which means you've downloaded the qemu kernel and rootfs file(s) before. If you choose continue downloading, old files will be overridden."
216 echo_info "[ADT_INST] Do you want to continue downloading? Please enter Y/N:"
217 read YOCTOADT_INSTALL
218 YOCTOADT_INSTALL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_INSTALL"`
219 if [ "$YOCTOADT_INSTALL" == "Y" ]; then
220 pre_result=0
221 return 0
222 elif [ "$YOCTOADT_INSTALL" == "N" ]; then
223 pre_result=1
224 return 1
225 fi
226done
227}
228
229download_file()
230{
231local filename=`echo ${1##*/}`
232if [ -f "$LOCAL_DOWNLOAD/$filename" ]; then
233 confirm_download $filename
234 result="$?"
235 if [ ! "$result" == "0" ]; then
236 return
237 else
238 echo "Removing old file [$1]"
239 rm -rf "$LOCAL_DOWNLOAD/$filename"
240 fi
241fi
242echo_info "Downloading file: $filename..."
243wget "$YOCTOADT_REPO/rootfs/$1" -P $LOCAL_DOWNLOAD --progress=bar:force 2>&1 | tee -a "$YOCTOADT_INSTALL_LOG_FILE"
244}
245
246
247
248#Need three input params:
249# $1 arch_type(arm powerpc x86 mips)
250# $2 machine(qemuarm beagleboard)
251# $3 rootfs_image_type (a list of sdk sato minimal lsb)
252get_image()
253{
254 local machine=$2
255
256 if [ "$1" == "x86" ] || [ "$1" == "x86_64" ]; then
257 kernel="bzImage-$machine.bin"
258 elif [ "$1" == "ppc" ] || [ "$1" == "mips" ]; then
259 kernel="vmlinux-$machine.bin"
260 else
261 kernel="zImage-$machine.bin"
262 fi
263
264 #echo_info "[ADT_INST] Downloading qemu kernel binary: $qemu_kernel"
265 download_file $machine/$kernel
266 check_result
267
268 for image_type in $select_rootfs; do
269 #echo_info "[ADT_INST] Downloading rootfs file: core-image-$image_type-$machine.tar.bz2"
270 filename="core-image-$image_type-$machine.tar.bz2"
271 download_file $machine/$filename
272 check_result
273 done
274}
275
276download_images()
277{
278 select_rootfs_var="\$YOCTOADT_ROOTFS_$1"
279 select_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1"
280 select_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$1"
281 select_machine_var="\$YOCTOADT_TARGET_MACHINE_$1"
282 select_rootfs=`eval echo $select_rootfs_var`
283 select_sysroot_image=`eval echo $select_sysroot_image_var`
284 select_sysroot=`eval echo $select_sysroot_var`
285 select_machine=`eval echo $select_machine_var`
286
287 if [ -n "$select_sysroot" ]; then
288 select_sysroot=`readlink -m $select_sysroot`
289 fi
290
291 if [ "$select_rootfs" != "" ]; then
292 if [ $2 ]; then
293 #echo_info "\n############################################################################"
294 #echo_info "# To be downloaded rootfs image details defined in adt_installer.conf"
295 #echo_info "############################################################################"
296 echo_info "# Target architecture:\t\t$1"
297 echo_info "# Target machine:\t\t$select_machine"
298 echo_info "# Root_fs images:\t\t$select_rootfs"
299 echo_info "# Target sysroot image:\t\t$select_sysroot_image"
300 echo_info "# Target sysroot loc:\t\t$select_sysroot"
301 echo_info "\n"
302 #echo_info "############################################################################\n"
303 else
304 get_image $1 $select_machine $select_rootfs
305 fi
306 fi
307}
308
309
310
311
312#Main body of installer
313
314clear
315
316run_path=`dirname $0`
317cd $run_path
318
319if [ ! -f "scripts/util" ]; then
320 echo -e "[ADT_INST] Error: Script file: util, can't be found under: $run_path!"
321 echo -e "\n#############################################################################"
322 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
323 echo -e "#############################################################################\n"
324 exit -1
325fi
326
327if [ ! -f "scripts/adt_installer_internal" ]; then
328 echo -e "[ADT_INST] Error: Script file: adt_installer_internal, can't be found under: $run_path!"
329 echo -e "\n#############################################################################"
330 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
331 echo -e "#############################################################################\n"
332 exit -1
333fi
334
335config_file="adt_installer.conf"
336if [ ! -f "$config_file" ]; then
337 echo_info "[ADT_INST] Error: Installation configuration file: adt_installer.conf is not found!\n"
338 echo_info "\n##################################################################################"
339 echo_info "# Meet error(s) when installing Yocto ADT. Please check log file for details. "
340 echo_info "##################################################################################\n"
341 exit -1
342fi
343
344. scripts/data_define
345. scripts/util
346
347
348if [ -f "$YOCTOADT_INSTALL_LOG_FILE" ]; then
349 rm $YOCTOADT_INSTALL_LOG_FILE
350fi
351
352echo -n "Please enter the install location (default: $DEFAULT_INSTALL_FOLDER): "
353read INSTALL_FOLDER
354
355if [ "$INSTALL_FOLDER" = "" ]; then
356 INSTALL_FOLDER=$DEFAULT_INSTALL_FOLDER
357fi
358
359eval INSTALL_FOLDER=$(printf "%q" "$INSTALL_FOLDER")
360if [ -d "$INSTALL_FOLDER" ]; then
361 export INSTALL_FOLDER=$(cd "$INSTALL_FOLDER"; pwd)
362else
363 export INSTALL_FOLDER=$(readlink -m "$INSTALL_FOLDER")
364fi
365
366if [ -n "$(echo $INSTALL_FOLDER|grep ' ')" ]; then
367 echo "The target directory path ($INSTALL_FOLDER) contains spaces. Abort!"
368 exit 1
369fi
370
371clear
372
373usage
374
375user_inst_type="$?"
376
377validate_config
378check_result
379
380#check adt_repo exist
381wget $YOCTOADT_REPO 2>&1 | tee -a "$YOCTOADT_INSTALL_LOG_FILE"
382if grep -q "ERROR 404: Not Found" $YOCTOADT_INSTALL_LOG_FILE; then
383 echo -e "[ADT_INST] Error: YOCTOADT_REPO does not exist: $YOCTOADT_REPO"
384 echo -e "\n#############################################################################"
385 echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
386 echo -e "#############################################################################\n"
387 exit -1
388fi
389
390#firstly we need to install opkg host
391install_opkg
392
393#Create folders for holding rootfs/qemu images
394if [ ! -d "$LOCAL_DOWNLOAD" ]; then
395 echo_info "Creating new images downloading folder: $LOCAL_DOWNLOAD ..."
396 mkdir -p $LOCAL_DOWNLOAD
397fi
398
399#downloading required qemu images/rootfs
400if [ "$user_inst_type" == "0" ]; then
401 override_oldfile=1
402else
403 override_oldfile=0
404fi
405
406for arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
407 download_images $arch_type
408done
409
410scripts/adt_installer_internal $user_inst_type
411
412result="$?"
413#echo_info "\n############################################################"
414if [ "$result" == "0" ]; then
415 echo_info "\n############################################################"
416 echo_info "# Yocto ADT has been successfully installed."
417 echo_info "############################################################\n"
418fi
419
diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer.conf b/meta/recipes-devtools/installer/adt-installer/adt_installer.conf
new file mode 100644
index 0000000000..9329a8d199
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/adt_installer.conf
@@ -0,0 +1,75 @@
1# Yocto ADT Installer Configuration File
2#
3# Copyright 2010-2011 by Intel Corp.
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21# THE SOFTWARE.
22
23
24# Your yocto distro repository, this should include IPKG based packages and root filesystem files where the installation is based on
25
26YOCTOADT_REPO="ADTREPO"
27
28# The following are for system wide setup
29# Target architectures that you want to setup host cross dev environment for
30# valid values are: arm, x86, x86_64, ppc, mips with space separation between entries
31YOCTOADT_TARGETS="arm x86"
32# Whether install qemu or not, valid entries are: Y/N
33YOCTOADT_QEMU="Y"
34# Whether install user-mode nfs or not, valid entries are: Y/N. If you want to use Yocto Eclipse plug-in as your dev IDE, you need to select both qemu and NFS
35YOCTOADT_NFS_UTIL="Y"
36
37# These 2 values will be supported in the furture installer
38#YOCTOADT_BITBAKE="Y"
39#YOCTOADT_METADATA="Y"
40
41#The followings are for setting up specific target architecture
42#YOCTOADT_ROOTFS_$arch is for specifying what root filesystem image files you want to download from the repository. The valid values to replace $arch are: arm, x86, x86_64, powerpc, mips. The valid image files are: minimal, minimal-dev, sato, sato-dev, sato-sdk,lsb, lsb-dev, lsb-sdk. If you want to download multiple images, the entries are space separated
43YOCTOADT_ROOTFS_arm="minimal sato-sdk"
44#Specify which root filesystem file to use to extract as target sysroot. Please ensure the entry is in the list of downloaded root filesystem files that specified above in YOCTOADT_ROOTFS_$arch
45YOCTOADT_TARGET_SYSROOT_IMAGE_arm="sato-sdk"
46#The machine for which you want to download the image. Each machine might have
47#different compilation options in order to select certain hardware models or
48#configurations
49YOCTOADT_TARGET_MACHINE_arm="qemuarm"
50#The location where the target sysroot will be setup
51YOCTOADT_TARGET_SYSROOT_LOC_arm="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_arm"
52
53
54#Here's a template for setting up target arch of x86
55YOCTOADT_ROOTFS_x86="sato-sdk"
56YOCTOADT_TARGET_SYSROOT_IMAGE_x86="sato-sdk"
57YOCTOADT_TARGET_MACHINE_x86="qemux86"
58YOCTOADT_TARGET_SYSROOT_LOC_x86="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_x86"
59
60#Here's some template of other arches, which you need to change the value in ""
61#YOCTOADT_ROOTFS_x86_64="sato-sdk"
62#YOCTOADT_TARGET_SYSROOT_IMAGE_x86_64="sato-sdk"
63#YOCTOADT_TARGET_MACHINE_x86_64="qemux86-64"
64#YOCTOADT_TARGET_SYSROOT_LOC_x86_64="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_x86_64"
65
66#YOCTOADT_ROOTFS_ppc="sato-sdk"
67#YOCTOADT_TARGET_SYSROOT_IMAGE_ppc="sato-sdk"
68#YOCTOADT_TARGET_MACHINE_ppc="qemuppc"
69#YOCTOADT_TARGET_SYSROOT_LOC_ppc="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_ppc"
70
71#YOCTOADT_ROOTFS_mips="sato-sdk"
72#YOCTOADT_TARGET_SYSROOT_IMAGE_mips="sato-sdk"
73#YOCTOADT_TARGET_MACHINE_mips="qemumips"
74#YOCTOADT_TARGET_SYSROOT_LOC_mips="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_mips"
75
diff --git a/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf
new file mode 100644
index 0000000000..ba627b3f3a
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf
@@ -0,0 +1,6 @@
1arch all 1
2arch any 6
3arch noarch 11
4arch i686-nativesdk 16
5src yp-i686-nativesdk ADTREPO_URL/adt-ipk/i686-nativesdk
6src yp-i686-all ADTREPO_URL/adt-ipk/all
diff --git a/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf
new file mode 100644
index 0000000000..10504a92e9
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf
@@ -0,0 +1,6 @@
1arch all 1
2arch any 6
3arch noarch 11
4arch x86_64-nativesdk 16
5src yp-x86_64-nativesdk ADTREPO_URL/adt-ipk/x86_64-nativesdk
6src yp-x86_64-all ADTREPO_URL/adt-ipk/all
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
new file mode 100755
index 0000000000..2eb13a9044
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -0,0 +1,300 @@
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
25parse_config()
26{
27 INST_ARCH=`uname -m`
28
29 case $INST_ARCH in
30 i[3-6]86)
31 OPKG_CONFIG_FILE=$YOCTOADT_OPKG_CONF_FILE_32
32 OECORE_NATIVE_SYSROOT="$INSTALL_FOLDER/sysroots/$INST_ARCH$SDK_VENDOR-linux/"
33 ;;
34 x86_64)
35 OPKG_CONFIG_FILE=$YOCTOADT_OPKG_CONF_FILE_64
36 OECORE_NATIVE_SYSROOT="$INSTALL_FOLDER/sysroots/x86_64$SDK_VENDOR-linux/"
37 ;;
38 *)
39 echo_info "[ADT_INST] Error: Installation Machine is not supported!"
40 exit -1
41 ;;
42 esac
43}
44
45get_sudo_app()
46{
47 username=$(id -nu)
48
49 # find the owner of the parent
50 dir=$1
51 while [ 1 ]; do
52 if [ -d $dir ]; then
53 owner=$(stat -c %U $dir)
54 break
55 else
56 dir=$(dirname $dir)
57 fi
58 done
59
60 if [ "$owner" = "$username" ]; then
61 true
62 else
63 echo sudo
64 fi
65}
66
67
68#let us install a qemu-native firstly
69#installation step 2
70install_native_sdk()
71{
72
73echo_info "\nStart installing selected native ADT for archs: $YOCTOADT_TARGETS..."
74
75# where the packages are installed.
76NATIVE_INSTALL_DIR=$INSTALL_FOLDER
77
78if [ -d "$INSTALL_FOLDER" ]; then
79 echo_info "\nNative ADT installation directory \"$INSTALL_FOLDER\" already exists! Continue installation will override its contents!"
80 confirm_install $1
81fi
82
83#Now begin to install native sdk and extract qemu rootfs which needs privilege rights
84#depending on the install location
85SUDO=$(get_sudo_app $NATIVE_INSTALL_DIR)
86if [ -n "$SUDO" ]; then
87 echo_info "#######################################################################"
88 echo_info "Please note from this point on installation requires sudo password ..."
89 echo_info "#######################################################################"
90fi
91
92#we need to make this directory firstly since opkg need to use it.
93OPKG_LOCK_DIR="$NATIVE_INSTALL_DIR/$OPKG_LIBDIR/opkg"
94if [ ! -d "$OPKG_LOCK_DIR" ]; then
95 $SUDO mkdir -p $OPKG_LOCK_DIR
96 echo_info "Successfully create directory $OPKG_LOCK_DIR. "
97#if user delete /opt/xxx, while dangling folders there, report error
98elif [ ! -d "$INSTALL_FOLDER" ]; then
99 echo_info "\nDangling opkg cache folder $OPKG_LOCK_DIR detected. Continue installation will remove the folder!"
100 confirm_install $1
101 $SUDO rm -rf $OPKG_LOCK_DIR
102 $SUDO mkdir -p $OPKG_LOCK_DIR
103#if user are updating installing, just let him/her go, give her/him prompt
104else
105 echo_info "ADT has already been installed. Will update its contents..."
106fi
107
108#first update repository
109if [ "x$SUDO" = "x" ]; then
110 OPKG_CMD="$LOCAL_OPKG_LOC/bin/opkg-cl"
111else
112 OPKG_CMD="sudo -E $LOCAL_OPKG_LOC/bin/opkg-cl"
113fi
114
115echo_info "Updating opkg..."
116$OPKG_CMD -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR update &>> $YOCTOADT_INSTALL_LOG_FILE
117echo_info "opkg update process ended..."
118check_result
119
120#install below must sdk-host packages
121OPKG_INSTALL_CMD="$OPKG_CMD "
122OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD --force-overwrite -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
123
124BASE_HOSTSDK_PKGNAMES="pseudo opkg pkgconfig libtool autoconf automake"
125for pkg in $BASE_HOSTSDK_PKGNAMES; do
126 echo_info "Installing ${pkg} nativesdk ...\n"
127 $OPKG_INSTALL_NATIVE_CMD nativesdk-${pkg} &>> $YOCTOADT_INSTALL_LOG_FILE
128 check_result
129done
130
131for target_type in $YOCTOADT_TARGETS; do
132 machine_var="\$YOCTOADT_TARGET_MACHINE_$target_type"
133 machine=`eval echo $machine_var`
134 echo_info "Installing cross canadian packages for $machine ..."
135 $OPKG_INSTALL_NATIVE_CMD packagegroup-cross-canadian-$machine &>> $YOCTOADT_INSTALL_LOG_FILE
136 check_result
137done
138
139if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" = "y" ]; then
140 echo_info "\nInstalling qemu native ..."
141 $OPKG_INSTALL_NATIVE_CMD nativesdk-qemu &>> $YOCTOADT_INSTALL_LOG_FILE
142 check_result
143 $OPKG_INSTALL_NATIVE_CMD nativesdk-qemu-helper &>> $YOCTOADT_INSTALL_LOG_FILE
144 check_result
145fi
146
147if [ "$YOCTOADT_NFS_UTIL" == "Y" ] || [ "$YOCTOADT_NFS_UTIL" == "y" ]; then
148 echo_info "\nInstalling unfs ..."
149 $OPKG_INSTALL_NATIVE_CMD nativesdk-unfs-server &>> $YOCTOADT_INSTALL_LOG_FILE
150 check_result
151fi
152
153# Lose the ./opt/${DISTRO}/${SDK_VERSION} part, we don't really need to keep
154# the entire directory structure. We could patch opkg to do that but it's far
155# simpler to do that here and achieve the same result.
156# This is done in two steps:
157if [ -d $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER ]; then
158 # Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR.
159 # We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains
160 # another SDK)
161 $SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR
162
163 # delete the source directory now
164 $SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/*
165
166 # Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty
167 dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER
168 while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do
169 # if the user chose / as the install folder, then we should leave /opt in place
170 if [ "$dir" = "/opt" ]; then
171 break
172 fi
173
174 # try to delete the directory, only if it's empty
175 $SUDO rmdir $dir
176 if [ $? -ne 0 ]; then
177 break
178 fi
179
180 # go to the next directory
181 dir=$(dirname $dir)
182 done
183fi
184
185# Link the ld.so.cache file into the hosts filesystem
186if [ ! -f "$OECORE_NATIVE_SYSROOT/etc/ld.so.cache" ]; then
187echo_info "Link the ld.so.cache file into the host filesystem"
188$SUDO ln -s /etc/ld.so.cache $OECORE_NATIVE_SYSROOT/etc/ld.so.cache
189check_result
190fi
191
192# relocate binaries
193echo_info "\nRelocating binaries ..."
194escaped_sdkpath=$(echo $DEFAULT_INSTALL_FOLDER |sed -e "s:[\+\.]:\\\\\\\\\0:g")
195
196# We don't change the script in-place since we may want the user to re-run
197# adt-installer script
198sed -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" scripts/relocate_sdk.py > scripts/relocate_sdk_tmp.py
199chmod +x scripts/relocate_sdk_tmp.py
200
201dl_path=$(find $OECORE_NATIVE_SYSROOT/lib -name "ld-linux*")
202executable_files=$(find $OECORE_NATIVE_SYSROOT -type f -perm /111)
203
204$SUDO scripts/relocate_sdk_tmp.py $INSTALL_FOLDER $dl_path $executable_files
205check_result
206
207# replace /opt/${DISTRO}/${SDK_VERSION} with the install folder in all configs
208env_setup_script=$(find $NATIVE_INSTALL_DIR/ -name "environment-setup-*")
209$SUDO sed -i -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:g" $env_setup_script
210
211find $OECORE_NATIVE_SYSROOT -type f -exec file '{}' \; | grep ":.*\(ASCII\|script\|source\).*text" | \
212 cut -d':' -f1 | xargs $SUDO sed -i -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:g"
213
214# change all symlinks pointing to /opt/${DISTRO}/${SDK_VERSION}
215for l in $(find $NATIVE_INSTALL_DIR -type l); do
216 $SUDO ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:") $l
217done
218
219# find out all perl scripts in $OECORE_NATIVE_SYSROOT and modify them
220# replacing the host perl with SDK perl.
221for perl_script in $($SUDO grep -m 1 "^#!.*perl" -rl $OECORE_NATIVE_SYSROOT); do
222 $SUDO sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \
223 "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script
224done
225
226echo_info "\nSuccessfully installed selected native ADT!"
227}
228
229#Need three input params, $1 -- arch_type(arm powerpc x86 mips) #2 -- user installation type
230#customer or scilent
231
232install_target()
233{
234
235# rootfs extraction directory
236target_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$1"
237target_sysroot=`eval echo $target_sysroot_var`
238
239if [ "$target_sysroot" == "" ]; then
240 return 0
241else
242 target_sysroot=`readlink -m $target_sysroot`
243fi
244
245target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1"
246target_sysroot_image=`eval echo $target_sysroot_image_var`
247if [ "$target_sysroot_image" == "" ]; then
248 echo_info "[ADT_INST] Error: YOCTOADT_TARGET_SYSROOT_IMAGE_$1 selection is empty, failed to create target sysroot!"
249 return 1
250fi
251
252echo_info "Installing target sysroot for arch: $1, rootfs type: $target_sysroot_image, location: $target_sysroot"
253
254target_machine_var="\$YOCTOADT_TARGET_MACHINE_$1"
255target_machine=`eval echo $target_machine_var`
256sysroot_image_name="core-image-$target_sysroot_image-$target_machine.tar.bz2"
257 #echo_info "Extracting rootfs: $sysroot_image_name, using pseudo..."
258
259# sudo password might be needed to install the target sysroot
260SUDO=$(get_sudo_app $target_sysroot)
261
262$SUDO scripts/extract_rootfs $sysroot_image_name $target_sysroot $OECORE_NATIVE_SYSROOT $user_inst_type
263check_result
264
265echo_info "Updating environment script with target sysroot location."
266if [ "$1" == "x86" ]; then
267 env_filename=`ls $INSTALL_FOLDER/environment-setup-i586*`
268else
269 env_filename=`ls $INSTALL_FOLDER/environment-setup-$1*`
270fi
271
272if [ ! -z "$env_filename" ]; then
273 SUDO=$(get_sudo_app $INSTALL_FOLDER)
274 $SUDO sed -i -e "s%##SDKTARGETSYSROOT##%$target_sysroot%g" $env_filename
275else
276 echo_info "[ADT_INST] Error: Failed to find environment script for arch: $1"
277 return 1
278fi
279
280
281}
282
283
284#Main part
285. scripts/data_define
286. scripts/util
287
288parse_config
289
290#secondly we will start to install native tools
291user_inst_type=$1
292install_native_sdk $user_inst_type
293check_result
294
295for arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
296 install_target $arch_type
297 check_result
298done
299
300
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/data_define b/meta/recipes-devtools/installer/adt-installer/scripts/data_define
new file mode 100644
index 0000000000..2781e77032
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/data_define
@@ -0,0 +1,39 @@
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
25config_file="adt_installer.conf"
26source `pwd`/$config_file
27
28LOCAL_OPKG_LOC="./opkg/build/opkg"
29LOCAL_OPKG_FOLDER="./opkg/build"
30OPKG_LIBDIR="/var/lib"
31
32# List all supported root fs types and target types,
33# it will be used in user configuration validity checking
34YOCTOADT_SUPPORTED_ROOTFS="minimal minimal-dev sato sato-dev sato-sdk lsb lsb-dev lsb-sdk"
35YOCTOADT_SUPPORTED_TARGETS="x86 x86_64 arm ppc mips"
36# Different host (32 bit or 64 bit) will have different opkg
37# configuration files
38YOCTOADT_OPKG_CONF_FILE_32="./opkg/conf/opkg-sdk-i686.conf"
39YOCTOADT_OPKG_CONF_FILE_64="./opkg/conf/opkg-sdk-x86_64.conf"
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..d1a595b268
--- /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
25extract_rootfs()
26{
27
28 native_sysroot=$3
29 target_sysroot=$2
30 PSEUDO_COMMAND="$native_sysroot/usr/bin/pseudo"
31 TAR_OPTS="-xjf"
32 PSEUDO_OPTS="-P $native_sysroot/usr"
33
34
35 rm -rf $PSEUDO_LOCALSTATEDIR
36
37 if [ -d "$target_sysroot" ]; then
38 echo_info "\nTarget sysroot location: $target_sysroot, already exists! If you continue installation, this folder will be re-created."
39 confirm_install $4
40 rm -rf "$target_sysroot"
41 fi
42
43 if [ ! -d "$target_sysroot" ]; then
44 echo_info "Creating directory $target_sysroot..."
45 mkdir -p "$target_sysroot"
46 fi
47
48 pseudo_state_dir="$target_sysroot/../$(basename "$target_sysroot").pseudo_state"
49 mkdir -p "$pseudo_state_dir"
50 touch "$pseudo_state_dir/pseudo.pid"
51 PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
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: OECORE_NATIVE_SYSROOT
65#Param 2: user defined rootfs extraction directory
66#param 1: sysroot image name
67extract_rootfs $1 $2 $3 $4
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/util b/meta/recipes-devtools/installer/adt-installer/scripts/util
new file mode 100644
index 0000000000..9be7517272
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/util
@@ -0,0 +1,104 @@
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
25echo_info()
26{
27 echo -e $1 | tee -a $YOCTOADT_INSTALL_LOG_FILE
28}
29
30select_install_type()
31{
32# If choosing silent install, all older installation data will be
33# overriden without user's interaction
34while true; do
35 #echo_info "[ADT_INST] Silent install means overrides all existing older"
36 #echo_info "[ADT_INST] data and the installation needs least user interaction"
37 #echo_info "[ADT_INST] If you want to use silent installation, please enter S:"
38 #echo_info "[ADT_INST] If you want to customize installation, please enter C:"
39 #echo_info "[ADT_INST} If you want to exit current installation, please enter X:"
40 echo_info "There're two ways you can do installation: silent mode or interactive mode. To choose silent mode, which means you opt for the system to override the existing data under the specified installation directories without prompting for your confirmation. Please be cautious with this selection which may trigger your losing data. With the interactive mode, you have to closely monitor the installation process, since it will prompt you each step it needs to override some existing data. To choose silent mode, please enter [S], for interactive mode, please enter [I] or [X] to exit the installation."
41 echo_info "[ADT_INST] Please enter your selections here:"
42 read YOCTOADT_SEL
43 YOCTOADT_SEL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_SEL"`
44 if [ "$YOCTOADT_SEL" == "S" ]; then
45 return "0"
46 elif [ "$YOCTOADT_SEL" == "I" ]; then
47 return "1"
48 elif [ "$YOCTOADT_SEL" == "X" ]; then
49 echo_info "\n############################################################"
50 echo_info "# User cancelled installation!"
51 echo_info "############################################################\n"
52 exit 1
53 fi
54done
55
56
57}
58
59confirm_install()
60{
61# below are prompt, make sure user still want to install even meet
62# some prompts
63
64#User likes to enjoy silent installation, we will not break his
65#installation process here
66if [ "$1" == "0" ]; then
67 return
68fi
69
70while true; do
71 echo_info "[ADT_INST] Do you want to continue installation? Please enter Y/N:"
72 read YOCTOADT_INSTALL
73 YOCTOADT_INSTALL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_INSTALL"`
74 if [ "$YOCTOADT_INSTALL" == "Y" ]; then
75 break
76 elif [ "$YOCTOADT_INSTALL" == "N" ]; then
77 echo_info "\n############################################################"
78 echo_info "# User cancelled installation!"
79 echo_info "############################################################\n"
80 exit 1
81 fi
82done
83}
84
85check_result()
86{
87 result=$?
88 if [ $result -eq 1 ]; then
89 exit -1
90 elif [ $result -ne 0 ]; then
91 echo_info "\n#############################################################################"
92 echo_info "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
93 echo_info "#############################################################################\n"
94 exit -1
95 fi
96}
97
98# yocto adt installation log file
99YOCTOADT_INSTALL_LOG_FILE="adt_installer.log"
100# Temp folders holding qemu/rootfs downloaded images
101# It will be put into the installation folder
102LOCAL_DOWNLOAD="./download_image"
103
104
diff --git a/meta/recipes-devtools/installer/adt-installer_1.0.bb b/meta/recipes-devtools/installer/adt-installer_1.0.bb
new file mode 100644
index 0000000000..88650ae8b0
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer_1.0.bb
@@ -0,0 +1,90 @@
1# Yocto ADT Installer bb file
2#
3# Copyright 2010-2012 by Intel Corp.
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21# THE SOFTWARE.
22
23
24DESCRIPTION = "Meta package for creating sdk installer tarball"
25LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
26 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
27LICENSE = "MIT"
28
29PACKAGES = ""
30
31PR = "r11"
32
33ADT_DEPLOY = "${TMPDIR}/deploy/sdk/"
34ADT_DIR = "${WORKDIR}/adt-installer/"
35YOCTOADT_VERSION = "${SDK_VERSION}"
36S = "${WORKDIR}/trunk"
37
38SRCREV = "596"
39PV = "0.1.8+svnr${SRCPV}"
40SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
41 file://wget_cache.patch \
42 file://adt_installer \
43 file://scripts/adt_installer_internal \
44 file://scripts/util \
45 file://scripts/data_define \
46 file://scripts/extract_rootfs \
47 file://adt_installer.conf \
48 file://opkg/conf/opkg-sdk-x86_64.conf \
49 file://opkg/conf/opkg-sdk-i686.conf \
50 "
51
52ADTREPO ?= "http://adtrepo.yoctoproject.org/${SDK_VERSION}"
53
54do_populate_adt[umask] = "022"
55
56fakeroot do_populate_adt () {
57 cd ${WORKDIR}
58 mkdir -p ${ADT_DEPLOY}
59 rm -f ${ADT_DEPLOY}/adt_installer.tar.bz2
60 rm -rf ${ADT_DIR}
61 mkdir -p ${ADT_DIR}/opkg/build
62 cp -r opkg ${ADT_DIR}/
63 sed -i -e 's#ADTREPO_URL#${ADTREPO}#' ${ADT_DIR}/opkg/conf/*.conf
64 cp -r trunk ${ADT_DIR}/opkg/build/
65 mv ${ADT_DIR}/opkg/build/trunk ${ADT_DIR}/opkg/build/opkg-svn
66 rm -rf ${ADT_DIR}/opkg/build/opkg-svn/patches ${ADT_DIR}/opkg/build/opkg-svn/.pc
67 cp -r scripts ${ADT_DIR}/
68 cp adt_installer ${ADT_DIR}
69 cp adt_installer.conf ${ADT_DIR}
70 sed -i -e 's#YOCTOADT_VERSION#${SDK_VERSION}#' ${ADT_DIR}/adt_installer.conf
71 sed -i -e 's#ADTREPO#${ADTREPO}#' ${ADT_DIR}/adt_installer.conf
72 echo 'SDK_VENDOR=${SDK_VENDOR}' >> ${ADT_DIR}/scripts/data_define
73 echo 'DEFAULT_INSTALL_FOLDER=${SDKPATH}' >> ${ADT_DIR}/scripts/data_define
74 cp ${COREBASE}/scripts/relocate_sdk.py ${ADT_DIR}/scripts/
75 tar cfj adt_installer.tar.bz2 adt-installer
76 cp ${WORKDIR}/adt_installer.tar.bz2 ${ADT_DEPLOY}
77}
78
79do_populate_adt[nostamp] = "1"
80do_configure[noexec] = "1"
81do_compile[noexec] = "1"
82do_package[noexec] = "1"
83do_packagedata[noexec] = "1"
84do_package_write[noexec] = "1"
85do_package_write_ipk[noexec] = "1"
86do_package_write_rpm[noexec] = "1"
87do_package_write_deb[noexec] = "1"
88do_poplulate_sysroot[noexec] = "1"
89
90addtask populate_adt before do_build after do_install
diff --git a/meta/recipes-devtools/installer/files/wget_cache.patch b/meta/recipes-devtools/installer/files/wget_cache.patch
new file mode 100644
index 0000000000..1281d12a3b
--- /dev/null
+++ b/meta/recipes-devtools/installer/files/wget_cache.patch
@@ -0,0 +1,12 @@
1Upstream-Status: Inappropriate [configuration]
2
3--- trunk/libopkg/opkg_download.c 2011-03-10 16:41:29.000000000 +0800
4+++ trunk/libopkg/opkg_download.c 2011-03-10 16:42:33.000000000 +0800
5@@ -162,6 +162,7 @@
6
7 argv[i++] = "wget";
8 argv[i++] = "-q";
9+ argv[i++] = "--no-cache";
10 if (conf->http_proxy || conf->ftp_proxy) {
11 argv[i++] = "-Y";
12 argv[i++] = "on";