1 SUMMARY = "Distribution build manifest"
2 DESCRIPTION = "The /etc/platform-build-info file contains build manifest (SPEC-720)."
5 # information distributed by the package is machine specific
6 PACKAGE_ARCH = "${MACHINE_ARCH}"
8 # dependencies of ${DISTRO_MANIFEST_GENERATOR}
9 DEPENDS = "coreutils-native bash-native git-native gawk-native sed-native"
11 # force a rebuild everytime a build is started
12 do_compile[nostamp] = "1"
16 outfile=${B}/platform-build-info
17 if [ -x "${DISTRO_MANIFEST_GENERATOR}" -a -f "${DISTRO_SETUP_MANIFEST}" ]; then
18 ${DISTRO_MANIFEST_GENERATOR} ${DISTRO_SETUP_MANIFEST} deploy >${outfile}-deploy
20 ${DISTRO_MANIFEST_GENERATOR} ${DISTRO_SETUP_MANIFEST} target >${outfile}-target
22 ${DISTRO_MANIFEST_GENERATOR} ${DISTRO_SETUP_MANIFEST} sdk >${outfile}-sdk
25 if [ "$rc1" -ne 0 -o "$rc2" -ne 0 -o "$rc3" -ne 0 ]; then
29 if [ -z "${DISTRO_MANIFEST_GENERATOR}" ]; then
30 echo "The name of the generation script is not defined."
31 elif [ ! -f "${DISTRO_MANIFEST_GENERATOR}" ]; then
32 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} is missing."
33 elif [ ! -x "${DISTRO_MANIFEST_GENERATOR}" ]; then
34 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} isn't executable."
36 if [ -z "${DISTRO_SETUP_MANIFEST}" ]; then
37 echo "The name of the data file is not defined."
38 elif [ ! -f "${DISTRO_SETUP_MANIFEST}" ]; then
39 echo "Data file ${DISTRO_SETUP_MANIFEST} is missing."
41 echo "You can try to rerun aglsetup.sh to solve that issue."
42 echo "You can also try to source agl-init-build-env instead of oe-init-build-env."
45 if [ "$rc" -ne 0 ]; then
46 echo "distro-build-manifest generation failed."
51 # borrowed to os-release.bb (output format is very close)
52 python do_compilestep2 () {
54 with open(d.expand('${B}/platform-build-info-deploy'),'a') as f:
55 for field in d.getVar('BUILD_MANIFEST_FIELDS_DEPLOY').split():
58 f.write('DIST_BB_{0}="{1}"\n'.format(field,value))
60 with open(d.expand('${B}/platform-build-info-target'),'a') as f:
61 for field in d.getVar('BUILD_MANIFEST_FIELDS_TARGET').split():
64 f.write('DIST_BB_{0}="{1}"\n'.format(field,value))
66 with open(d.expand('${B}/platform-build-info-sdk'),'a') as f:
67 for field in d.getVar('BUILD_MANIFEST_FIELDS_SDK').split():
70 f.write('DIST_BB_{0}="{1}"\n'.format(field,value))
72 do_compilestep2[vardeps] += " ${BUILD_MANIFEST_FIELDS_DEPLOY}"
73 do_compilestep2[vardeps] += " ${BUILD_MANIFEST_FIELDS_TARGET}"
74 do_compilestep2[vardeps] += " ${BUILD_MANIFEST_FIELDS_SDK}"
76 # combine the two steps
78 bb.build.exec_func("do_compilestep1",d)
79 bb.build.exec_func("do_compilestep2",d)
83 # install in target dir
84 install -d ${D}${sysconfdir}
85 install -m 0644 platform-build-info-target ${D}${sysconfdir}/platform-build-info
87 # also copy in deploy dir
88 install -d ${DEPLOY_DIR_IMAGE}
89 install -m 0644 platform-build-info-deploy ${DEPLOY_DIR_IMAGE}/platform-build-info
91 # and copy to nativesdk package
95 # list of variables to add to the various manifests
96 # smalles one is 'target', then 'deploy' and finally 'sdk'
97 BUILD_MANIFEST_FIELDS_TARGET = "\
103 DISTRO_BRANCH_VERSION_TAG \
109 BUILD_MANIFEST_FIELDS_DEPLOY = "\
110 ${BUILD_MANIFEST_FIELDS_TARGET} \
116 ALL_MULTILIB_PACKAGE_ARCHS \
119 BUILD_MANIFEST_FIELDS_SDK = "\
120 ${BUILD_MANIFEST_FIELDS_DEPLOY} \
130 # dont exec useless tasks
131 do_fetch[noexec] = "1"
132 do_unpack[noexec] = "1"
133 do_patch[noexec] = "1"
134 do_configure[noexec] = "1"