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))
51 outfile=${B}/build-info
52 if [ -x "${DISTRO_MANIFEST_GENERATOR}" -a -f "${DISTRO_SETUP_MANIFEST}" ]; then
54 for format in bash json; do
55 if [ "$format" = "json" ]; then
60 for mode in deploy target sdk; do
61 ${DISTRO_MANIFEST_GENERATOR} -m $mode -f $format -t $timestamp -s ${B}/bbinfo-${mode} ${DISTRO_SETUP_MANIFEST} >${outfile}-${mode}${ext}
63 if [ $rc -ne 0 ]; then
69 if [ -z "${DISTRO_MANIFEST_GENERATOR}" ]; then
70 echo "The name of the generation script is not defined."
71 elif [ ! -f "${DISTRO_MANIFEST_GENERATOR}" ]; then
72 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} is missing."
73 elif [ ! -x "${DISTRO_MANIFEST_GENERATOR}" ]; then
74 echo "Generation script ${DISTRO_MANIFEST_GENERATOR} isn't executable."
76 if [ -z "${DISTRO_SETUP_MANIFEST}" ]; then
77 echo "The name of the data file is not defined."
78 elif [ ! -f "${DISTRO_SETUP_MANIFEST}" ]; then
79 echo "Data file ${DISTRO_SETUP_MANIFEST} is missing."
81 echo "You can try to rerun aglsetup.sh to solve that issue."
82 echo "You can also try to source agl-init-build-env instead of oe-init-build-env."
85 if [ "$rc" -ne 0 ]; then
86 echo "distro-build-manifest generation failed."
91 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_DEPLOY}"
92 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_TARGET}"
93 do_compilestep1[vardeps] += " ${BUILD_MANIFEST_FIELDS_SDK}"
95 # avoid errors "ERROR: When reparsing .../distro-build-manifest/distro-build-manifest.bb.do_compile, the basehash value changed from .... to .... . The metadata is not deterministic and this needs to be fixed."
96 do_compilestep2[vardepsexclude] = "DATETIME"
98 # combine the two steps
100 bb.build.exec_func("do_compilestep1",d)
101 bb.build.exec_func("do_compilestep2",d)
105 # install in target dir
106 install -d ${D}${sysconfdir}/platform-info
107 install -m 0644 build-info-target ${D}${sysconfdir}/platform-info/build
108 install -m 0644 build-info-target.json ${D}${sysconfdir}/platform-info/build.json
110 # also copy in deploy dir
111 install -d ${DEPLOY_DIR_IMAGE}
112 install -m 0644 build-info-deploy ${DEPLOY_DIR_IMAGE}/build-info
113 install -m 0644 build-info-deploy.json ${DEPLOY_DIR_IMAGE}/build-info.json
115 # copy into sdk deploy dir
116 install -d ${DEPLOY_DIR}/sdk
117 install -m 0644 build-info-sdk ${DEPLOY_DIR}/sdk/${SDK_NAME}.build-info
118 install -m 0644 build-info-sdk.json ${DEPLOY_DIR}/sdk/${SDK_NAME}.build-info.json
120 # and copy to nativesdk package
124 # list of variables to add to the various manifests
125 # smalles one is 'target', then 'deploy' and finally 'sdk'
126 BUILD_MANIFEST_FIELDS_TARGET = "\
132 DISTRO_BRANCH_VERSION_TAG \
138 BUILD_MANIFEST_FIELDS_DEPLOY = "\
139 ${BUILD_MANIFEST_FIELDS_TARGET} \
145 ALL_MULTILIB_PACKAGE_ARCHS \
148 BUILD_MANIFEST_FIELDS_SDK = "\
149 ${BUILD_MANIFEST_FIELDS_DEPLOY} \
159 # dont exec useless tasks
160 do_fetch[noexec] = "1"
161 do_unpack[noexec] = "1"
162 do_patch[noexec] = "1"
163 do_configure[noexec] = "1"