diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2012-06-25 12:38:36 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-03 14:54:58 +0100 |
commit | 1d5271153deacb29b2643aa7bc5982b4be28de18 (patch) | |
tree | 9452927d989209cd1204af40c761e79b5be7bbd1 /meta | |
parent | 9870fbc9f80f6c752e0d5cb73a118603b078f44f (diff) | |
download | poky-1d5271153deacb29b2643aa7bc5982b4be28de18.tar.gz |
populate_sdk.bbclass: Split into two parts
populate_sdk was renamed to populate_sdk_base in order to allow for changes
that may break existing SDK recipes. Any such changes need an analog
in populate_sdk (new version) to restore previous desired behavior.
In addition to the rename, one minor change was made. The _base version
only had the do_populate_sdk as an added task, but no before or after defined.
For compatibility, populate_sdk has do_populate_sdk defined as "after"
do_install and before do_build, this is identical to the original behavior.
(From OE-Core rev: bde224ba44c16edc1892cea1b33ab973ae971115)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/populate_sdk.bbclass | 91 | ||||
-rw-r--r-- | meta/classes/populate_sdk_base.bbclass | 89 |
2 files changed, 93 insertions, 87 deletions
diff --git a/meta/classes/populate_sdk.bbclass b/meta/classes/populate_sdk.bbclass index 1131d686b9..e5bb54026e 100644 --- a/meta/classes/populate_sdk.bbclass +++ b/meta/classes/populate_sdk.bbclass | |||
@@ -1,89 +1,6 @@ | |||
1 | inherit meta toolchain-scripts | 1 | # The majority of populate_sdk is located in populate_sdk_base |
2 | inherit populate_sdk_${IMAGE_PKGTYPE} | 2 | # This chunk simply facilitates compatibility with SDK only recipes. |
3 | 3 | ||
4 | SDK_DIR = "${WORKDIR}/sdk" | 4 | inherit populate_sdk_base |
5 | SDK_OUTPUT = "${SDK_DIR}/image" | ||
6 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" | ||
7 | 5 | ||
8 | SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${MULTIMACH_TARGET_SYS}" | 6 | addtask populate_sdk after do_install before do_build |
9 | |||
10 | TOOLCHAIN_HOST_TASK ?= "task-sdk-host-nativesdk task-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
11 | TOOLCHAIN_TARGET_TASK ?= "task-core-standalone-sdk-target task-core-standalone-sdk-target-dbg" | ||
12 | TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}" | ||
13 | |||
14 | RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" | ||
15 | DEPENDS = "virtual/fakeroot-native sed-native" | ||
16 | |||
17 | PID = "${@os.getpid()}" | ||
18 | |||
19 | EXCLUDE_FROM_WORLD = "1" | ||
20 | |||
21 | python () { | ||
22 | # If we don't do this we try and run the mapping hooks while parsing which is slow | ||
23 | # bitbake should really provide something to let us know this... | ||
24 | if bb.data.getVar('BB_WORKERCONTEXT', d, True) is not None: | ||
25 | runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d) | ||
26 | } | ||
27 | |||
28 | fakeroot do_populate_sdk() { | ||
29 | rm -rf ${SDK_OUTPUT} | ||
30 | mkdir -p ${SDK_OUTPUT} | ||
31 | |||
32 | # populate_sdk_<image> is required to construct two images: | ||
33 | # SDK_ARCH-nativesdk - contains the cross compiler and associated tooling | ||
34 | # target - contains a target rootfs configured for the SDK usage | ||
35 | # | ||
36 | # the output of populate_sdk_<image> should end up in ${SDK_OUTPUT} it is made | ||
37 | # up of: | ||
38 | # ${SDK_OUTPUT}/<sdk_arch-nativesdk pkgs> | ||
39 | # ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/<target pkgs> | ||
40 | |||
41 | populate_sdk_${IMAGE_PKGTYPE} | ||
42 | |||
43 | # Don't ship any libGL in the SDK | ||
44 | rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL* | ||
45 | |||
46 | # Can copy pstage files here | ||
47 | # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '` | ||
48 | |||
49 | # Fix or remove broken .la files | ||
50 | #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la | ||
51 | rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la | ||
52 | |||
53 | # Link the ld.so.cache file into the hosts filesystem | ||
54 | ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache | ||
55 | |||
56 | # Setup site file for external use | ||
57 | toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} | ||
58 | |||
59 | toolchain_create_sdk_env_script | ||
60 | |||
61 | # Add version information | ||
62 | toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} | ||
63 | |||
64 | # Package it up | ||
65 | mkdir -p ${SDK_DEPLOY} | ||
66 | cd ${SDK_OUTPUT} | ||
67 | tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . | ||
68 | } | ||
69 | |||
70 | populate_sdk_log_check() { | ||
71 | for target in $* | ||
72 | do | ||
73 | lf_path="`dirname ${BB_LOGFILE}`/log.do_$target.${PID}" | ||
74 | |||
75 | echo "log_check: Using $lf_path as logfile" | ||
76 | |||
77 | if test -e "$lf_path" | ||
78 | then | ||
79 | ${IMAGE_PKGTYPE}_log_check $target $lf_path | ||
80 | else | ||
81 | echo "Cannot find logfile [$lf_path]" | ||
82 | fi | ||
83 | echo "Logfile is clean" | ||
84 | done | ||
85 | } | ||
86 | |||
87 | do_populate_sdk[nostamp] = "1" | ||
88 | do_populate_sdk[recrdeptask] = "do_package_write" | ||
89 | addtask populate_sdk before do_build after do_install | ||
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass new file mode 100644 index 0000000000..a3bf8c2e09 --- /dev/null +++ b/meta/classes/populate_sdk_base.bbclass | |||
@@ -0,0 +1,89 @@ | |||
1 | inherit meta toolchain-scripts | ||
2 | inherit populate_sdk_${IMAGE_PKGTYPE} | ||
3 | |||
4 | SDK_DIR = "${WORKDIR}/sdk" | ||
5 | SDK_OUTPUT = "${SDK_DIR}/image" | ||
6 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" | ||
7 | |||
8 | SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${MULTIMACH_TARGET_SYS}" | ||
9 | |||
10 | TOOLCHAIN_HOST_TASK ?= "task-sdk-host-nativesdk task-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
11 | TOOLCHAIN_TARGET_TASK ?= "task-core-standalone-sdk-target task-core-standalone-sdk-target-dbg" | ||
12 | TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}" | ||
13 | |||
14 | RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" | ||
15 | DEPENDS = "virtual/fakeroot-native sed-native" | ||
16 | |||
17 | PID = "${@os.getpid()}" | ||
18 | |||
19 | EXCLUDE_FROM_WORLD = "1" | ||
20 | |||
21 | python () { | ||
22 | # If we don't do this we try and run the mapping hooks while parsing which is slow | ||
23 | # bitbake should really provide something to let us know this... | ||
24 | if bb.data.getVar('BB_WORKERCONTEXT', d, True) is not None: | ||
25 | runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d) | ||
26 | } | ||
27 | |||
28 | fakeroot do_populate_sdk() { | ||
29 | rm -rf ${SDK_OUTPUT} | ||
30 | mkdir -p ${SDK_OUTPUT} | ||
31 | |||
32 | # populate_sdk_<image> is required to construct two images: | ||
33 | # SDK_ARCH-nativesdk - contains the cross compiler and associated tooling | ||
34 | # target - contains a target rootfs configured for the SDK usage | ||
35 | # | ||
36 | # the output of populate_sdk_<image> should end up in ${SDK_OUTPUT} it is made | ||
37 | # up of: | ||
38 | # ${SDK_OUTPUT}/<sdk_arch-nativesdk pkgs> | ||
39 | # ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/<target pkgs> | ||
40 | |||
41 | populate_sdk_${IMAGE_PKGTYPE} | ||
42 | |||
43 | # Don't ship any libGL in the SDK | ||
44 | rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL* | ||
45 | |||
46 | # Can copy pstage files here | ||
47 | # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '` | ||
48 | |||
49 | # Fix or remove broken .la files | ||
50 | #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la | ||
51 | rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la | ||
52 | |||
53 | # Link the ld.so.cache file into the hosts filesystem | ||
54 | ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache | ||
55 | |||
56 | # Setup site file for external use | ||
57 | toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} | ||
58 | |||
59 | toolchain_create_sdk_env_script | ||
60 | |||
61 | # Add version information | ||
62 | toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} | ||
63 | |||
64 | # Package it up | ||
65 | mkdir -p ${SDK_DEPLOY} | ||
66 | cd ${SDK_OUTPUT} | ||
67 | tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . | ||
68 | } | ||
69 | |||
70 | populate_sdk_log_check() { | ||
71 | for target in $* | ||
72 | do | ||
73 | lf_path="`dirname ${BB_LOGFILE}`/log.do_$target.${PID}" | ||
74 | |||
75 | echo "log_check: Using $lf_path as logfile" | ||
76 | |||
77 | if test -e "$lf_path" | ||
78 | then | ||
79 | ${IMAGE_PKGTYPE}_log_check $target $lf_path | ||
80 | else | ||
81 | echo "Cannot find logfile [$lf_path]" | ||
82 | fi | ||
83 | echo "Logfile is clean" | ||
84 | done | ||
85 | } | ||
86 | |||
87 | do_populate_sdk[nostamp] = "1" | ||
88 | do_populate_sdk[recrdeptask] = "do_package_write" | ||
89 | addtask populate_sdk | ||