title: Yocto bitbake ${@bb.utils.contains(...)} is having subtistution failure
body: <p>I'm trying to integrate meta-mender and the problem comes down to the file path:</p>
  <p>meta-mender/meta-mender-core/classes/mender-part-images.classes</p>
  <p>On the line:</p>
  <pre><code>56:     if ${@bb.utils.contains('DISTRO_FEATURES','mender-uboot','true','false',d)}; then
  </code></pre>
  <p>It shoots out:</p>
  <pre><code>temp/run.do_image_sdimg.3123112: 125: Bad substitution
  </code></pre>
  <p>The syntax for bitbake is right, and this is written by mender themselves. So what else could possibly cause this issue?</p>
  <p>EDIT = Added the file that is having a problem as a request from comment</p>
  <pre><code># Class that creates an SD card image that boots under qemu's emulation
  # for vexpress-a9 board. See the script mender-qemu for an example of
  # how to boot the image.
  
  # The partitioning scheme is:
  #    part1: FAT partition with bootloader
  #    part2: first rootfs, active
  #    part3: second rootfs, inactive, mirror of first,
  #           available as failsafe for when some update fails
  #    part4: persistent data partition
  #    partx: extra user defined partition
  
  python() {
      deprecated_vars = ['SDIMG_DATA_PART_DIR', 'SDIMG_DATA_PART_SIZE_MB',
                         'SDIMG_BOOT_PART_SIZE_MB', 'SDIMG_PARTITION_ALIGNMENT_MB']
      for varname in deprecated_vars:
          cur = d.getVar(varname, True)
          if cur:
              newvarname = varname.replace('SDIMG_', 'MENDER_')
              bb.fatal('Detected use of deprecated var %s, please replace it with %s in your setup' % (varname, newvarname))
  }
  
  inherit image
  inherit image_types
  inherit mender-helpers
  
  # This normally defaults to .rootfs which is misleading as this is not a simple
  # rootfs image and causes problems if one wants to use something like this:
  #
  #    IMAGE_FSTYPES += &quot;sdimg.gz&quot;
  #
  # Above assumes that the image name is:
  #
  #    ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}
  #
  # Which results in a empty &quot;gz&quot; archive when using the default value, in our
  # case IMAGE_NAME_SUFFIX should be empty as we do not use it when naming
  # our image.
  IMAGE_NAME_SUFFIX = &quot;&quot;
  
  
  ################################################################################
  # Block storage
  ################################################################################
  
  mender_part_image() {
      suffix=&quot;$1&quot;
      ptable_type=&quot;$2&quot;
      boot_part_params=&quot;$3&quot;
  
      set -ex
      mkdir -p &quot;${WORKDIR}&quot;
      if ${@bb.utils.contains('DISTRO_FEATURES','mender-uboot','true','false',d)}; then
          # Copy the files to embed in the WIC image into ${WORKDIR} for exclusive access
          install -m 0644 &quot;${DEPLOY_DIR_IMAGE}/uboot.env&quot; &quot;${WORKDIR}/&quot;
      fi
  
      ondisk_dev=&quot;$(basename &quot;${MENDER_STORAGE_DEVICE}&quot;)&quot;
  
      wks=&quot;${WORKDIR}/mender-$suffix.wks&quot;
      rm -f &quot;$wks&quot;
      if [ -n &quot;${MENDER_IMAGE_BOOTLOADER_FILE}&quot; ]; then
          # Copy the files to embed in the WIC image into ${WORKDIR} for exclusive access
          install -m 0644 &quot;${DEPLOY_DIR_IMAGE}/${MENDER_IMAGE_BOOTLOADER_FILE}&quot; &quot;${WORKDIR}/&quot;
  
          if [ $(expr ${MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET} % 2) -ne 0 ]; then
              # wic doesn't support fractions of kiB, so we need to do some tricks
              # when we are at an odd sector: Create a new bootloader file that
              # lacks the first 512 bytes, write that at the next even sector,
              # which coincides with a whole kiB, and then write the missing
              # sector manually afterwards.
              bootloader_sector=$(expr ${MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET} + 1)
              bootloader_file=${WORKDIR}/${MENDER_IMAGE_BOOTLOADER_FILE}-partial
              dd if=${WORKDIR}/${MENDER_IMAGE_BOOTLOADER_FILE} of=$bootloader_file skip=1
          else
              bootloader_sector=${MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET}
              bootloader_file=${WORKDIR}/${MENDER_IMAGE_BOOTLOADER_FILE}
          fi
          bootloader_align_kb=$(expr $(expr $bootloader_sector \* 512) / 1024)
          bootloader_size=$(stat -c '%s' &quot;$bootloader_file&quot;)
          bootloader_end=$(expr $bootloader_align_kb \* 1024 + $bootloader_size)
          if [ $bootloader_end -gt ${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET} ]; then
              bberror &quot;Size of bootloader specified in MENDER_IMAGE_BOOTLOADER_FILE&quot; \
                      &quot;exceeds MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET, which is&quot; \
                      &quot;reserved for U-Boot environment storage. Please raise it&quot; \
                      &quot;manually.&quot;
          fi
          cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  # embed bootloader
  part --source rawcopy --sourceparams=&quot;file=$bootloader_file&quot; --ondisk &quot;$ondisk_dev&quot; --align $bootloader_align_kb --no-table
  EOF
      fi
  
      if ${@bb.utils.contains('DISTRO_FEATURES', 'mender-uboot', 'true', 'false', d)} &amp;&amp; [ -n &quot;${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET}&quot; ]; then
          boot_env_align_kb=$(expr ${MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET} / 1024)
          cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  part --source rawcopy --sourceparams=&quot;file=${WORKDIR}/uboot.env&quot; --ondisk &quot;$ondisk_dev&quot; --align $boot_env_align_kb --no-table
  EOF
      fi
  
      if [ $(expr ${MENDER_PARTITION_ALIGNMENT} % 1024 || true) -ne 0 ]; then
          bbfatal &quot;MENDER_PARTITION_ALIGNMENT must be KiB aligned when using partition table.&quot;
      fi
  
      alignment_kb=$(expr ${MENDER_PARTITION_ALIGNMENT} / 1024)
  
      # Used for all Linux filesystem partitions.
      if [ &quot;$ptable_type&quot; = &quot;gpt&quot; ]; then
          part_type_params=&quot;--part-type 8300&quot;
      else
          part_type_params=
      fi
  
      # remove leading and trailing spaces
      IMAGE_BOOT_FILES_STRIPPED=$(echo &quot;${IMAGE_BOOT_FILES}&quot; | sed -r 's/(^\s*)|(\s*$)//g')
  
      if [ &quot;${MENDER_BOOT_PART_SIZE_MB}&quot; -ne &quot;0&quot; ]; then
          mender_merge_bootfs_and_image_boot_files
          cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  part --source rootfs --rootfs-dir ${WORKDIR}/bootfs.${BB_CURRENTTASK} --ondisk &quot;$ondisk_dev&quot; --fstype=vfat --label boot --align $alignment_kb --fixed-size ${MENDER_BOOT_PART_SIZE_MB} --active $boot_part_params
  EOF
      elif [ -n &quot;$IMAGE_BOOT_FILES_STRIPPED&quot; ]; then
          bbwarn &quot;MENDER_BOOT_PART_SIZE_MB is set to zero, but IMAGE_BOOT_FILES is not empty. The files are being omitted from the image.&quot;
      fi
  
      cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  part --source rawcopy --sourceparams=&quot;file=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${ARTIFACTIMG_FSTYPE}&quot; --ondisk &quot;$ondisk_dev&quot; --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $part_type_params
  part --ondisk &quot;$ondisk_dev&quot; --fstype=${ARTIFACTIMG_FSTYPE} --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $part_type_params
  EOF
  
      if [ &quot;${MENDER_SWAP_PART_SIZE_MB}&quot; -ne &quot;0&quot; ]; then
          cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  part swap --ondisk &quot;$ondisk_dev&quot; --fstype=swap --label swap --align $alignment_kb --size ${MENDER_SWAP_PART_SIZE_MB}
  EOF
      fi
  
      cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  part --source rawcopy --sourceparams=&quot;file=${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.dataimg&quot; --ondisk &quot;$ondisk_dev&quot; --align $alignment_kb --fixed-size ${MENDER_DATA_PART_SIZE_MB} $part_type_params
  EOF
      # added extra partitions if exists
      cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  ${@get_extra_parts_wks(d)}
  EOF
  
      cat &gt;&gt; &quot;$wks&quot; &lt;&lt;EOF
  bootloader --ptable $ptable_type
  EOF
  
  
      echo &quot;### Contents of wks file ###&quot;
      cat &quot;$wks&quot;
      echo &quot;### End of contents of wks file ###&quot;
  
      # Call WIC
      outimgname=&quot;${IMGDEPLOYDIR}/${IMAGE_NAME}.$suffix&quot;
      wicout=&quot;${IMGDEPLOYDIR}/${IMAGE_NAME}-$suffix&quot;
      BUILDDIR=&quot;${TOPDIR}&quot; wic create &quot;$wks&quot; --vars &quot;${STAGING_DIR}/${MACHINE}/imgdata/&quot; -e &quot;${IMAGE_BASENAME}&quot; -o &quot;$wicout/&quot; ${WIC_CREATE_EXTRA_ARGS}
      mv &quot;$wicout/$(basename &quot;${wks%.wks}&quot;)&quot;*.direct &quot;$outimgname&quot;
  
      if [ -n &quot;${MENDER_IMAGE_BOOTLOADER_FILE}&quot; ] &amp;&amp; [ ${MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET} -ne $bootloader_sector ]; then
          # We need to write the first sector of the bootloader. See comment above
          # where bootloader_sector is set.
          dd if=${WORKDIR}/${MENDER_IMAGE_BOOTLOADER_FILE} of=&quot;$outimgname&quot; seek=${MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET} count=1 conv=notrunc
      fi
  
      if [ -n &quot;${MENDER_MBR_BOOTLOADER_FILE}&quot; ]; then
          dd if=&quot;${DEPLOY_DIR_IMAGE}/${MENDER_MBR_BOOTLOADER_FILE}&quot; of=&quot;$outimgname&quot; bs=${MENDER_MBR_BOOTLOADER_LENGTH} count=1 conv=notrunc
      fi
  
      rm -rf &quot;$wicout/&quot;
  
      # Pad the image up to the alignment. This matters mostly for the emulator,
      # which uses the file size to determine the size of the storage device,
      # which must be a multiple of its device block size. However, it might be
      # beneficial for real storage media as well, to make sure the final sector
      # is cleared out when flashing the image. May increase image size slightly,
      # but should compress well!
      alignment=${MENDER_PARTITION_ALIGNMENT}
      pad_size=$(expr \( $(stat -c %s &quot;$outimgname&quot;) + $alignment - 1 \) / $alignment \* $alignment)
      truncate -s $pad_size &quot;$outimgname&quot;
  
      # If we padded above, and the partition table type is GPT, we need to
      # relocate the trailing backup header to the new end to avoid warnings.
      if [ &quot;$ptable_type&quot; = &quot;gpt&quot; ]; then
          sgdisk -e &quot;$outimgname&quot;
      fi
  
      if [ &quot;$ptable_type&quot; = &quot;msdos&quot; ]; then
          # Fix partition entry types for MBR style partition table.
          (
              echo t                                  # Partition type
              echo ${MENDER_ROOTFS_PART_A_NUMBER}     # Number of partition
              echo 83                                 # &quot;Linux filesystem&quot; type
  
              echo t                                  # Partition type
              echo ${MENDER_ROOTFS_PART_B_NUMBER}     # Number of partition
              echo 83                                 # &quot;Linux filesystem&quot; type
  
              echo t                                  # Partition type
              echo ${MENDER_DATA_PART_NUMBER}         # Number of partition
              echo 83                                 # &quot;Linux filesystem&quot; type
  
              echo w                                  # Save and exit
          ) | fdisk ${outimgname}
      fi
  
      if ${@bb.utils.contains('DISTRO_FEATURES', 'mender-partuuid', 'true', 'false', d)}; then
          if [ &quot;$ptable_type&quot; = &quot;gpt&quot; ]; then
              # Set Fixed PARTUUID for all devices
              sgdisk -u ${MENDER_BOOT_PART_NUMBER}:${@mender_get_partuuid_from_device(d, '${MENDER_BOOT_PART}')} &quot;$outimgname&quot;
              sgdisk -u ${MENDER_ROOTFS_PART_A_NUMBER}:${@mender_get_partuuid_from_device(d, '${MENDER_ROOTFS_PART_A}')} &quot;$outimgname&quot;
              sgdisk -u ${MENDER_ROOTFS_PART_B_NUMBER}:${@mender_get_partuuid_from_device(d, '${MENDER_ROOTFS_PART_B}')} &quot;$outimgname&quot;
              sgdisk -u ${MENDER_DATA_PART_NUMBER}:${@mender_get_partuuid_from_device(d, '${MENDER_DATA_PART}')} &quot;$outimgname&quot;
          else
              diskIdent=$(echo ${@mender_get_partuuid_from_device(d, '${MENDER_ROOTFS_PART_A}')} | cut -d- -f1)
              # For MBR Set the Disk Identifier.  Drives follow the pattern of &lt;Disk Identifier&gt;-&lt;Part Number&gt;
              (
                  echo x                              # Enter expert mode
                  echo i                              # Set disk identifier
                  echo 0x${diskIdent}                 # Identifier
                  echo r                              # Exit expert mode
                  echo w                              # Write changes
              ) | fdisk ${outimgname}
          fi
      fi
  }
  
  IMAGE_CMD_sdimg() {
      mender_part_image sdimg msdos
  }
  IMAGE_CMD_uefiimg() {
      mender_part_image uefiimg gpt &quot;--part-type EF00&quot;
  }
  IMAGE_CMD_biosimg() {
      mender_part_image biosimg msdos
  }
  IMAGE_CMD_gptimg() {
      mender_part_image gptimg gpt
  }
  
  
  addtask do_rootfs_wicenv after do_image before do_image_sdimg
  addtask do_rootfs_wicenv after do_image before do_image_uefiimg
  addtask do_rootfs_wicenv after do_image before do_image_biosimg
  addtask do_rootfs_wicenv after do_image before do_image_gptimg
  
  _MENDER_PART_IMAGE_DEPENDS = &quot; \
      ${@d.getVarFlag('do_image_wic', 'depends', False)} \
      coreutils-native:do_populate_sysroot \
      wic-tools:do_populate_sysroot \
      dosfstools-native:do_populate_sysroot \
      mtools-native:do_populate_sysroot \
      ${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('WKS_FILE_DEPENDS').split()])} \
  &quot;
  _MENDER_PART_IMAGE_DEPENDS += &quot;${@bb.utils.contains('MENDER_DATA_PART_FSTYPE', 'btrfs','btrfs-tools-native:do_populate_sysroot','',d)}&quot;
  
  
  # This is needed because by default 'mender-grub' feature is used on ARM, but
  # it still uses U-boot as an EFI provider/launcher and requires it to be
  # present.
  #
  # This assumes that U-boot is used on ARM, this could become problematic
  # if we add support for other bootloaders on ARM, e.g Barebox.
  _MENDER_PART_IMAGE_DEPENDS_append_mender-grub_arm =     &quot; u-boot:do_deploy&quot;
  _MENDER_PART_IMAGE_DEPENDS_append_mender-grub_aarch64 = &quot; u-boot:do_deploy&quot;
  
  _MENDER_PART_IMAGE_DEPENDS_append_mender-uboot = &quot; u-boot:do_deploy&quot;
  _MENDER_PART_IMAGE_DEPENDS_append_mender-grub_mender-bios = &quot; grub:do_deploy&quot;
  
  do_image_sdimg[depends] += &quot;${_MENDER_PART_IMAGE_DEPENDS}&quot;
  do_image_sdimg[depends] += &quot; ${@bb.utils.contains('SOC_FAMILY', 'rpi', 'bootfiles:do_populate_sysroot', '', d)}&quot;
  
  do_image_uefiimg[depends] += &quot;${_MENDER_PART_IMAGE_DEPENDS} \
                                gptfdisk-native:do_populate_sysroot&quot;
  
  do_image_biosimg[depends] += &quot;${_MENDER_PART_IMAGE_DEPENDS}&quot;
  
  do_image_gptimg[depends] += &quot;${_MENDER_PART_IMAGE_DEPENDS}&quot;
  
  IMAGE_TYPEDEP_sdimg_append   = &quot; ${ARTIFACTIMG_FSTYPE} dataimg&quot;
  IMAGE_TYPEDEP_uefiimg_append = &quot; ${ARTIFACTIMG_FSTYPE} dataimg&quot;
  IMAGE_TYPEDEP_biosimg_append = &quot; ${ARTIFACTIMG_FSTYPE} dataimg&quot;
  IMAGE_TYPEDEP_gptimg_append  = &quot; ${ARTIFACTIMG_FSTYPE} dataimg&quot;
  
  # This isn't actually a dependency, but a way to avoid sdimg and uefiimg
  # building simultaneously, since wic will use the same file names in both, and
  # in parallel builds this is a recipe for disaster.
  IMAGE_TYPEDEP_uefiimg_append = &quot;${@bb.utils.contains('IMAGE_FSTYPES', 'sdimg', ' sdimg', '', d)}&quot;
  # And same here.
  IMAGE_TYPEDEP_biosimg_append = &quot;${@bb.utils.contains('IMAGE_FSTYPES', 'sdimg', ' sdimg', '', d)} ${@bb.utils.contains('IMAGE_FSTYPES', 'uefiimg', ' uefiimg', '', d)}&quot;
  # And same here.
  IMAGE_TYPEDEP_gptimg_append = &quot;${@bb.utils.contains('IMAGE_FSTYPES', 'sdimg', ' sdimg', '', d)} \
                                 ${@bb.utils.contains('IMAGE_FSTYPES', 'uefiimg', ' uefiimg', '', d)} \
                                 ${@bb.utils.contains('IMAGE_FSTYPES', 'biosimg', ' biosimg', '', d)}&quot;
  # Make sure the Mender part image is available in the live installer
  IMAGE_TYPEDEP_hddimg_append = &quot;${@bb.utils.contains('IMAGE_FSTYPES', 'sdimg', ' sdimg', '', d)} \
                                 ${@bb.utils.contains('IMAGE_FSTYPES', 'gptimg', ' gptimg', '', d)} \
                                 ${@bb.utils.contains('IMAGE_FSTYPES', 'uefiimg', ' uefiimg', '', d)} \
                                 ${@bb.utils.contains('IMAGE_FSTYPES', 'biosimg', ' biosimg', '', d)}&quot;
  
  # Use the Mender part image as the Live image
  python() {
      if bb.utils.contains('IMAGE_FSTYPES', 'sdimg', True, False, d):
          type='sdimg'
      elif bb.utils.contains('IMAGE_FSTYPES', 'uefiimg', True, False, d):
          type='uefiimg'
      elif bb.utils.contains('IMAGE_FSTYPES', 'biosimg', True, False, d):
          type='biosimg'
      elif bb.utils.contains('IMAGE_FSTYPES', 'gptimg', True, False, d):
          type='gptimg'
      else:
          return
  
      d.setVar('LIVE_ROOTFS_TYPE', type)
      d.setVar('ROOTFS', &quot;${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.%s.bz2&quot; % type)
      d.appendVar('IMAGE_FSTYPES', ' %s.bz2 ' % type)
  
      # Remove the boot option on the Live installer; it won't work since Mender hard codes
      # the device nodes
      d.setVar('LABELS_LIVE_remove', 'boot')
  }
  
  # So that we can use the files from excluded paths in the full images.
  do_image_sdimg[respect_exclude_path] = &quot;0&quot;
  do_image_uefiimg[respect_exclude_path] = &quot;0&quot;
  do_image_biosimg[respect_exclude_path] = &quot;0&quot;
  do_image_gptimg[respect_exclude_path] = &quot;0&quot;
  
  ################################################################################
  # Flash storage
  ################################################################################
  
  mender_flash_mtdpart() {
      local file=&quot;$1&quot;
      local size=&quot;$2&quot;
      local kbsize=&quot;$3&quot;
      local kboffset=&quot;$4&quot;
      local name=&quot;$5&quot;
  
      if [ &quot;$size&quot; = &quot;-&quot; ]; then
          # Remaining space.
          local total_space_kb=$(expr ${MENDER_STORAGE_TOTAL_SIZE_MB} \* 1024)
          kbsize=$(expr $total_space_kb - $kboffset)
          size=$(expr $kbsize \* 1024)
      fi
  
      if [ &quot;$file&quot; != &quot;/dev/zero&quot; ]; then
          local file_size=$(stat -Lc '%s' &quot;$file&quot;)
          if [ $file_size -gt $size ]; then
              bbfatal &quot;$file is too big to fit inside '$name' mtdpart of size $size.&quot;
          fi
      fi
      # Flash zeros first to make sure that a shorter ubimg doesn't truncate the
      # write.
      dd if=&quot;/dev/zero&quot; \
          of=&quot;${IMGDEPLOYDIR}/${IMAGE_NAME}.mtdimg&quot; \
          bs=1024 \
          seek=$kboffset \
          count=$kbsize \
          conv=notrunc
      dd if=&quot;$file&quot; \
          of=&quot;${IMGDEPLOYDIR}/${IMAGE_NAME}.mtdimg&quot; \
          bs=1024 \
          seek=$kboffset \
          count=$kbsize \
          conv=notrunc
  }
  
  IMAGE_CMD_mtdimg() {
      set -ex
  
      # We don't actually use the result from this one, it's only to trigger a
      # warning or error if the variable is not correctly set.
      mender_get_mtdparts
  
      ${@mender_make_mtdparts_shell_array(d)}
  
      local remaining_encountered=0
      local i=0
      while [ $i -lt $mtd_count ]; do
          eval local name=&quot;\&quot;\$mtd_names_$i\&quot;&quot;
          eval local size=&quot;\&quot;\$mtd_sizes_$i\&quot;&quot;
          eval local kbsize=&quot;\&quot;\$mtd_kbsizes_$i\&quot;&quot;
          eval local kboffset=&quot;\&quot;\$mtd_kboffsets_$i\&quot;&quot;
  
          if [ &quot;$name&quot; = &quot;u-boot&quot; ]; then
              if [ -n &quot;${MENDER_IMAGE_BOOTLOADER_FILE}&quot; ]; then
                  mender_flash_mtdpart &quot;${DEPLOY_DIR_IMAGE}/${MENDER_IMAGE_BOOTLOADER_FILE}&quot; $size $kbsize $kboffset $name
              else
                  bbwarn &quot;There is a 'u-boot' mtdpart, but MENDER_IMAGE_BOOTLOADER_FILE is undefined. Filling with zeros.&quot;
                  mender_flash_mtdpart &quot;/dev/zero&quot; $size $kbsize $kboffset $name
              fi
          elif [ &quot;$name&quot; = &quot;u-boot-env&quot; ]; then
              mender_flash_mtdpart &quot;${DEPLOY_DIR_IMAGE}/uboot.env&quot; $size $kbsize $kboffset $name
          elif [ &quot;$name&quot; = &quot;ubi&quot; ]; then
              mender_flash_mtdpart &quot;${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ubimg&quot; $size $kbsize $kboffset $name
          else
              bbwarn &quot;Don't know how to flash mtdparts '$name'. Filling with zeros.&quot;
              mender_flash_mtdpart &quot;/dev/zero&quot; $size $kbsize $kboffset $name
          fi
  
          i=$(expr $i + 1)
      done
  
      ln -sfn &quot;${IMAGE_NAME}.mtdimg&quot; &quot;${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.mtdimg&quot;
  }
  
  IMAGE_TYPEDEP_mtdimg_append = &quot; ubimg&quot;
  </code></pre>