From patchwork Fri Dec 24 07:32:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12698892 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 9FE25C433F5 for ; Fri, 24 Dec 2021 07:33:18 +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.web11.43149.1640331195859306086 for ; Thu, 23 Dec 2021 23:33:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=ovWTl5ZX; 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 z9-20020a17090a7b8900b001b13558eadaso10876764pjc.4 for ; Thu, 23 Dec 2021 23:33:15 -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=ovWTl5ZX1Yft3Mh8uWO9v65hVpaQoxjVmksUK3N+MSYjWI0RuT7UN1+irSF0Qd63Pg xXQig+nahVFZQwIcIWhyiU36VFskzLHOzHXuB68tEot/e9zEcz++RLdbUcS/vDrGKi8y MqYXowOOXQCxLFR/h5iKfAzj2ThsVwnK72lexJYW+AvAwkJNepIdgZ6I981/IDPVyCQw a2F2nJTxBqIcpMzIL6U1YdLTTiKBghhXvqsLdAzcVK6JIzFZv9K8dCdYbiD+NIpPQm1+ 3hL+ZEGzivvWO4qUKabDjMmBadPjT3mK8CMkkqD722iVsMQ08JbdjOb1hwoqt46K0B9g xrUg== 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=gaqoe+ZxlEM/GM5M9m1KgSUBWxhEsTFi2KCsOOa0CDXvCYBlAKVh2naJwBU6IgD2S/ hNTyGBj1J5zN1dGrf2hDDYcHG1slKtnvQtt/XBTS8oDoErVEtS3u8e/VU04pf07TjAnn vP01bazgTIug0PJWiMLNV8SgwtVMa/52yq6vyk0B+PnKmIfb8as2RmkhwaaWiqMq1PRO 8aecCtlkfMHE1BuK371GOlf6XX8GI7nJGbZJVqMYJay91VuIiznGwmKFPhuxuGTCgIyk gZx/5FCdhK1weLuUmSQG7i25Fyxw8081fNKeJm9qmv7LvgEVbaUDRD8votAcJvwN0Af/ //qA== X-Gm-Message-State: AOAM532ZHWHNMG60st6DJ4ZH2gx65oRG+iXZiN37iO1gQKfVguLfxD5k QIeTybGMaLAFV/hJFXWr/gVMRxUrrIvn X-Google-Smtp-Source: ABdhPJzK5h+lFsRCuYShPtTLIu5bXUfLzmR4PSvkdGxHaTzbFejya8A8kfmR2vrOjNuCn1gfnDO64w== X-Received: by 2002:a17:903:41c1:b0:149:3895:48a1 with SMTP id u1-20020a17090341c100b00149389548a1mr5518626ple.159.1640331195403; Thu, 23 Dec 2021 23:33: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 u18sm8763175pfi.158.2021.12.23.23.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 23:33:14 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [PATCH 1/4] Add cip-core-image-kernelci Date: Fri, 24 Dec 2021 16:32:39 +0900 Message-Id: <20211224073242.69676-2-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211224073242.69676-1-alice.ferrazzi@miraclelinux.com> References: <20211224073242.69676-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 ; Fri, 24 Dec 2021 07:33:18 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7265 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 Fri Dec 24 07:32:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12698893 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 A8F80C433FE for ; Fri, 24 Dec 2021 07:33:20 +0000 (UTC) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mx.groups.io with SMTP id smtpd.web11.43150.1640331199234655385 for ; Thu, 23 Dec 2021 23:33:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=A0q2YhJR; spf=pass (domain: miraclelinux.com, ip: 209.85.215.181, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f181.google.com with SMTP id f125so7165208pgc.0 for ; Thu, 23 Dec 2021 23:33:19 -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=A0q2YhJRmQXXzQmGyUxjX37MWIiD9DJWHzqy69o8ExSXmiJks3ODTorssfSmF3rIHp xtla4fr3fHR4Lp9S+b4FdSpAUjUtI5W24BjEAaIkpQizVtamjEKa7JUg6vbZyZUzLqkl lc/ClnpYawAScEHX6IUR9lVFNLQLsnZtHxHB0o2vDJ6XY/7KR3JFQLFkALv032ObjOc6 ueucoNHrMndKWGTmH8BrCMdPV3bx4X3LsEaChXQunVp3TplOkceO0wT91f0cSxVErKJf YN7zI0ULX/nVpQFk4kgl4Y73yTrGQNwqFsrZqkjrSjqrztbgaKu4/JhTqPpmZpCdysSg AnQA== 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=KsbLGIABxtXypjsitXn1EvJvctJsWI1MJOTov1iNy0fge8kXOBIzg/DKk2HVrdDX64 uckyJpHm+7v/tzp2JgpARzVb1jnTC/HWrLbGN7Zr0BKxvNrpbjSN0qLJQ1cAldnRG3tW SmU0vUyIXdg2nkQEjXzXvA2Ag14GjvUAF3ioAfaqEoPJWwTFM6sm25o9oVHbjsWexrfu pYxmeRIjvp6qx5zHxzrBgud9q9rqR5mObzyQsxELz5ZRgoTnD1PwnZhkgLm4jfoRQ4uB 0lyqh5P90CSZGpME1rdXyNo3smcQJGdCR5jq/7OEtI0p0pGvrXBQ1hLr+Yhuov+pCJWK yBrQ== X-Gm-Message-State: AOAM533CwnNME8P9pzpJ9iJFVyTm51TvSDqMsozsTV/W/tcgTqYYwJXZ BEjFMFhQ+vXKn/d6Uc1kuiYI77rUsuG4 X-Google-Smtp-Source: ABdhPJxTXnqoeeeJKwHIlnYOR3KvA+tkBLtuKjetOxMCUsm3Ed7917AChzk2fYakbYNEWsZv9Ef8tQ== X-Received: by 2002:a65:5bc4:: with SMTP id o4mr5007042pgr.489.1640331198723; Thu, 23 Dec 2021 23:33: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 u18sm8763175pfi.158.2021.12.23.23.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 23:33:18 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [PATCH 2/4] Add dmesg filter needed for lava test result Date: Fri, 24 Dec 2021 16:32:40 +0900 Message-Id: <20211224073242.69676-3-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211224073242.69676-1-alice.ferrazzi@miraclelinux.com> References: <20211224073242.69676-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 ; Fri, 24 Dec 2021 07:33:20 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7266 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 Fri Dec 24 07:32:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12698894 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 85515C433F5 for ; Fri, 24 Dec 2021 07:33:23 +0000 (UTC) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web11.43152.1640331202703203464 for ; Thu, 23 Dec 2021 23:33:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=fmIUdIvx; spf=pass (domain: miraclelinux.com, ip: 209.85.215.175, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pg1-f175.google.com with SMTP id 200so7015021pgg.3 for ; Thu, 23 Dec 2021 23:33:22 -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=fmIUdIvxp5+TvebzZJbKjs8feOoma/M4a2Y4XRBqGNCrH3+wWJl48fJZdQYRNGROcj fLxXzEXw5ClT6Jt3P8eZE1HdN1ki2pDANuszzDuNOUaZFZbO3Gwpzcny+tzTgIWsVbKv I4p072oj9M7G66KkBD2Adk3rT9OgYLCjsNFrBjV8oveh93VuDatqEKrQlhTTkQg1m5Ry y08p2zFBH9XXvuI/EWlzbZZ9VM7jmLObkjKg+Wn6eTZ+m/D8np1PzZ9VMPUPeXDhoAaA OE3H77S+8uF9z7s89DdTTGpD7Aiut9N7N9B9DcTIIjVBWXaLbR1wGKbxcCFST0mUR/DM jJWQ== 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=K4DwbCeyfvZ5qGFmAgM5Wp4W6dcRYYZpuASKwAZim+W5qtSa6XlJPlJBsnd6MU3GUC 54parOkJqZU3mGSxZGytV/6JJIJOeQm3Nem9dvvOq+KEA4PCNlJ1uuSMHSeIuP3vCRTn Myqq/51UH2e47E5OrFchn1LsLPueJVCyjiug+QxRAfq1oMASADJ15X8AkiavW5saSosD sMo07jnWW1+umC7Ify1PLOdZfge/nLS6QQEX3bWFbyFQtwCEuq1BOaSCWHxrRUjdLQkN 7AHq6zpm+nK4PoYdi6i9vwWau3Jlu4VmC/AlmvJz0YmY/HC2/17SZQZ8pthqq5I5e+VA GhXQ== X-Gm-Message-State: AOAM530fX6MhDEDn0MbJ+WTm3X8nmKOWXtggiYjgKjHX6Ck+8A18OzZN KrPZ7b/Ot3KO06aSS7bMMY+R8zcSS7lw X-Google-Smtp-Source: ABdhPJzBxSTP8iRXaPa1VW4NgfSRwLJEBzF/SzPd1HOY1LqcXd7CPi5UoWrZiaG7OBeC48nWWw0QEA== X-Received: by 2002:a63:8849:: with SMTP id l70mr5014602pgd.433.1640331202283; Thu, 23 Dec 2021 23:33:22 -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 u18sm8763175pfi.158.2021.12.23.23.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 23:33:21 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [PATCH 3/4] Add script deploy-kernelci.py for upload the cip-core-image-kernelci Date: Fri, 24 Dec 2021 16:32:41 +0900 Message-Id: <20211224073242.69676-4-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211224073242.69676-1-alice.ferrazzi@miraclelinux.com> References: <20211224073242.69676-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 ; Fri, 24 Dec 2021 07:33:23 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7267 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 Fri Dec 24 07:32:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Ferrazzi X-Patchwork-Id: 12698895 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 7D161C433F5 for ; Fri, 24 Dec 2021 07:33:29 +0000 (UTC) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mx.groups.io with SMTP id smtpd.web12.43285.1640331208021807340 for ; Thu, 23 Dec 2021 23:33:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@miraclelinux-com.20210112.gappssmtp.com header.s=20210112 header.b=0daf3Rb2; spf=pass (domain: miraclelinux.com, ip: 209.85.210.169, mailfrom: alice.ferrazzi@miraclelinux.com) Received: by mail-pf1-f169.google.com with SMTP id m1so7192705pfk.8 for ; Thu, 23 Dec 2021 23:33:27 -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=0daf3Rb2Ade4YByrpY0STbr4gz7+p5o62fJqvnnYAhtpqglK//9oW5p+js2uEvuCAS ncduANNgFvxIqCN1A7XAeuHih3o/TGdwCPg+gHweLJbSXNWGtlgLpfbvpkUJXMNcJkDl OZ4ZLsCnZMcwBkRVQx+/dr2SXWSYUneQtm/aXlx5VK4Qts6WRrFgsbod3wX0tWLQ+A8T 7H5j18SstGGv3Hz2k45FT5A/msq/NJrVNpNj7t1KWN2d2/qim3y909fxq1mcLhbtYHMP pUg/mDfhTSfE5gxaAYzLT0BWpJ4FqOWUHEbd396VcQOvtsmsDGOkjiWQU3HWPsHF28Ip zvQA== 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=OM/OSxVA7rZTLp5Hm10fS391s4+ArJnJFZZZVGtgxpGZDMNv3Z7Lry07/28LbBPtbR c8Av7Aj9lWR3wHvu8Rm+Qg7hvWwitW9dvS5vqs7VHnIgcaIHkjSvINstgUrhKskrTyRr IJAZHv04WmgHk4aKbo4p5K6cGLoqVpJAbZwJAvVEoIvK0r6xmomLB6nwrJFVY3wmM/li EEQyHMkMVY7NKB2FTHLXWDDTSs+AKDZjfqvUsMu2T4EXG5zeQBfcUNM/njYIkKuK/+0g Kvzclq5/1/S5qkgkn2kDNoLlsKU1RhrUNzkW3dnvqRqwsM4TR4hLgzObYQItaUm8aSKf OreQ== X-Gm-Message-State: AOAM531E3j05cqzncdXhKGn7XHF5fpDBQv5viEPuHo7aIJjJWMDjz6g5 2XscdQ7JuN0jR6TdPmJgRzh1u4HgnvMw X-Google-Smtp-Source: ABdhPJzLvt9SqZEcNgUZIDGgTbcaygLbnKwpwCXyqXy2lgHUlH6Uc4nKGSJM1OO+CdCOBcG3M669TA== X-Received: by 2002:a63:6ac9:: with SMTP id f192mr5118602pgc.79.1640331207628; Thu, 23 Dec 2021 23:33:27 -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 u18sm8763175pfi.158.2021.12.23.23.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 23:33:26 -0800 (PST) From: Alice Ferrazzi To: cip-dev@lists.cip-project.org Cc: Alice Ferrazzi Subject: [PATCH 4/4] enable cip-core-image-kernelci Date: Fri, 24 Dec 2021 16:32:42 +0900 Message-Id: <20211224073242.69676-5-alice.ferrazzi@miraclelinux.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211224073242.69676-1-alice.ferrazzi@miraclelinux.com> References: <20211224073242.69676-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 ; Fri, 24 Dec 2021 07:33:29 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/7268 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: