# Debian image for raspberry pi 3 convertion fail

**URL:** <https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629>\
**Category:** General Discussions\
**Created:** [October 7, 2020, 2:16pm UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629 "2020-10-07T14:16:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xcancerberox](https://avatars.discourse-cdn.com/v4/letter/x/4bbf92/32.png) [@xcancerberox](https://hub.mender.io/u/xcancerberox)\
**Post date:** [October 7, 2020, 2:16pm UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/1 "2020-10-07T14:16:55Z")

</div>

Hi. I’m trying to convert a Debian (NOT raspbian) image. I’m generating the image using vmdb2 and it works fine before conversion.

I’m using mender-convert 2.2.0 tag and running it from docker using (docker-mender-convert):

```auto
mender-convert ((2.2.0))$ MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert --disk-image input/myimage.img --config configs/raspberrypi3_config

```

Doing it directly doesn’t work. It still use the kernel from debian and doesn’t boot from mender uboot.

I changed the config.txt to do that, just deleted kernel and initramfs definition and then it boot the uboot from mender-convert. The problem then is that it doesn’t boot any kernel.

I’m doing something wrong? how do I make this work?  
I don’t know if the mender convert is prepared to use the initramfs and kernel from debian.

Thanks for the help!  
–joa

---

<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:** [October 7, 2020, 5:05pm UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/2 "2020-10-07T17:05:59Z")

</div>

Hi,

Never tested using Debian images built with vmdb2, but it is a very interesting use-case.

You probably need to do some minor tweaks of the various Raspberry Pi configuration files, majority of the logic is [https://github.com/mendersoftware/mender-convert/blob/master/configs/raspberrypi\_config](https://github.com/mendersoftware/mender-convert/blob/master/configs/raspberrypi_config).

You can also have a look at the `boot.scr` file which contains the logic that U-Boot will execute to boot the device. It for sure does not contain anything initramfs related, so might need to tweak this one.

---

<div class="post-metadata">

**Author:** ![xcancerberox](https://avatars.discourse-cdn.com/v4/letter/x/4bbf92/32.png) [@xcancerberox](https://hub.mender.io/u/xcancerberox)\
**Post date:** [October 14, 2020, 9:52am UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/3 "2020-10-14T09:52:03Z")

</div>

Hi @mirzak,

Thanks for replying. Yes, I took some time and follow the scripts on mender convert. I finally get the uboot running, the problem was that the config.txt file of debian defines the kernel and initramfs and the mender\_convert script doesn’t override that value. I changed that (commented all) and then I have uboot running.

My problem now is that the bootscr is looking for a kernel to boot (zImage or uImage) and debian uses initramfs and vmlinux. My line of work will follow that. Any comment or help is appreciated .

Just for some context this work I’m doing is for a open hardware and software project called Librerouter ([https://librerouter.org/](https://librerouter.org/)). The repo whit the image building is here ([https://gitlab.com/librerouter/miniserver](https://gitlab.com/librerouter/miniserver)).

---

<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:** [October 14, 2020, 10:38am UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/4 "2020-10-14T10:38:48Z")

</div>

You can override the default `boot.scr` with something that is compatible with your environment using [hooks/overrides](https://docs.mender.io/system-updates-debian-family/convert-a-mender-debian-image/customization#hooks-overrides)

The `boot.scr` we use is generated [here](https://github.com/mendersoftware/mender-convert-integration-scripts/blob/master/build-uboot-rpi.sh#L56-L76), which work as source of inspiration.

---

<div class="post-metadata">

**Author:** ![xcancerberox](https://avatars.discourse-cdn.com/v4/letter/x/4bbf92/32.png) [@xcancerberox](https://hub.mender.io/u/xcancerberox)\
**Post date:** [March 3, 2021, 12:55pm UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/5 "2021-03-03T12:55:33Z")

</div>

Hey. Getting back to this.

I managed to get a bootable image:

- First I had to build uboot from your fork to ARCH=arm64. With this bootloader I could boot the debian kernel.
- Then I had to change the bootscript to add the initramfs like this:

```auto
setenv kernel_addr_r 0x20000000
setenv ramdisk_addr_r 0x30000000

load mmc 0 ${fdt_addr_r} bcm2837-rpi-3-b.dtb

fdt addr ${fdt_addr_r}
fdt get value bootargs /chosen bootargs

run mender_setup
mmc dev ${mender_uboot_dev}

setenv bootargs "root=${mender_kernel_root} rw elevator=deadline fsck.repair=yes net.ifnames=0 cma=64M rootwait"

if load ${mender_uboot_root} ${kernel_addr_r} /vmlinuz; then
    if load ${mender_uboot_root} ${ramdisk_addr_r} /initrd.img; then
        booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
    else
        echo "No initramfs found."
    fi
else
    echo "No bootable Kernel found."
fi
run mender_try_to_recover

```

- Using mender-convert I convert the debian image and then copy this files.

With this I have a debian imagen booting using kernel and initramfs from debian.

I’m having a problem now when using mender-client. When I try to execute it I get an error from fw\_printenv:

```auto
$ mender show-artifact
WARN[0000] No server URL(s) specified in mender configuration. 
WARN[0000] Server entry 1 has no associated server URL. 
ERRO[0000] Failed to read the current active partition: No match between boot and root partitions.: fork/exec /usr/sbin/fw_printenv: no such file or directory 

```

The fw\_printenv binary is there and if I try to execute it I get the same error.

Any hint how to continue? Thanks for the support!

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 3, 2021, 6:07pm UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/6 "2021-03-03T18:07:54Z")

</div>

My guess is that the fw\_printenv binary is for a different CPU architecture or some such. What does the following show?

> $ file /usr/bin/mender  
> $ file /usr/sbin/fw\_printenv

What is your OS/Distro on the board?

---

<div class="post-metadata">

**Author:** ![xcancerberox](https://avatars.discourse-cdn.com/v4/letter/x/4bbf92/32.png) [@xcancerberox](https://hub.mender.io/u/xcancerberox)\
**Post date:** [March 17, 2021, 11:28am UTC](https://hub.mender.io/t/debian-image-for-raspberry-pi-3-convertion-fail/2629/7 "2021-03-17T11:28:21Z")

</div>

Hey @drewmoseley! Yes, that was the problem. I Checked the /usr/bin/fw\_printenv but the system is using the /usr/sbin/fw\_printenv installed by mender-convert and this one is 32bits.

I’m working on my scripts to delete the binaries installed by mender-convert and use the system ones. Thanks!
