# Mender is not creating partitions in iMX6 UL

**URL:** <https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924>\
**Category:** General Discussions\
**Tags:** yocto, nxp, warrior, imx6ul-evk\
**Created:** [May 15, 2020, 7:09am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924 "2020-05-15T07:09:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 7:09am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/1 "2020-05-15T07:09:07Z")

</div>

Hi all,

I’m building Yocto project with mender for [iMX6UL EVK](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx6ultralite-evaluation-kit:MCIMX6UL-EVK). It fails to load with the following error:

```auto
[TIME] Timed out waiting for device /dev/mmcblk1p4.
[DEPEND] Dependency failed for /data.
[DEPEND] Dependency failed for Local File Systems.

```

and it goes into emergency mode, the disk partition reveals there’s no partition 4

```auto
~ # fdisk -l
Disk /dev/mmcblk1: 7416 MB, 7776239616 bytes, 15187968 sectors
237312 cylinders, 4 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type
/dev/mmcblk1p1 * 64,0,1 437,2,24 8192 56023 47832 23.3M c Win95 FAT32 (LBA)
/dev/mmcblk1p2 448,0,1 1023,3,32 57344 9705881 9648538 4711M 83 Linux

```

My `local.conf` file is as follows,

```auto
# IP of local server
MENDER_DEMO_HOST_IP_ADDRESS = "192.168.1.6"

MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
MENDER_STORAGE_TOTAL_SIZE_MB = "7416"

MENDER_ARTIFACT_NAME = "release-1"

INHERIT += "mender-full"
MENDER_FEATURES_DISABLE_append = " mender-growfs-data"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"

MENDER_STORAGE_DEVICE_imx6ulevk = "/dev/mmcblk1"

MACHINE ??= 'imx6ulevk'
DISTRO ?= 'fslc-xwayland'
PACKAGE_CLASSES ?= 'package_rpm'
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "/home/ux/.yocto/warrior/downloads/"
ACCEPT_FSL_EULA = "1"

```

Basically, I’ve 3 questions:

1. Does mender create the required partitions?
2. If not, do we need to create them manually or is there any steps to be followed
3. How to check the mender integration on iMX6UL EVK?

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [May 15, 2020, 8:28am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/2 "2020-05-15T08:28:54Z")

</div>

It should create the data partition automatically. You could try setting the MENDER\_DATA\_PART\_SIZE\_MB variable explicit in your local.conf in case the default is not working for some reason.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 15, 2020, 8:31am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/3 "2020-05-15T08:31:48Z")

</div>

meta-mender should build an image with all the partitions in place. But you how have to use these images to provision your device. The image suffix should be `.sdimg` in your case.

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 8:40am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/4 "2020-05-15T08:40:13Z")

</div>

Hey @mirzak,

Thanks for bringing this to my attention, but my current `local.conf` won’t produce `.sdimg` file and also I’ve disabled the `.uefiimg` so I’m using the default `core-image-base-imx6ulevk-20200515082827.wic.gz` to boot up my system.

**NOTE** : Earlier I included the following in my `local.conf`

```auto
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"

```

and tried the `.sdimg` but it doesn’t boot up at all

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 15, 2020, 8:41am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/5 "2020-05-15T08:41:21Z")

</div>

> [@danie](#):
>
> and tried the `.sdimg` but it doesn’t boot up at all

This is something that needs to be resolved then. Because the `sdimg` contains the appropriate partitions not the `wic.gz`

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 9:13am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/6 "2020-05-15T09:13:58Z")

</div>

Thanks for pointing me in the right direction. However when I try booting with `.sdimg` it doesn’t boot up.

The starting address of `/` in `.wic` image is **8192** as shown below:

```auto
$sudo fdisk -l | grep sd
Disk /dev/sdc: 7.2 GiB, 7776239616 bytes, 15187968 sectors
/dev/sdc1 * 8192 56023 47832 23.4M c W95 FAT32 (LBA)
/dev/sdc2 57344 9705881 9648538 4.6G 83 Linux

```

The `.sdimg` contains all the four partitions as mentioned in [Mender partition configuration](https://docs.mender.io/2.3/devices/yocto-project/partition-configuration#configuring-the-partition-sizes) however the starting _ **address now changed to 49152** _.

```auto
$sudo fdisk -l | grep sd
/dev/sdc1 * 49152 81919 32768 16M c W95 FAT32 (LBA)
/dev/sdc2 81920 7487487 7405568 3.5G 83 Linux
/dev/sdc3 7487488 14893055 7405568 3.5G 83 Linux
/dev/sdc4 14893056 15155199 262144 128M 83 Linux

```

I thought the **problem is changed address can you help me figuring this out**. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 15, 2020, 9:15am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/7 "2020-05-15T09:15:34Z")

</div>

Can you please share the `.wks` source that is used to build your `wic` file?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 15, 2020, 9:17am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/8 "2020-05-15T09:17:31Z")

</div>

Start should not matter much. What I suspect is that you have an embedded bootloader in the `wic` and not in the `.sdimg`.

Then you need to specific the following variables (with similar information that you will find in the `.wks` file):

[https://docs.mender.io/2.3/artifacts/yocto-project/variables#mender\_image\_bootloader\_bootsector\_offset](https://docs.mender.io/2.3/artifacts/yocto-project/variables#mender_image_bootloader_bootsector_offset)  
[https://docs.mender.io/2.3/artifacts/yocto-project/variables#mender\_image\_bootloader\_file](https://docs.mender.io/2.3/artifacts/yocto-project/variables#mender_image_bootloader_file)

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 10:28am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/9 "2020-05-15T10:28:34Z")

</div>

There are lots of `.wks` files in the directory, as below:

```auto
~/warrior_yocto/mender_build/tmp/work/imx6ulevk-fslc-linux-gnueabi/core-image-base/1.0-r0/mender-uefiimg.wks
~/warrior_yocto/mender_build/tmp/work/imx6ulevk-fslc-linux-gnueabi/core-image-base/1.0-r0/imx-uboot-spl-bootpart.wks
~/warrior_yocto/mender_build/tmp/work/imx6ulevk-fslc-linux-gnueabi/core-image-base/1.0-r0/mender-sdimg.wks
~/warrior_yocto/sources/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/mkefidisk.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/directdisk.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/mkhybridiso.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/systemd-bootdisk.wks
~/warrior_yocto/sources/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks
~/warrior_yocto/sources/poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
~/warrior_yocto/sources/poky/meta-selftest/wic/wictestdisk.wks
~/warrior_yocto/sources/poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks
~/warrior_yocto/sources/poky/meta-yocto-bsp/wic/beaglebone-yocto.wks
~/warrior_yocto/sources/poky/meta-yocto-bsp/wic/edgerouter.wks
~/warrior_yocto/sources/poky/meta-yocto-bsp/wic/genericx86.wks
~/warrior_yocto/sources/meta-freescale/wic/imx-uboot.wks

```

And I’m sharing the contents of `~/warrior_yocto/sources/meta-freescale/wic/imx-uboot.wks` as I thought it would be the appropriate one:

```auto
# short-description: Create SD card image with a boot partition
# long-description:
# Create an image that can be written onto a SD card using dd for use
# with i.MX SoC family
# It uses u-boot
#
# The disk layout used is:
# - --------- --------------
# | | u-boot | rootfs |
# - --------- --------------
# ^ ^ ^ ^
# | | | |
# 0 1kiB 4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

```

Kindly walk me through the next step if this is the one, or specify the file name so that I could share that with you.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 15, 2020, 10:31am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/10 "2020-05-15T10:31:12Z")

</div>

> [@danie](#):
>
> Kindly walk me through the next step if this is the one

I do not know which one you are using as this is something that is probably set in your `MACHINE` configuration.

But the one you pasted would translate to:

```auto
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "2"
MENDER_IMAGE_BOOTLOADER_FILE = "u-boot.imx"

```

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 10:39am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/11 "2020-05-15T10:39:14Z")

</div>

> [@mirzak](#):
>
> `MACHINE` configuration.

The file pointed in `machine.conf` (_imx6ulevk.conf_) is as follows `~/warrior_yocto/mender_build/tmp/work/imx6ulevk-fslc-linux-gnueabi/core-image-base/1.0-r0/imx-uboot-spl-bootpart.wks`, sorry for the previous one.

```auto
# short-description: Create SD card image with a boot partition
# long-description:
# Create an image that can be written onto a SD card using dd for use
# with i.MX SoC family.
# It uses SPL and u-boot
#
# The disk layout used is:
# - ----- --------- -------------- --------------
# | | SPL | u-boot | boot | rootfs |
# - ----- --------- -------------- --------------
# ^ ^ ^ ^ ^
# | | | | |
# 0 1kiB 69kiB 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk --no-table --align 69
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

```

---

<div class="post-metadata">

**Author:** ![danie](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/danie/32/620_2.png) [@danie](https://hub.mender.io/u/danie)\
**Post date:** [May 15, 2020, 11:18am UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/12 "2020-05-15T11:18:34Z")

</div>

Hi @mirzak,

I’ve added the following lines in the `local.conf`

```auto
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "2"
MENDER_IMAGE_BOOTLOADER_FILE = "SPL"

```

and now board is looping in,

```auto
U-Boot SPL 2019.07+fslc+gca0ab15271 (May 15 2020 - 08:46:04 +0000)
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
spl_load_image_ext: ext4fs mount err - 0

```

Can you help me in this?

---

<div class="post-metadata">

**Author:** ![TheMeaningfulEnginee](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/themeaningfulenginee/32/988_2.png) [@TheMeaningfulEnginee](https://hub.mender.io/u/TheMeaningfulEnginee)\
**Post date:** [December 15, 2020, 9:43pm UTC](https://hub.mender.io/t/mender-is-not-creating-partitions-in-imx6-ul/1924/13 "2020-12-15T21:43:32Z")

</div>

Hi @danie  
it seems like the problem is likely that there two u-boot artifacts (SPL and u-boot) being created.  
It does seem to be a possibility to have those two things together which is what happens in the example of the “u-boot.imx” wks:

```
part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1

```

I’d look for imx layer related variables which define how to create the u-boot.imx.
