From patchwork Thu Jan 20 12:54:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12718608 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 350C0C4332F for ; Thu, 20 Jan 2022 12:55:54 +0000 (UTC) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web11.11209.1642683352386932127 for ; Thu, 20 Jan 2022 04:55:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=nkpzBAMo; spf=pass (domain: miraclelinux.com, ip: 209.85.215.170, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f170.google.com with SMTP id p125so5323589pga.2 for ; Thu, 20 Jan 2022 04:55:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miraclelinux-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u9gqQIo7Fw8BVR6llbOlE9b1kL17o3XFR9HX6wYAXIg=; b=nkpzBAMouAVJcYFuzbTL2rDjKrNwJBxiRdNEoeAJ6wZifWTZnXkcjbeE+6JlrEO6HA TUnjkTJj8sZQ4AL/9wFsCwy8FhXzyLozpFiWsGv5aSHjUDaE5cVKwNaO/UGHr6GbbYBa BR4hHbYRZWFKpz8tMnG/Ghq00xT5mu1skLLdYs+M9c+cmIiLvZEnGnsvnKO5hqmQwpOV ZIcpdgRokrumgtEmvftw0FvzaWX8DlVK+Q4NqjmurfKVqFh+HWbL7cu1tCW6Gq0u+wM9 YMCrNh2Iku5ZCWXH4D5ih7qQlqm+fkv1jdEKFrdKtTjuhacEOEJix8F913ujMOU+9fUI rhBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9gqQIo7Fw8BVR6llbOlE9b1kL17o3XFR9HX6wYAXIg=; b=1SRyrMs14yfcYXuaeNAZ26+I3512u9geibKn2aD6SFtQgdB8C3AY7AIgkYe83NMVpY KZFe7KZKBAdM4xJlTVpHMJKXysKhYw5cz4P7hXNxID8/SNpsOH42GllQtD/kJtExB5Nr mo8+SfcN7JtWDAyhK8R6mQSCI9+d2lHgRnRBiNZysX1WUmUIhYVSdLCOdYVoIhdYARJ0 ChO98WIhrY7XpS1liZVlmpK1+hrRJoY8tbsqoV13UvqlpVBBZ+1AV7GvIEG2ynu/3ebE W1WTTW1V3HAKt2NmObRK9951lIj6t/ngqs7Fxzv8XL69hynA/NUeXzrvvHUI+CkDnsao YSSA== X-Gm-Message-State: AOAM533A0p8qjvwx4T83OubjgGvzwftczf0eBCqmf98qUp4/K9PGhay5 x0wXB3OwiZEf//5Ia4YlWkfKC7kiJ8W/ X-Google-Smtp-Source: ABdhPJzlwpHm7735iM1aA0b5Qj/2BjecEUfiib1qw3djseo2RCfHN9LMOnqPP6KR/TTSZWIvyMe/aA== X-Received: by 2002:a63:1c1d:: with SMTP id c29mr31812421pgc.89.1642683351821; Thu, 20 Jan 2022 04:55:51 -0800 (PST) Received: from alicef-pc.nkano1.kt.home.ne.jp (27-139-229-132.rev.home.ne.jp. [27.139.229.132]) by smtp.gmail.com with ESMTPSA id n11sm9975634pjf.29.2022.01.20.04.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:55:50 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH v2 1/4] Add cip-core-image-kernelci Date: Thu, 20 Jan 2022 21:54:15 +0900 Message-Id: <20220120125418.236990-2-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> References: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 20 Jan 2022 12:55:54 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7473 This image is currently used by KernelCI production for testing purpose. The purpose of this image is that KernelCI need to be able to autologin without password and to detect the login shell using special characters. Currently added are the default settings used by KernelCI images. Signed-off-by: Alice Ferrazzi --- 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 | 34 +++++++++++++++++++ .../kernelci-customizations.bb | 34 +++++++++++++++++++ 6 files changed, 124 insertions(+) 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/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 +# Alice Ferrazzi +# +# 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 +# +# 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 +# +# 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..7ae30e8 --- /dev/null +++ b/recipes-core/kernelci-customizations/files/postinst @@ -0,0 +1,34 @@ +#!/bin/sh +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2019 +# Copyright (c) Cybertrust Japan Co., Ltd., 2021 +# +# Authors: +# Jan Kiszka +# Alice Ferrazzi +# +# SPDX-License-Identifier: MIT +# + +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/serial-getty@.service.d/ +echo "[Service]" > /etc/systemd/system/serial-getty@.service.d/override.conf +echo "ExecStart=" >> /etc/systemd/system/serial-getty@.service.d/override.conf +echo "ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM" >> /etc/systemd/system/serial-getty@.service.d/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 diff --git a/recipes-core/kernelci-customizations/kernelci-customizations.bb b/recipes-core/kernelci-customizations/kernelci-customizations.bb new file mode 100644 index 0000000..dca0891 --- /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 +# Alice Ferrazzi +# +# 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/ +} From patchwork Thu Jan 20 12:54:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12718610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C694C433EF for ; Thu, 20 Jan 2022 12:56:01 +0000 (UTC) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mx.groups.io with SMTP id smtpd.web12.11059.1642683355739386866 for ; Thu, 20 Jan 2022 04:55:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=VVPO9Mkr; spf=pass (domain: miraclelinux.com, ip: 209.85.216.41, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pj1-f41.google.com with SMTP id s2-20020a17090ad48200b001b501977b23so4958041pju.2 for ; Thu, 20 Jan 2022 04:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miraclelinux-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PTHS+D8v5iHTS/UXgT3kKjIanyW4w9irHfKQidWy9GY=; b=VVPO9MkrYrhG8Jc0LtizZNc41KhmFhuWF5+Ixvet2xyte6bIPic5+j+z8BVWcowQPf YjWsxe9zzbaPl0VS6DLhhXE6ltIxa+OjgL0mhUHl1r6Ay9x0SP7t0VZjdZW8678t67E7 rdrkSnY9VhpyF+IZrIbDSVlHEbOM6LE+AD4Z8z63mGINUh5GlzhM9CzzeviBqOANGtV9 O5v08e229Y58qc6Vl68HtoqiE7R/r588D/qrH+8W6m6bJPq8CvPhU/WmK1CjCDgeT3eV +MdHaBdJU9XOZ+CUzR7MJ0COh4YN5w/jbx09PDaVzkVuRxZXKQos2smqaqm57BCfjWrD AoVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PTHS+D8v5iHTS/UXgT3kKjIanyW4w9irHfKQidWy9GY=; b=Ga72z9mJVJwCIsxP5AhhjV3dh3f1LKZwCEpl4o4b02KGjJrTy8zQ47tXN1Eu5tLLBl gCoXs46LIrdDLnqlsDd3fgYaU1YgRUlWeU5dWIetGeMKeQeRWPI3MR2rZaRpTorKfy+U 7OCOfD29xQPEZiPDyMngvO3Zizvd0Usb/kWZnB+znD4qKZydWcF4vVTIil7JzkJ0QvnG xni+nYDKexpZLYaOtqPsaQvi4aSyY44c/5TXt5eePlp0Y5qLs/8QXmFPmFwk0EU28QiS yTUuiS38nlV6E2vqtpSxioXbE4eSp6lrxfoTDSUkwpgCQcaGiYvlNjuKE1mj2/7HmpCU Bxtw== X-Gm-Message-State: AOAM532eHaQWIidUr33uEoQW9esKVepcJwe0hgSl2sHeKjkOH0EJ0pXS Fj04vZRu7ti0tMxySnhUWjxFzy06diGe X-Google-Smtp-Source: ABdhPJxvkBaT/LIh9JeY+rvEr4wxNCYJQ15CEtzJLxUIQT+CAg2iWaKcqcoy4hKpFTnop4ZMLIZQbA== X-Received: by 2002:a17:903:244e:b0:14a:537b:db0b with SMTP id l14-20020a170903244e00b0014a537bdb0bmr37642686pls.28.1642683355267; Thu, 20 Jan 2022 04:55:55 -0800 (PST) Received: from alicef-pc.nkano1.kt.home.ne.jp (27-139-229-132.rev.home.ne.jp. [27.139.229.132]) by smtp.gmail.com with ESMTPSA id n11sm9975634pjf.29.2022.01.20.04.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:55:54 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH v2 2/4] Add dmesg filter needed for lava test result Date: Thu, 20 Jan 2022 21:54:16 +0900 Message-Id: <20220120125418.236990-3-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> References: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 20 Jan 2022 12:56:01 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7474 KernelCI is using a dmesg filter script for checking dmesg logs result with lava. Adding the script to the cip-core-image-kernelci. Signed-off-by: Alice Ferrazzi --- .../kernelci-customizations/files/dmesg.sh | 23 +++++++++++++++++++ .../kernelci-customizations.bb | 1 + 2 files changed, 24 insertions(+) create mode 100644 recipes-core/kernelci-customizations/files/dmesg.sh diff --git a/recipes-core/kernelci-customizations/files/dmesg.sh b/recipes-core/kernelci-customizations/files/dmesg.sh new file mode 100644 index 0000000..3b096e1 --- /dev/null +++ b/recipes-core/kernelci-customizations/files/dmesg.sh @@ -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 diff --git a/recipes-core/kernelci-customizations/kernelci-customizations.bb b/recipes-core/kernelci-customizations/kernelci-customizations.bb index dca0891..c3f677c 100644 --- a/recipes-core/kernelci-customizations/kernelci-customizations.bb +++ b/recipes-core/kernelci-customizations/kernelci-customizations.bb @@ -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" From patchwork Thu Jan 20 12:54:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12718609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AE1FC433F5 for ; Thu, 20 Jan 2022 12:56:00 +0000 (UTC) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mx.groups.io with SMTP id smtpd.web08.11233.1642683359124317340 for ; Thu, 20 Jan 2022 04:55:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=yNHwcy6y; spf=pass (domain: miraclelinux.com, ip: 209.85.215.169, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f169.google.com with SMTP id e9so1755941pgn.4 for ; Thu, 20 Jan 2022 04:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miraclelinux-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RRYhDsiQqxp8TXb60neak8ciHC84xt/O57ONpJQOLQo=; b=yNHwcy6yYye3kkIXU409ioVgZymkFiJFGXLD4qIKRq37W7JhYU0rVxSWigALdRW6SP lFMXqWUzAbKEloBRtP/Q/+CgBGcTv3jUjve7rbMT4WIeNbt/NFoeGkLy0nCXLOjSb+EO 5U0VuJbtCDx6L3GQoFByejjDXxIzqZGmpdAjlyCZuvSX9M+7NYkDfQpvKn1zpAIYGqMD 8u0PqNGz+n8AihMg/DufBWXlXYXl5/afl+vWd0H5DqiVSwjx5TrKvlfFpmkdXJecYaRB GfNMgRIbIb8fgYmzpVa6IljF/5LxvMjO3igK0heN+ca/zDpbn5tfyNDFFpKAZRXrkZnY yXAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RRYhDsiQqxp8TXb60neak8ciHC84xt/O57ONpJQOLQo=; b=NE+LxLDKIFXGIyj/xruf3jQtLgP9bpXHS58g8gJ24OF3f3p69eFpm5dJZZzKl9cI7D rFoyjR6fQeqivvDX4cNymTIwlbJw2VhlXraqsg/4MdfzS8kReHE4lyuzvEa3itHN8P0D KJVZCPoUunT4yQT6kMkecPZkgE1VwQ8hFa6Y1RcqDLlPJKwweFLAtQEtNnyfQT46UDCW UqdgFYAddSTMA0XaoBKIU06SIweh3pYGvHRIaN6snISu1ZbATME++VpUMtY3oC4SgNYK LO6yJTSWfMfi2mxjY4Zugd78EaI8/kYZYecROWmN8m0irguQ5kfKuloSe8cjxz1reabS Dbug== X-Gm-Message-State: AOAM5315CUMd3qPCNsYHeITZnH/gHvsfb//Tzcajb9XNtHYJ+17Np6Uc B7hyRl4XKpBpWe6S3IcJT9X5EMbbbHWo X-Google-Smtp-Source: ABdhPJwBIrV+O7lvRdIzA6mDVJMlbYMZXqBr5UEGtZS8oXBHsR23ZGJoVLpPz1y3hZ5JDuDh6H07dg== X-Received: by 2002:aa7:81cf:0:b0:4c0:6242:c14e with SMTP id c15-20020aa781cf000000b004c06242c14emr35383167pfn.83.1642683358564; Thu, 20 Jan 2022 04:55:58 -0800 (PST) Received: from alicef-pc.nkano1.kt.home.ne.jp (27-139-229-132.rev.home.ne.jp. [27.139.229.132]) by smtp.gmail.com with ESMTPSA id n11sm9975634pjf.29.2022.01.20.04.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:55:57 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH v2 3/4] Add script deploy-kernelci.py for upload the cip-core-image-kernelci Date: Thu, 20 Jan 2022 21:54:17 +0900 Message-Id: <20220120125418.236990-4-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> References: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 20 Jan 2022 12:56:00 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7475 The cip-core-image-kernelci need to be uploaded to the KernelCI production storage for been used by KernelCI. This script use the KernelCI API for uploading the cip-core-image-kernelci to the production storage. The images are uploaded in the following link: https://storage.kernelci.org/images/rootfs/cip/ Signed-off-by: Alice Ferrazzi --- scripts/deploy-kernelci.py | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 scripts/deploy-kernelci.py diff --git a/scripts/deploy-kernelci.py b/scripts/deploy-kernelci.py new file mode 100755 index 0000000..5a8adca --- /dev/null +++ b/scripts/deploy-kernelci.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import subprocess +import requests +import os +import sys +import time +from urllib.parse import urljoin + +cdate=time.strftime("%Y%m%d") +api="https://api.kernelci.org/upload" +token=os.getenv("KERNELCI_TOKEN") + +release=sys.argv[1] +target=sys.argv[2] +extension=sys.argv[3] + +rootfs_filename="cip-core-image-kernelci-cip-core-"+release+"-"+target+".tar.gz" +initrd_filename="cip-core-image-kernelci-cip-core-"+release+"-"+target+"-initrd.img" +initrd_gz_filename="cip-core-image-kernelci-cip-core-"+release+"-"+target+"-initrd.img.gz" + +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 + +def upload_file(api, token, path, input_file, input_filename): + headers = { + 'Authorization': token, + } + data = { + 'path': path, + } + files = { + 'file': (input_filename, open(input_file, 'rb').read()), + } + url = urljoin(api, 'upload') + resp = requests.post(url, headers=headers, data=data, files=files) + resp.raise_for_status() + +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_gz_filename) + 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.kernelci.org"+upload_path_latest) From patchwork Thu Jan 20 12:54:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12718611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12D60C433FE for ; Thu, 20 Jan 2022 12:56:03 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web11.11212.1642683362027040130 for ; Thu, 20 Jan 2022 04:56:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=JtBqGA8C; spf=pass (domain: miraclelinux.com, ip: 209.85.216.49, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pj1-f49.google.com with SMTP id s2-20020a17090ad48200b001b501977b23so4958351pju.2 for ; Thu, 20 Jan 2022 04:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miraclelinux-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gg+ppPp5FucG+md+HTlpu2GaKreMSHMuhWd/UbzxLeM=; b=JtBqGA8Cr5/xPdz0tJuD9WPfdALts3Q6at6eoNFJ6fS1qmbCvqeOjnxWt4VcJn+7t7 9eyo5e4XFFdijT9wy06qDi+WzLfuD96mgkYfViOn06jhId9xpPcP32vkmcJecO2srWYV u4gE76ZdLxZZ6RlHwdj+aTbc0BvPhvW+fkT8B8R+8qJkK6XXRww2jNRZfv2CrqvWi750 cIuavDe+Z5/G252KHxSx+UtHQX8p/NTTWdmo9IFyuYf36mvENso6h6+t3i0BePllkFqP 26IKn+dqAetm9jeW23oLSpwOq+xnjR64J9IeFjs4rJsiUYgwHQX8Yk5l/mOZjUoCurzY iTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gg+ppPp5FucG+md+HTlpu2GaKreMSHMuhWd/UbzxLeM=; b=J9hk0dFMqVEuQnM8DViVZnBDXLhShmRV5shIgmw+6/ZiIJa38z/nsgeEZ/yT64vvRT /+XCz3u0GoMcZe0OyfeOMX8IPFUJlqDCTYvCYQP5yq5X2l16bUR9hGXAMeozCQZBZ0uX EKS3jLrrT3xFY18ixPtpfhs654oX5NZPctcq5628PIj3r8HoWjz28FZLvzg2yBU7dvTa fLPo6rhLDOrn1T2pZ0OJxO3Guvyw45TVkBeP38Vg+AZJTfLgwpBIo+QqYmK25KgBwPN/ i1qND/IxfQ5ccHbx17OMmeBhmnEBTiTx9WlqoVlf9Z0FHnSSscT4XM09KUY/HvLtDMQR IwSg== X-Gm-Message-State: AOAM532RaVVuh3NxXYAbBoaMZopb8QNvNuqzULqmowui8ec5SXz1zyCd VQXJMZ6RtS/5M4JmnmASmZsKaNAHNfXa X-Google-Smtp-Source: ABdhPJzEtBNhz4nnFTndeD9QBuoRtISgNlKR32kB1DJDRpZj9eZNzGY4M+ulHeGNk/owbhn8sOuiug== X-Received: by 2002:a17:90b:224c:: with SMTP id hk12mr10563487pjb.62.1642683361556; Thu, 20 Jan 2022 04:56:01 -0800 (PST) Received: from alicef-pc.nkano1.kt.home.ne.jp (27-139-229-132.rev.home.ne.jp. [27.139.229.132]) by smtp.gmail.com with ESMTPSA id n11sm9975634pjf.29.2022.01.20.04.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:56:00 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH v2 4/4] enable cip-core-image-kernelci Date: Thu, 20 Jan 2022 21:54:18 +0900 Message-Id: <20220120125418.236990-5-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> References: <20220120125418.236990-1-alice.ferrazzi@miraclelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 20 Jan 2022 12:56:03 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7476 enable CIP core image KernelCI to be built with gitlab pipeline and uploaded to the KernelCI storage using KernelCI API. enable cip-core-image-kernelci to be built for amd64, arm and arm64. Signed-off-by: Alice Ferrazzi --- .gitlab-ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9cbc60..c06c783 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ variables: targz: disable dtb: none deploy: enable + deploy_kernelci: disable stages: - build @@ -38,6 +39,7 @@ default: - echo "Building ${base_yaml}" - kas build ${base_yaml} - if [ "${deploy}" = "enable" ]; then scripts/deploy-cip-core.sh ${release} ${target} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi + - if [ "${deploy_kernelci}" = "enable" ]; then scripts/deploy-kernelci.py ${release} ${target} ${extension} ${dtb}; fi # base image build:simatic-ipc227e-base: @@ -77,6 +79,18 @@ build:qemu-amd64-base: wic_targz: disable targz: enable +build:qemu-amd64-base-kernelci: + extends: + - .build_base + variables: + target: qemu-amd64 + extension: kernelci + use_rt: disable + wic_targz: disable + targz: enable + deploy: disable + deploy_kernelci: enable + build:qemu-arm64-base: extends: - .build_base @@ -87,6 +101,18 @@ build:qemu-arm64-base: wic_targz: disable targz: enable +build:qemu-arm64-base-kernelci: + extends: + - .build_base + variables: + target: qemu-arm64 + extension: kernelci + use_rt: disable + wic_targz: disable + targz: enable + deploy: disable + deploy_kernelci: enable + build:qemu-arm-base: extends: - .build_base @@ -97,6 +123,18 @@ build:qemu-arm-base: wic_targz: disable targz: enable +build:qemu-arm-base-kernelci: + extends: + - .build_base + variables: + target: qemu-arm + extension: kernelci + use_rt: disable + wic_targz: disable + targz: enable + deploy: disable + deploy_kernelci: enable + # test build:simatic-ipc227e-test: extends: