From patchwork Thu Jan 6 11:16:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12705323 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 219D3C433EF for ; Thu, 6 Jan 2022 11:17:12 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web10.7277.1641467830112949625 for ; Thu, 06 Jan 2022 03:17:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=l+lu5LWc; spf=pass (domain: miraclelinux.com, ip: 209.85.216.54, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pj1-f54.google.com with SMTP id rj2-20020a17090b3e8200b001b1944bad25so2806183pjb.5 for ; Thu, 06 Jan 2022 03:17:10 -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=l+lu5LWcLmz/WRngnbaqA/KiH9MEcQn6kraP6ATiBUQFaJCthRmYY0OSwB2XnI7BDz xPplcRvjWssEmBxcdRO4CX9Nu7bR3u4BooqWZkcV9s7P98j44THUkH5veAqILTJi8//I rencS7MOLyk4d39ALrnF3eZzbfC9407wQNytyjZmeDBZf+8tt9QcEsikybSgZYA1R8p2 mkEy3lXXJm7YH4UIiSUIOgVXFdpAXzhiatfnPIfLKtkGEypgLryQn2cPI4kkq8om7Oep Z9CEn0XSaaUI+z3jEEkq4R7XIFOtGoEnatSSxM9dvfsiEhpWQzQ8UWei7wlGwMQWRwPh bvNQ== 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=hEXOG/ocQPs4HhqSQG8r4ufk/rtli20CZZX0ZyGLgkRahmusuG+FNgbdwMk2KYg1N8 Ttik07wahWEpE26Y8PPIi7/gfz4fhxqxGLMjDIng3WCqhplZc9cUBMwP0hoqWneb1mJd likGVXRYQGinpBwKxCRqNJs/CkvSRetOJgcN6aLW7cLPMvZREuiXtZdaWlb2KyrL+60R Hqtp9E7E2HzcnQNNGATcWX39dz1AlA685nYsc+oXXeSwhhF1Xz1PO0o4Fg4nai9ozukf S1WapsEe+Wf+KCVvuL0DekLiEiHiX+LMYQewNNxI4/aHqk3YwW13aBIaXdUq6iBjFwZ+ qThw== X-Gm-Message-State: AOAM5307XSDvIpjF/NSKG8wr0lV9ID1Du2krB9vZFas0RLgcWdEwrsrt CQVoiiDxlQEb5t3960DUXom728fzzUcd X-Google-Smtp-Source: ABdhPJxywu9u/c2thL7Pfh44YoktDOofhrsS1vzxkwUjEGYQ7hoZCpODjE4lEKqJCCS3PFxg8D2/mw== X-Received: by 2002:a17:90a:bd01:: with SMTP id y1mr9474328pjr.33.1641467829568; Thu, 06 Jan 2022 03:17:09 -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 x6sm1766325pge.50.2022.01.06.03.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 03:17:08 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH 1/4] Add cip-core-image-kernelci Date: Thu, 6 Jan 2022 20:16:11 +0900 Message-Id: <20220106111614.218823-2-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220106111614.218823-1-alice.ferrazzi@miraclelinux.com> References: <20220106111614.218823-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, 06 Jan 2022 11:17:12 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7327 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 6 11:16:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12705324 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 2E69FC433FE for ; Thu, 6 Jan 2022 11:17:18 +0000 (UTC) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mx.groups.io with SMTP id smtpd.web12.7215.1641467833448547009 for ; Thu, 06 Jan 2022 03:17:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=1ap6dB6t; spf=pass (domain: miraclelinux.com, ip: 209.85.215.182, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f182.google.com with SMTP id 8so2265546pgc.10 for ; Thu, 06 Jan 2022 03:17:13 -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=1ap6dB6tlcBV+8dKls/bkq1m9fK3NrWv2hkRba5OD/gr1mHhBn1o6TRl7gug1HIwsC hocn4Q8eHOPsTqwb+vjpRSSQBB91G7wBm3v6kVr0b/uFgnMM+iAGN016K1UOb4MBuaCY KRgrgUpOIGAsgrH9bUWr/GGOWc9N8trUxRUJ7eo3TBx/a1cw8YvT13cyzE2dxyxA3NGk TUEIh+7d74jWhr6hpgS9QKjKkgjYUcnuYI0GnF8GoByhWTMQmadSlcdd52VZ+So7MPQd WSNmS5WIIcTq5muFpur5xEU9Jbhjw+O7VCT4KoxLrfFJDBlUPSGk8b2BEQcVEDEk3MEX oWTA== 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=bYWrC/lahc7/MZEwltHMrQR8myBlSbRrD06uLCN3+3nl1anzINSo/PN5TwPhVC8NHu QQ8jLxv8qXJNyX8fbRBxKuvZ8nizttPHeNE7hEm6FSroa8/rjtt3RqhYgwINquIQlBKx KC46m0QgZ7IH8B/RqPfldGG8Ix8o7fP+dopCaBvY2MlR6AS92EN4T56sZZ7VbinBUHAy fmv3MIxacgnIjL7HqIw2fL7qSPiSXDpBi7Hfxfq/CMbnQfH1hhGG21Wybr/UlKg3aMyz LB5gYbgCD3v++NxVARvIvz8VW5dsmojjs9hTMbCg3cUYSKdfYvQxNQTBYQhE93XIpXlb ZFgQ== X-Gm-Message-State: AOAM530xujZtUrnfg4OqHwVkzTnSIs7YmTsiEGKoOFfaOT/e/sydnsDa FIHb4vXAGW9qAchdb0YzK5yz9LokFC74 X-Google-Smtp-Source: ABdhPJyR3jy5rOghBfHTfqFJY+sn3FiYJDEqFTuTvV3wgIBRRSfCMTyl8fORbveugLSiWB+f7ouSsA== X-Received: by 2002:a62:ed06:0:b0:4bb:1152:2fbd with SMTP id u6-20020a62ed06000000b004bb11522fbdmr59513822pfh.34.1641467833050; Thu, 06 Jan 2022 03:17:13 -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 x6sm1766325pge.50.2022.01.06.03.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 03:17:12 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH 2/4] Add dmesg filter needed for lava test result Date: Thu, 6 Jan 2022 20:16:12 +0900 Message-Id: <20220106111614.218823-3-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220106111614.218823-1-alice.ferrazzi@miraclelinux.com> References: <20220106111614.218823-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, 06 Jan 2022 11:17:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7328 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 6 11:16:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12705325 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 224D7C433F5 for ; Thu, 6 Jan 2022 11:17:18 +0000 (UTC) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mx.groups.io with SMTP id smtpd.web10.7280.1641467836187794243 for ; Thu, 06 Jan 2022 03:17:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=tLox63eP; spf=pass (domain: miraclelinux.com, ip: 209.85.215.174, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f174.google.com with SMTP id i30so2317338pgl.0 for ; Thu, 06 Jan 2022 03:17:16 -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=tLox63ePH2gH1+U7X6Rn4c8wuESmvrB+6EbdoD9rhppBi5fheKfU9YFgIWqsHTNvJb yqTLI7XFqHKXrdaDi0VXqtiEQZ+NJL3x17ZxU7CaAGsvVwHdCPiErYRjFHDfr5df1fV4 HfZksr3VotgirWzLnw5bUZNXvwlmLp6yENfnSzYkqcS5SiKIn9ZxeW+iieWUC3pLGUu3 F5r+zmONSSKgG34MgcrJ5g2uaeBNssPFBQV4PoCwYusX7iEdQjw38dO+wFscuvRB0/I2 nwNh3UWGd6qoIRud7M5+XPBg7ETHwdnO9JNDKzV/d6Jaz5FT6OT+6695TtQlh2ICegFs Eqkg== 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=esTl3BrjJ9c2vkldImVByAr54JIkx2aQa/I36RgTywct9y+NkUzLOzwkMHd+acpvtj 6dEcuYqlnSj+rgJadUfNL2LSgxAHDKWbfj6LG04iM6IeabhwUtZa3GxUI/KNDisMHDiI 4X7Wzq33g1coVsgTyfKQIf7EUfMy1jFJ8ZOcOgi3JMGdacl1Z4lMiMYcLxaPgcUix9Q9 SsrFQYM0rGdyb+y+2fW/65p7/rvaaDCAGegpDWvzMyhfGcZV+xMxZOptUVu6/yuyiLFd zPyMSOY7eNPBnovsnP/7UIJwKth4Jrv/hQuDWevVigAHsPbqX6iLEwprfy3yhuJo/lhT C74g== X-Gm-Message-State: AOAM532NcP0lrjY+9TzBUGLcQOFbtOjo+FpXtPvTRdx8TXNjnuFNOh0+ MBHpaAsoFEijmR7um0jmH4vBjw9bwbj8 X-Google-Smtp-Source: ABdhPJzmMdhrlmZGThXK7RGiBOi1kDSJOaF9GFv5afCrTxRxTcpbVZRofaTNNRSET1/IWBL/SqCRLw== X-Received: by 2002:aa7:8b0b:0:b0:4bc:d5eb:93c6 with SMTP id f11-20020aa78b0b000000b004bcd5eb93c6mr9397624pfd.71.1641467835756; Thu, 06 Jan 2022 03:17:15 -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 x6sm1766325pge.50.2022.01.06.03.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 03:17:15 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH 3/4] Add script deploy-kernelci.py for upload the cip-core-image-kernelci Date: Thu, 6 Jan 2022 20:16:13 +0900 Message-Id: <20220106111614.218823-4-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220106111614.218823-1-alice.ferrazzi@miraclelinux.com> References: <20220106111614.218823-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, 06 Jan 2022 11:17:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7329 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 6 11:16:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12705326 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 22D68C433EF for ; Thu, 6 Jan 2022 11:17:23 +0000 (UTC) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mx.groups.io with SMTP id smtpd.web10.7281.1641467838712259538 for ; Thu, 06 Jan 2022 03:17:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=II2UGZdL; spf=pass (domain: miraclelinux.com, ip: 209.85.215.176, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f176.google.com with SMTP id 200so2284592pgg.3 for ; Thu, 06 Jan 2022 03:17:18 -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=uIATOyQofeUF5Nuv6Ln+Oj2h/9BIXCrTWIgNB3B2qRg=; b=II2UGZdLMBY9b8s96tcXasd7XxDyX9vSdmMeYxH3LE6hiD5UYv5m+YkYSh2tHi7laJ IABD1YKjgnHWStDXL2uH5B5SxEYLCWdq6nMX5K1igq+OHNej6NxS08avKgHQUdCmjqbP /bqg/CetuPhEHZlpM0p6Utkg799Mzf70kaxdvANMHNjpYatJcD7pEunzfnGOPFuyfgJU rzqrntl7iKlG9np6pB9iNFcQlJ+f+gHfWESJbV+SPC+kfCQxfZl+J4m4aKHAbF7gXdOW G6PPGdw5z+w71+0Th0JpdIRxqPqp0rayMgu1iU7KIlQdWCCrhjKcjrNta5G3o8vA129q VxVw== 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=uIATOyQofeUF5Nuv6Ln+Oj2h/9BIXCrTWIgNB3B2qRg=; b=wFN6UOYGFLWwTZiBhKtjnUAOGnv6FZ6v9CMsU5CYgftjy946NOmUYqKNBKPT0FeW67 2iwh0JW5KOHo0nUhHca83cftiz3b/cnILVIVIwzAyYD80MO7nXzP5v8Hnpuk7u/oGfSg 9xG2rOHub+x709I2lYvK7uk/IxLqDPxx4s22YJH9LxOb+DCqG+LzkL2HlJYN1yCEHwz6 O2VSJ++MtORG+lFyuu+4vtlBbMW54F9XyZhS9Y1gC2bRcTQup0bq2+UkmpShCF/Cap66 ACE0z05NPKxaEUTp1KFas832qC/M1hYLkq9GfQ4UVonjKwcTRREwy8NGmlc1M9AvKjnY CXqQ== X-Gm-Message-State: AOAM531GskFjsqRPltFH79cttM3PE23hmnuP6wctZ1BmOewGnrEZeNE2 oV0ZeD5JgcYM82TZEcL7VwNnI+ynfiNl X-Google-Smtp-Source: ABdhPJzKV4jascWgDXbGDluHKy6GxyIaGZNq+9hUn2/voobJ2trM+d2FPigjm28lnX43IYn+KMaO9w== X-Received: by 2002:a63:700d:: with SMTP id l13mr52722093pgc.333.1641467838366; Thu, 06 Jan 2022 03:17:18 -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 x6sm1766325pge.50.2022.01.06.03.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 03:17:17 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [isar-cip-core][PATCH 4/4] enable cip-core-image-kernelci Date: Thu, 6 Jan 2022 20:16:14 +0900 Message-Id: <20220106111614.218823-5-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220106111614.218823-1-alice.ferrazzi@miraclelinux.com> References: <20220106111614.218823-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, 06 Jan 2022 11:17:23 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7330 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 | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7db8c1..784343b 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 @@ -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} ${extension} ${dtb} ${CI_COMMIT_REF_SLUG}; fi + - 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: