1 SUMMARY = "Distribution build manifest"
2 DESCRIPTION = "The folder /etc/platform-info 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 jq-native"
11 # force a rebuild everytime a build is started
12 do_compile[nostamp] = "1"
14 # borrowed to os-release.bb (output format is very close)
15 python do_compilestep1 () {
17 with open(d.expand('${B}/bbinfo-deploy'),'w') as f:
19 for field in d.getVar('BUILD_MANIFEST_FIELDS_DEPLOY').split():
20 key='DIST_BB_{0}'.format(field)
24 f.write('{0}="{1}"\n'.format(key,value))
25 f.write('declare -A BITBAKE_VARS\nBITBAKE_VARS[deploy]="%s"' % ' '.join(allkeys))
27 with open(d.expand('${B}/bbinfo-target'),'w') as f:
29 for field in d.getVar('BUILD_MANIFEST_FIELDS_TARGET').split():
30 key='DIST_BB_{0}'.format(field)
34 f.write('{0}="{1}"\n'.format(key,value))
35 f.write('declare -A BITBAKE_VARS\nBITBAKE_VARS[target]="%s"' % ' '.join(allkeys))
37 with open(d.expand('${B}/bbinfo-sdk'),'w') as f:
39 for field in d.getVar('BUILD_MANIFEST_FIELDS_SDK').split():
40 key='DIST_BB_{0}'.format(field)
44 f.write('{0}="{1}"\n'.format(key,value))
45 f.write('declare -A BITBAKE_VARS\nBITBAKE_VARS[sdk]="%s"' % ' '.join(allkeys))
50 outfile=${B}/build-info
51 if [ -x "${DISTRO_MANIFEST_GENERATOR}" -a -f "${DISTRO_SETUP_MANIFEST}" ]; then
53 for format in bash json; do
54 if [ "$format" = "json" ]; then
59 for mode in deploy target sdk; do
60 ${DISTRO_MANIFEST_GENERATOR} -m $mode -f $format -s ${B}/bbinfo-${mode} ${DISTRO_SETUP_MANIFEST} >${outfile}-${mode}${ext}
62 if [ $rc -ne 0 ]; then
68 if [ -z "${DISTRO_MANIFEST_GENERATOR}" ]; then
69 echo "The name of the generation script is not defined."
70 elif [ ! -f "${DISTRO_MANIFEST_GENERATOR}" ]; then
71 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} is missing."
72 elif [ ! -x "${DISTRO_MANIFEST_GENERATOR}" ]; then
73 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} isn't executable."
75 if [ -z "${DISTRO_SETUP_MANIFEST}" ]; then
76 echo "The name of the data file is not defined."
77 elif [ ! -f "${DISTRO_SETUP_MANIFEST}" ]; then
78 echo "Data file ${DISTRO_SETUP_MANIFEST} is missing."
80 echo "You can try to rerun aglsetup.sh to solve that issue."
81 echo "You can also try to source agl-init-build-env instead of oe-init-build-env."
84 if [ "$rc" -ne 0 ]; then
85 echo "distro-build-manifest generation failed."
90 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_DEPLOY}"
91 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_TARGET}"
92 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_SDK}"
94 # combine the two steps
96 bb.build.exec_func("do_compilestep1",d)
97 bb.build.exec_func("do_compilestep2",d)
101 # install in target dir
102 install -d ${D}${sysconfdir}/platform-info
103 install -m 0644 build-info-target ${D}${sysconfdir}/platform-info/build
104 install -m 0644 build-info-target.json ${D}${sysconfdir}/platform-info/build.json
106 # also copy in deploy dir
107 install -d ${DEPLOY_DIR_IMAGE}
108 install -m 0644 build-info-deploy ${DEPLOY_DIR_IMAGE}/build-info
109 install -m 0644 build-info-deploy.json ${DEPLOY_DIR_IMAGE}/build-info.json
111 # copy into sdk deploy dir
112 install -d ${DEPLOY_DIR}/sdk
113 install -m 0644 build-info-sdk ${DEPLOY_DIR}/sdk/${SDK_NAME}.build-info
114 install -m 0644 build-info-sdk.json ${DEPLOY_DIR}/sdk/${SDK_NAME}.build-info.json
116 # and copy to nativesdk package
120 # list of variables to add to the various manifests
121 # smalles one is 'target', then 'deploy' and finally 'sdk'
122 BUILD_MANIFEST_FIELDS_TARGET = "\
128 DISTRO_BRANCH_VERSION_TAG \
134 BUILD_MANIFEST_FIELDS_DEPLOY = "\
135 ${BUILD_MANIFEST_FIELDS_TARGET} \
141 ALL_MULTILIB_PACKAGE_ARCHS \
144 BUILD_MANIFEST_FIELDS_SDK = "\
145 ${BUILD_MANIFEST_FIELDS_DEPLOY} \
155 # dont exec useless tasks
156 do_fetch[noexec] = "1"
157 do_unpack[noexec] = "1"
158 do_patch[noexec] = "1"
159 do_configure[noexec] = "1"