In this article, we share the process for creating your own custom firmware for the i.MX 8M Plus virtual board.
This packaging process follows the Understanding Firmware on AVH knowledge base article and uses the i.MX 8M Plus image version 5.10.72, available directly from NXP.
Firmware Package Contents
A proper Ubuntu Server firmware package file contains the following:
Info.plist
- the version, type, build, unique identifier, and device identifiernand
- the preinstalled i.MX8M Plus arm64 image file from NXPdevicetree
- hardware components data for the Linux kernelkernel
- the Linux kernel file
Firmware Packaging Script
The following script creates a custom firmware package in your working directory.
Run the script as a superuser.
#!/bin/bash
set -e
dir_name="imx8mp_package"
output_filename="imx8mp_yocto_firmware.zip"
firmware_name="LF_v5.10.72-2.2.0_images_IMX8MPEVK.zip"
image_name="imx-image-full-imx8mpevk.wic"
# Create a temporary directory and extract the image
[ -d ${dir_name} ] || mkdir ${dir_name}
cd ${dir_name}
unzip -d . ../${firmware_name} ${image_name}
mv ${image_name} nand
# Mount the boot partition and extract the kernel and device tree
LO="$(losetup -f)"
losetup -P ${LO} nand
mkdir boot/
mount ${LO}p1 boot/
cp boot/Image kernel
cp boot/imx8mp-evk.dtb devicetree
umount boot/
rm -r boot/
# Mount the root filesystem to make any custom modifications
mkdir rootfs/
mount ${LO}p2 rootfs/
touch rootfs/custom_file_on_filesystem
umount rootfs/
rm -r rootfs/
losetup -D ${LO}
# Create the metadata file Info.plist
cat << EOF > Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Type</key>
<string>iot</string>
<key>UniqueIdentifier</key>
<string>i.MX 8M Plus Yocto 2.2.0</string>
<key>DeviceIdentifier</key>
<string>imx8mp-evk</string>
<key>Version</key>
<string>2.2.0</string>
<key>Build</key>
<string>5.10.72-2.2.0</string>
</dict>
</plist>
EOF
# Zip the contents and remove the packaging directory
zip ../${output_filename} nand kernel devicetree Info.plist
cd ..
rm -r ${dir_name}
โ