Info on mender integration

Hello , i’m trying to integrate mender without success on a board not present in the mender-community layer following this instructions .

I’ve got some questions :

  • is better to use grub instead of u-boot ?
  • there is a more detailed guide on how to integrate mender with a non community supported board ?

thanks to anybody will reply

Edit

Enabling GRUB as default bootloader i’ve reached a point where :

  1. the image builds without errors
  2. the image does not boot completely
  3. one of the rootfs partition is empty

I think that the second issue is related to the fact that the the partitions are malformed in some way , but i’m not sure why .
Do i need also to add a custom partitions layout? Reading from the mender docs More detailed storage configuration i was thinking that the mender-core layer will do a default layout ( because the docs says Note that the Mender image builder will not produce such images, so only set these variables if you're building partitioned images yourself, with a different layout than the default Mender layout (the example above reflects the default). .

Those are the boot logs


picocom v3.1

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready

U-Boot SPL 2020.01_oskar-dunfell_4.0.0-beta+g1e797797ee (Sep 29 2021 - 08:34:12 +0000)
Kontron SL i.MX8MM (N801X) module, 1 GB RAM detected
Normal Boot
Trying to boot from MMC2
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.0-0-gf1d7187f2-dirty
NOTICE:  BL31: Built : 09:58:42, Dec  1 2020


U-Boot 2020.01_oskar-dunfell_4.0.0-beta+g1e797797ee (Sep 29 2021 - 08:34:12 +0000)

CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
Reset cause: POR
Model: Kontron i.MX8MM N801X S
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@30be0000 [PRIME]
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
442 bytes read in 15 ms (28.3 KiB/s)
Menu entry 1 fits detected board. Use as default selection...
Select the boot mode
1:	Kontron i.MX8MM N801X S
2:	Kontron i.MX8MM N801X S LVDS
Enter choice: 1:	Kontron i.MX8MM N801X S
Retrieving file: /extlinux/../fitImage
8786612 bytes read in 388 ms (21.6 MiB/s)
append: root=/dev/mmcblk1p2 rootwait video=HDMI-A-1:1280x720 console=ttymxc2,115200
## Loading kernel from FIT Image at 43000000 ...
   Using 'conf@freescale_imx8mm-kontron-n801x-s.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x430000f0
     Data Size:    8714396 Bytes = 8.3 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x40480000
     Entry Point:  0x40480000
     Hash algo:    sha256
     Hash value:   13bba69f9a0229197e1901a6477139fc9548f55428cd7c05fc51bb5ff1a8f917
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 43000000 ...
   Using 'conf@freescale_imx8mm-kontron-n801x-s.dtb' configuration
   Trying 'fdt-freescale_imx8mm-kontron-n801x-s.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x4384fab4
     Data Size:    33823 Bytes = 33 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   705abdb256853bf1cd7132244c95c091ad03952396da9956973c6a53ca575331
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x4384fab4
   Uncompressing Kernel Image
   Loading Device Tree to 000000007bf0d000, end 000000007bf1841e ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.73-ktn (oe-user@oe-host) (aarch64-ktn-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP PREEMPT Tue Nov 23 11:27:19 UTC 2021
[    0.000000] Machine model: Kontron i.MX8MM N801X S
[    0.000000] efi: UEFI not found.
[    0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x7fdd3b00-0x7fdd5fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] cma: Reserved 320 MiB at 0x0000000067c00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 23 pages/cpu s55640 r8192 d30376 u94208
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258048
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: root=/dev/mmcblk1p2 rootwait video=HDMI-A-1:1280x720 console=ttymxc2,115200
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 679532K/1048576K available (12288K kernel code, 1170K rwdata, 4628K rodata, 2112K init, 474K bss, 41364K reserved, 327680K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 128 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] random: get_random_bytes called from start_kernel+0x31c/0x4dc with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000004] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.000314] Console: colour dummy device 80x25
[    0.000383] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.000396] pid_max: default: 32768 minimum: 301
[    0.000465] LSM: Security Framework initializing
[    0.000524] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000535] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.001864] rcu: Hierarchical SRCU implementation.
[    0.002661] EFI services will not be available.
[    0.002834] smp: Bringing up secondary CPUs ...
[    0.003220] Detected VIPT I-cache on CPU1
[    0.003252] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[    0.003302] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.003736] Detected VIPT I-cache on CPU2
[    0.003757] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[    0.003782] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.004233] Detected VIPT I-cache on CPU3
[    0.004250] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[    0.004274] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.004332] smp: Brought up 1 node, 4 CPUs
[    0.004345] SMP: Total of 4 processors activated.
[    0.004353] CPU features: detected: 32-bit EL0 Support
[    0.004359] CPU features: detected: CRC32 instructions
[    0.004365] CPU features: detected: 32-bit EL1 Support
[    0.011745] CPU: All CPU(s) started at EL2
[    0.011768] alternatives: patching kernel code
[    0.012938] devtmpfs: initialized
[    0.018008] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.018033] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.026341] pinctrl core: initialized pinctrl subsystem
[    0.026913] DMI not present or invalid.
[    0.027383] NET: Registered protocol family 16
[    0.028904] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.028989] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.029086] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.029162] audit: initializing netlink subsys (disabled)
[    0.029296] audit: type=2000 audit(0.028:1): state=initialized audit_enabled=0 res=1
[    0.029775] thermal_sys: Registered thermal governor 'step_wise'
[    0.029961] cpuidle: using governor menu
[    0.030157] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.030240] ASID allocator initialised with 65536 entries
[    0.030920] Serial: AMBA PL011 UART driver
[    0.051087] debugfs: Directory 'dummy-iomuxc-gpr@30340000' with parent 'regmap' already present!
[    0.051333] imx8mm-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[    0.060153] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.060168] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.060177] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.060183] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.061233] cryptd: max_cpu_qlen set to 1000
[    0.063640] ACPI: Interpreter disabled.
[    0.064526] iommu: Default domain type: Translated 
[    0.064669] vgaarb: loaded
[    0.064925] SCSI subsystem initialized
[    0.065259] usbcore: registered new interface driver usbfs
[    0.065294] usbcore: registered new interface driver hub
[    0.065325] usbcore: registered new device driver usb
[    0.066195] pps_core: LinuxPPS API ver. 1 registered
[    0.066204] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.066219] PTP clock support registered
[    0.066353] EDAC MC: Ver: 3.0.0
[    0.066799] FPGA manager framework
[    0.066881] Advanced Linux Sound Architecture Driver Initialized.
[    0.067551] clocksource: Switched to clocksource arch_sys_counter
[    0.067720] VFS: Disk quotas dquot_6.6.0
[    0.067771] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.067942] pnp: PnP ACPI: disabled
[    0.073342] NET: Registered protocol family 2
[    0.073462] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.074036] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.074060] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.074151] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.074282] TCP: Hash tables configured (established 8192 bind 8192)
[    0.074378] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.074406] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.074536] NET: Registered protocol family 1
[    0.074856] RPC: Registered named UNIX socket transport module.
[    0.074863] RPC: Registered udp transport module.
[    0.074868] RPC: Registered tcp transport module.
[    0.074875] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.074886] PCI: CLS 0 bytes, default 64
[    0.075669] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    0.076205] kvm [1]: IPA Size Limit: 40 bits
[    0.077235] kvm [1]: GICv3: no GICV resource entry
[    0.077243] kvm [1]: disabling GICv2 emulation
[    0.077265] kvm [1]: GIC system register CPU interface enabled
[    0.077337] kvm [1]: vgic interrupt IRQ9
[    0.077450] kvm [1]: Hyp mode initialized successfully
[    0.080529] Initialise system trusted keyrings
[    0.080657] workingset: timestamp_bits=42 max_order=18 bucket_order=0
[    0.086391] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.087003] NFS: Registering the id_resolver key type
[    0.087030] Key type id_resolver registered
[    0.087036] Key type id_legacy registered
[    0.087117] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.087125] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.087287] 9p: Installing v9fs 9p2000 file system support
[    0.123370] Key type asymmetric registered
[    0.123380] Asymmetric key parser 'x509' registered
[    0.123415] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.123423] io scheduler mq-deadline registered
[    0.123429] io scheduler kyber registered
[    0.126267] EINJ: ACPI disabled.
[    0.141120] SoC: i.MX8MM revision 1.0
[    0.142620] debugfs: Directory 'dummy-reset-controller@30390000' with parent 'regmap' already present!
[    0.142899] imx-sdma 302c0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[    0.142912] imx-sdma 302c0000.dma-controller: external firmware not found, using ROM firmware
[    0.142983] imx-sdma 302b0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[    0.142993] imx-sdma 302b0000.dma-controller: external firmware not found, using ROM firmware
[    0.143202] imx-sdma 30bd0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[    0.143212] imx-sdma 30bd0000.dma-controller: external firmware not found, using ROM firmware
[    0.145146] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.147230] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 35, base_baud = 1500000) is a IMX
[    0.148015] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 36, base_baud = 1500000) is a IMX
[    1.116423] printk: console [ttymxc2] enabled
[    1.121616] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 37, base_baud = 1500000) is a IMX
[    1.135913] imx-dsim-dsi 32e10000.mipi_dsi: supply vddcore not found, using dummy regulator
[    1.144375] imx-dsim-dsi 32e10000.mipi_dsi: supply vddio not found, using dummy regulator
[    1.152651] imx-dsim-dsi 32e10000.mipi_dsi: failed to get dsim phy
[    1.168114] loop: module loaded
[    1.175204] libphy: Fixed MDIO Bus: probed
[    1.180011] tun: Universal TUN/TAP device driver, 1.6
[    1.185286] CAN device driver interface
[    1.189641] thunder_xcv, ver 1.0
[    1.192909] thunder_bgx, ver 1.0
[    1.196176] nicpf, ver 1.0
[    1.199700] pps pps0: new PPS source ptp0
[    1.206014] libphy: fec_enet_mii_bus: probed
[    1.212287] hclge is initializing
[    1.215654] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[    1.222886] hns3: Copyright (c) 2017 Huawei Corporation.
[    1.228289] e1000e: Intel(R) PRO/1000 Network Driver
[    1.233276] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.239250] igb: Intel(R) Gigabit Ethernet Network Driver
[    1.244656] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.250261] igbvf: Intel(R) Gigabit Virtual Function Network Driver
[    1.256534] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.262589] sky2: driver version 1.30
[    1.266616] VFIO - User Level meta-driver version: 0.3
[    1.273031] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.279576] ehci-pci: EHCI PCI platform driver
[    1.284056] ehci-platform: EHCI generic platform driver
[    1.289429] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.295637] ohci-pci: OHCI PCI platform driver
[    1.300116] ohci-platform: OHCI generic platform driver
[    1.305842] usbcore: registered new interface driver usb-storage
[    1.314292] i2c /dev entries driver
[    1.319985] sdhci: Secure Digital Host Controller Interface driver
[    1.326180] sdhci: Copyright(c) Pierre Ossman
[    1.330696] Synopsys Designware Multimedia Card Interface Driver
[    1.337187] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.343780] mmc0: CQHCI version 5.10
[    1.343918] mmc1: CQHCI version 5.10
[    1.351070] ledtrig-cpu: registered to indicate activity on CPUs
[    1.357787] caam 30900000.crypto: Entropy delay = 3200
[    1.363022] caam 30900000.crypto: Entropy delay = 3600
[    1.435843] caam 30900000.crypto: Instantiated RNG4 SH0
[    1.503499] caam 30900000.crypto: Instantiated RNG4 SH1
[    1.508736] caam 30900000.crypto: device ID = 0x0a16040100000000 (Era 9)
[    1.515449] caam 30900000.crypto: job rings = 3, qi = 0
[    1.527760] caam algorithms registered in /proc/crypto
[    1.533834] caam 30900000.crypto: caam pkc algorithms registered in /proc/crypto
[    1.541254] caam 30900000.crypto: registering rng-caam
[    1.572322] usbcore: registered new interface driver usbhid
[    1.577917] usbhid: USB HID core driver
[    1.584232] NET: Registered protocol family 17
[    1.588714] can: controller area network core
[    1.593131] NET: Registered protocol family 29
[    1.597583] can: raw protocol
[    1.600568] can: broadcast manager protocol
[    1.604767] can: netlink gateway - max_hops=1
[    1.609330] 9pnet: Installing 9P2000 support
[    1.613660] Key type dns_resolver registered
[    1.618255] registered taskstats version 1
[    1.622367] Loading compiled-in X.509 certificates
[    1.643788] gpio-110 (dsi-mux-sel): hogged as output/high
[    1.649221] gpio-111 (dsi-mux-oe): hogged as output/high
[    1.656859] usb_phy_generic usbphynop1: supply vcc not found, using dummy regulator
[    1.664812] usb_phy_generic usbphynop2: supply vcc not found, using dummy regulator
[    1.686112] nxp-pca9450 0-0025: pca9450a probed.
[    1.690908] i2c i2c-0: IMX I2C adapter registered
[    1.696944] adv7511 2-0039: supply dvdd not found, using dummy regulator
[    1.703764] adv7511 2-0039: supply pvdd not found, using dummy regulator
[    1.710551] adv7511 2-0039: supply a2vdd not found, using dummy regulator
[    1.723310] random: fast init done
[    1.726904] i2c i2c-2: IMX I2C adapter registered
[    1.736655] rtc-rv8803 3-0032: registered as rtc0
[    1.743173] rtc-rv8803 3-0032: setting system clock to 2022-02-02T13:56:06 UTC (1643810166)
[    1.751667] i2c i2c-3: IMX I2C adapter registered
[    1.759004] imx-dsim-dsi 32e10000.mipi_dsi: supply vddcore not found, using dummy regulator
[    1.767511] imx-dsim-dsi 32e10000.mipi_dsi: supply vddio not found, using dummy regulator
[    1.778106] etnaviv etnaviv: bound 38000000.gpu (ops gpu_ops)
[    1.784023] etnaviv etnaviv: bound 38008000.gpu (ops gpu_ops)
[    1.789791] etnaviv-gpu 38000000.gpu: model: GC600, revision: 4653
[    1.796051] etnaviv-gpu 38008000.gpu: model: GC520, revision: 5341
[    1.802643] [drm] Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0
[    1.812420] [drm] Initialized mxsfb-drm 1.0.0 20160824 for 32e00000.lcdif on minor 1
[    1.820831] mxsfb 32e00000.lcdif: [drm] Cannot find any crtc or sizes
[    1.828154] spi-flash@0 enforce active low on chipselect handle
[    1.834907] spi-nor spi0.0: mx25r1635f (2048 Kbytes)
[    1.841913] random: crng init done
[    1.853900] mcp251x spi1.0 can0: MCP2515 successfully initialized.
[    1.862714] pps pps0: new PPS source ptp0
[    1.869281] libphy: fec_enet_mii_bus: probed
[    1.875440] fec 30be0000.ethernet eth0: registered PHC device 0
[    1.995262] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    2.000188] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[    2.019660] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    2.025597] hub 1-0:1.0: USB hub found
[    2.029382] hub 1-0:1.0: 1 port detected
[    2.035329] pwm-beeper pwm-beeper: supply amp not found, using dummy regulator
[    2.042769] input: pwm-beeper as /devices/platform/pwm-beeper/input/input0
[    2.050006] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 2 mkt segment 2 supported-hw 0x4 0x4
[    2.061766] mmc1: CQHCI version 5.10
[    2.061890] mmc0: CQHCI version 5.10
[    2.063760] ALSA device list:
[    2.063764]   No soundcards found.
[    2.065439] sdhci-esdhc-imx 30b50000.mmc: Got CD GPIO
[    2.094833] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA
[    2.112296] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[    2.119758] Waiting for root device /dev/mmcblk1p2...
[    2.171733] mmc1: host does not support reading read-only switch, assuming write-enable
[    2.198904] mmc0: Command Queue Engine enabled
[    2.200891] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
[    2.203366] mmc0: new HS400 Enhanced strobe MMC card at address 0001
[    2.210540] mmcblk1: mmc1:aaaa SC16G 14.8 GiB 
[    2.216704] mmcblk0: mmc0:0001 008GB0 7.28 GiB 
[    2.225033]  mmcblk1: p1 p2
[    2.225458] mmcblk0boot0: mmc0:0001 008GB0 partition 1 4.00 MiB
[    2.234175] mmcblk0boot1: mmc0:0001 008GB0 partition 2 4.00 MiB
[    2.240185] mmcblk0rpmb: mmc0:0001 008GB0 partition 3 4.00 MiB, chardev (242:0)
[    2.248983]  mmcblk0: p1 p2
[    2.275016] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.283195] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.287572] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[    2.292571] devtmpfs: mounted
[    2.300327] Freeing unused kernel memory: 2112K
[    2.307625] Run /sbin/init as init process
[    2.442320] NET: Registered protocol family 10
[    2.447617] Segment Routing with IPv6
[    2.452704] hub 1-1:1.0: USB hub found
[    2.456588] hub 1-1:1.0: 5 ports detected
[    2.468900] systemd[1]: systemd 244.5+ running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR -SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[    2.491029] systemd[1]: Detected architecture arm64.

Welcome to Linux!

[    2.534102] systemd[1]: Set hostname to <kontron-mx8mm>.
[    2.725464] systemd[1]: Configuration file /lib/systemd/system/reload-hostname.service is marked executable. Please remove executable permission bits. Proceeding anyway.
[    2.747585] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
[    2.797607] systemd[1]: Configuration file /lib/systemd/system/machine-id-write.service is marked executable. Please remove executable permission bits. Proceeding anyway.
[    2.862562] systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[    2.874963] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[    2.885503] systemd[1]: Created slice system-getty.slice.
[  OK  ] Created slice system-getty.slice.
[    2.908531] systemd[1]: Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[    2.932830] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[  OK  ] Created slice system-systemd\x2dfsck.slice.
[    2.956847] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[    2.979929] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[    3.003780] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[    3.027881] systemd[1]: Reached target Paths.
[  OK  ] Reached target Paths.
[    3.043656] systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
[    3.063627] systemd[1]: Reached target Slices.
[  OK  ] Reached target Slices.
[    3.079659] systemd[1]: Reached target Swap.
[  OK  ] Reached target Swap.
[    3.096173] systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
[    3.115865] systemd[1]: Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[    3.140254] systemd[1]: Listening on Journal Audit Socket.
[  OK  ] Listening on Journal Audit Socket.
[    3.159984] systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
[    3.180042] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[    3.200084] systemd[1]: Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
[    3.219920] systemd[1]: Listening on udev Kernel Socket.
[  OK  ] Listening on udev Kernel Socket.
[    3.243062] systemd[1]: Mounting Huge Pages File System...
         Mounting Huge Pages File System...
[    3.267179] systemd[1]: Mounting POSIX Message Queue File System...
         Mounting POSIX Message Queue File System...
[    3.291137] systemd[1]: Mounting Kernel Debug File System...
         Mounting Kernel Debug File System...
[    3.317435] systemd[1]: Mounting Temporary Directory (/tmp)...
         Mounting Temporary Directory (/tmp)...
[    3.339450] systemd[1]: Starting Create list of static device nodes for the current kernel...
         Starting Create list of st…odes for the current kernel...
[    3.367348] systemd[1]: Starting Mender service to grow data partition size...
         Starting Mender service to grow data partition size...
[    3.395127] systemd[1]: Starting Mount partitions...
         Starting Mount partitions...
[    3.416842] systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
[  OK  ] Started Hardware RNG Entropy Gatherer Daemon.
[    3.443251] systemd[1]: Starting File System Check on Root Device...
         Starting File System Check on Root Device...
[    3.472139] systemd[1]: Starting Journal Service...
         Starting Journa[    3.479786] systemd[1]: Condition check resulted in Load Kernel Modules being skipped.
l Service...
[    3.488585] systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[    3.501709] systemd[1]: Mounting Kernel Configuration File System...
         Mounting Kernel Configuration File System.[    3.511341] systemd[1]: Starting Apply Kernel Variables...
