Skip to contentSkip to conversation

cip-core-image-kernelci

PATCH In review Alice Ferrazzi 2 participants 17 messages Nov 15, 2021

lore
Share & tools
lore
#0 lore raw

cover cip-core-image-kernelci

This patch series add a new image with settings for KernelCI.

This new image is called cip-core-image-kernelci and is based on isar-cip-core general image.
The cip-core-image-kernelci images are built by GitlabCI and uploaded to KernelCI production fileserver.
https://storage.kernelci.org/images/rootfs/cip/

These patches are already integrated in the isar-cip-core:alicef/kernelci_image repository branch and are generating the images that are currently used by KernelCI.

cip-core-image-kernelci as been tested and are already used in KernelCI production with good results.
https://linux.kernelci.org/test/job/stable-rc/branch/queue%2F5.14/kernel/v5.14.17-9-g9f7eecaa70b3/plan/baseline-cip-nfs/

Alice Ferrazzi (11):
Deploy tarballs and initrd to kernelci Rename initrd with the gz suffix
Add latest folder to the storage fileserver Create kernelci build step
Ignore extension argument when not set Enable KernelCI build step also for arm and arm64 Create cip-core-image-kernelci
Remove root password
Set the profile for KernelCI
dmesg.sh is needed for KernelCI
Upload to KernelCI production

 .gitlab-ci.yml                                | 40 +++++++++-
 kas/opt/kernelci.yml                          | 16 ++++
 .../images/cip-core-image-kernelci.bb         | 16 ++++
 .../files/99-silent-printk.conf               |  1 +
 .../kernelci-customizations/files/dmesg.sh    | 23 ++++++
 .../kernelci-customizations/files/ethernet    | 23 ++++++
 .../kernelci-customizations/files/postinst    | 34 +++++++++
 .../kernelci-customizations.bb                | 38 ++++++++++
 scripts/deploy-kernelci.py                    | 76 +++++++++++++++++++
 9 files changed, 266 insertions(+), 1 deletion(-)
 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/dmesg.sh
 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
 create mode 100755 scripts/deploy-kernelci.py
Signature · 1 line
2.33.1
#1 lore raw

PATCH 1/11 Deploy tarballs and initrd to kernelci

Create script for deploy images to KernelCI file server using KernelCI api

---
 .gitlab-ci.yml             |  4 +++-
 scripts/deploy-kernelci.py | 48 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100755 scripts/deploy-kernelci.py
.gitlab-ci.yml +3 -1
index 5becd37..dd7d9cc 100644
@@ -9,6 +9,7 @@ variables:
   targz: disable
   dtb: none
   deploy: enable
+  deploy_kernelci: enable
 
 stages:
   - build
@@ -37,7 +38,8 @@ default:
     - if [ "${release}" = "bullseye" ]; then base_yaml="${base_yaml}:kas/opt/bullseye.yml"; fi;
     - echo "Building ${base_yaml}"
     - kas build ${base_yaml}
-    - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extention} ${dtb}; fi
+    - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extention} ${dtb}; fi;
+    - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extention} ${dtb}; fi
 
 # base image
 build:simatic-ipc227e-base:
scripts/deploy-kernelci.py new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.33.1
#2 lore raw

PATCH 2/11 Rename initrd with the gz suffix

In reply to Alice Ferrazzi

Generated initrd are actually gz compressed and KernelCI need the initrd image filename to contain the gz suffix for work.

---
 scripts/deploy-kernelci.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/deploy-kernelci.py +5 -1
index 931504c..c2341a6 100755
@@ -18,6 +18,10 @@ extension=sys.argv[3]
 
 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 is actually gz compressed
+initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+
 input_dir="build/tmp/deploy/images/"+target
 upload_path="/images/rootfs/cip/"+cdate+"/"+target+"/"
 rootfs=input_dir+"/"+rootfs_filename
@@ -44,5 +48,5 @@ if os.path.exists(rootfs) and os.path.exists(initrd):
     print("uploading rootfs to KernelCI")
     upload_file(api, token, upload_path, rootfs, rootfs_filename)
     print("uploading initrd to KernelCI")
-    upload_file(api, token, upload_path, initrd, initrd_filename)
+    upload_file(api, token, upload_path, initrd, initrd_gz_filename)
     print("uploaded to: https://storage.staging.kernelci.org"+upload_path)
Signature · 1 line
2.33.1
#3 lore raw

Re: [isar-cip-core][PATCH 02/11] Rename initrd with the gz suffix

Quoted 25 lines · Alice Ferrazzi

Generated initrd are actually gz compressed and KernelCI need the initrd image filename to contain the gz suffix for work.

---
 scripts/deploy-kernelci.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/deploy-kernelci.py +4 -0
index 931504c..c2341a6 100755
@@ -18,6 +18,10 @@ extension=sys.argv[3]
 
 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 is actually gz compressed
+initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+
 input_dir="build/tmp/deploy/images/"+target
 upload_path="/images/rootfs/cip/"+cdate+"/"+target+"/"
 rootfs=input_dir+"/"+rootfs_filename

scripts/deploy-kernelci.py if os.path.exists(rootfs) and os.path.exists(initrd): · line 52

Quoted 6 lines
scripts/deploy-kernelci.py +1 -1
@@ -44,5 +48,5 @@ if os.path.exists(rootfs) and os.path.exists(initrd):
     print("uploading rootfs to KernelCI")
     upload_file(api, token, upload_path, rootfs, rootfs_filename)
     print("uploading initrd to KernelCI")
-    upload_file(api, token, upload_path, initrd, initrd_filename)
+    upload_file(api, token, upload_path, initrd, initrd_gz_filename)
     print("uploaded to: https://storage.staging.kernelci.org"+upload_path)

Why not fold that into patch 1 directly? Fixing new files right after introducing them is not an optimal pattern.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#4 lore raw

PATCH 3/11 Add latest folder to the storage fileserver

In reply to Alice Ferrazzi

Creating a latest folder useful if we want to test the latest image.

---
 scripts/deploy-kernelci.py | 8 ++++++++
 1 file changed, 8 insertions(+)
scripts/deploy-kernelci.py +8 -0
index c2341a6..88c09d7 100755
@@ -24,6 +24,7 @@ initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"
 
 input_dir="build/tmp/deploy/images/"+target
 upload_path="/images/rootfs/cip/"+cdate+"/"+target+"/"
+upload_path_latest="/images/rootfs/cip/latest/"+target+"/"
 rootfs=input_dir+"/"+rootfs_filename
 initrd=input_dir+"/"+initrd_filename
 
@@ -50,3 +51,10 @@ if os.path.exists(rootfs) and os.path.exists(initrd):
     print("uploading initrd to KernelCI")
     upload_file(api, token, upload_path, initrd, initrd_gz_filename)
     print("uploaded to: https://storage.staging.kernelci.org"+upload_path)
+
+    # Upload latest
+    print("uploading rootfs to KernelCI CIP latest")
+    upload_file(api, token, upload_path_latest, rootfs, rootfs_filename)
+    print("uploading initrd to KernelCI CIP latest")
+    upload_file(api, token, upload_path_latest, initrd, initrd_gz_filename)
+    print("uploaded to: https://storage.staging.kernelci.org"+upload_path_latest)
Signature · 1 line
2.33.1
#5 lore raw

PATCH 4/11 Create kernelci build step

In reply to Alice Ferrazzi

By default disable KernelCI upload and enable it only when needed for KernelCI image build.

---
 .gitlab-ci.yml | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
.gitlab-ci.yml +13 -2
index dd7d9cc..5f0463e 100644
@@ -9,7 +9,7 @@ variables:
   targz: disable
   dtb: none
   deploy: enable
-  deploy_kernelci: enable
+  kernelci: disable
 
 stages:
   - build
@@ -39,7 +39,7 @@ default:
     - echo "Building ${base_yaml}"
     - kas build ${base_yaml}
     - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extention} ${dtb}; fi;
-    - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extention} ${dtb}; fi
+    - if [ "${kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extention} ${dtb}; fi
 
 # base image
 build:simatic-ipc227e-base:
@@ -79,6 +79,17 @@ build:qemu-amd64-base:
     wic_targz: disable
     targz: enable
 
+build:qemu-amd64-base-kernelci:
+  extends:
+    - .build_base
+  variables:
+    target: qemu-amd64
+    use_rt: disable
+    wic_targz: disable
+    targz: enable
+    deploy: disable
+    kernelci: enable
+
 build:qemu-arm64-base:
   extends:
     - .build_base
Signature · 1 line
2.33.1
#6 lore raw

Re: [isar-cip-core][PATCH 04/11] Create kernelci build step

Quoted 13 lines · Alice Ferrazzi

By default disable KernelCI upload and enable it only when needed for KernelCI image build.

---
 .gitlab-ci.yml | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
.gitlab-ci.yml +0 -0
index dd7d9cc..5f0463e 100644

.gitlab-ci.yml variables: · line 12

Quoted 5 lines
.gitlab-ci.yml +1 -1
@@ -9,7 +9,7 @@ variables:
   targz: disable
   dtb: none
   deploy: enable
-  deploy_kernelci: enable
+  kernelci: disable

Why that renaming? Is it no longer about deploying for kernelci?

Quoted 31 lines
.gitlab-ci.yml +12 -1
 stages:
   - build
@@ -39,7 +39,7 @@ default:
     - echo "Building ${base_yaml}"
     - kas build ${base_yaml}
     - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extention} ${dtb}; fi;
-    - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extention} ${dtb}; fi
+    - if [ "${kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extention} ${dtb}; fi
 
 # base image
 build:simatic-ipc227e-base:
@@ -79,6 +79,17 @@ build:qemu-amd64-base:
     wic_targz: disable
     targz: enable
 
+build:qemu-amd64-base-kernelci:
+  extends:
+    - .build_base
+  variables:
+    target: qemu-amd64
+    use_rt: disable
+    wic_targz: disable
+    targz: enable
+    deploy: disable
+    kernelci: enable
+
 build:qemu-arm64-base:
   extends:
     - .build_base
Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#7 lore raw

PATCH 5/11 Ignore extension argument when not set

In reply to Alice Ferrazzi
---
 scripts/deploy-kernelci.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
scripts/deploy-kernelci.py +18 -3
index 88c09d7..c234113 100755
@@ -16,11 +16,18 @@ release=sys.argv[1]
 target=sys.argv[2]
 extension=sys.argv[3]
 
-rootfs_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+".tar.gz"
-initrd_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img"
+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":
+    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
-initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+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
 upload_path="/images/rootfs/cip/"+cdate+"/"+target+"/"
@@ -28,6 +35,14 @@ upload_path_latest="/images/rootfs/cip/latest/"+target+"/"
 rootfs=input_dir+"/"+rootfs_filename
 initrd=input_dir+"/"+initrd_filename
 
+print("arguments:")
+print(release)
+print(target)
+print(extension)
+print("filenames:")
+print(rootfs_filename)
+print(initrd_filename)
+print(initrd_gz_filename)
 print("build directory contents:")
 print(os.listdir(input_dir))
 
Signature · 1 line
2.33.1
#8 lore raw

Re: [isar-cip-core][PATCH 05/11] Ignore extension argument when not set

Reasoning missing.

Therefore it is tricky for me to judge if this separate patch makes sense or is better folded into an earlier one.

Quoted 37 lines · Alice Ferrazzi
---
 scripts/deploy-kernelci.py | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
scripts/deploy-kernelci.py +11 -3
index 88c09d7..c234113 100755
@@ -16,11 +16,18 @@ release=sys.argv[1]
 target=sys.argv[2]
 extension=sys.argv[3]
 
-rootfs_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+".tar.gz"
-initrd_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img"
+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":
+    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
-initrd_gz_filename="cip-core-image-"+extension+"-cip-core-"+release+"-"+target+"-initrd.img.gz"
+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
 upload_path="/images/rootfs/cip/"+cdate+"/"+target+"/"
@@ -28,6 +35,14 @@ upload_path_latest="/images/rootfs/cip/latest/"+target+"/"
 rootfs=input_dir+"/"+rootfs_filename
 initrd=input_dir+"/"+initrd_filename
 
+print("arguments:")

scripts/deploy-kernelci.py upload_path_latest="/images/rootfs/cip/latest/"+target+"/" · line 48

Quoted 10 lines
scripts/deploy-kernelci.py +7 -0
+print(release)
+print(target)
+print(extension)
+print("filenames:")
+print(rootfs_filename)
+print(initrd_filename)
+print(initrd_gz_filename)
 print("build directory contents:")
 print(os.listdir(input_dir))
 

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#9 lore raw

PATCH 6/11 Enable KernelCI build step also for arm and arm64

In reply to Alice Ferrazzi
---
 .gitlab-ci.yml | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
.gitlab-ci.yml +22 -0
index 5f0463e..9776754 100644
@@ -100,6 +100,17 @@ build:qemu-arm64-base:
     wic_targz: disable
     targz: enable
 
+build:qemu-arm64-base-kernelci:
+  extends:
+    - .build_base
+  variables:
+    target: qemu-arm64
+    use_rt: disable
+    wic_targz: disable
+    targz: enable
+    deploy: disable
+    kernelci: enable
+
 build:qemu-arm-base:
   extends:
     - .build_base
@@ -110,6 +121,17 @@ build:qemu-arm-base:
     wic_targz: disable
     targz: enable
 
+build:qemu-arm-base-kernelci:
+  extends:
+    - .build_base
+  variables:
+    target: qemu-arm
+    use_rt: disable
+    wic_targz: disable
+    targz: enable
+    deploy: disable
+    kernelci: enable
+
 # test
 build:simatic-ipc227e-test:
   extends:
Signature · 1 line
2.33.1
#10 lore raw

PATCH 7/11 Create cip-core-image-kernelci

In reply to Alice Ferrazzi

Initialization of the cip-core-image-kernelci

---
 .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
.gitlab-ci.yml +3 -0
index 9776754..7e9b31c 100644
@@ -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
kas/opt/kernelci.yml new file +16 -0
new file mode 100644
index 0000000..9c67864
@@ -0,0 +1,16 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation, 2020
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Venkata Pyla <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+header:
+  version: 10
+
+target: cip-core-image-kernelci
recipes-core/images/cip-core-image-kernelci.bb new file +16 -0
new file mode 100644
index 0000000..479c14c
@@ -0,0 +1,16 @@
+#
+# A reference image for KernelCI
+#
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Alice Ferrazzi <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit image
+
+DESCRIPTION = "CIP Core image for KernelCI"
+
+IMAGE_INSTALL += "kernelci-customizations"
recipes-core/kernelci-customizations/files/99-silent-printk.conf new file +1 -0
new file mode 100644
index 0000000..ad24d3a
@@ -0,0 +1 @@
+kernel.printk = 3 4 1 3
recipes-core/kernelci-customizations/files/ethernet new file +23 -0
new file mode 100644
index 0000000..fa47d1a
@@ -0,0 +1,23 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# 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
recipes-core/kernelci-customizations/files/postinst new file +22 -0
new file mode 100644
index 0000000..33faaeb
@@ -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 <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# 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
recipes-core/kernelci-customizations/kernelci-customizations.bb new file +34 -0
new file mode 100644
index 0000000..15788a0
@@ -0,0 +1,34 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# 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/
+}
scripts/deploy-kernelci.py +7 -6
index c234113..1df4e72 100755
@@ -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
Signature · 1 line
2.33.1
#11 lore raw

Re: [isar-cip-core][PATCH 07/11] Create cip-core-image-kernelci

Quoted 204 lines · Alice Ferrazzi

Initialization of the cip-core-image-kernelci

---
 .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
.gitlab-ci.yml +3 -0
index 9776754..7e9b31c 100644
@@ -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
kas/opt/kernelci.yml new file +16 -0
new file mode 100644
index 0000000..9c67864
@@ -0,0 +1,16 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Toshiba Corporation, 2020
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Venkata Pyla <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+header:
+  version: 10
+
+target: cip-core-image-kernelci
recipes-core/images/cip-core-image-kernelci.bb new file +16 -0
new file mode 100644
index 0000000..479c14c
@@ -0,0 +1,16 @@
+#
+# A reference image for KernelCI
+#
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Alice Ferrazzi <[email protected]>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit image
+
+DESCRIPTION = "CIP Core image for KernelCI"
+
+IMAGE_INSTALL += "kernelci-customizations"
recipes-core/kernelci-customizations/files/99-silent-printk.conf new file +1 -0
new file mode 100644
index 0000000..ad24d3a
@@ -0,0 +1 @@
+kernel.printk = 3 4 1 3
recipes-core/kernelci-customizations/files/ethernet new file +23 -0
new file mode 100644
index 0000000..fa47d1a
@@ -0,0 +1,23 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#
+# 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
recipes-core/kernelci-customizations/files/postinst new file +22 -0
new file mode 100644
index 0000000..33faaeb
@@ -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 <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# 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
recipes-core/kernelci-customizations/kernelci-customizations.bb new file +34 -0
new file mode 100644
index 0000000..15788a0
@@ -0,0 +1,34 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019
+# Copyright (c) Cybertrust Japan Co., Ltd., 2021
+#
+# Authors:
+#  Jan Kiszka <[email protected]>
+#  Alice Ferrazzi <[email protected]>
+#
+# 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/
+}
scripts/deploy-kernelci.py +0 -0
index c234113..1df4e72 100755
@@ -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"

