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
116    local suffix=$2
117
118    # Use the bitbake reproducible timestamp instead of the hardcoded squashfs one
119    export SOURCE_DATE_EPOCH=$(stat -c '%Y' ${IMAGE_ROOTFS})
120    mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.squashfs${comp:+-}${suffix:-$comp} ${EXTRA_IMAGECMD} -noappend ${comp:+-comp }$comp
121}
122IMAGE_CMD:squashfs = "oe_mksquashfs"
123IMAGE_CMD:squashfs-xz = "oe_mksquashfs xz"
124IMAGE_CMD:squashfs-lzo = "oe_mksquashfs lzo"
125IMAGE_CMD:squashfs-lz4 = "oe_mksquashfs lz4"
126IMAGE_CMD:squashfs-zst = "oe_mksquashfs zstd zst"
127
128IMAGE_CMD:erofs = "mkfs.erofs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs ${IMAGE_ROOTFS}"
129IMAGE_CMD:erofs-lz4 = "mkfs.erofs -zlz4 ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs-lz4 ${IMAGE_ROOTFS}"
130IMAGE_CMD:erofs-lz4hc = "mkfs.erofs -zlz4hc ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.erofs-lz4hc ${IMAGE_ROOTFS}"
131
132# Note that vfat can't handle all types of files that a real linux file system
133# can (e.g. device files, symlinks, etc.) and therefore it not suitable for all
134# use cases
135oe_mkvfatfs () {
136    mkfs.vfat $@ -C ${IMGDEPLOYDIR}/${IMAGE_NAME}.vfat ${ROOTFS_SIZE}
137    mcopy -i "${IMGDEPLOYDIR}/${IMAGE_NAME}.vfat" -vsmpQ ${IMAGE_ROOTFS}/* ::/
138}
139
140IMAGE_CMD:vfat = "oe_mkvfatfs ${EXTRA_IMAGECMD}"
141
142IMAGE_CMD_TAR ?= "tar"
143# ignore return code 1 "file changed as we read it" as other tasks(e.g. do_image_wic) may be hardlinking rootfs
144IMAGE_CMD:tar = "${IMAGE_CMD_TAR} --sort=name --format=posix --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
145
146do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
147IMAGE_CMD:cpio () {
148	(cd ${IMAGE_ROOTFS} && find . | sort | cpio --reproducible -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}.cpio)
149	# We only need the /init symlink if we're building the real
150	# image. The -dbg image doesn't need it! By being clever
151	# about this we also avoid 'touch' below failing, as it
152	# might be trying to touch /sbin/init on the host since both
153	# the normal and the -dbg image share the same WORKDIR
154	if [ "${IMAGE_BUILDING_DEBUGFS}" != "true" ]; then
155		if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then
156			if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then
157				ln -sf /sbin/init ${WORKDIR}/cpio_append/init
158                                touch -h -r ${IMAGE_ROOTFS}/sbin/init ${WORKDIR}/cpio_append/init
159			else
160                                touch -r ${IMAGE_ROOTFS} ${WORKDIR}/cpio_append/init
161			fi
162			(cd  ${WORKDIR}/cpio_append && echo ./init | cpio --reproducible -oA -H newc -F ${IMGDEPLOYDIR}/${IMAGE_NAME}.cpio)
163		fi
164	fi
165}
166
167UBI_VOLNAME ?= "${MACHINE}-rootfs"
168UBI_VOLTYPE ?= "dynamic"
169UBI_IMGTYPE ?= "ubifs"
170
171write_ubi_config() {
172	local vname="$1"
173
174	cat <<EOF > ubinize${vname}-${IMAGE_NAME}.cfg
175[ubifs]
176mode=ubi
177image=${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.${UBI_IMGTYPE}
178vol_id=0
179vol_type=${UBI_VOLTYPE}
180vol_name=${UBI_VOLNAME}
181vol_flags=autoresize
182EOF
183}
184
185multiubi_mkfs() {
186	local mkubifs_args="$1"
187	local ubinize_args="$2"
188
189        # Added prompt error message for ubi and ubifs image creation.
190        if [ -z "$mkubifs_args" ] || [ -z "$ubinize_args" ]; then
191            bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
192        fi
193
194	if [ -z "$3" ]; then
195		local vname=""
196	else
197		local vname="_$3"
198	fi
199	write_ubi_config "${vname}"
200
201	if [ -n "$vname" ]; then
202		mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.ubifs ${mkubifs_args}
203	fi
204	ubinize -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}.ubi ${ubinize_args} ubinize${vname}-${IMAGE_NAME}.cfg
205
206	# Cleanup cfg file
207	mv ubinize${vname}-${IMAGE_NAME}.cfg ${IMGDEPLOYDIR}/
208
209	# Create own symlinks for 'named' volumes
210	if [ -n "$vname" ]; then
211		cd ${IMGDEPLOYDIR}
212		if [ -e ${IMAGE_NAME}${vname}.ubifs ]; then
213			ln -sf ${IMAGE_NAME}${vname}.ubifs \
214			${IMAGE_LINK_NAME}${vname}.ubifs
215		fi
216		if [ -e ${IMAGE_NAME}${vname}.ubi ]; then
217			ln -sf ${IMAGE_NAME}${vname}.ubi \
218			${IMAGE_LINK_NAME}${vname}.ubi
219		fi
220		cd -
221	fi
222}
223
224MULTIUBI_ARGS = "MKUBIFS_ARGS UBINIZE_ARGS"
225
226IMAGE_CMD:multiubi () {
227	${@' '.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()])}
228	# Split MKUBIFS_ARGS_<name> and UBINIZE_ARGS_<name>
229	for name in ${MULTIUBI_BUILD}; do
230		eval local mkubifs_args=\"\$MKUBIFS_ARGS_${name}\"
231		eval local ubinize_args=\"\$UBINIZE_ARGS_${name}\"
232
233		multiubi_mkfs "${mkubifs_args}" "${ubinize_args}" "${name}"
234	done
235}
236
237IMAGE_CMD:ubi () {
238	multiubi_mkfs "${MKUBIFS_ARGS}" "${UBINIZE_ARGS}"
239}
240IMAGE_TYPEDEP:ubi = "${UBI_IMGTYPE}"
241
242IMAGE_CMD:ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.ubifs ${MKUBIFS_ARGS}"
243
244MIN_F2FS_SIZE ?= "524288"
245IMAGE_CMD:f2fs () {
246        # We need to add additional smarts here form devices smaller than 1.5G
247        # Need to scale appropriately between 40M -> 1.5G as the "overprovision
248        # ratio" goes down as the device gets bigger (70% -> 4.5%), below about
249        # 500M the standard IMAGE_OVERHEAD_FACTOR does not work, so add additional
250        # space here when under 500M
251	size=${ROOTFS_SIZE}
252	if [ ${size} -lt ${MIN_F2FS_SIZE} ] ; then
253		size=${MIN_F2FS_SIZE}
254		bbwarn "Rootfs size is too small for F2FS. Filesystem will be extended to ${size}K"
255	fi
256	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs seek=${size} count=0 bs=1024
257	mkfs.f2fs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs
258	sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs
259}
260
261EXTRA_IMAGECMD = ""
262
263inherit siteinfo kernel-arch image-artifact-names
264
265JFFS2_ENDIANNESS ?= "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
266JFFS2_ERASEBLOCK ?= "0x40000"
267EXTRA_IMAGECMD:jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
268
269# Change these if you want default mkfs behavior (i.e. create minimal inode number)
270EXTRA_IMAGECMD:ext2 ?= "-i 4096"
271EXTRA_IMAGECMD:ext3 ?= "-i 4096"
272EXTRA_IMAGECMD:ext4 ?= "-i 4096"
273EXTRA_IMAGECMD:btrfs ?= "-n 4096 --shrink"
274EXTRA_IMAGECMD:f2fs ?= ""
275
276# If a specific FAT size is needed, set it here (e.g. "-F 32"/"-F 16"/"-F 12")
277# otherwise mkfs.vfat will automatically pick one.
278EXTRA_IMAGECMD:vfat ?= ""
279
280do_image_cpio[depends] += "cpio-native:do_populate_sysroot"
281do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
282do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
283do_image_ext2[depends] += "e2fsprogs-native:do_populate_sysroot"
284do_image_ext3[depends] += "e2fsprogs-native:do_populate_sysroot"
285do_image_ext4[depends] += "e2fsprogs-native:do_populate_sysroot"
286do_image_btrfs[depends] += "btrfs-tools-native:do_populate_sysroot"
287do_image_squashfs[depends] += "squashfs-tools-native:do_populate_sysroot"
288do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
289do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
290do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
291do_image_squashfs_zst[depends] += "squashfs-tools-native:do_populate_sysroot"
292do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
293do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
294do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
295do_image_f2fs[depends] += "f2fs-tools-native:do_populate_sysroot"
296do_image_erofs[depends] += "erofs-utils-native:do_populate_sysroot"
297do_image_erofs_lz4[depends] += "erofs-utils-native:do_populate_sysroot"
298do_image_erofs_lz4hc[depends] += "erofs-utils-native:do_populate_sysroot"
299do_image_vfat[depends] += "dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot"
300
301# This variable is available to request which values are suitable for IMAGE_FSTYPES
302IMAGE_TYPES = " \
303    jffs2 jffs2.sum \
304    cramfs \
305    ext2 ext2.gz ext2.bz2 ext2.lzma \
306    ext3 ext3.gz \
307    ext4 ext4.gz \
308    btrfs \
309    vfat \
310    squashfs squashfs-xz squashfs-lzo squashfs-lz4 squashfs-zst \
311    ubi ubifs multiubi \
312    tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
313    cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 cpio.zst \
314    wic wic.gz wic.bz2 wic.lzma wic.zst \
315    container \
316    f2fs \
317    erofs erofs-lz4 erofs-lz4hc \
318"
319# These image types are x86 specific as they need syslinux
320IMAGE_TYPES:append:x86 = " hddimg iso"
321IMAGE_TYPES:append:x86-64 = " hddimg iso"
322
323# Compression is a special case of conversion. The old variable
324# names are still supported for backward-compatibility. When defining
325# new compression or conversion commands, use CONVERSIONTYPES and
326# CONVERSION_CMD/DEPENDS.
327COMPRESSIONTYPES ?= ""
328
329CONVERSIONTYPES = "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}"
330CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}.${type}"
331CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.gz"
332CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}.${type}"
333CONVERSION_CMD:xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_DEFAULTS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.xz"
334CONVERSION_CMD:lz4 = "lz4 -9 -z -l ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.lz4"
335CONVERSION_CMD:lzo = "lzop -9 ${IMAGE_NAME}.${type}"
336CONVERSION_CMD:zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}.${type}.zip ${IMAGE_NAME}.${type}"
337CONVERSION_CMD:7zip = "7za a -mx=${7ZIP_COMPRESSION_LEVEL} -mm=${7ZIP_COMPRESSION_METHOD} ${IMAGE_NAME}.${type}.${7ZIP_EXTENSION} ${IMAGE_NAME}.${type}"
338CONVERSION_CMD:zst = "zstd -f -k -c ${ZSTD_DEFAULTS} ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.zst"
339CONVERSION_CMD:sum = "sumtool -i ${IMAGE_NAME}.${type} -o ${IMAGE_NAME}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
340CONVERSION_CMD:md5sum = "md5sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.md5sum"
341CONVERSION_CMD:sha1sum = "sha1sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha1sum"
342CONVERSION_CMD:sha224sum = "sha224sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha224sum"
343CONVERSION_CMD:sha256sum = "sha256sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha256sum"
344CONVERSION_CMD:sha384sum = "sha384sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha384sum"
345CONVERSION_CMD:sha512sum = "sha512sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha512sum"
346CONVERSION_CMD:bmap = "bmaptool create ${IMAGE_NAME}.${type} -o ${IMAGE_NAME}.${type}.bmap"
347CONVERSION_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"
348CONVERSION_CMD:vmdk = "qemu-img convert -O vmdk ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vmdk"
349CONVERSION_CMD:vhdx = "qemu-img convert -O vhdx -o subformat=dynamic ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhdx"
350CONVERSION_CMD:vhd = "qemu-img convert -O vpc -o subformat=fixed ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhd"
351CONVERSION_CMD:vdi = "qemu-img convert -O vdi ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vdi"
352CONVERSION_CMD:qcow2 = "qemu-img convert -O qcow2 ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.qcow2"
353CONVERSION_CMD:base64 = "base64 ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.base64"
354CONVERSION_CMD:zsync = "zsyncmake_curl ${IMAGE_NAME}.${type}"
355CONVERSION_CMD:gzsync = "zsyncmake_curl -z ${IMAGE_NAME}.${type}"
356CONVERSION_DEPENDS_lzma = "xz-native"
357CONVERSION_DEPENDS_gz = "pigz-native"
358CONVERSION_DEPENDS_bz2 = "pbzip2-native"
359CONVERSION_DEPENDS_xz = "xz-native"
360CONVERSION_DEPENDS_lz4 = "lz4-native"
361CONVERSION_DEPENDS_lzo = "lzop-native"
362CONVERSION_DEPENDS_zip = "zip-native"
363CONVERSION_DEPENDS_7zip = "p7zip-native"
364CONVERSION_DEPENDS_zst = "zstd-native"
365CONVERSION_DEPENDS_sum = "mtd-utils-native"
366CONVERSION_DEPENDS_bmap = "bmaptool-native"
367CONVERSION_DEPENDS_u-boot = "u-boot-tools-native"
368CONVERSION_DEPENDS_vmdk = "qemu-system-native"
369CONVERSION_DEPENDS_vdi = "qemu-system-native"
370CONVERSION_DEPENDS_qcow2 = "qemu-system-native"
371CONVERSION_DEPENDS_base64 = "coreutils-native"
372CONVERSION_DEPENDS_vhdx = "qemu-system-native"
373CONVERSION_DEPENDS_vhd = "qemu-system-native"
374CONVERSION_DEPENDS_zsync = "zsync-curl-native"
375CONVERSION_DEPENDS_gzsync = "zsync-curl-native"
376
377RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
378RUNNABLE_MACHINE_PATTERNS ?= "qemu"
379
380DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
381
382# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
383# images that will not be built at do_rootfs time: vmdk, vhd, vhdx, vdi, qcow2, hddimg, iso, etc.
384IMAGE_TYPES_MASKED ?= ""
385
386# bmap requires python3 to be in the PATH
387EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"
388