All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
To: cip-dev@lists.cip-project.org
Cc: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
Subject: [isar-cip-core][PATCH 07/11] Create cip-core-image-kernelci
Date: Tue, 16 Nov 2021 01:17:20 +0900	[thread overview]
Message-ID: <20211115161724.19516-8-alice.ferrazzi@miraclelinux.com> (raw)
In-Reply-To: <20211115161724.19516-1-alice.ferrazzi@miraclelinux.com>

Initialization of the cip-core-image-kernelci

Signed-off-by: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
---
 .gitlab-ci.yml                                |  3 ++
 kas/opt/kernelci.yml                          | 16 +++++++++
 .../images/cip-core-image-kernelci.bb         | 16 +++++++++
 .../files/99-silent-printk.conf               |  1 +
 .../kernelci-customizations/files/ethernet    | 23 +++++++++++++
 .../kernelci-customizations/files/postinst    | 22 ++++++++++++
 .../kernelci-customizations.bb                | 34 +++++++++++++++++++
 scripts/deploy-kernelci.py                    | 13 +++----
 8 files changed, 122 insertions(+), 6 deletions(-)
 create mode 100644 kas/opt/kernelci.yml
 create mode 100644 recipes-core/images/cip-core-image-kernelci.bb
 create mode 100644 recipes-core/kernelci-customizations/files/99-silent-printk.conf
 create mode 100644 recipes-core/kernelci-customizations/files/ethernet
 create mode 100644 recipes-core/kernelci-customizations/files/postinst
 create mode 100644 recipes-core/kernelci-customizations/kernelci-customizations.bb

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9776754..7e9b31c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -84,6 +84,7 @@ build:qemu-amd64-base-kernelci:
     - .build_base
   variables:
     target: qemu-amd64
+    extention: kernelci
     use_rt: disable
     wic_targz: disable
     targz: enable
@@ -105,6 +106,7 @@ build:qemu-arm64-base-kernelci:
     - .build_base
   variables:
     target: qemu-arm64
+    extention: kernelci
     use_rt: disable
     wic_targz: disable
     targz: enable
@@ -126,6 +128,7 @@ build:qemu-arm-base-kernelci:
     - .build_base
   variables:
     target: qemu-arm
+    extention: kernelci
     use_rt: disable
     wic_targz: disable
     targz: enable
diff --git a/kas/opt/kernelci.yml b/kas/opt/kernelci.yml
new file mode 100644
index 0000000..9c67864
--- /dev/null
+++ b/kas/opt/kernelci.yml
@@ -0,0 +1,16 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation, 2020
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Venkata Pyla <venkata.pyla@toshiba-tsip.com>
+#  Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
+#
+# SPDX-License-Identifier: MIT
+#
+header:
+  version: 10
+
+target: cip-core-image-kernelci
diff --git a/recipes-core/images/cip-core-image-kernelci.bb b/recipes-core/images/cip-core-image-kernelci.bb
new file mode 100644
index 0000000..479c14c
--- /dev/null
+++ b/recipes-core/images/cip-core-image-kernelci.bb
@@ -0,0 +1,16 @@
+#
+# A reference image for KernelCI
+#
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit image
+
+DESCRIPTION = "CIP Core image for KernelCI"
+
+IMAGE_INSTALL += "kernelci-customizations"
diff --git a/recipes-core/kernelci-customizations/files/99-silent-printk.conf b/recipes-core/kernelci-customizations/files/99-silent-printk.conf
new file mode 100644
index 0000000..ad24d3a
--- /dev/null
+++ b/recipes-core/kernelci-customizations/files/99-silent-printk.conf
@@ -0,0 +1 @@
+kernel.printk = 3 4 1 3
diff --git a/recipes-core/kernelci-customizations/files/ethernet b/recipes-core/kernelci-customizations/files/ethernet
new file mode 100644
index 0000000..fa47d1a
--- /dev/null
+++ b/recipes-core/kernelci-customizations/files/ethernet
@@ -0,0 +1,23 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+allow-hotplug eth0
+allow-hotplug enp0s2
+allow-hotplug enp2s0
+
+# used on BBB
+iface eth0 inet dhcp
+
+# used on qemu-amd64
+iface enp0s2 inet dhcp
+
+# used on simatic-ipc227e
+iface enp2s0 inet dhcp
diff --git a/recipes-core/kernelci-customizations/files/postinst b/recipes-core/kernelci-customizations/files/postinst
new file mode 100644
index 0000000..33faaeb
--- /dev/null
+++ b/recipes-core/kernelci-customizations/files/postinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Jan Kiszka <jan.kiszka@siemens.com>
+#  Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+echo "CIP Core Demo & Test Image" > /etc/issue
+
+echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
+echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
+
+HOSTNAME=demo
+echo "$HOSTNAME" > /etc/hostname
+echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
diff --git a/recipes-core/kernelci-customizations/kernelci-customizations.bb b/recipes-core/kernelci-customizations/kernelci-customizations.bb
new file mode 100644
index 0000000..15788a0
--- /dev/null
+++ b/recipes-core/kernelci-customizations/kernelci-customizations.bb
@@ -0,0 +1,34 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Jan Kiszka <jan.kiszka@siemens.com>
+#  Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+DESCRIPTION = "CIP Core image demo & customizations"
+
+SRC_URI = " \
+    file://postinst \
+    file://ethernet \
+    file://99-silent-printk.conf"
+
+DEPENDS += "sshd-regen-keys"
+
+DEBIAN_DEPENDS = " \
+    ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys"
+
+do_install() {
+	install -v -d ${D}/etc/network/interfaces.d
+	install -v -m 644 ${WORKDIR}/ethernet ${D}/etc/network/interfaces.d/
+
+	install -v -d ${D}/etc/sysctl.d
+	install -v -m 644 ${WORKDIR}/99-silent-printk.conf ${D}/etc/sysctl.d/
+}
diff --git a/scripts/deploy-kernelci.py b/scripts/deploy-kernelci.py
index c234113..1df4e72 100755
--- a/scripts/deploy-kernelci.py
+++ b/scripts/deploy-kernelci.py
@@ -19,14 +19,15 @@ extension=sys.argv[3]
 if extension == "security":
     rootfs_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+".tar.gz"
     initrd_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img"
