# Unable to convert Image to Mender format using mender-convert

**URL:** <https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166>\
**Category:** General Discussions\
**Created:** [October 8, 2021, 12:56pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166 "2021-10-08T12:56:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Deepthi](https://hub.mender.io/u/Deepthi)\
**Post date:** [October 8, 2021, 12:56pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/1 "2021-10-08T12:56:12Z")

</div>

Hi I am using Dra7xx/ Jacinto6plus. I am trying to convert my Image using mender-convert 2.5 version.  
Output of my fdisk -l golden-image-1.img is

Disk golden-image-1.img: 29.7 GiB, 31914983424 bytes, 62333952 sectors  
Units: sectors of 1 \* 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disklabel type: dos  
Disk identifier: 0x8ba2f9ba

Device Boot Start End Sectors Size Id Type  
golden-image-1.img1 \* 2048 3908297 3906250 1.9G c W95 FAT32 (LBA)  
golden-image-1.img2 3909632 62333951 58424320 27.9G 83 Linux

Below is the error when I am converting my image

sudo MENDER\_ARTIFACT\_NAME=release-1 ./docker-mender-convert --disk-image input/golden-image-1.img --config configs/mender\_convert\_config  
Running mender-convert --disk-image input/golden-image-1.img --config configs/mender\_convert\_config  
Running mender-convert-extract: --config ./work/override\_compression\_config --disk-image input/golden-image-1.img --config configs/mender\_convert\_config  
2021-10-08 09:07:20 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] Using configuration file: ./work/override\_compression\_config  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] Validating disk image  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] Disk parsed successfully  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] PART 1: SIZE: 1.9G TYPE: 0xc  
2021-10-08 09:07:21 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs  
2021-10-08 09:08:10 [INFO] [mender-convert-extract] PART 2: SIZE: 27.9G TYPE: 0x83  
2021-10-08 09:08:10 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs  
2021-10-08 09:42:14 [INFO] [mender-convert-extract] Extracting boot gap to work/boot-gap.bin  
mender-convert-extract has finished. Cleaning up…  
Running mender-convert-modify: --config ./work/override\_compression\_config --disk-image input/golden-image-1.img --config configs/mender\_convert\_config  
2021-10-08 09:42:17 [INFO] [mender-convert-modify] Using configuration file: configs/mender\_convert\_config  
2021-10-08 09:42:17 [INFO] [mender-convert-modify] Using configuration file: ./work/override\_compression\_config  
2021-10-08 09:42:17 [INFO] [mender-convert-modify] Using configuration file: configs/mender\_convert\_config  
2021-10-08 09:42:22 [INFO] [mender-convert-modify] Installing Mender client and related files  
2021-10-08 09:42:23 [INFO] [mender-convert-modify] Installing Mender client version latest  
2021-10-08 09:42:36 [INFO] [mender-convert-modify] Successfully downloaded mender-client\_3.1.0-1\_armhf.deb  
2021-10-08 09:42:40 [INFO] [mender-convert-modify] Successfully installed mender-client\_3.1.0-1\_armhf.deb into /mender-convert/work/rootfs/  
2021-10-08 09:42:41 [INFO] [mender-convert-modify] Creating the Mender Configure state folder in the data partition  
2021-10-08 09:42:46 [WARN] [mender-convert-modify] Found multiple kernel images:

```
/mender-convert/work/rootfs/boot/zImage-dra7xx-evm.bin
/mender-convert/work/rootfs/boot/zImage-4.4.84-g742f84423d
/mender-convert/work/rootfs/boot/zImage

```

2021-10-08 09:42:46 [WARN] [mender-convert-modify] Selecting newest kernel image:

```
/mender-convert/work/rootfs/boot/zImage-dra7xx-evm.bin

```

2021-10-08 09:42:46 [WARN] [mender-convert-modify] Set MENDER\_GRUB\_KERNEL\_IMAGETYPE to override selected kernel  
2021-10-08 09:42:46 [INFO] [mender-convert-modify] Found Linux kernel image:

```
/mender-convert/work/rootfs/boot/zImage-dra7xx-evm.bin

```

2021-10-08 09:42:47 [FATAL] [mender-convert-modify] Detected a kernel which does not have an EFI stub. This kernel is not supported when booting with UEFI. Please consider using a U-Boot port if the board has one (look for a board specific file in `configs`), or find a kernel which has the CONFIG\_EFI\_STUB turned on. To ignore this message and proceed anyway, set the MENDER\_IGNORE\_MISSING\_EFI\_STUB=1 config option.  
mender-convert-modify has finished. Cleaning up…  
Log file available at: logs/convert.log.27CN

I have enabled CONFIG\_EFI\_STUB in my kernel but still I am facing the same issue. If I need to ignore this message where to set MENDER\_IGNORE\_MISSING\_EFI\_STUB=1 config option.

Thank you,  
Deepthi

---

<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:** [October 8, 2021, 2:21pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/2 "2021-10-08T14:21:14Z")

</div>

Given that it’s finding multiple kernels, is it selecting the one you expect it to?, as you have a versioned kernel and a non-versioned kernel and it’s selecting the non-versioned kernel.

---

<div class="post-metadata">

**Author:** ![Deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Deepthi](https://hub.mender.io/u/Deepthi)\
**Post date:** [October 8, 2021, 4:51pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/3 "2021-10-08T16:51:55Z")

</div>

Hi dellgreen,

Thank you for the reply.  
Given that it’s finding multiple kernels, is it selecting the one you expect it to?  
No  
How to select which kernel to use and how to ignore EFI\_STUB?

Thank you,  
Deepthi

---

<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:** [October 8, 2021, 5:44pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/4 "2021-10-08T17:44:13Z")

</div>

you can try removing unwanted kernels from your golden image before putting it through the mender-conversion process. Depending on your distro they normally have tools/options for cleaning up unused kernels and their supporting files

---

<div class="post-metadata">

**Author:** ![Deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Deepthi](https://hub.mender.io/u/Deepthi)\
**Post date:** [October 9, 2021, 10:56am UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/5 "2021-10-09T10:56:10Z")

</div>

Hi Dellgreen,

I removed the kernels but still I am getting the same error.  
How to disable EFI\_STUB

Thank you,  
Deepthi

---

<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:** [October 9, 2021, 2:08pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/6 "2021-10-09T14:08:23Z")

</div>

I believe MENDER\_IGNORE\_MISSING\_EFI\_STUB=1 should be in placed in your own mender-convert config file

> **[Search · MENDER\_IGNORE\_MISSING\_EFI\_STUB · mendersoftware/mender-convert](https://github.com/mendersoftware/mender-convert/search?q=MENDER_IGNORE_MISSING_EFI_STUB)**
>
> An easy way to integrate the Mender client into an existing image - Search · MENDER\_IGNORE\_MISSING\_EFI\_STUB · mendersoftware/mender-convert

[https://tracker.mender.io/browse/MEN-2404](https://tracker.mender.io/browse/MEN-2404)

---

<div class="post-metadata">

**Author:** ![Deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Deepthi](https://hub.mender.io/u/Deepthi)\
**Post date:** [October 11, 2021, 6:21pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/7 "2021-10-11T18:21:16Z")

</div>

Hi Dellgreen,

I am able to disable MENDER\_IGNORE\_MISSING\_EFI\_STUB.Now I am unable to configure MENDER\_STORAGE\_TOTAL\_SIZE\_MB . I have done changes in mender\_convert\_config but I am not getting how much memory need to be allocated to this variable.

Below is the error:  
user@user-Latitude-5490:~/Mender/mender-convert$ sudo MENDER\_ARTIFACT\_NAME=release-1 ./docker-mender-convert --disk-image input/golden-image-1.img  
Running mender-convert --disk-image input/golden-image-1.img  
Running mender-convert-extract: --config ./work/override\_compression\_config --disk-image input/golden-image-1.img  
2021-10-11 16:09:24 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2021-10-11 16:09:24 [INFO] [mender-convert-extract] Using configuration file: ./work/override\_compression\_config  
2021-10-11 16:09:25 [INFO] [mender-convert-extract] Validating disk image  
2021-10-11 16:09:25 [INFO] [mender-convert-extract] Disk parsed successfully  
2021-10-11 16:09:25 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos  
2021-10-11 16:09:25 [INFO] [mender-convert-extract] PART 1: SIZE: 1.9G TYPE: 0xc  
2021-10-11 16:09:25 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs  
2021-10-11 16:11:50 [INFO] [mender-convert-extract] PART 2: SIZE: 27.9G TYPE: 0x83  
2021-10-11 16:11:50 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs  
2021-10-11 17:15:17 [INFO] [mender-convert-extract] Extracting boot gap to work/boot-gap.bin  
2021-10-11 17:15:19 [INFO] [mender-convert-modify] Using configuration file: configs/mender\_convert\_config  
mender-convert-extract has finished. Cleaning up…  
Running mender-convert-modify: --config ./work/override\_compression\_config --disk-image input/golden-image-1.img  
2021-10-11 17:15:19 [INFO] [mender-convert-modify] Using configuration file: ./work/override\_compression\_config  
2021-10-11 17:15:28 [INFO] [mender-convert-modify] Installing Mender client and related files  
2021-10-11 17:15:30 [INFO] [mender-convert-modify] Installing Mender client version latest  
2021-10-11 17:15:45 [INFO] [mender-convert-modify] Successfully downloaded mender-client\_3.1.0-1\_armhf.deb  
2021-10-11 17:15:49 [INFO] [mender-convert-modify] Successfully installed mender-client\_3.1.0-1\_armhf.deb into /mender-convert/work/rootfs/  
2021-10-11 17:15:50 [INFO] [mender-convert-modify] Creating the Mender Configure state folder in the data partition  
2021-10-11 17:15:51 [INFO] [mender-convert-modify] Using root device A in mender.conf: /dev/mmcblk0p2  
2021-10-11 17:15:51 [INFO] [mender-convert-modify] Using root device B in mender.conf: /dev/mmcblk0p3  
2021-10-11 17:15:53 [WARN] [mender-convert-modify] No mender.conf file found in resources. Have you remembered to run the bootstrap script?  
2021-10-11 17:15:53 [INFO] [mender-convert-modify] Creating state scripts version file.  
2021-10-11 17:15:53 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see /mender-convert/logs/convert.log.53OR for more info)  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Using boot partition device in fstab: /dev/mmcblk0p1  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Using data partition device in fstab: /dev/mmcblk0p4  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Running hook: platform\_modify  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Performing user/local specific modifications (if any)  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Running hook: user\_local\_modify  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Performing overlay specific modifications (if any)  
2021-10-11 17:15:54 [INFO] [mender-convert-modify] Running hook: overlay\_modify  
mender-convert-modify has finished. Cleaning up…  
Running mender-convert-package: --config ./work/override\_compression\_config --disk-image input/golden-image-1.img  
2021-10-11 17:15:59 [INFO] [mender-convert-package] Using configuration file: configs/mender\_convert\_config  
2021-10-11 17:15:59 [INFO] [mender-convert-package] Using configuration file: ./work/override\_compression\_config  
2021-10-11 17:15:59 [WARN] [mender-convert-package] The allocated boot part size 500 MiB is too small.  
2021-10-11 17:15:59 [WARN] [mender-convert-package] The actual boot part size is 1907 MiB  
2021-10-11 17:15:59 [WARN] [mender-convert-package] Will adjust MENDER\_BOOT\_PART\_SIZE\_MB automatically  
2021-10-11 17:15:59 [WARN] [mender-convert-package] Consider adjusting the configuration file to avoid this message  
2021-10-11 17:16:37 [WARN] [mender-convert-package] The calculated rootfs partition size 6960 MiB is too small.  
2021-10-11 17:16:37 [WARN] [mender-convert-package] The actual rootfs image size is 15498 MiB  
2021-10-11 17:16:37 [FATAL] [mender-convert-package] You can try adjusting the MENDER\_STORAGE\_TOTAL\_SIZE\_MB variable to increase available space, or modify one of the variables IMAGE\_ROOTFS\_SIZE, IMAGE\_ROOTFS\_EXTRA\_SPACE or IMAGE\_OVERHEAD\_FACTOR to reduce the size of the root filesystem.  
mender-convert-package has finished. Cleaning up…  
Log file available at: logs/convert.log.53OR

Thank you,  
Deepthi

---

<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:** [October 11, 2021, 11:15pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/8 "2021-10-11T23:15:23Z")

</div>

as a starting point i would set MENDER\_STORAGE\_TOTAL\_SIZE\_MB to

`1907 + (15498 * 2) + preferredDataPartitionSize`

and then fine tune from there on. There are other ways to do it.

So for example in one of my projects is set the following in my mender config file (your numbers will be different)

```auto
MENDER_STORAGE_TOTAL_SIZE_MB="23168"
MENDER_BOOT_PART_SIZE_MB="512"
MENDER_DATA_PART_SIZE_MB="1024"

```

which gives me approx 10G part A and Part B partitions.

I set a small data partition as i always configure the image to grow and resize the data partition on boot to fill whatever medium it may be running on.

---

<div class="post-metadata">

**Author:** ![Deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Deepthi](https://hub.mender.io/u/Deepthi)\
**Post date:** [October 19, 2021, 6:49pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/9 "2021-10-19T18:49:38Z")

</div>

Hi Dellgreen,

Now I have generated mender-convert image, I am able to see the partitions which are created using fdisk -l command but my board is not booting from the sdcard.  
How to test whether it is able to boot or not?  
Do I need to do any modifications in uboot source code?

Thank you,  
Deepthi

---

<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:** [October 19, 2021, 7:12pm UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/10 "2021-10-19T19:12:36Z")

</div>

I’m sorry, I’m not familiar with your board so don’t know. The manufacturer usually has pdfs with more info on that.

---

<div class="post-metadata">

**Author:** ![rushowr](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/rushowr/32/1436_2.png) [@rushowr](https://hub.mender.io/u/rushowr)\
**Post date:** [December 9, 2021, 9:53am UTC](https://hub.mender.io/t/unable-to-convert-image-to-mender-format-using-mender-convert/4166/11 "2021-12-09T09:53:06Z")

</div>

I am having the same issue as the OP, good ol’ EFI STUB not found in the kernel.

I have a customized version of mender\_convert\_config that has been dubbed mender\_convert\_rushowr (I literally copied the original to the new file and then edited the new file), and within this file I placed at the top before the compression settings:

```auto
MENDER_IGNORE_MISSING_EFI_STUB=1

```

When that didn’t make a difference in the conversion result, I doublechecked this thread and discovered that maybe it might need to be placed in, say, raspberrypi4\_ubuntu\_config.  
So the aforementioned variable was defined and assigned the appropriate value in THAT file.  
I run the conversion process again…and get the same result.  
Oh, and I almost forgot, here’s the conversion command used both times:

```auto
MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert \
--disk-image input/golden-image-1.img --config \
configs/raspberrypi4_ubuntu_config --config \
configs/mender_convert_ronin \
--overlay rootfs_overlay_demo/

```

I hate to complain, so I’ll hold off (for now) and just plead for assistance. I’m not sure why this issue was solved with a fix that I then tried and the result is a fatal error. (Sorry, the ordered, logical part of my brain is just as frustrated as the creative, emotional side, and that’s not a great thing, since logical brain is the one that tells emotional to chill out when it’s freaking out).

Thoughts, ideas regarding this issue?

Thanks in advance
