summaryrefslogtreecommitdiffstats
path: root/meta/classes/populate_sdk.bbclass
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-01-30 15:56:51 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-01 23:59:38 +0000
commitd22b4357c981dfd7b44dcaae59d276edc0f78dce (patch)
tree8091ab41fbae4084e7f59993fef4a5478ff2a730 /meta/classes/populate_sdk.bbclass
parent63e220c1e8e4bf94105372156cb1ef7a6d652682 (diff)
downloadpoky-d22b4357c981dfd7b44dcaae59d276edc0f78dce.tar.gz
populate_sdk.bbclass/meta-toolchain: Made populate_sdk task more generic
Move the populate_sdk task out of meta-toolchain. Made it more generic to support rpm/deb package format. This commit is dependant on a series of commit: 2ea0406e4516fc59dff86cb4adc35c82cb774c2f 7ffa45b7cfea24dae1b51f40cfc807bf78b21b66 bf201a74c243942af3fcae6f174496bdd819dbc0 3d29933f2925efe8a84f10efdf50396031c33ae4 3d29933f2925efe8a84f10efdf50396031c33ae4 9c724dbf57e610a9e06bbdce38383dee3ac49281 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'meta/classes/populate_sdk.bbclass')
-rw-r--r--meta/classes/populate_sdk.bbclass82
1 files changed, 82 insertions, 0 deletions
diff --git a/meta/classes/populate_sdk.bbclass b/meta/classes/populate_sdk.bbclass
new file mode 100644
index 0000000000..7e260ef38d
--- /dev/null
+++ b/meta/classes/populate_sdk.bbclass
@@ -0,0 +1,82 @@
1inherit meta toolchain-scripts
2inherit populate_sdk_${IMAGE_PKGTYPE}
3
4SDK_DIR = "${WORKDIR}/sdk"
5SDK_OUTPUT = "${SDK_DIR}/image"
6SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
7
8SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
9
10TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}"
11TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg"
12TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}"
13
14RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
15DEPENDS = "virtual/fakeroot-native sed-native"
16
17PID = "${@os.getpid()}"
18
19EXCLUDE_FROM_WORLD = "1"
20
21fakeroot do_populate_sdk() {
22 rm -rf ${SDK_OUTPUT}
23 mkdir -p ${SDK_OUTPUT}
24
25 populate_sdk_${IMAGE_PKGTYPE}
26
27 # Don't ship any libGL in the SDK
28 rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL*
29
30 # Can copy pstage files here
31 # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
32
33 # Fix or remove broken .la files
34 #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la
35 rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
36
37 # Link the ld.so.cache file into the hosts filesystem
38 ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
39
40 # Setup site file for external use
41 siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}
42 touch $siteconfig
43 for sitefile in ${CONFIG_SITE} ; do
44 cat $sitefile >> $siteconfig
45 done
46
47 toolchain_create_sdk_env_script
48
49 # Add version information
50 versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS}
51 touch $versionfile
52 echo 'Distro: ${DISTRO}' >> $versionfile
53 echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
54 echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
55 echo 'Timestamp: ${DATETIME}' >> $versionfile
56
57 # Package it up
58 mkdir -p ${SDK_DEPLOY}
59 cd ${SDK_OUTPUT}
60 tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
61}
62
63populate_sdk_log_check() {
64 for target in $*
65 do
66 lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
67
68 echo "log_check: Using $lf_path as logfile"
69
70 if test -e "$lf_path"
71 then
72 ${IMAGE_PKGTYPE}_log_check $target $lf_path
73 else
74 echo "Cannot find logfile [$lf_path]"
75 fi
76 echo "Logfile is clean"
77 done
78}
79
80do_populate_sdk[nostamp] = "1"
81do_populate_sdk[recrdeptask] = "do_package_write"
82addtask populate_sdk before do_build after do_install