..
         Starting Apply Kernel Variables...
[    3.522942] systemd[1]: Starting udev Coldplug all Devices...
         Starting udev Coldplug all Devices...
[    3.535274] systemd[1]: Mounted Huge Pages File System.
[  OK  ] Mounted Huge Pages File System.
[    3.568451] systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Mounted Temporary Directory (/tmp).
[  OK  ] Started Create list of sta… nodes for the current kernel.
[FAILED] Failed to start Mender ser…e to grow data partition size.
See 'systemctl status mender-grow-data.service' for details.
[  OK  ] Started Mount partitions.
[  OK  ] Started File System Check on Root Device.
[  OK  ] Mounted Kernel Configuration File System.
[  OK  ] Started Apply Kernel Variables.
         Starting Remount Root and Kernel File Systems...
[    3.800783] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  OK  ] Started Remount Root and Kernel File Systems.
         Starting Flush Journal to Persistent Storage...
         Starting Create System Users...
[    3.859850] systemd-journald[277]: Received client request to flush runtime journal.
[  OK  ] Started Create System Users.
[  OK  ] Started Flush Journal to Persistent Storage.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
         Mounting /var/volatile...
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Mounted /var/volatile.
         Starting Load/Save Random Seed...
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Reached target Hardware activated USB gadget.
[    4.770062] smsc95xx v2.0.0
[    4.864720] libphy: smsc95xx-mdiobus: probed
[    4.869917] smsc95xx 1-1.1:1.0 eth1: register 'smsc95xx' at usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet, 70:82:0e:12:fe:da
[    4.910347] usbcore: registered new interface driver smsc95xx
[  OK  ] Found device /dev/mmcblk0p1.
         Starting File System Check on /dev/mmcblk0p1...
[  OK  ] Started File System Check on /dev/mmcblk0p1.
         Mounting /boot/efi...
[    5.638086] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  OK  ] Mounted /boot/efi.
[  OK  ] Found device /dev/mmcblk1p1.
         Starting File System Check on /dev/mmcblk1p1...
[  OK  ] Started File System Check on /dev/mmcblk1p1.
         Mounting /run/media/mmcblk1p1...
[    5.981312] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  OK  ] Mounted /run/media/mmcblk1p1.
[ TIME ] Timed out waiting for device /dev/mmcblk0p4.
[DEPEND] Dependency failed for /data.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for Grow File System on /data.
[DEPEND] Dependency failed for File…ystem Check on /dev/mmcblk0p4.
[  OK  ] Stopped Dispatch Password …ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R…uests to Wall Directory Watch.
[  OK  ] Reached target Timers.
[  OK  ] Reached target Network (Pre).
[  OK  ] Reached target Login Prompts.
[  OK  ] Closed Syslog Socket.
[  OK  ] Reached target Network.
[  OK  ] Reached target Network is Online.
[  OK  ] Reached target Sockets.
[  OK  ] Started Emergency Shell.
[  OK  ] Reached target Emergency Mode.
         Starting Rebuild Dynamic Linker Cache...
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Run pending postinsts...
         Starting Rebuild Journal Catalog...
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Rebuild Journal Catalog.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Run pending postinsts.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Network Time Synchronization.
[  OK  ] Started Rebuild Dynamic Linker Cache.
[  OK  ] Reached target System Time Set.
[  OK  ] Reached target System Time Synchronized.
         Starting Update is Completed...
[  OK  ] Started Update is Completed.
[  OK  ] Started Update UTMP about System Runlevel Changes.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systePress Enter for maintenance
(or press Control-D to continue): 

Am i missing something?

Edit

if i continue the boot and i enter in maintance mode , this is what i get as lsblk output

bash-5.0# lsblk -o name,mountpoint,label,size,uuid
NAME         MOUNTPOINT        LABEL   SIZE UUID
mtdblock0                                2M 
mmcblk1                               14.9G 
|-mmcblk1p1  /run/media/mmcblk boot   83.2M 345A-344E
`-mmcblk1p2  /                 root    1.2G e2632adc-ad73-4b5c-bb70-5bc7164fc508
mmcblk0                                7.3G 
|-mmcblk0p1  /boot/efi         boot   83.2M 5FDC-758B
`-mmcblk0p2                    root  757.9M c0b6718f-a5b5-47c0-a19b-e10248c03299
mmcblk0boot0                             4M 
mmcblk0boot1                             4M 

Edit
this device has also an internal memory

I have been working with Variscite imx8mn-nano SoM and facing similar issues.

The steps mentioned in the mender documents gives a sdimg file. This image shows bootloader, rootfs 1/2 and partition data. However, the board is not booting. While trying to manually change the u-boot configs for imx8mn I have been getting compilation errors.

