I am building Ubuntu core image for iMX8 using Gadget snap and kernel snap. But after building Ubuntu core image i am not able to boot the board. Ubuntu core image size is 4.3Gb but after flashing there are two partitions one is of size 420Mb and another of 128Mb. When opening the 420Mb file i can see only kernel snap is present there. I am facing issue with the Gadget snap. Please look into the issue and help to resolve it.
**Kernel snap file**
**snapcraft.yaml**
name: imx8-kernel
version: 4.4
base: core18
summary: A i.mx8-kernel built from source
description: This provides a kernel snap for i.mx8.
type: kernel
architectures:
- build-on: arm64
run-on: arm64
confinement: strict
parts:
kernel:
plugin: kernel
source: http://source.codeaurora.org/external/imx/linux-imx
source-depth: 1
source-branch: rel_imx_5.4.24_2.1.0
source-type: git
kdefconfig: [imx_v8_defconfig]
kconfigs:
- CONFIG_CONFIGFS_FS=y
- CONFIG_KEYS=y
- CONFIG_ENCRYPTED_KEYS=y
- CONFIG_BLK_DEV_LOOP=y
- CONFIG_BLK_DEV_LOOP_MIN_COUNT=256
- CONFIG_SQUASHFS=y
- CONFIG_SQUASHFS_FILE_DIRECT=y
- CONFIG_SQUASHFS_DECOMP_SINGLE=y
- CONFIG_SQUASHFS_XATTR=y
- CONFIG_SQUASHFS_ZLIB=y
- CONFIG_SQUASHFS_LZ4=y
- CONFIG_SQUASHFS_LZO=y
- CONFIG_SQUASHFS_XZ=y
- CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
- CONFIG_CGROUP_FREEZER=y
- CONFIG_NF_NAT_IPV4=m
- CONFIG_NF_NAT_NEEDED=y
- CONFIG_BLK_DEV_THROTTLING=y
- CONFIG_IOSCHED_CFQ=y
- CONFIG_CFQ_GROUP_IOSCHED=y
- CONFIG_NET_CLS_CGROUP=m
- CONFIG_CGROUP_NET_PRIO=y
- CONFIG_RT_GROUP_SCHED=m
- CONFIG_EXT4_FS_SECURITY=y
- CONFIG_AUFS_FS=m
- CONFIG_DM_THIN_PROVISIONING=m
- CONFIG_OVERLAY_FS_V1=y
- CONFIG_RTC_DRV_CMOS=m
- CONFIG_NVRAM=m
- CONFIG_CC_STACKPROTECTOR=y
- CONFIG_CC_STACKPROTECTOR_REGULAR=y
- CONFIG_DEBUG_RODATA=y
- CONFIG_DEBUG_SET_MODULE_RONX=y
- CONFIG_RFKILL_REGULATOR=m
- CONFIG_UEVENT_HELPER_PATH=""
- CONFIG_DEFAULT_SECURIT_APPARMOR=y
- CONFIG_TMPFS_XATTR=y
- CONFIG_TEMPFS_POSIX_ACL
- CONFIG_DEBUG_SET_MODULE_RONX
- CONFIG_DBUG_RODATA
- CONFIG_DEFAULT_SECURITY_APPARMOR
override-build: |
snapcraftctl build
cp $SNAPCRAFT_PART_BUILD/arch/arm64/boot/Image $SNAPCRAFT_PART_INSTALL
kernel-with-firmware: False
kernel-image-target: Image
build-packages: [cpio, kmod, bc]
**Gadget snap files**
**snapcraft.yaml:**
name: imx8-gadget
version: new
summary: A i.mx8-gadget built from source
description: |
Bootloader files and partitoning data to create a
bootable Ubuntu Core image for the imx8mpevk from NXP.
type: gadget
base: core18
architectures:
- build-on: amd64
run-on: arm64
confinement: strict
grade: stable
parts:
uboot:
plugin: make
source: https://source.codeaurora.org/external/imx/uboot-imx
source-branch: imx_v2020.04_5.4.24_2.1.0
source-type: git
override-build: |
CROSS_COMPILE=aarch64-linux-gnu- make imx8mp_evk_defconfig
CROSS_COMPILE=aarch64-linux-gnu- make
CROSS_COMPILE=aarch64-linux-gnu- make u-boot.bin
mkdir -p $SNAPCRAFT_PART_INSTALL/boot-assets
cp u-boot.bin $SNAPCRAFT_PART_INSTALL/boot-assets/uboot.bin
cp $SNAPCRAFT_PART_BUILD/u-boot.bin $SNAPCRAFT_PART_INSTALL/
#tools/mkenvimage -r -s 131072 -o $SNAPCRAFT_PART_INSTALL/uboot.env $SNAPCRAFT_PROJECT_DIR/uboot.env.in
tools/mkenvimage -r -s 8192 -o $SNAPCRAFT_PART_INSTALL/uboot.env /home/el/imx8-gadget/uboot.env.in
cd $SNAPCRAFT_PART_INSTALL/; ln -s uboot.env uboot.conf
build-packages:
- libpython2.7-dev
- build-essential
- bc
- device-tree-compiler
- gcc-aarch64-linux-gnu
- bison
- flex
**gadget.yaml**
device-tree: imx8mp-evk.dtb
volumes:
evk:
schema: mbr
bootloader: u-boot
structure:
- name: boot-img
type: bare
size: 8355840
offset: 32768
content:
- image: u-boot.bin
- name: system-boot
type: 0C
filesystem: vfat
filesystem-label: system-boot
size: 128M
role: system-boot
- name: writable
type: 83
filesystem: ext4
filesystem-label: writable
size: 420M
role: system-data