diff mbox series

[isar-cip-core,2/3] Fix return value handling on filesystem check

Message ID 20250217100024.42995-3-alexander.heinisch@siemens.com (mailing list archive)
State New
Headers show
Series Added support for rootfs-overlay (for development). | expand

Commit Message

Heinisch, Alexander Feb. 17, 2025, 10 a.m. UTC
From: Alexander Heinisch <alexander.heinisch@siemens.com>

Detected errors during the filesystem check caused the script to
abort. This is caused by the `set -e` in the script-header.tmpl
in isar/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 .../initramfs-overlay-hook/files/local-bottom.tmpl           | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-overlay-hook/files/local-bottom.tmpl b/recipes-initramfs/initramfs-overlay-hook/files/local-bottom.tmpl
index 1087c3f..71cc63c 100644
--- a/recipes-initramfs/initramfs-overlay-hook/files/local-bottom.tmpl
+++ b/recipes-initramfs/initramfs-overlay-hook/files/local-bottom.tmpl
@@ -23,8 +23,9 @@  if ! mountpoint -q "${rootmnt}${storage_mount_point}"; then
 
 	case $partition_fstype in
 	ext*)
-		e2fsck -p -f "$ovl_partition_device"
-		fsck_ret="$?"
+		fsck_ret=0
+		e2fsck -p -f "$ovl_partition_device" || fsck_ret="$?"
+
 		# e2fsck returns a 1 in case of repairing the file system
 		# https://man7.org/linux/man-pages/man8/e2fsck.8.html#EXIT_CODE
 		if [ "$fsck_ret" -gt "1" ]  && [ -x "$ovl_recovery_script" ]; then