From: "Leonid Krivoshein" <klark.devel@gmail.com> To: make-initrd@lists.altlinux.org 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 <klark.devel@gmail.com> --- features/bootchain-core/README.md | 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/README.md b/features/bootchain-core/README.md index cea2d84..14db55f 100644 --- a/features/bootchain-core/README.md +++ b/features/bootchain-core/README.md @@ -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" fi -if [ -f "$BC_LOGFILE" ] && [ -n "$BC_DEBUG" ]; then +if [ -f "$BC_LOGFILE" ] && [ -n "${BC_DEBUG}${BC_TEST-}" ]; then if [ -d "$rootmnt/var/log" ]; then destdir="$rootmnt/var/log" else run mkdir -p -- "$mntdir" destdir="$mntdir" fi + + 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/" fi -- 2.24.1
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: 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=20211024172159.1ypMmtzrbJkE6DecVRjezz66IqDBPtUZ_y_MJp7jwf4@z \ --to=klark.devel@gmail.com \ --cc=make-initrd@lists.altlinux.org \ /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
Make-initrd development discussion This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/make-initrd/0 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/ http://lore.altlinux.org/make-initrd \ make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com public-inbox-index make-initrd Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.make-initrd AGPL code for this site: git clone https://public-inbox.org/public-inbox.git