Device Boot Start End Sectors Size Id Type
tmp/deploy/images/enphz-encontroller-proto-0/encontroller-image-core-enphz-encontroller-proto-0.sdimg1 * 49152 81919 32768 16M c W95 FAT32 (LBA)
tmp/deploy/images/.sdimg2 81920 8290303 8208384 3.9G 83 Linux
tmp/deploy/images/
.sdimg3 8290304 16498687 8208384 3.9G 83 Linux
tmp/deploy/images/*.sdimg4 16498688 16760831 262144 128M 83 Linux

With the tar.gz image I see that u-boot stops as it fails to boot the image. I get the following error:

[Bad Linux ARM64 Image magic!]

Hi @bikumar , i managed to boot my device correctly , but i’m still unable to install an artifact.
To make it boot correctly i made this steps :

  • set this variables in my local.conf
    note : set MENDER_STORAGE_DEVICE_BASE & MENDER_STORAGE_DEVICE to the correct value was very important, in my case was set to the wrong value

local.conf

CONF_VERSION = "1"
# include version variables for source code
include sourcecode-version.conf
# ######### DISTRO ############################
# use our distro configuration from
# layers/meta-oskar/conf/distro/oskar.conf
DISTRO = "oskar"
# ######### MACHINE ###########################
# set a default MACHINE to build for
# usually this is overriden by the environment variable MACHINE
# (-m parameter of init-env exports MACHINE)
MACHINE ?= "kontron-mx8mm"
# ######### EXTRA FEATURES / ROOT PWD #########
# the default is to use the image feature `debug-tweaks` to remove the
# root password and add some packages (gdbserver, ptool, nano, etc.)
# remove it if you build a release image and set a root password
# by setting ROOT_PWD to a hashed password (`openssl passwd -1 password`)
# Note: you need to escape all '$' characters with '\' manually
# Note: the default value below is 'root'
EXTRA_IMAGE_FEATURES = "debug-tweaks"
#ROOT_PWD ?= "\$1\$/nrGReFp\$Emef9p70yRoahjHctKZ2p0"
# ######### SDK MACHINE #######################
# set a default SDKMACHINE
# possible values are "i686" and "x86_64" to build an SDK for
# 32-bit or 64-bit hosts respectively
SDKMACHINE ?= "x86_64"
# ######### SPECIAL OPTIONS/OVERRIDES #########
# set special options via MACHINEOVERRIDES
#MACHINEOVERRIDES .= ":option"
# ######### LICENSE / EULA RESTRICTIONS #######
# block/allow packages with certain licenses
# (e.g. commercial)
LICENSE_FLAGS_WHITELIST = "commercial"
# for builds including software from Freescale/NXP you might
# need to accept their EULA
ACCEPT_FSL_EULA = "1"
# ######### CACHE / DOWNLOAD PATHS ############
# set default locations for downloads and the sstate cache
DL_DIR ?= "${TOPDIR}/../downloads"
SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"
# ######### PARALLEL TASKS / THREADING ########
# depending on your build host you might want to tweak
# the number of bitbake threads and parallel make tasks
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()*2}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
# ######### MISC ##############################
# uncomment to remove all temporary files after each build
# to save disk space
#INHERIT += "rm_work"
# ######### KUSTOMIZATIONS ####################
# read only rootfs
IMAGE_FEATURES += "read-only-rootfs"
# When using read-only rootfs
SERIAL_CONSOLES_CHECK = ""
# set default time-zone to Europe/Rome
DEFAULT_TIMEZONE = "Europe/Rome"
# set command line utils to coreutils , remove busybox
# in order to temove busybox we need also to set login_manager to shadow
# otherwise busybox will be pulled in
PREFERRED_PROVIDER_virtual/base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
VIRTUAL-RUNTIME_base-utils-syslog = ""
VIRTUAL-RUNTIME_login_manager = "shadow"
# remove splash screen
EXTRA_IMAGE_FEATURE_remove = "psplash"
# connman version
PREFERRED_VERSION_connman ??= "1.38"
# multiple device tree found : choosing n801x-s
KERNEL_DEVICETREE = "freescale/imx8mm-kontron-n801x-s.dtb"
MENDER_DTB_NAME_FORCE = "freescale/imx8mm-kontron-n801x-s.dtb"
# ######### Mender integration ################
# inherit mender-full enables : mender-grub mender-image mender-image-uefi mender-client-install mender-systemd mender-growfs-data
INHERIT += "mender-full"
# TODO ReEnable it after developement , now is disabled to save time
# enable sdimg generation
# MENDER_FEATURES_ENABLE_append = " mender-image-sd"
# total image size
MENDER_STORAGE_TOTAL_SIZE_MB = "2048"
# artifact format
ARTIFACTIMG_FSTYPE = "ext4"
# mender-client version
PREFERRED_VERSION_mender-client = "3.0.0"
# mender-connect version
PREFERRED_VERSION_mender-connect = "1.2.0"
# choosing kontron u-boot
PREFERRED_PROVIDER_u-boot = "u-boot-ktn"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ktn"
# # setting providers
# NOTE: Multiple providers are available for runtime nativesdk-u-boot-mkimage (nativesdk-u-boot-mkimage, nativesdk-u-boot-tools)
# Consider defining a PREFERRED_RPROVIDER entry to match nativesdk-u-boot-mkimage
PREFERRED_RPROVIDER_nativesdk-u-boot-mkimage = "nativesdk-u-boot-mkimage"
# set the storage device base otherwise mender won't work
MENDER_STORAGE_DEVICE_BASE = "/dev/mmcblk1p"
# set the storage device otherwise meder-grow-data service won't work
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
# partition names
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"
# artifact name ( static only for test purposes )
MENDER_ARTIFACT_NAME = "test-imx8mm"
  • create an append to the custom u-boot recipe ( in my case u-boot-ktn )

u-boot-ktn_%.bbappend

# tell to mender layer that this recipe provides/rprovides u-boot
PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"
  • create a custom wks file (and import in the machine configuration file ES : WKS_FILE = "image-custom.wks" )

image-custom.wks

# boot partitions
part spl --source rawcopy --sourceparams="file=flash.bin" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part u-boot --source rawcopy --sourceparams="file=u-boot.itb" --ondisk mmcblk --no-table --align 1024
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 64
# first rootfs partition
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
# second rootfs partition
part   --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
# data partition
part /data --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/data --ondisk mmcblk --fstype=ext4 --label data
bootloader --ptable msdos

At least now the image boots correctly , and the mender-grow-data service expand the data partition correctly ( and i’m really happy about that :smiley: ) … BUT , as i say , i can’t install an artifact .
If i try to install it i get those errors :

mender install image-oskar-kontron-mx8
INFO[0000] Loaded configuration file: /var/lib/mender/mender.conf 
INFO[0000] Loaded configuration file: /etc/mender/mender.conf 
INFO[0000] 'UpdateControlMapExpirationTimeSeconds' is not set in the Mender configuration file. Falling back to the default of 2*UpdatePollIntervalSeconds 
INFO[0000] 'UpdateControlMapBootExpirationTimeSeconds' is not set in the Mender configuration file. Falling back to the default of 600 seconds 
/usr/bin/fw_printenv: line 96: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/env': No such file or directory
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/lock': No such file or directory
/usr/bin/fw_printenv: line 102: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
Unable to restore environment 2.
/usr/bin/fw_printenv: line 96: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/env': No such file or directory
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/lock': No such file or directory
/usr/bin/fw_printenv: line 102: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
Unable to restore environment 2.
ERRO[0000] Failed to read the current active partition: No match between boot and root partitions.: exit status 2 
INFO[0000] Start updating from local image file: [image-oskar-kontron-mx8mm-20220204083136.mender] 
Installing Artifact of size 126541312...
INFO[0000] No public key was provided for authenticating the artifact 
INFO[0000] Update Module path "/usr/share/mender/modules/v3" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available 
/usr/bin/fw_printenv: line 96: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/env': No such file or directory
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/lock': No such file or directory
/usr/bin/fw_printenv: line 102: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
Unable to restore environment 2.
/usr/bin/fw_printenv: line 96: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/env': No such file or directory
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
/usr/bin/grub-editenv: error: cannot open `/boot/efi/EFI/BOOT/mender_grubenv2/lock.new': No such file or directory.
sync: error opening '/boot/efi/EFI/BOOT/mender_grubenv2/lock': No such file or directory
/usr/bin/fw_printenv: line 102: cd: /boot/efi/EFI/BOOT/mender_grubenv2: No such file or directory
Unable to restore environment 2.
ERRO[0000] Download failed: Payload: can not install Payload: image-oskar-kontron-mx8mm.ext4: No match between boot and root partitions.: exit status 2 
ERRO[0000] Payload: can not install Payload: image-oskar-kontron-mx8mm.ext4: No match between boot and root partitions.: exit status 2 

In conclusion i think that i have to edit some u-boot configuration BUT i don’t know what i’m doing wrong , because the OS boot up correctly … i hope that this can help you and help others , if you have some hint i will be glad to hear it :slight_smile:

Hi @leonardo-k , thanks for sharing the details.
With the following values in my local.conf I was able to get a wic.img which booted the board. But then it shows as running in “Emergency Mode”.

MENDER_FEATURES_ENABLE_append = " mender-image-sd mender-image"

MENDER_FEATURES_DISABLE_append = " mender-image-uefi "

MENDER_ARTIFACT_NAME = “encontroller-release-1”

MENDER_UBOOT_AUTO_CONFIGURE=“0”

MENDER_IMAGE_BOOTLOADER_FILE_imx8mn-var-som = “imx-boot”

MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_imx8mn-var-som = “64”

do_image_sdimg[depends] += “${@bb.utils.contains(‘MACHINE’, ‘imx8mn-var-som’, ‘imx-boot:do_deploy’, ‘’, d)}”

MENDER_BOOT_PART_SIZE_MB_imx8mn-var-som = “16”

IMAGE_BOOT_FILES_remove_imx8mn-var-som = “${KERNEL_IMAGETYPE} ${@make_dtb_boot_files(d)}”

Cleanup image types generated

IMAGE_FSTYPES_remove = “tar.gz ext4 wic.bmap multiubi mender.bmap”

MACHINE_EXTRA_RDEPENDS_remove = “u-boot-fw-utils”

VARISCITE_UBOOT_ENV_IN_EMMC = “0”

MENDER_STORAGE_DEVICE_imx8mn-var-som = “/dev/mmcblk1”

MENDER_UBOOT_STORAGE_DEVICE_imx8mn-var-som = “1”

MENDER_BOOT_PART_SIZE_MB_mender-uboot = “0”

KERNEL_IMAGETYPE_mender-uboot = “Image”

UBOOT_CONFIG_imx8mm-var-som = “sd”

Are you using sdimg to boot your device? From the configuration it looks like you have built a U-Boot image and while running it is looking for grub!

On my board mender client doesn’t run and am debugging that.

@bikumar
At the moment i’m only using .wic.gz image because it is faster to work with , but i also tried to add mender-image-sd to the mender_features_enable variable and the .sdimg is generated correctly ( and boots correctly like the .wic.gz image ) .
My board originally uses a custom u-boot recipe , so because in the mender instructions i readed By default, Mender uses GRUB to boot, and this is the recommended bootloader to use, even on platforms that ordinarily use U-Boot. i only inherit mender-full in my local.conf file ( that enables mender-image mender-client-install mender-systemd mender-image-uefi mender-grub mender-growfs-data ) and tell the mender-layer that my custom-u-boot provides u-boot .
The other key point was to set set the MENDER_STORAGE_DEVICE_BASE & MENDER_STORAGE_DEVICE to the correct value otherwise mender in my case wasn’t work.
So i’m not sure WHY my board boots correctly but can’t install an artifact .
Maybe , if you can boot in recovery mode , i suggest you to check your partitions maybe with lsblk -f or maybe with mount and see if all the partitions are mounted correctly .
what errors are you facing in during the boot?

Edit
this is my lsblk -f output

root@kontron-mx8mm:~# lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                         
`-sda1
     vfat               0115-ABEC                              22.9G    22% /run/media
mtdblock0
                                                                            
mmcblk0
|                                                                           
|-mmcblk0p1
|    vfat         boot  5FDC-758B                              75.3M     9% /run/media
`-mmcblk0p2
     ext4         root  c0b6718f-a5b5-47c0-a19b-e10248c03299                
mmcblk0boot0
                                                                            
mmcblk0boot1
                                                                            
mmcblk1
|                                                                           
|-mmcblk1p1
|    vfat         boot  4DF9-ADA0                              74.6M    10% /boot/efi
|-mmcblk1p2
|    ext4         root  7d7381fe-64e8-41c9-8a0a-6183fdf459d9  741.4M    29% /
|-mmcblk1p3
|    ext4         root  7b27251e-cb6e-435e-9d21-ed7c74433f9d                
`-mmcblk1p4
     ext4         data  ba021d6d-53c9-4123-8c4e-949bcb25a806   11.8G     0% /data

as you can see mmcblk1 is my sdcard , the 4 partitions were generated correctly and the mender-grow-data has finished its work growing data partition to ~12GB

I actually have two problems:

  1. My board doesn’t boot from the sdimg image. Though I see using fdisk that sdimg has four partitions (1 boot, 2 rootfs and one data partition).
  2. When I use wic image the board boots but at the end of the boot log it shows
[  OK  ] Reached target Network is Online.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systePress Enter for maintenance

I also updated the local.conf with the values that you suggested:

# set the storage device base otherwise mender won't work
MENDER_STORAGE_DEVICE_BASE = "/dev/mmcblk1p"
# set the storage device otherwise meder-grow-data service won't work
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
# partition names
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"
# artifact name ( static only for test purposes )

My sdimg file shows the following partition:

Device                                                                                                 Boot    Start      End Sectors  Size Id Type
tmp/deploy/images/*.sdimg1 *       16384    49151   32768   16M  c W95 FAT32 (LBA)
tmp/deploy/images/*.sdimg2         49152  8273919 8224768  3.9G 83 Linux
tmp/deploy/images/*.sdimg3       8273920 16498687 8224768  3.9G 83 Linux
tmp/deploy/images/*.sdimg4      16498688 16760831  262144  128M 83 Linux

Now after I boot from wic image, lsblk shows only one partition on my SD card:

sh-5.0# lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
mmcblk2
|                                                                           
`-mmcblk2p1
     ext4         rootfs
                        7e832798-5e7b-485c-b44d-34d09fecdcf4     12G    10% /run/media
mmcblk2boot0
                                                                            
mmcblk2boot1
                                                                            
mmcblk1
|                                                                           
`-mmcblk1p1
     ext4         root  8cc2889b-d97e-45db-b698-4a20e0635bf6    3.1G    31% /boot/efi
sh-5.0# 

there are errors other than the “emergency mode” one?
because based on my experience images ( even of different types ) should be partitioned the same.

Don’t see anything suspicious, other than following:

[    1.786914] Waiting for root device /dev/mmcblk1p1...
[    1.814373] mmc1: host does not support reading read-only switch, assuming wr
ite-enable
[    1.956793] mmc1: new ultra high speed SDR104 SDXC card at address 0001
[    1.964715] mmcblk1: mmc1:0001 SD 116 GiB 
[    1.971754]  mmcblk1: p1
[    2.082115] EXT4-fs (mmcblk1p1): recovery complete
[    2.088779] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. O
pts: (null)

[    3.534173] galcore: loading out-of-tree module taints kernel.
[    3.534659] systemd[1]: Starting Remount Root and Kernel File Systems...
[    3.550051] galcore: clk_get 2d core clock failed, disable 2d/vg!
[    3.560559] EXT4-fs (mmcblk1p1): re-mounted. Opts: (null)

can you post your complete local.conf and the other customization you made?
maybe we can find something useful to understand better our issues

Here is my local.conf:

MACHINE ??= 'imx8mn-var-som'
DISTRO ?= 'fslc-xwayland'
PACKAGE_CLASSES ?= 'package_rpm'
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"

include sourcecode-version.conf

#INHERIT += "mender-full"
MENDER_FEATURES_ENABLE_append = " mender-image-sd mender-image"
MENDER_FEATURES_DISABLE_append = " mender-image-uefi "
MENDER_ARTIFACT_NAME = "encontroller-release-1"
ARTIFACTIMG_FSTYPE = "ext4"
# mender-client version
PREFERRED_VERSION_mender-client = "3.0.0"
# mender-connect version
PREFERRED_VERSION_mender-connect = "1.2.0"

MENDER_STORAGE_TOTAL_SIZE_MB = "8192"
MENDER_UBOOT_AUTO_CONFIGURE="0"

# Cleanup image types generated
IMAGE_FSTYPES_remove = "tar.gz ext4 wic.bmap multiubi mender.bmap"
MACHINE_EXTRA_RDEPENDS_remove = "u-boot-fw-utils"
VARISCITE_UBOOT_ENV_IN_EMMC = "0"
MENDER_STORAGE_DEVICE_imx8mn-var-som = "/dev/mmcblk1"
MENDER_UBOOT_STORAGE_DEVICE_imx8mn-var-som = "1"
MENDER_BOOT_PART_SIZE_MB_mender-uboot = "0"
KERNEL_IMAGETYPE_mender-uboot = "Image"
UBOOT_CONFIG_imx8mm-var-som = "sd"

PREFERRED_PROVIDER_u-boot = "u-boot-variscite"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-variscite"

# set the storage device base otherwise mender won't work
MENDER_STORAGE_DEVICE_BASE = "/dev/mmcblk1p"
# set the storage device otherwise meder-grow-data service won't work
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
# partition names
MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"

I also see the following when my board boots up:

[  OK  ] Reached target Hardware activated USB gadget.
[  OK  ] Started File System Check on /dev/mmcblk1p1.
         Mounting /boot/efi...
[  OK  ] Mounted /boot/efi.
[  OK  ] Found device /dev/mmcblk2p1.
         Starting File System Check on /dev/mmcblk2p1...
[  OK  ] Started File System Check on /dev/mmcblk2p1.
         Mounting /run/media/mmcblk2p1...
[    6.143943] EXT4-fs (mmcblk2p1): mounted filesystem with ordered data mode. Opts: (null)
[  OK  ] Mounted /run/media/mmcblk2p1.
[    6.426437] random: crng init done
[    6.429849] random: 7 urandom warning(s) missed due to ratelimiting
[  OK  ] Started Load/Save Random Seed.
[ ***  ] A start job is running for /dev/mmcblk1p4 (17s / 1min 30s)
[ TIME ] Timed out waiting for device /dev/mmcblk1p4.

[DEPEND] Dependency failed for /data.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for File…ystem Check on /dev/mmcblk1p4.
[  OK  ] Stopped Dispatch Password …ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R…uests to Wall Directory Watch.
[  OK  ] Reached target Timers.

i think that commenting

#INHERIT += "mender-full"

can create issues and if you want to use u-boot or GRUB you have to re-enable it adding it to the variable

MENDER_FEATURES_ENABLE_append

for the other error

[ ***  ] A start job is running for /dev/mmcblk1p4 (17s / 1min 30s)
[ TIME ] Timed out waiting for device /dev/mmcblk1p4.

your system fails to mount /data but i can’t really tell you why ( other than this possibly wrong build configuration )

I enabled mender-full and also disabled grub using FEATURES_DISABLE.
However still I haven’t been able to boot my board using sdimg. It boots with wic file but in the same state. “Emergency mode” and no mender running.

This looks like a problem on my configuration for u-boot. I am using u-boot-variscite as the preferred u-boot. When I check the BOOTNV_SIZE

$ bitbake -e u-boot-variscite | grep 'BOOTENV_SIZE'
BOOTENV_SIZE="0x20000"

it is configured as 0x20000. Even changing that in the bbappend file isn’t causing any difference. I get error now during compilation in do_configure step:

ERROR: u-boot-variscite-1.0-r0 do_configure: U-Boot configuration  imx8mn_var_som_config has setting:                                                                       
CONFIG_ENV_SIZE=0x1000                                                                                                                                                      
but Mender expects:                                                                                                                                                         
CONFIG_ENV_SIZE=0x20000                                                                                                                                                     
Please fix U-Boot's configuration file.  

Any suggestions here?

i think maybe you have to make a patch to u-boot defconfig

maybe you also can try to edit mender_uboot_env_device_storage_offset

@bikumar did you find a solution? I am running into the same issues.