scripts/deploy-kernelci.py extension=sys.argv[3] · line 30

Quoted 10 lines
scripts/deploy-kernelci.py +7 -1
-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"

I didn't look at the complete file yet (too many steps) but I suspect it can be shrunk by

- using initrd.img.gz for all images
- doing
if extension:
extension = extension + "-"
and then using it unconditionally again

scripts/deploy-kernelci.py extension=sys.argv[3] · line 33

Quoted 9 lines
scripts/deploy-kernelci.py +0 -5
-
-# 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

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#12 lore raw

PATCH 8/11 Remove root password

In reply to Alice Ferrazzi

KernelCI require the image to login automatically without root password for testing.

---
 recipes-core/kernelci-customizations/files/postinst | 8 ++++++++
 1 file changed, 8 insertions(+)
recipes-core/kernelci-customizations/files/postinst +8 -0
index 33faaeb..68ef9d3 100644
@@ -14,8 +14,16 @@
 
 echo "CIP Core Demo & Test Image" > /etc/issue
 
+# permit root login without password
 echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
 echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
+passwd root -d
+
+# serial getty service for autologin
+mkdir -p /etc/systemd/system/[email protected]/
+echo "[Service]" > /etc/systemd/system/[email protected]/override.conf
+echo "ExecStart=" >> /etc/systemd/system/[email protected]/override.conf
+echo "ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM" >> /etc/systemd/system/[email protected]/override.conf
 
 HOSTNAME=demo
 echo "$HOSTNAME" > /etc/hostname
Signature · 1 line
2.33.1
#13 lore raw

Re: [isar-cip-core][PATCH 08/11] Remove root password

Quoted 13 lines · Alice Ferrazzi

KernelCI require the image to login automatically without root password for testing.

---
 recipes-core/kernelci-customizations/files/postinst | 8 ++++++++
 1 file changed, 8 insertions(+)
recipes-core/kernelci-customizations/files/postinst +0 -0
index 33faaeb..68ef9d3 100644

recipes-core/kernelci-customizations/files/postinst line 20

Quoted 7 lines
recipes-core/kernelci-customizations/files/postinst +2 -0
@@ -14,8 +14,16 @@
 
 echo "CIP Core Demo & Test Image" > /etc/issue
 
+# permit root login without password
 echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
 echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
+passwd root -d

This should also be achievable via

USER_root[flags] = "allow-empty-password"

Could be set in the kernel-ci image recipe. Maybe nicer than the back and forth.

recipes-core/kernelci-customizations/files/postinst line 27

Quoted 7 lines
recipes-core/kernelci-customizations/files/postinst +6 -0
+
+# serial getty service for autologin
+mkdir -p /etc/systemd/system/[email protected]/
+echo "[Service]" > /etc/systemd/system/[email protected]/override.conf
+echo "ExecStart=" >> /etc/systemd/system/[email protected]/override.conf
+echo "ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM" >> /etc/systemd/system/[email protected]/override.conf
 

Actually topic-wise beyond what $subject suggests.

Jan

Quoted 3 lines
recipes-core/kernelci-customizations/files/postinst +0 -0
 HOSTNAME=demo
 echo "$HOSTNAME" > /etc/hostname
Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#14 lore raw

PATCH 9/11 Set the profile for KernelCI

In reply to Alice Ferrazzi

This profile is need for make KernelCI recognize that we have successfully effectuated the log in.

