xref: /openbmc/openbmc/poky/meta/classes-recipe/image_types.bbclass (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7# The default aligment of the size of the rootfs is set to 1KiB. In case
8# you're using the SD card emulation of a QEMU system simulator you may
9# set this value to 2048 (2MiB alignment).
10IMAGE_ROOTFS_ALIGNMENT ?= "1"
11
12def imagetypes_getdepends(d):
13    def adddep(depstr, deps):
14        for d in (depstr or "").split():
15            # Add task dependency if not already present
16            if ":" not in d:
17                d += ":do_populate_sysroot"
18            deps.add(d)
19
20    # Take a type in the form of foo.bar.car and split it into the items
21    # needed for the image deps "foo", and the conversion deps ["bar", "car"]
22    def split_types(typestring):
23        types = typestring.split(".")
24        return types[0], types[1:]
25
26    fstypes = set((d.getVar('IMAGE_FSTYPES') or "").split())
27    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS') or "").split())
28
29    deprecated = set()
30    deps = set()
31    for typestring in fstypes:
32        basetype, resttypes = split_types(typestring)
33
34        var = "IMAGE_DEPENDS_%s" % basetype
35        if d.getVar(var) is not None:
36            deprecated.add(var)
37
38        for typedepends in (d.getVar("IMAGE_TYPEDEP:%s" % basetype) or "").split():
39            base, rest = split_types(typedepends)
40            resttypes += rest
41
42            var = "IMAGE_DEPENDS_%s" % base
43            if d.getVar(var) is not None:
44                deprecated.add(var)
45
46        for ctype in resttypes:
47            adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype), deps)
48            adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype), deps)
49
50    if deprecated:
51        bb.fatal('Deprecated variable(s) found: "%s". '
52                 'Use do_image_<type>[depends] += "<recipe>:<task>" instead' % ', '.join(deprecated))
53
54    # Sort the set so that ordering is consistant
55    return " ".join(sorted(deps))
56
57XZ_COMPRESSION_LEVEL ?= "-6"
58XZ_INTEGRITY_CHECK ?= "crc32"
59
60ZIP_COMPRESSION_LEVEL ?= "-9"
61
627ZIP_COMPRESSION_LEVEL ?= "9"
637ZIP_COMPRESSION_METHOD ?= "BZip2"
647ZIP_EXTENSION ?= "7z"
65
66JFFS2_SUM_EXTRA_ARGS ?= ""
67IMAGE_CMD:jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${IMGDEPLOYDIR}/${IMAGE_NAME}.jffs2 ${EXTRA_IMAGECMD}"
68
69IMAGE_CMD:cramfs = "mkfs.cramfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.cramfs ${EXTRA_IMAGECMD}"
70
71oe_mkext234fs () {
72	fstype=$1
73	extra_imagecmd=""
74
75	if [ $# -gt 1 ]; then
76		shift
77		extra_imagecmd=$@
78	fi
79
80	# If generating an empty image the size of the sparse block should be large
81	# enough to allocate an ext4 filesystem using 4096 bytes per inode, this is
82	# about 60K, so dd needs a minimum count of 60, with bs=1024 (bytes per IO)
83	eval local COUNT=\"0\"
84	eval local MIN_COUNT=\"60\"
85	if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then
86		eval COUNT=\"$MIN_COUNT\"
87	fi
88	# Create a sparse image block
89	bbdebug 1 Executing "dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024"
90	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
91	bbdebug 1 "Actual Rootfs size:  `du -s ${IMAGE_ROOTFS}`"
92	bbdebug 1 "Actual Partition size: `stat -c '%s' ${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype`"
93	bbdebug 1 Executing "mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype -d ${IMAGE_ROOTFS}"
94	mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype -d ${IMAGE_ROOTFS}
95	# Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected)
96	fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}.$fstype || [ $? -le 3 ]
97}
98
99IMAGE_CMD:ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
100IMAGE_CMD:ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
101IMAGE_CMD:ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
102
103MIN_BTRFS_SIZE ?= "16384"
104IMAGE_CMD:btrfs () {
105	size=${ROOTFS_SIZE}
106	if [ ${size} -lt ${MIN_BTRFS_SIZE} ] ; then
107		size=${MIN_BTRFS_SIZE}
108		bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K"
109	fi
110	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.btrfs seek=${size} count=0 bs=1024
111	mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.btrfs
112}
113
114oe_mksquashfs () {
115    local comp=$1; shift
116    local extra_imagecmd="$@"
117
118    if [ "$comp" = "zstd" ]; then
119        suffix="zst"
120    fi
121
122    # Use the bitbake reproducible timestamp instead of the hardcoded squashfs one
123    export SOURCE_DATE_EPOCH=$(stat -c '%Y' ${IMAGE_ROOTFS})
124    mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.squashfs${comp:+-}${suffix:-$comp} -noappend ${comp:+-comp }$comp $extra_imagecmd
125}
126IMAGE_CMD:squashfs = "oe_mksquashfs '' ${EXTRA_IMAGECMD}"
127IMAGE_CMD:squashfs-xz = "oe_mksquashfs xz ${EXTRA_IMAGECMD}"
128IMAGE_CMD:squashfs-lzo = "oe_mksquashfs lzo ${EXTRA_IMAGECMD}"
129IMAGE_CMD:squashfs-lz4 = "oe_mksquashfs lz4 ${EXTRA_IMAGECMD}"
130IMAGE_CMD:squashfs-zst = "oe_mksquashfs zstd ${EXTRA_IMAGECMD}"
131
132IMAGE_CMD:erofs = "mkfs.erofs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs ${IMAGE_ROOTFS}"
133IMAGE_CMD:erofs-lz4 = "mkfs.erofs -zlz4 ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs-lz4 ${IMAGE_ROOTFS}"
134IMAGE_CMD:erofs-lz4hc = "mkfs.erofs -zlz4hc ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs-lz4hc ${IMAGE_ROOTFS}"
135
136# Note that vfat can't handle all types of files that a real linux file system
137# can (e.g. device files, symlinks, etc.) and therefore it not suitable for all
138# use cases
139oe_mkvfatfs () {
140    mkfs.vfat $@ -C ${IMGDEPLOYDIR}/${IMAGE_NAME}.vfat ${ROOTFS_SIZE}
141    mcopy -i "${IMGDEPLOYDIR}/${IMAGE_NAME}.vfat" -vsmpQ ${IMAGE_ROOTFS}/* ::/
142}
143
144IMAGE_CMD:vfat = "oe_mkvfatfs ${EXTRA_IMAGECMD}"
145
146IMAGE_CMD_TAR ?= "tar"
147# ignore return code 1 "file changed as we read it" as other tasks(e.g. do_image_wic) may be hardlinking rootfs
148IMAGE_CMD:tar = "${IMAGE_CMD_TAR} --sort=name --format=posix --pax-option=delete=atime,delete=ctime --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
149SPDX_IMAGE_PURPOSE:tar = "archive"
150
151do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
152IMAGE_CMD:cpio () {
153	(cd ${IMAGE_ROOTFS} && find . | sort | cpio --reproducible -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}.cpio)
154	# We only need the /init symlink if we're building the real
155	# image. The -dbg image doesn't need it! By being clever
156	# about this we also avoid 'touch' below failing, as it
157	# might be trying to touch /sbin/init on the host since both
158	# the normal and the -dbg image share the same WORKDIR
159	if [ "${IMAGE_BUILDING_DEBUGFS}" != "true" ]; then
160		if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then
161			if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then
162				ln -sf /sbin/init ${WORKDIR}/cpio_append/init
163                                touch -h -r ${IMAGE_ROOTFS}/sbin/init ${WORKDIR}/cpio_append/init
164			else
165                                touch -r ${IMAGE_ROOTFS} ${WORKDIR}/cpio_append/init
166			fi
167			(cd  ${WORKDIR}/cpio_append && echo ./init | cpio --reproducible -oA -H newc -F ${IMGDEPLOYDIR}/${IMAGE_NAME}.cpio)
168		fi
169	fi
170}
171SPDX_IMAGE_PURPOSE:cpio = "archive"
172
173UBI_VOLNAME ?= "${MACHINE}-rootfs"
174UBI_VOLTYPE ?= "dynamic"
175UBI_IMGTYPE ?= "ubifs"
176
177write_ubi_config() {
178	local vname="$1"
179
180	cat <<EOF > ubinize${vname}-${IMAGE_NAME}.cfg
181[ubifs]
182mode=ubi
183image=${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.${UBI_IMGTYPE}
184vol_id=0
185vol_type=${UBI_VOLTYPE}
186vol_name=${UBI_VOLNAME}
187vol_flags=autoresize
188EOF
189}
190
191multiubi_mkfs() {
192	local mkubifs_args="$1"
193	local ubinize_args="$2"
194
195        # Added prompt error message for ubi and ubifs image creation.
196        if [ -z "$mkubifs_args" ] || [ -z "$ubinize_args" ]; then
197            bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
198        fi
199
200	if [ -z "$3" ]; then
201		local vname=""
202	else
203		local vname="_$3"
204	fi
205	write_ubi_config "${vname}"
206
207	if [ -n "$vname" ]; then
208		mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.ubifs ${mkubifs_args}
209	fi
210	ubinize -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.ubi ${ubinize_args} ubinize${vname}-${IMAGE_NAME}.cfg
211
212	# Cleanup cfg file
213	mv ubinize${vname}-${IMAGE_NAME}.cfg ${IMGDEPLOYDIR}/
214
215	# Create own symlinks for 'named' volumes
216	if [ -n "$vname" ]; then
217		cd ${IMGDEPLOYDIR}
218		if [ -e ${IMAGE_NAME}${vname}.ubifs ]; then
219			ln -sf ${IMAGE_NAME}${vname}.ubifs \
220			${IMAGE_LINK_NAME}${vname}.ubifs
221		fi
222		if [ -e ${IMAGE_NAME}${vname}.ubi ]; then
223			ln -sf ${IMAGE_NAME}${vname}.ubi \
224			${IMAGE_LINK_NAME}${vname}.ubi
225		fi
226		cd -
227	fi
228}
229
230MULTIUBI_ARGS = "MKUBIFS_ARGS UBINIZE_ARGS"
231
232IMAGE_CMD:multiubi () {
233	${@' '.join(['%s_%s="%s";' % (arg, name, d.getVar('%s_%s' % (arg, name))) for arg in d.getVar('MULTIUBI_ARGS').split() for name in d.getVar('MULTIUBI_BUILD').split()])}
234	# Split MKUBIFS_ARGS_<name> and UBINIZE_ARGS_<name>
235	for name in ${MULTIUBI_BUILD}; do
236		eval local mkubifs_args=\"\$MKUBIFS_ARGS_${name}\"
237		eval local ubinize_args=\"\$UBINIZE_ARGS_${name}\"
238
239		multiubi_mkfs "${mkubifs_args}" "${ubinize_args}" "${name}"
240	done
241}
242
243IMAGE_CMD:ubi () {
244	multiubi_mkfs "${MKUBIFS_ARGS}" "${UBINIZE_ARGS}"
245}
246IMAGE_TYPEDEP:ubi = "${UBI_IMGTYPE}"
247
248IMAGE_CMD:ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.ubifs ${MKUBIFS_ARGS}"
249
250MIN_F2FS_SIZE ?= "524288"
251IMAGE_CMD:f2fs () {
252        # We need to add additional smarts here form devices smaller than 1.5G
253        # Need to scale appropriately between 40M -> 1.5G as the "overprovision
254        # ratio" goes down as the device gets bigger (70% -> 4.5%), below about
255        # 500M the standard IMAGE_OVERHEAD_FACTOR does not work, so add additional
256        # space here when under 500M
257	size=${ROOTFS_SIZE}
258	if [ ${size} -lt ${MIN_F2FS_SIZE} ] ; then
259		size=${MIN_F2FS_SIZE}
260		bbwarn "Rootfs size is too small for F2FS. Filesystem will be extended to ${size}K"
261	fi
262	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs seek=${size} count=0 bs=1024
263	mkfs.f2fs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs
264	sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs
265}
266
267EXTRA_IMAGECMD = ""
268
269inherit siteinfo kernel-arch image-artifact-names
270
271JFFS2_ENDIANNESS ?= "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
272JFFS2_ERASEBLOCK ?= "0x40000"
273EXTRA_IMAGECMD:jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
274
275# Change these if you want default mkfs behavior (i.e. create minimal inode number)
276EXTRA_IMAGECMD:ext2 ?= "-i 4096"
277EXTRA_IMAGECMD:ext3 ?= "-i 4096"
278EXTRA_IMAGECMD:ext4 ?= "-i 4096"
279EXTRA_IMAGECMD:btrfs ?= "-n 4096 --shrink"
280EXTRA_IMAGECMD:f2fs ?= ""
281
282# If a specific FAT size is needed, set it here (e.g. "-F 32"/"-F 16"/"-F 12")
283# otherwise mkfs.vfat will automatically pick one.
284EXTRA_IMAGECMD:vfat ?= ""
285
286do_image_tar[depends] += "tar-replacement-native:do_populate_sysroot"
287do_image_cpio[depends] += "cpio-native:do_populate_sysroot"
288do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
289do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
290do_image_ext2[depends] += "e2fsprogs-native:do_populate_sysroot"
291do_image_ext3[depends] += "e2fsprogs-native:do_populate_sysroot"
292do_image_ext4[depends] += "e2fsprogs-native:do_populate_sysroot"
293do_image_btrfs[depends] += "btrfs-tools-native:do_populate_sysroot"
294do_image_squashfs[depends] += "squashfs-tools-native:do_populate_sysroot"
295do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
296do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
297do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
298do_image_squashfs_zst[depends] += "squashfs-tools-native:do_populate_sysroot"
299do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
300do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
301do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
302do_image_f2fs[depends] += "f2fs-tools-native:do_populate_sysroot"
303do_image_erofs[depends] += "erofs-utils-native:do_populate_sysroot"
304do_image_erofs_lz4[depends] += "erofs-utils-native:do_populate_sysroot"
305do_image_erofs_lz4hc[depends] += "erofs-utils-native:do_populate_sysroot"
306do_image_vfat[depends] += "dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot"
307
308# This variable is available to request which values are suitable for IMAGE_FSTYPES
309IMAGE_TYPES = " \
310    jffs2 jffs2.sum \
311    cramfs \
312    ext2 ext2.gz ext2.bz2 ext2.lzma \
313    ext3 ext3.gz \
314    ext4 ext4.gz \
315    btrfs \
316    vfat \
317    squashfs squashfs-xz squashfs-lzo squashfs-lz4 squashfs-zst \
318    ubi ubifs multiubi \
319    tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
320    cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 cpio.zst \
321    wic wic.gz wic.bz2 wic.lzma wic.zst \
322    container \
323    f2fs \
324    erofs erofs-lz4 erofs-lz4hc \
325"
326# These image types are x86 specific as they need syslinux
327IMAGE_TYPES:append:x86 = " hddimg iso"
328IMAGE_TYPES:append:x86-64 = " hddimg iso"
329
330# Compression is a special case of conversion. The old variable
331# names are still supported for backward-compatibility. When defining
332# new compression or conversion commands, use CONVERSIONTYPES and
333# CONVERSION_CMD/DEPENDS.
334COMPRESSIONTYPES ?= ""
335
336CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync ${COMPRESSIONTYPES}"
337CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}.${type}"
338CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.gz"
339CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}.${type}"
340CONVERSION_CMD:xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_DEFAULTS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.xz"
341CONVERSION_CMD:lz4 = "lz4 -f -9 -z -l ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.lz4"
342CONVERSION_CMD:lzo = "lzop -f -9 ${IMAGE_NAME}.${type}"
343CONVERSION_CMD:zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}.${type}.zip ${IMAGE_NAME}.${type}"
344CONVERSION_CMD:7zip = "7za a -mx=${7ZIP_COMPRESSION_LEVEL} -mm=${7ZIP_COMPRESSION_METHOD} ${IMAGE_NAME}.${type}.${7ZIP_EXTENSION} ${IMAGE_NAME}.${type}"
345CONVERSION_CMD:zst = "zstd -f -k -c ${ZSTD_DEFAULTS} ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.zst"
346CONVERSION_CMD:sum = "sumtool -i ${IMAGE_NAME}.${type} -o ${IMAGE_NAME}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
347CONVERSION_CMD:md5sum = "md5sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.md5sum"
348CONVERSION_CMD:sha1sum = "sha1sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha1sum"
349CONVERSION_CMD:sha224sum = "sha224sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha224sum"
350CONVERSION_CMD:sha256sum = "sha256sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha256sum"
351CONVERSION_CMD:sha384sum = "sha384sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha384sum"
352CONVERSION_CMD:sha512sum = "sha512sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha512sum"
353CONVERSION_CMD:bmap = "bmaptool create ${IMAGE_NAME}.${type} -o ${IMAGE_NAME}.${type}.bmap"
354CONVERSION_CMD:u-boot = "mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.u-boot"
355CONVERSION_CMD:vmdk = "qemu-img convert -O vmdk ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vmdk"
356CONVERSION_CMD:vhdx = "qemu-img convert -O vhdx -o subformat=dynamic ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhdx"
357CONVERSION_CMD:vhd = "qemu-img convert -O vpc -o subformat=fixed ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhd"
358CONVERSION_CMD:vdi = "qemu-img convert -O vdi ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vdi"
359CONVERSION_CMD:qcow2 = "qemu-img convert -O qcow2 ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.qcow2"
360CONVERSION_CMD:base64 = "base64 ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.base64"
361CONVERSION_CMD:zsync = "zsyncmake_curl ${IMAGE_NAME}.${type}"
362CONVERSION_CMD:gzsync = "zsyncmake_curl -z ${IMAGE_NAME}.${type}"
363CONVERSION_DEPENDS_lzma = "xz-native"
364CONVERSION_DEPENDS_gz = "pigz-native"
365CONVERSION_DEPENDS_bz2 = "pbzip2-native"
366CONVERSION_DEPENDS_xz = "xz-native"
367CONVERSION_DEPENDS_lz4 = "lz4-native"
368CONVERSION_DEPENDS_lzo = "lzop-native"
369CONVERSION_DEPENDS_zip = "zip-native"
370CONVERSION_DEPENDS_7zip = "p7zip-native"
371CONVERSION_DEPENDS_zst = "zstd-native"
372CONVERSION_DEPENDS_sum = "mtd-utils-native"
373CONVERSION_DEPENDS_bmap = "bmaptool-native"
374CONVERSION_DEPENDS_u-boot = "u-boot-tools-native"
375CONVERSION_DEPENDS_vmdk = "qemu-system-native"
376CONVERSION_DEPENDS_vdi = "qemu-system-native"
377CONVERSION_DEPENDS_qcow2 = "qemu-system-native"
378CONVERSION_DEPENDS_base64 = "coreutils-native"
379CONVERSION_DEPENDS_vhdx = "qemu-system-native"
380CONVERSION_DEPENDS_vhd = "qemu-system-native"
381CONVERSION_DEPENDS_zsync = "zsync-curl-native"
382CONVERSION_DEPENDS_gzsync = "zsync-curl-native"
383
384RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
385RUNNABLE_MACHINE_PATTERNS ?= "qemu"
386
387DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
388
389# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
390# images that will not be built at do_rootfs time: vmdk, vhd, vhdx, vdi, qcow2, hddimg, iso, etc.
391IMAGE_TYPES_MASKED ?= ""
392
393# bmap requires python3 to be in the PATH
394EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"
395# reproducible tar requires our tar, not the host's
396EXTRANATIVEPATH += "${@'tar-native' if 'tar' in d.getVar('IMAGE_FSTYPES') else ''}"
397