Make-initrd development discussion
 help / color / mirror / Atom feed
From: "Leonid Krivoshein" <>
Subject: [make-initrd] [PATCH v6 13/22] bootchain-core: introduces new parameter bc_test
Date: Sun, 24 Oct 2021 17:21:59 -0000
Message-ID: <20211024172159.1ypMmtzrbJkE6DecVRjezz66IqDBPtUZ_y_MJp7jwf4@z> (raw)

Enabling the bc_test option allows the boot log to be saved to the stage2
even when extended debugging has not been enabled. It will be possible to
examine the contents of the boot log without additional debugging messages.

Signed-off-by: Leonid Krivoshein <>
 features/bootchain-core/                         | 4 ++++
 .../data/etc/initrd/cmdline.d/bootchain-core              | 1 +
 features/bootchain-core/data/sbin/chaind                  | 8 +++++++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/features/bootchain-core/ b/features/bootchain-core/
index cea2d84..14db55f 100644
--- a/features/bootchain-core/
+++ b/features/bootchain-core/
@@ -108,6 +108,10 @@ own needs.
 - `overlayfs=list` - defines the list of elements to combine.
 - `bc_debug` - a boolean parameter that enables advanced debugging and forces
   if the daemon completes successfully, copy boot log to the stage2.
+- `bc_test=name` - defines the name of the current test case in the process of
+  fully automated self-testing, forcing in case of successful after completing
+  the daemon, copy the boot log to the stage2 and next to it create a
+  `BC-TEST.passed` file with the specified name of the test case.
 ## bootchain-sh-functions extended API
diff --git a/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core b/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
index 4151a8d..d397f86 100644
--- a/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
+++ b/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
@@ -1,5 +1,6 @@
 register_parameter string BOOTCHAIN
 register_alias BOOTCHAIN PIPELINE
+register_parameter string BC_TEST
 register_parameter bool BC_DEBUG
 register_array string MOUNTFS
 register_array string OVERLAYFS
diff --git a/features/bootchain-core/data/sbin/chaind b/features/bootchain-core/data/sbin/chaind
index ec4458e..c1b2451 100755
--- a/features/bootchain-core/data/sbin/chaind
+++ b/features/bootchain-core/data/sbin/chaind
@@ -115,12 +115,18 @@ else
 	debug "last step finished with exit code $rc"
-if [ -f "$BC_LOGFILE" ] && [ -n "$BC_DEBUG" ]; then
+if [ -f "$BC_LOGFILE" ] && [ -n "${BC_DEBUG}${BC_TEST-}" ]; then
 	if [ -d "$rootmnt/var/log" ]; then
 		run mkdir -p -- "$mntdir"
+	if [ -n "${BC_TEST-}" ]; then
+		debug "test '$BC_TEST' in the stage1 passed"
+		echo "$BC_TEST" >"$destdir"/BC-TEST.passed
+	fi
 	run cp -Lf -- "$BC_LOGFILE" "$destdir/"

                 reply	other threads:[~2021-10-24 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211024172159.1ypMmtzrbJkE6DecVRjezz66IqDBPtUZ_y_MJp7jwf4@z \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Make-initrd development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror make-initrd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 make-initrd make-initrd/ \
	public-inbox-index make-initrd

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone