From: "'Rakesh Kumar' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com, cedric.hombourger@siemens.com,
Rakesh Kumar <kumar.rakesh@siemens.com>
Subject: [PATCH 2/2] initramfs-fsck-hook: improve error handling and correct fsck path
Date: Sat, 7 Sep 2024 22:21:04 +0530 [thread overview]
Message-ID: <20240907165104.1825446-2-kumar.rakesh@siemens.com> (raw)
In-Reply-To: <20240907165104.1825446-1-kumar.rakesh@siemens.com>
* Used hook_error() function to improve error handling during
copy_exec calls in the initramfs hook script.
* Corrected the path for fsck from /sbin/fsck to /usr/sbin/fsck.
Signed-off-by: Rakesh Kumar <kumar.rakesh@siemens.com>
---
.../files/initramfs-fsck-ext4.hook | 21 +++++++------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-ext4.hook
index 259b73b4..4762c805 100644
--- a/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-ext4.hook
+++ b/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-ext4.hook
@@ -5,8 +5,6 @@
#!/bin/sh
-set -e
-
PREREQ=""
prereqs()
@@ -24,16 +22,11 @@ esac
. /usr/share/initramfs-tools/scripts/functions
. /usr/share/initramfs-tools/hook-functions
-if [ ! -x /sbin/fsck ]; then
- echo "Warning: couldn't find /sbin/fsck!"
- exit 0
-fi
-
-copy_exec /sbin/fsck
-copy_exec /sbin/logsave
+hook_error() {
+ echo "(ERROR): $1" >&2
+ exit 1
+}
-if prog="$(command -v fsck.ext4)"; then
- copy_exec "$prog"
-else
- echo "Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring."
-fi
+copy_exec /sbin/fsck || hook_error "Unable to copy /usr/sbin/fsck"
+copy_exec /sbin/logsave || hook_error "Unable to copy /usr/sbin/logsave"
+copy_exec /usr/sbin/fsck.ext4 || hook_error "Unable to copy /usr/sbin/fsck.ext4"
--
2.39.2
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240907165104.1825446-2-kumar.rakesh%40siemens.com.
next prev parent reply other threads:[~2024-09-07 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 9:39 [PATCH] initramfs-fsck-hook: bump version and improve error handling 'Rakesh Kumar' via isar-users
2024-09-06 9:56 ` 'Jan Kiszka' via isar-users
2024-09-07 16:51 ` [PATCH 1/2] initramfs-fsck-hook: bump version, rename package and files 'Rakesh Kumar' via isar-users
2024-09-07 16:51 ` 'Rakesh Kumar' via isar-users [this message]
2024-09-09 3:13 ` [PATCH 2/2] initramfs-fsck-hook: improve error handling and correct fsck path 'cedric.hombourger@siemens.com' via isar-users
2024-09-09 3:15 ` [PATCH 1/2] initramfs-fsck-hook: bump version, rename package and files 'cedric.hombourger@siemens.com' via isar-users
2024-09-07 16:59 ` [PATCH 0/2] initramfs-fsck-hook: version bump to 0.3 and error handling improvement 'Rakesh Kumar' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240907165104.1825446-2-kumar.rakesh@siemens.com \
--to=isar-users@googlegroups.com \
--cc=cedric.hombourger@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=kumar.rakesh@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox