All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shivanand.Kunijadar@toshiba-tsip.com
To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com,
	quirin.gylstorff@siemens.com
Cc: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>,
	dinesh.kumar@toshiba-tsip.com, kazuhiro3.hayashi@toshiba.co.jp,
	akihiro27.suzuki@toshiba.co.jp
Subject: [isar-cip-core v2 1/2] Add recipe to cause kernel panic during system boot
Date: Tue,  1 Feb 2022 21:05:01 +0530	[thread overview]
Message-ID: <20220201153502.14230-2-Shivanand.Kunijadar@toshiba-tsip.com> (raw)
In-Reply-To: <52fae1ea-25fc-e692-2b51-e503681d2efb@siemens.com>

From: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>

This recipe adds systemd service to cause kernel panic during system
boot.
It helps to check the swupdate-rollback feature.

Signed-off-by: Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
---
 kas/opt/kernel-panic.yml                      | 18 ++++++++++++++
 .../kernel-panic/files/sysrq-panic.service    | 10 ++++++++
 recipes-core/kernel-panic/kernel-panic.bb     | 24 +++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 kas/opt/kernel-panic.yml
 create mode 100644 recipes-core/kernel-panic/files/sysrq-panic.service
 create mode 100644 recipes-core/kernel-panic/kernel-panic.bb

diff --git a/kas/opt/kernel-panic.yml b/kas/opt/kernel-panic.yml
new file mode 100644
index 0000000..47df7b1
--- /dev/null
+++ b/kas/opt/kernel-panic.yml
@@ -0,0 +1,18 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation, 2022
+#
+# Authors:
+#  Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
+#
+# SPDX-License-Identifier: MIT
+#
+# This kas file adds systemd service file to cause kernel panic during system boot.
+
+header:
+  version: 10
+
+local_conf_header:
+  kernel-panic: |
+    IMAGE_INSTALL_append = " kernel-panic"
diff --git a/recipes-core/kernel-panic/files/sysrq-panic.service b/recipes-core/kernel-panic/files/sysrq-panic.service
new file mode 100644
index 0000000..169a97c
--- /dev/null
+++ b/recipes-core/kernel-panic/files/sysrq-panic.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=sysrq panic
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "echo c > /proc/sysrq-trigger"
+
+[Install]
+WantedBy=default.target
+
diff --git a/recipes-core/kernel-panic/kernel-panic.bb b/recipes-core/kernel-panic/kernel-panic.bb
new file mode 100644
index 0000000..511febb
--- /dev/null
+++ b/recipes-core/kernel-panic/kernel-panic.bb
@@ -0,0 +1,24 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation, 2022
+#
+# Authors:
+#  Shivanand Kunijadar <Shivanand.Kunijadar@toshiba-tsip.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+DESCRIPTION = "Systemd service file to cause kernel panic"
+
+SRC_URI = " \
+    file://sysrq-panic.service"
+
+do_install() {
+	install -v -d ${D}/lib/systemd/system
+	install -v -m 0644 ${WORKDIR}/sysrq-panic.service ${D}/lib/systemd/system/
+	install -v -d ${D}/etc/systemd/system/default.target.wants
+	ln -s /lib/systemd/system/sysrq-panic.service ${D}/etc/systemd/system/default.target.wants/
+}
-- 
2.20.1




  parent reply	other threads:[~2022-02-01 15:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 14:20 [isar-cip-core] swupdate: add recipe to cause kernel panic during system boot Shivanand.Kunijadar
2022-01-27 15:55 ` Jan Kiszka
2022-02-01 15:35   ` [isar-cip-core v2 0/2] Add necessary steps to verify swupdate Shivanand.Kunijadar
2022-02-03 11:23     ` quirin.gylstorff
2022-02-01 15:35   ` Shivanand.Kunijadar [this message]
2022-02-04  6:50     ` [isar-cip-core v2 1/2] Add recipe to cause kernel panic during system boot Jan Kiszka
2022-02-01 15:35   ` [isar-cip-core v2 2/2] README.swupdate.md: add readme file with steps to verify swupdate Kunijadar Shivanand
2022-02-03 11:57     ` Quirin Gylstorff
2022-02-04  6:48       ` Jan Kiszka
2022-02-08 11:32         ` [isar-cip-core v3] " Kunijadar Shivanand
2022-02-08 18:42           ` Jan Kiszka

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=20220201153502.14230-2-Shivanand.Kunijadar@toshiba-tsip.com \
    --to=shivanand.kunijadar@toshiba-tsip.com \
    --cc=akihiro27.suzuki@toshiba.co.jp \
    --cc=cip-dev@lists.cip-project.org \
    --cc=dinesh.kumar@toshiba-tsip.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kazuhiro3.hayashi@toshiba.co.jp \
    --cc=quirin.gylstorff@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.