blob: 19422fc052d4ebc9815d8fe7673fdb9a357d9328 [file] [log] [blame]
Brad Bishop97cce002017-07-22 14:49:25 -04001# Base image class extension, inlined into every image.
2
Saqib Khan41723472017-09-22 10:21:30 -05003inherit image_version
Brad Bishop97cce002017-07-22 14:49:25 -04004
Brad Bishop19fc4f82017-08-04 23:38:54 -04005# Phosphor image types
6#
Brad Bishop3aa1ef62017-08-04 23:48:12 -04007# Phosphor OpenBMC supports a fixed partition mtd layout,
8# A dynamic mtd with ubi layout, and a tar file for use with
9# The reference BMC software update implementation.
Brad Bishop19fc4f82017-08-04 23:38:54 -040010
11# Image composition
Brad Bishop8623bbe2018-03-09 00:04:00 -050012FLASH_KERNEL_IMAGE ?= "fitImage-${INITRAMFS_IMAGE}-${MACHINE}.bin"
13FLASH_KERNEL_IMAGE_df-obmc-ubi-fs ?= "fitImage-${MACHINE}.bin"
14
Brad Bishop19fc4f82017-08-04 23:38:54 -040015IMAGE_BASETYPE ?= "squashfs-xz"
16OVERLAY_BASETYPE ?= "jffs2"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040017FLASH_UBI_BASETYPE ?= "${IMAGE_BASETYPE}"
18FLASH_UBI_OVERLAY_BASETYPE ?= "ubifs"
Brad Bishop19fc4f82017-08-04 23:38:54 -040019
Brad Bishop02ee6ae2018-03-30 08:43:23 -040020IMAGE_TYPES += "mtd-static mtd-static-alltar mtd-static-tar mtd-ubi mtd-ubi-tar"
Brad Bishop19fc4f82017-08-04 23:38:54 -040021
22IMAGE_TYPEDEP_mtd-static = "${IMAGE_BASETYPE}"
23IMAGE_TYPEDEP_mtd-static-tar = "${IMAGE_BASETYPE}"
24IMAGE_TYPEDEP_mtd-static-alltar = "mtd-static"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040025IMAGE_TYPEDEP_mtd-ubi = "${FLASH_UBI_BASETYPE}"
26IMAGE_TYPEDEP_mtd-ubi-tar = "${FLASH_UBI_BASETYPE}"
Brad Bishop02ee6ae2018-03-30 08:43:23 -040027IMAGE_TYPES_MASKED += "mtd-static mtd-static-alltar mtd-static-tar mtd-ubi mtd-ubi-tar"
Brad Bishop19fc4f82017-08-04 23:38:54 -040028
Brad Bishop3aa1ef62017-08-04 23:48:12 -040029# Flash characteristics in KB unless otherwise noted
Brad Bishop19fc4f82017-08-04 23:38:54 -040030FLASH_SIZE ?= "32768"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040031FLASH_PEB_SIZE ?= "64"
32# Flash page and overhead sizes in bytes
33FLASH_PAGE_SIZE ?= "1"
34FLASH_NOR_UBI_OVERHEAD ?= "64"
Brad Bishop19fc4f82017-08-04 23:38:54 -040035
36# Fixed partition offsets
37FLASH_UBOOT_OFFSET ?= "0"
38FLASH_KERNEL_OFFSET ?= "512"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040039FLASH_UBI_OFFSET ?= "${FLASH_KERNEL_OFFSET}"
Brad Bishop19fc4f82017-08-04 23:38:54 -040040FLASH_ROFS_OFFSET ?= "4864"
41FLASH_RWFS_OFFSET ?= "28672"
42
Brad Bishop3aa1ef62017-08-04 23:48:12 -040043# UBI volume sizes in KB unless otherwise noted.
Adriana Kobylakb70005d2018-02-14 16:35:30 -060044FLASH_UBI_RWFS_SIZE ?= "6144"
45FLASH_UBI_RWFS_TXT_SIZE ?= "6MiB"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040046
Eddie Jamesb2b7ff62018-02-09 11:59:18 -060047SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
48INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}"
49SIGNING_KEY_DEPENDS = "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native:do_populate_sysroot', '', d)}"
50
Brad Bishop3e37d382018-03-31 12:17:28 -040051UBOOT_SUFFIX ?= "bin"
52
Brad Bishop3aa1ef62017-08-04 23:48:12 -040053python() {
54 # Compute rwfs LEB count and LEB size.
55 page_size = d.getVar('FLASH_PAGE_SIZE', True)
56 nor_overhead_size = d.getVar('FLASH_NOR_UBI_OVERHEAD', True)
57 overhead_size = max(int(page_size), int(nor_overhead_size))
58 peb_size = d.getVar('FLASH_PEB_SIZE', True)
59 leb_size = (int(peb_size) * 1024) - (2 * overhead_size)
60 d.setVar('FLASH_LEB_SIZE', str(leb_size)) # In bytes
61
62 rwfs_size = d.getVar('FLASH_UBI_RWFS_SIZE', True)
63 rwfs_size = int(rwfs_size) * 1024
64 lebs = int((rwfs_size + leb_size - 1) / leb_size) # Rounding up
65 d.setVar('FLASH_UBI_RWFS_LEBS', str(lebs))
66}
67
Brad Bishop19fc4f82017-08-04 23:38:54 -040068# Allow rwfs mkfs configuration through OVERLAY_MKFS_OPTS and OVERRIDES. However,
69# avoid setting 'ext4' or 'jffs2' in OVERRIDES as such raw filesystem types are
70# reserved for the primary image (and setting them currently breaks the build).
71# Instead, prefix the overlay override value with 'rwfs-' to avoid collisions.
72DISTROOVERRIDES .= ":static-rwfs-${OVERLAY_BASETYPE}"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040073DISTROOVERRIDES .= ":ubi-rwfs-${FLASH_UBI_OVERLAY_BASETYPE}"
Brad Bishop19fc4f82017-08-04 23:38:54 -040074
75JFFS2_RWFS_CMD = "mkfs.jffs2 --root=jffs2 --faketime --output=rwfs.jffs2"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040076UBIFS_RWFS_CMD = "mkfs.ubifs -r ubifs -c ${FLASH_UBI_RWFS_LEBS} -m ${FLASH_PAGE_SIZE} -e ${FLASH_LEB_SIZE} rwfs.ubifs"
Brad Bishop19fc4f82017-08-04 23:38:54 -040077
78FLASH_STATIC_RWFS_CMD_static-rwfs-jffs2 = "${JFFS2_RWFS_CMD}"
Brad Bishop3aa1ef62017-08-04 23:48:12 -040079FLASH_UBI_RWFS_CMD_ubi-rwfs-jffs2 = "${JFFS2_RWFS_CMD}"
80FLASH_UBI_RWFS_CMD_ubi-rwfs-ubifs = "${UBIFS_RWFS_CMD}"
Brad Bishop19fc4f82017-08-04 23:38:54 -040081
82mk_nor_image() {
83 image_dst="$1"
84 image_size_kb=$2
85 dd if=/dev/zero bs=1k count=$image_size_kb \
86 | tr '\000' '\377' > $image_dst
87}
88
89make_rwfs() {
90 type=$1
91 cmd=$2
92 shift
93 shift
94 opts="$@"
95
96 rm -f rwfs.$type
97 rm -rf $type
98 mkdir $type
99
100 $cmd $opts
101}
102
103do_generate_rwfs_static() {
104 make_rwfs ${OVERLAY_BASETYPE} "${FLASH_STATIC_RWFS_CMD}" ${OVERLAY_MKFS_OPTS}
105}
106do_generate_rwfs_static[dirs] = " ${S}/static"
107do_generate_rwfs_static[depends] += " \
108 mtd-utils-native:do_populate_sysroot \
109 "
110
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400111do_generate_rwfs_ubi() {
112 make_rwfs ${FLASH_UBI_OVERLAY_BASETYPE} "${FLASH_UBI_RWFS_CMD}"
113}
114do_generate_rwfs_ubi[dirs] = " ${S}/ubi"
115do_generate_rwfs_ubi[depends] += " \
116 mtd-utils-native:do_populate_sysroot \
117 "
118
119add_volume() {
120 config_file=$1
121 vol_id=$2
122 vol_type=$3
123 vol_name=$4
124 image=$5
125 vol_size=$6
126
127 echo \[$vol_name\] >> $config_file
128 echo mode=ubi >> $config_file
129 echo image=$image >> $config_file
130 echo vol_type=$vol_type >> $config_file
131 echo vol_name=$vol_name >> $config_file
132 echo vol_id=$vol_id >> $config_file
133 if [ ! -z $vol_size ]; then
134 echo vol_size=$vol_size >> $config_file
135 fi
136}
137
Saqib Khan41723472017-09-22 10:21:30 -0500138python do_generate_ubi() {
139 version_id = do_get_versionID(d)
140 d.setVar('VERSION_ID', version_id)
141 bb.build.exec_func("do_make_ubi", d)
142}
143do_generate_ubi[dirs] = "${S}/ubi"
144do_generate_ubi[depends] += " \
145 ${PN}:do_image_${@d.getVar('FLASH_UBI_BASETYPE', True).replace('-', '_')} \
146 virtual/kernel:do_deploy \
147 u-boot:do_populate_sysroot \
148 mtd-utils-native:do_populate_sysroot \
149 "
150
151do_make_ubi() {
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400152 cfg=ubinize-${IMAGE_NAME}.cfg
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400153 rm -f $cfg ubi-img
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400154 # Construct the ubinize config file
Saqib Khan41723472017-09-22 10:21:30 -0500155 add_volume $cfg 0 static kernel-${VERSION_ID} \
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400156 ${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE}
157
Saqib Khan41723472017-09-22 10:21:30 -0500158 add_volume $cfg 1 static rofs-${VERSION_ID} \
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400159 ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${FLASH_UBI_BASETYPE}
160
161 add_volume $cfg 2 dynamic rwfs rwfs.${FLASH_UBI_OVERLAY_BASETYPE} ${FLASH_UBI_RWFS_TXT_SIZE}
162
163 # Build the ubi partition image
164 ubinize -p ${FLASH_PEB_SIZE}KiB -m ${FLASH_PAGE_SIZE} -o ubi-img $cfg
165
166 # Concatenate the uboot and ubi partitions
167 mk_nor_image ${IMGDEPLOYDIR}/${IMAGE_NAME}.ubi.mtd ${FLASH_SIZE}
168 dd bs=1k conv=notrunc seek=${FLASH_UBOOT_OFFSET} \
169 if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
170 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.ubi.mtd
171 dd bs=1k conv=notrunc seek=${FLASH_UBI_OFFSET} \
172 if=ubi-img \
173 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.ubi.mtd
174
175 cd ${IMGDEPLOYDIR}
176 ln -sf ${IMAGE_NAME}.ubi.mtd ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ubi.mtd
177}
Saqib Khan41723472017-09-22 10:21:30 -0500178do_make_ubi[dirs] = "${S}/ubi"
179do_make_ubi[depends] += " \
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400180 ${PN}:do_image_${@d.getVar('FLASH_UBI_BASETYPE', True).replace('-', '_')} \
181 virtual/kernel:do_deploy \
182 u-boot:do_populate_sysroot \
183 mtd-utils-native:do_populate_sysroot \
184 "
185
Brad Bishop19fc4f82017-08-04 23:38:54 -0400186do_generate_static() {
187 # Assemble the flash image
188 mk_nor_image ${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd ${FLASH_SIZE}
189 dd bs=1k conv=notrunc seek=${FLASH_UBOOT_OFFSET} \
190 if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
191 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd
192
193 dd bs=1k conv=notrunc seek=${FLASH_KERNEL_OFFSET} \
194 if=${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE} \
195 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd
196
197 dd bs=1k conv=notrunc seek=${FLASH_ROFS_OFFSET} \
198 if=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${IMAGE_BASETYPE} \
199 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd
200
201 dd bs=1k conv=notrunc seek=${FLASH_RWFS_OFFSET} \
202 if=rwfs.${OVERLAY_BASETYPE} \
203 of=${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd
204 # File needed for generating non-standard legacy links below
205 cp rwfs.${OVERLAY_BASETYPE} ${IMGDEPLOYDIR}/rwfs.${OVERLAY_BASETYPE}
206
207 cd ${IMGDEPLOYDIR}
208 ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.static.mtd
209
210 # Maintain non-standard legacy links
211 ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/flash-${MACHINE}
212 ln -sf ${IMAGE_NAME}.static.mtd ${IMGDEPLOYDIR}/image-bmc
213 ln -sf u-boot.${UBOOT_SUFFIX} ${IMGDEPLOYDIR}/image-u-boot
214 ln -sf ${FLASH_KERNEL_IMAGE} ${IMGDEPLOYDIR}/image-kernel
215 ln -sf ${IMAGE_LINK_NAME}.${IMAGE_BASETYPE} ${IMGDEPLOYDIR}/image-rofs
216 ln -sf rwfs.${OVERLAY_BASETYPE} ${IMGDEPLOYDIR}/image-rwfs
217}
218do_generate_static[dirs] = "${S}/static"
219do_generate_static[depends] += " \
220 ${PN}:do_image_${@d.getVar('IMAGE_BASETYPE', True).replace('-', '_')} \
221 virtual/kernel:do_deploy \
222 u-boot:do_populate_sysroot \
223 "
224
Lei YUf2072212018-06-20 13:27:34 +0800225make_signatures() {
226 signature_files=""
227 for file in "$@"; do
228 openssl dgst -sha256 -sign ${SIGNING_KEY} -out "${file}.sig" $file
229 signature_files="${signature_files} ${file}.sig"
230 done
231}
232
Brad Bishop19fc4f82017-08-04 23:38:54 -0400233do_generate_static_alltar() {
Lei YUa4674942018-05-23 14:01:14 +0800234 ln -sf ${S}/MANIFEST MANIFEST
235 ln -sf ${S}/publickey publickey
Brad Bishop19fc4f82017-08-04 23:38:54 -0400236 ln -sf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.static.mtd image-bmc
Lei YUa4674942018-05-23 14:01:14 +0800237
Lei YUf2072212018-06-20 13:27:34 +0800238 make_signatures image-bmc MANIFEST publickey
Lei YUa4674942018-05-23 14:01:14 +0800239
240 tar -h -cvf ${IMGDEPLOYDIR}/${IMAGE_NAME}.static.mtd.all.tar \
241 image-bmc MANIFEST publickey ${signature_files}
Brad Bishop19fc4f82017-08-04 23:38:54 -0400242
243 cd ${IMGDEPLOYDIR}
244
245 ln -sf ${IMAGE_NAME}.static.mtd.all.tar \
246 ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.static.mtd.all.tar
247
248 # Maintain non-standard legacy link.
249 ln -sf ${IMAGE_NAME}.static.mtd.all.tar \
250 ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.all.tar
Lei YUa4674942018-05-23 14:01:14 +0800251
Brad Bishop19fc4f82017-08-04 23:38:54 -0400252}
253do_generate_static_alltar[vardepsexclude] = "DATETIME"
254do_generate_static_alltar[dirs] = "${S}/static"
Lei YUa4674942018-05-23 14:01:14 +0800255do_generate_static_alltar[depends] += " \
256 openssl-native:do_populate_sysroot \
257 ${SIGNING_KEY_DEPENDS} \
258 ${PN}:do_copy_signing_pubkey \
259 "
Brad Bishop19fc4f82017-08-04 23:38:54 -0400260
Brad Bishopde659382018-03-30 01:46:16 -0400261make_image_links() {
Brad Bishop19fc4f82017-08-04 23:38:54 -0400262 rwfs=$1
263 rofs=$2
Brad Bishop19fc4f82017-08-04 23:38:54 -0400264 shift
265 shift
Brad Bishop19fc4f82017-08-04 23:38:54 -0400266
Brad Bishopde659382018-03-30 01:46:16 -0400267 # Create some links to help make the tar archive in the format
268 # expected by phosphor-bmc-code-mgmt.
Brad Bishop19fc4f82017-08-04 23:38:54 -0400269 ln -sf ${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} image-u-boot
270 ln -sf ${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE} image-kernel
271 ln -sf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$rofs image-rofs
272 ln -sf rwfs.$rwfs image-rwfs
Brad Bishopde659382018-03-30 01:46:16 -0400273}
274
275make_tar_of_images() {
276 type=$1
277 shift
278 extra_files="$@"
Brad Bishop19fc4f82017-08-04 23:38:54 -0400279
280 # Create the tar archive
281 tar -h -cvf ${IMGDEPLOYDIR}/${IMAGE_NAME}.$type.mtd.tar \
282 image-u-boot image-kernel image-rofs image-rwfs $extra_files
283
284 cd ${IMGDEPLOYDIR}
285 ln -sf ${IMAGE_NAME}.$type.mtd.tar ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$type.mtd.tar
286}
287
288do_generate_static_tar() {
Lei YUa4674942018-05-23 14:01:14 +0800289 ln -sf ${S}/MANIFEST MANIFEST
290 ln -sf ${S}/publickey publickey
Brad Bishopde659382018-03-30 01:46:16 -0400291 make_image_links ${OVERLAY_BASETYPE} ${IMAGE_BASETYPE}
Lei YUf2072212018-06-20 13:27:34 +0800292 make_signatures image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey
Lei YUa4674942018-05-23 14:01:14 +0800293 make_tar_of_images static MANIFEST publickey ${signature_files}
Brad Bishop19fc4f82017-08-04 23:38:54 -0400294
295 # Maintain non-standard legacy link.
296 cd ${IMGDEPLOYDIR}
297 ln -sf ${IMAGE_NAME}.static.mtd.tar ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.tar
298}
299do_generate_static_tar[dirs] = " ${S}/static"
300do_generate_static_tar[depends] += " \
301 ${PN}:do_image_${@d.getVar('IMAGE_BASETYPE', True).replace('-', '_')} \
302 virtual/kernel:do_deploy \
303 u-boot:do_populate_sysroot \
Lei YUa4674942018-05-23 14:01:14 +0800304 openssl-native:do_populate_sysroot \
305 ${SIGNING_KEY_DEPENDS} \
306 ${PN}:do_copy_signing_pubkey \
Brad Bishop19fc4f82017-08-04 23:38:54 -0400307 "
308do_generate_static_tar[vardepsexclude] = "DATETIME"
309
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400310do_generate_ubi_tar() {
311 ln -sf ${S}/MANIFEST MANIFEST
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600312 ln -sf ${S}/publickey publickey
Brad Bishopde659382018-03-30 01:46:16 -0400313 make_image_links ${FLASH_UBI_OVERLAY_BASETYPE} ${FLASH_UBI_BASETYPE}
Lei YUf2072212018-06-20 13:27:34 +0800314 make_signatures image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey
315 make_tar_of_images ubi MANIFEST publickey ${signature_files}
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400316}
317do_generate_ubi_tar[dirs] = " ${S}/ubi"
318do_generate_ubi_tar[depends] += " \
319 ${PN}:do_image_${@d.getVar('FLASH_UBI_BASETYPE', True).replace('-', '_')} \
320 virtual/kernel:do_deploy \
321 u-boot:do_populate_sysroot \
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600322 openssl-native:do_populate_sysroot \
323 ${SIGNING_KEY_DEPENDS} \
324 ${PN}:do_copy_signing_pubkey \
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400325 "
326
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600327def get_pubkey_basedir(d):
328 return os.path.join(
329 d.getVar('STAGING_DIR_TARGET', True),
330 d.getVar('sysconfdir', True).strip(os.sep),
331 'activationdata')
332
333def get_pubkey_type(d):
334 return os.listdir(get_pubkey_basedir(d))[0]
335
336def get_pubkey_path(d):
337 return os.path.join(
338 get_pubkey_basedir(d),
339 get_pubkey_type(d),
340 'publickey')
341
Brad Bishop19fc4f82017-08-04 23:38:54 -0400342python do_generate_phosphor_manifest() {
Saqib Khan41723472017-09-22 10:21:30 -0500343 version = do_get_version(d)
Brad Bishop19fc4f82017-08-04 23:38:54 -0400344 with open('MANIFEST', 'w') as fd:
345 fd.write('purpose=xyz.openbmc_project.Software.Version.VersionPurpose.BMC\n')
346 fd.write('version={}\n'.format(version.strip('"')))
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600347 fd.write('KeyType={}\n'.format(get_pubkey_type(d)))
348 fd.write('HashType=RSA-SHA256\n')
Brad Bishop19fc4f82017-08-04 23:38:54 -0400349}
350do_generate_phosphor_manifest[dirs] = "${S}"
351do_generate_phosphor_manifest[depends] += " \
352 os-release:do_populate_sysroot \
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600353 phosphor-image-signing:do_populate_sysroot \
Brad Bishop19fc4f82017-08-04 23:38:54 -0400354 "
355
Eddie Jamesb2b7ff62018-02-09 11:59:18 -0600356python do_copy_signing_pubkey() {
357 with open(get_pubkey_path(d), 'r') as read_fd:
358 with open('publickey', 'w') as write_fd:
359 write_fd.write(read_fd.read())
360}
361
362do_copy_signing_pubkey[dirs] = "${S}"
363do_copy_signing_pubkey[depends] += " \
364 phosphor-image-signing:do_populate_sysroot \
365 "
366
367addtask copy_signing_pubkey after do_rootfs
Brad Bishop19fc4f82017-08-04 23:38:54 -0400368addtask generate_phosphor_manifest after do_rootfs
369addtask generate_rwfs_static after do_rootfs
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400370addtask generate_rwfs_ubi after do_rootfs
Brad Bishop19fc4f82017-08-04 23:38:54 -0400371
372python() {
373 types = d.getVar('IMAGE_FSTYPES', True).split()
374
375 if any([x in types for x in ['mtd-static', 'mtd-static-alltar']]):
376 bb.build.addtask(
377 'do_generate_static',
378 'do_image_complete',
379 'do_generate_rwfs_static', d)
380 if 'mtd-static-alltar' in types:
381 bb.build.addtask(
382 'do_generate_static_alltar',
383 'do_image_complete',
Lei YUa4674942018-05-23 14:01:14 +0800384 'do_generate_static do_generate_phosphor_manifest', d)
Brad Bishop19fc4f82017-08-04 23:38:54 -0400385 if 'mtd-static-tar' in types:
386 bb.build.addtask(
387 'do_generate_static_tar',
388 'do_image_complete',
Lei YUa4674942018-05-23 14:01:14 +0800389 'do_generate_rwfs_static do_generate_phosphor_manifest', d)
Brad Bishop3aa1ef62017-08-04 23:48:12 -0400390
391 if 'mtd-ubi' in types:
392 bb.build.addtask(
393 'do_generate_ubi',
394 'do_image_complete',
395 'do_generate_rwfs_ubi', d)
396 if 'mtd-ubi-tar' in types:
397 bb.build.addtask(
398 'do_generate_ubi_tar',
399 'do_image_complete',
400 'do_generate_rwfs_ubi do_generate_phosphor_manifest', d)
Brad Bishop19fc4f82017-08-04 23:38:54 -0400401}