-elif extension == "base":
+    initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+elif extension == "kernelci":
+    rootfs_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+".tar.gz"
+    initrd_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img"
+    initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+else:
+    # base extension is not adding extension name in the filename
     rootfs_filename="cip-core-image-cip-core-"+release+"-"+target+".tar.gz"
     initrd_filename="cip-core-image-cip-core-"+release+"-"+target+"-initrd.img"
-
-# initrd is actually gz compressed
-if extension == "security":
-    initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
-elif extension == "base":
     initrd_gz_filename="cip-core-image-cip-core-"+release+"-"+target+"-initrd.img.gz"
 
 input_dir="build/tmp/deploy/images/"+target
-- 
2.33.1



  parent reply	other threads:[~2021-11-15 16:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 16:17 [isar-cip-core][PATCH 00/11] cip-core-image-kernelci Alice Ferrazzi
2021-11-15 16:17 ` [isar-cip-core][PATCH 01/11] Deploy tarballs and initrd to kernelci Alice Ferrazzi
2021-11-15 16:17 ` [isar-cip-core][PATCH 02/11] Rename initrd with the gz suffix Alice Ferrazzi
2021-11-15 18:32   ` Jan Kiszka
2021-11-15 16:17 ` [isar-cip-core][PATCH 03/11] Add latest folder to the storage fileserver Alice Ferrazzi
2021-11-15 16:17 ` [isar-cip-core][PATCH 04/11] Create kernelci build step Alice Ferrazzi
2021-11-15 18:32   ` Jan Kiszka
2021-11-15 16:17 ` [isar-cip-core][PATCH 05/11] Ignore extension argument when not set Alice Ferrazzi
2021-11-15 18:36   ` Jan Kiszka
2021-11-15 16:17 ` [isar-cip-core][PATCH 06/11] Enable KernelCI build step also for arm and arm64 Alice Ferrazzi
2021-11-15 16:17 ` Alice Ferrazzi [this message]
2021-11-15 18:49   ` [isar-cip-core][PATCH 07/11] Create cip-core-image-kernelci Jan Kiszka
2021-11-15 16:17 ` [isar-cip-core][PATCH 08/11] Remove root password Alice Ferrazzi
2021-11-15 18:44   ` Jan Kiszka
2021-11-15 16:17 ` [isar-cip-core][PATCH 09/11] Set the profile for KernelCI Alice Ferrazzi
2021-11-15 16:17 ` [isar-cip-core][PATCH 10/11] dmesg.sh is needed " Alice Ferrazzi
2021-11-15 16:17 ` [isar-cip-core][PATCH 11/11] Upload to KernelCI production Alice Ferrazzi

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=20211115161724.19516-8-alice.ferrazzi@miraclelinux.com \
    --to=alice.ferrazzi@miraclelinux.com \
    --cc=cip-dev@lists.cip-project.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
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.