# Raspberry Pi 4 ubuntu arm64

**URL:** <https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898>\
**Category:** General Discussions\
**Tags:** ubuntu, arm64\
**Created:** [November 29, 2020, 6:36pm UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898 "2020-11-29T18:36:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixsteghofer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/felixsteghofer/32/959_2.png) [@felixsteghofer](https://hub.mender.io/u/felixsteghofer)\
**Post date:** [November 29, 2020, 6:36pm UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/1 "2020-11-29T18:36:47Z")

</div>

Hi there,

I am trying to convert an existing ubuntu arm64 image for an Raspberry Pi 4 to the correct partition layout including uboot etc.

So far I managed to build the image with a custom config:

> ```
> RASPBERRYPI_CONFIG="raspberrypi4"
> RASPBERRYPI_KERNEL_IMAGE="vmlinuz"
> MENDER_KERNEL_IMAGETYPE="zImage"
> MENDER_DEVICE_TYPE="raspberrypi4"
> MENDER_BOOT_PART_SIZE_MB="256"
> MENDER_STORAGE_TOTAL_SIZE_MB="16000"
> source configs/raspberrypi_config
> 
> ```

Built with:  
`MENDER_ARTIFACT_NAME=release-0.1 ./docker-mender-convert --disk-image input/raspi.img --config configs/raspberrypi4_custom_config --overlay rootfs_overlay_demo/`

Unfortunately the image fails at boot with the following error message:  
#- Error: “mender\_setup” not defined  
Full output below:

 ![Screenshot_20201129_185231](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/c6d0b38d9b1ca15ea1b1d334e2ffec7897086762.jpeg)

I am quite lost where to proceed from here. The image is pretty much a vanilla ubuntu arm64 20.04.

Does anybody have any clues what is going on here?

Best,  
Felix

---

<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:** [November 30, 2020, 7:33am UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/2 "2020-11-30T07:33:00Z")

</div>

Hi @felixsteghofer.

It looks like it was not successful in replacing U-Boot during the mender-convert process.

Please take a look here,

> <https://github.com/mendersoftware/mender-convert/blob/master/configs/raspberrypi_config#L61-L79>

I would guess that there is something in this logic that does not match your case, and which might need a fix.

---

<div class="post-metadata">

**Author:** ![felixsteghofer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/felixsteghofer/32/959_2.png) [@felixsteghofer](https://hub.mender.io/u/felixsteghofer)\
**Post date:** [November 30, 2020, 10:49am UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/3 "2020-11-30T10:49:58Z")

</div>

Hi @mirzak,

I appreciate your help and found my missing RASPBERRYPI\_BOOTLOADER\_IMAGE might cause the issue. I wanted to add that but one question arised that I could not answer by searching in the doc.

~~Where is the custom u-boot built, in my case for the raspberry pi with 64 bit? I could only find information for Yocto based images where presumably a custom u-boot is built.~~

I checked the resulting image that mender-convert created and the u-boot is still the same as in the “stock” input image.

=\> sry, was too fast. Could find the script at [https://github.com/mendersoftware/mender-convert-integration-scripts](https://github.com/mendersoftware/mender-convert-integration-scripts)  
Only have to migrate that for 64 bit

Best,  
Felix

---

<div class="post-metadata">

**Author:** ![felixsteghofer](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/felixsteghofer/32/959_2.png) [@felixsteghofer](https://hub.mender.io/u/felixsteghofer)\
**Post date:** [December 1, 2020, 5:26pm UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/4 "2020-12-01T17:26:18Z")

</div>

Hi @mirzak

I do now have a working uboot (took some time to debug kernel panics, this is pretty new for me).  
Steps I took:

- crosscompiled a custom 64bit u-boot (branch mender-rpi\_2020.01 from [https://github.com/mendersoftware/uboot-mender](https://github.com/mendersoftware/uboot-mender) with “rpi\_4\_defconfig”)
- created a custom boot.scr with `mkimage -C none -A arm64 -T script -d boot.cmd boot.scr`

At the moment my boot.cmd is a mess copy pasted from the existing ubuntu boot.scr and the one from mender-convert-integration-scripts:

```auto
fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
fdt move ${fdt_addr} ${fdt_addr_r}
run mender_setup
mmc dev ${mender_uboot_dev}
if load ${mender_uboot_root} ${ramdisk_addr_r} /boot/vmlinuz; then
    kernel_size=${filesize}
    unzip ${ramdisk_addr_r} ${kernel_addr_r}
    setenv kernel_size ${filesize}
    setenv try_boot "booti"
    load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /boot/initrd.img
    setenv ramdisk_param "${ramdisk_addr_r}:${filesize}"
    for cmd in ${try_boot}; do
         echo "Booting Ubuntu (with ${cmd}) from ${devtype} ${devnum}:${partition}..."
         ${cmd} ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}
     done
else
    echo "No bootable Kernel found."
fi
run mender_try_to_recover
 
# Recompile with:
# mkimage -C none -A arm64 -T script -d boot.cmd boot.scr

```

At first glance, do you spot anything that makes this config unusable with mender? E.g. for the safe updates?

---

<div class="post-metadata">

**Author:** ![janezcimerman](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/janezcimerman/32/1580_2.png) [@janezcimerman](https://hub.mender.io/u/janezcimerman)\
**Post date:** [October 7, 2021, 12:28pm UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/5 "2021-10-07T12:28:50Z")

</div>

Im also interested in making this work. Was there any progress on this?

---

<div class="post-metadata">

**Author:** ![jcheng2021](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jcheng2021](https://hub.mender.io/u/jcheng2021)\
**Post date:** [November 30, 2021, 10:20pm UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/6 "2021-11-30T22:20:55Z")

</div>

I’m also interested in this topic, anyone has successfully converted ubuntu image and is able to boot up?

---

<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:** [January 25, 2022, 10:43am UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/7 "2022-01-25T10:43:09Z")

</div>

As of now, I have been fighting Mender and Ubuntu Server versions (20.x and 21.x), but have not been able to get a bootable image. The latest status is:

1. Fresh Ubuntu 20 Server x64 on RPI4 install

2. Shutdown RPI4 and modified partition structure to match Mender’s expected layout (not sure if this is needed, just grasping at straws after a month…

3. Booted RPI4 again to confirm new layout did not bork the system. Shutdown after confirmation.

4. Imaged using

5. Resulting goldenimage.img converted without customizations in config files, and the conversion process completes without unexpected warnings or errors (size warnings and other items were expected).

6. Image written using dd using reverse of previous process.

7. RPI4 booted, but nothing occurs. Black screen from display output…

---

<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:** [February 11, 2022, 7:58am UTC](https://hub.mender.io/t/raspberry-pi-4-ubuntu-arm64/2898/8 "2022-02-11T07:58:16Z")

</div>

annnnnnd nothin’… dead topic… fun…