---
 recipes-core/kernelci-customizations/files/postinst | 4 ++++
 1 file changed, 4 insertions(+)
recipes-core/kernelci-customizations/files/postinst +4 -0
index 68ef9d3..7ae30e8 100644
@@ -25,6 +25,10 @@ echo "[Service]" > /etc/systemd/system/[email protected]/override.conf
 echo "ExecStart=" >> /etc/systemd/system/[email protected]/override.conf
 echo "ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM" >> /etc/systemd/system/[email protected]/override.conf
 
+# set the profile for KernelCI
+echo "PS1='\$(pwd) # '" > /root/.profile
+echo "cd /" >> /root/.profile
+
 HOSTNAME=demo
 echo "$HOSTNAME" > /etc/hostname
 echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
Signature · 1 line
2.33.1
#15 lore raw

PATCH 10/11 dmesg.sh is needed for KernelCI

In reply to Alice Ferrazzi

This script is needed for make dmesg logs readable by lava.

---
 .../kernelci-customizations/files/dmesg.sh    | 23 +++++++++++++++++++
 .../kernelci-customizations.bb                | 12 ++++++----
 2 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 recipes-core/kernelci-customizations/files/dmesg.sh
recipes-core/kernelci-customizations/files/dmesg.sh new file +23 -0
new file mode 100644
index 0000000..3b096e1
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+if [ "$KERNELCI_LAVA" = "y" ]; then
+    alias test-result='lava-test-case'
+else
+    alias test-result='echo'
+fi
+
+for level in crit alert emerg; do
+    dmesg --level=$level --notime -x -k > dmesg.$level
+    test -s dmesg.$level && res=fail || res=pass
+    count=$(cat dmesg.$level | wc -l)
+    cat dmesg.$level
+    test-result \
+        $level \
+        --result $res \
+        --measurement $count \
+        --units lines
+done
+
+exit 0
recipes-core/kernelci-customizations/kernelci-customizations.bb +8 -4
index 15788a0..df4257c 100644
@@ -18,6 +18,7 @@ DESCRIPTION = "CIP Core image demo & customizations"
 SRC_URI = " \
     file://postinst \
     file://ethernet \
+    file://dmesg.sh \
     file://99-silent-printk.conf"
 
 DEPENDS += "sshd-regen-keys"
@@ -26,9 +27,12 @@ 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/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/
+  install -v -d ${D}/etc/sysctl.d
+  install -v -m 644 ${WORKDIR}/99-silent-printk.conf ${D}/etc/sysctl.d/
+
+  install -v -d ${D}/opt/kernelci
+  install -v -m 744 ${WORKDIR}/dmesg.sh ${D}/opt/kernelci/
 }
Signature · 1 line
2.33.1
#16 lore raw

PATCH 11/11 Upload to KernelCI production

In reply to Alice Ferrazzi
---
 scripts/deploy-kernelci.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/deploy-kernelci.py +3 -3
index 1df4e72..479b971 100755
@@ -9,7 +9,7 @@ import time
 from urllib.parse import urljoin
 
 cdate=time.strftime("%Y%m%d")
-api="https://api.staging.kernelci.org/upload"
+api="https://api.kernelci.org/upload"
 token=os.getenv("KERNELCI_TOKEN")
 
 release=sys.argv[1]
@@ -66,11 +66,11 @@ if os.path.exists(rootfs) and os.path.exists(initrd):
     upload_file(api, token, upload_path, rootfs, rootfs_filename)
     print("uploading initrd to KernelCI")
     upload_file(api, token, upload_path, initrd, initrd_gz_filename)
-    print("uploaded to: https://storage.staging.kernelci.org"+upload_path)
+    print("uploaded to: https://storage.kernelci.org"+upload_path)
 
     # Upload latest
     print("uploading rootfs to KernelCI CIP latest")
     upload_file(api, token, upload_path_latest, rootfs, rootfs_filename)
     print("uploading initrd to KernelCI CIP latest")
     upload_file(api, token, upload_path_latest, initrd, initrd_gz_filename)
-    print("uploaded to: https://storage.staging.kernelci.org"+upload_path_latest)
+    print("uploaded to: https://storage.kernelci.org"+upload_path_latest)
Signature · 1 line
2.33.1