Add Mono Runtime to Yocto Image
Now that we have a functioning OS on the board, we have to add Mono Runtime to it. This step is also not fully straightforward, some tricks must be pulled from a sleeve. Read carefully.
Install kernel v. 6.2.12 on Fedora 36 VM (IMPORTANT)
The first step is to downgrade kernel to v. 6.2.12. This may seem odd at first, but building Mono runtime on any kernel greater than v. 6.2.12 crashes. This fact has been documented in multiple on-line resources, including e.g., Bugzilla of Red Hat community.
- Open your favourite terminal (MATE, VS Code, or similar).
-
Prepare download folder.
mkdir ~/kernel-6.2.12 cd ~/kernel-6.2.12 -
Download packages.
wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-6.2.12-100.fc36.x86_64.rpm wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-core-6.2.12-100.fc36.x86_64.rpm wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-6.2.12-100.fc36.x86_64.rpm wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-extra-6.2.12-100.fc36.x86_64.rpm wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-core-6.2.12-100.fc36.x86_64.rpm -
Install them.
sudo dnf install ./*.rpm -
Verify, if installation was successful.
sudo grubby --info=ALL | grep 6.2.12 -
Reboot your VM.
reboot - While booting, choose Advanced options → Fedora 6.2.12
Optional tip:
Read this material.
Preparing Yocto build environment for Mono runtime
- In your Fedora VM, Start Visual Studio Code.
- File → Open Folder → open
/home/developer/fsimx6-Y2024.04.1/build/yocto-fus/sourcesfolder. - Terminal → New Terminal folder.
-
Verify in terminal, that you are located in
/home/developer/fsimx6-Y2024.04.1/build/yocto-fus/sourcesfolder.pwdIf not, then
cdinto it. -
Git clone
meta-monolayer.git clone https://github.com/DynamicDevices/meta-mono.git -b kirkstone cd meta-mono -
In Visual Studio Code’s file browser, browse to folder, where OS image recipes are defined, that is into:
meta-fus/recipes-config/images. -
Create a new file
fus-image-mono.bbin the folder. Feel free to utilize Visual Studio Code’s file explorer and code editor to do this. Depending no your taste, it is probably more simple that way, as opposed to typing commands into terminal. If you prefer terminal way of doing things, you can do that too. -
Put this content into it:
DESCRIPTION = "F&S Mono image" LICENSE = "MIT" require recipes-config/images/fus-image-std.bb inherit features_check IMAGE_INSTALL += "mono tzdata libgdiplus" DEFAULT_TEST_SUITES_pn-${PN} = "mono ssh ping"Save the file.
-
Now open a different folder with Visual Studio Code: File → Open Folder → open
/home/developer/fsimx6-Y2024.04.1/build/yocto-fus/build-fsimx6-fus-imx-xwayland/conffolder. - In Visual Studio Code, open
bblayers.conffile. - Add this line to the end of it:
BBLAYERS += "${BSPDIR}/sources/meta-mono" - Optionally, if you want to decrease OS build time, consider commenting out some layers, which are not needed in the resulting OS image. These could include:
# BBLAYERS += "${BSPDIR}/sources/meta-nxp-demo-experience" # BBLAYERS += "${BSPDIR}/sources/meta-browser/meta-chromium" # BBLAYERS += "${BSPDIR}/sources/meta-virtualization" # BBLAYERS += "${BSPDIR}/sources/meta-clang" - Terminal → New Terminal folder.
-
Browse into
/home/developer/fsimx6-Y2024.04.1/build/yocto-fusfolder again.cd /home/developer/fsimx6-Y2024.04.1/build/yocto-fus -
Set environment variables.
DISTRO=fus-imx-xwayland MACHINE=fsimx6 source setup-environment build-fsimx6-fus-imx-xwayland -
Start OS build process.
bitbake fus-image-mono
We are going to create a new recipe that will allow us to build OS which includes Mono runtime. We will call the recipe fus-image-mono.
Deploying Mono image to the board
Once the OS image is built, it is time to deploy it to the board. The deployment is very similar to the one described in OS deployment section of previous article, however a few file names are changed.
So perform the same steps, however use this set of terminal commands to copy files to SD Card.
cp -L armstonea9q-fsimx6.dtb /mnt/f/armstonea9q.dtb
cp -L install.scr /mnt/f
cp -L fus-image-mono-fsimx6.manifest /mnt/f
cp -L fus-image-mono-fsimx6.ubifs /mnt/f/rootfs-fsimx6.ubifs
cp -L uboot.nb0 /mnt/f
cp -L zImage /mnt/f/zImage-fsimx6
In other words, instead of copying fus-image-std root file system data, we copy fus-image-mono file system data.
- Once copied, remove SD card from host computer, plug it into the boad and reboot the board. Since you now already have U-Boot on the board, it is not necessary to re-flash it with U-Boot. Instead, we can use the existing U-Boot to just reflash the board with the OS. Therefore, when booting up, check the messages that are displayed in DCUTerm. As soon as you see an U-Boot message
Hit any key to ..., press a key on the keyboard. That will interrupt the boot process and allow you to type commands into U-Boot. - Type this command to verify, that U-Boot is able to read data from SD card. The command should list files on your SD Card:
ls mmc 0 - If the command succeeded, use this command to tell U-Boot to reflash the OS from SD card:
update.install saveenv reset - When the OS boots up, log into it (by default, username:
root, no password). - Type
mono --versioncommand at command prompt. If version information appears, then Mono runtime is properly installed.
Documentation notice
Information may change over time
Technical details on this page may change as vendor tools, board support packages, operating system images, and runtime versions evolve.
This page was last technically reviewed on May 5, 2026. If your setup differs from the one described here, please contact us for help.
