I’m testing with mender 1.7 in standalone mode. The procedure is given below:
- Using mender -rootfs “HTTPS local server path of mender artifact”
- While downloading the artifact, remove the power plug when around 80% download completed.
- Connect the power plug again and boot the system.
I expected the fail safe mechanism here but, I’m getting the below error when performing the above procedure:
[ 1.859484] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 1.868841] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[ 1.876893] devtmpfs: mounted
[ 1.880023] Freeing unused kernel memory: 448K
[ 1.885645] EXT4-fs warning (device mmcblk0p1): dx_probe:792: inode #3451: comm swapper/0: dx entry: limit 0 != root limit 125
[ 1.897057] EXT4-fs warning (device mmcblk0p1): dx_probe:864: inode #3451: comm swapper/0: Corrupt directory, running e2fsck is recommended
[ 1.909711] Starting init: /sbin/init exists but couldn’t execute it (error -4094)
[ 1.918429] EXT4-fs warning (device mmcblk0p1): dx_probe:792: inode #2868: comm swapper/0: dx entry: limit 0 != root limit 125
[ 1.929845] EXT4-fs warning (device mmcblk0p1): dx_probe:864: inode #2868: comm swapper/0: Corrupt directory, running e2fsck is recommended
[ 1.942467] Starting init: /etc/init exists but couldn’t execute it (error -4094)
[ 1.951434] Starting init: /bin/init exists but couldn’t execute it (error -4094)
[ 1.958954] Starting init: /bin/sh exists but couldn’t execute it (error -4094)
[ 1.966279] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 1.980454] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.62-imx_4.14.62_1.0.0_beta+g1907fe4 #1
[ 1.994287] Call trace:
[ 1.996740] [ffff000008089c08] dump_backtrace+0x0/0x3c8
[ 2.002145] [ffff000008089fe4] show_stack+0x14/0x20
[ 2.007202] [ffff000008757620] dump_stack+0x9c/0xbc
[ 2.012257] [ffff0000080cb0b8] panic+0x124/0x29c
[ 2.017053] [ffff000008769cfc] kernel_init+0xec/0x100
[ 2.022282] [ffff000008084ed8] ret_from_fork+0x10/0x18
[ 2.027598] SMP: stopping secondary CPUs
[ 2.031524] Kernel Offset: disabled
[ 2.035015] CPU features: 0x0802008
[ 2.038497] Memory Limit: none
[ 2.041552] Rebooting in 10 seconds…
On further debugging, I have found that:
- When started the artifact download, the partitions from file system were:
mender_boot_part=2
mender_boot_part_hex=2
- But, after power failure and switch ON, the partitions from U-boot become:
mender_boot_part=1
mender_boot_part_hex=1
I believe this is causing the above kernel panic since, the inactive partition is already streamed and corrupted during the power failure. Please correct me if I’m wrong.
But, how to set it properly? Why it is switching to inactive partition on U-boot during the power failure? Am I missing anything here?
PS: If I didn’t update using mender artifact and changed the partitions manually (by setting mender_boot_part and mender_boot_part_hex), then, there is no issues and expected partition only marked as active partition.