From patchwork Wed Oct 23 12:53:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "srinuvasan.a" X-Patchwork-Id: 3880 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 23 Oct 2024 14:52:26 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f190.google.com (mail-il1-f190.google.com [209.85.166.190]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49NCqHdM012358 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Oct 2024 14:52:17 +0200 Received: by mail-il1-f190.google.com with SMTP id e9e14a558f8ab-3a3b506c87csf69227375ab.1 for ; Wed, 23 Oct 2024 05:52:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729687931; cv=pass; d=google.com; s=arc-20240605; b=GjHsIwPkqsvl3tQgFTDADB2qAZmr1sb5fw6dwq81w/EeFxJuAH3huXCTWbF90oYNja Fcsrr6kq5LdeVbo1ReGeBXoYEk7NHO+ItfVkPCONQzaVf9fJu2SXz8lnP79stGDdJlGL P1yGrmL0o29SzNwI+obZPINUYALSekir/tIhIHE0UQXY9o3BmVSbu2uy+4lmXyHdv1RY YHL0eXgf0O++V9LLPCkodNuZUw+r8ykrBNfZFIEpxYjSi8Q8dNRgsVwqXoT4GUNT/HrH p5mwgILudhjrx+GETMFuONhHvV57bx9k/UBBLjzd4QfFP2wmxjVFHnvAdqGpFEAEXGWw yTeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/RpLcUhBBevKbytYCWGtrTKK2QJ7H0yRjZbgAHKPtH0=; fh=GmuHyaE3tee/GOR6oYFtGCHM+SjwKyupHpEdJXH8CHA=; b=ZS3kWt1+0R/Q5ZHelWMopBfNxxpQwspperTCJGc7D+38Onv45d74WZItMGtqL/sVs1 uKrqnX0hikdzcKwKYWf5UFLZG4gxxiWTszhYEthY8/6PLdnrgZ/xkJBqrMZbNe0nMQOR 718KLifOlQcAPECGymHByNGUJJpgZGABVawZ0FASlgXy9QVSq+XwWcYyB0DQ2ZX6Gvdo OiQNgncpzFv6q2FB8o/ogkrYpL9FFGzufkDXim8nOBMfoZT6Sr/9VV507/88LBXnt/oE yl+THVwj6U2c/fERvJD7VPSwTKjF+EOaBbEBGd5wcUORwbLAAJavyyVieQkqNeR81Box cNFw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QL+hXV+k; spf=pass (google.com: domain of fm-1324425-20241023125208b3d902c3b9fd8d598a-en2mbc@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-20241023125208b3d902c3b9fd8d598a-en2MBc@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1729687931; x=1730292731; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=/RpLcUhBBevKbytYCWGtrTKK2QJ7H0yRjZbgAHKPtH0=; b=o7c6VKEW7yjS6Sr9FHPCtnlxAkMk8jkw/hvEEhkD+8jxEExizA352RQW3kzSgkVAwl CQGU3/hcGdIhidK2lXGnvuZmCMW2n2dw/SHcCImszq1dlXvKkWJlgRXj4KEyfbJlNDkk EViFlwEhMkMaIASgLwAkEA9/Murk1Tmt5uq6WCiDWp8bDJ+DIMgbJfMmpMRhrV6D/XfP 87xNcy4xq7dwi/NRwFsb5KEKKmBpcVEJUW8uP2TnqQIAQgKWEwLOFicskJ66OJWIlkob zVF8zlNJF2M0oIVu/LXpPe3vmZkpSIVyMEnatiJysuby+XwUPOVC7AbPO1+2hYpt8NmQ amLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729687931; x=1730292731; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/RpLcUhBBevKbytYCWGtrTKK2QJ7H0yRjZbgAHKPtH0=; b=AXASQJaKgOnAg08aur0q44EJeSPrunnrgofU9udnkusZyceRBoqM/p8sPGmiRwKN69 TZ4E8w2iCiHdFnCyLl4pGnxG1LIE/p3FKfXt0yewDLOEJUnUC3MjFXKKtaPPnpHtUHh0 Nv31X0BYYGw45Nh4oQc5e+eR/P7dsJbwh2Wf+Tejgy6+cwiX35Pvscc5DfT8YrOQwPxn pVzINwwHsKKRFlpJC/YSls6EBmgZkClW8s6StsAVvnv3G0N/0wjN4Z47TLJwAHSiwrwm 1YE6xEDgIlQW5VhiNlM+B7EI0gsO6slqN5dRPMh4Bktz2VYxKdkOkh4Y9k28lAYfutdJ Fscg== X-Forwarded-Encrypted: i=2; AJvYcCXpZ3qWZQdCz1M4Yo69bWxkzRMKrapiNZIeHNreBsmwVUYp9JqdDmrfHUypeRnQcG4cwuYsnD8=@isar-build.org X-Gm-Message-State: AOJu0YyQ1PmBrF4wELMOrpH0Ph68PyZyWJoK7FOsVICh6a0XOdleGNkn tbqLvO+LwOmnkGYZER7L2TTWPd2cz1mDRjDHndFTAooJY96xA/3/ X-Google-Smtp-Source: AGHT+IHdCosWJEY6mWERthcGR/XbTAgu0xi0sdTUrt9OP2ouGZjoLG3oDquln9ms5kN9iFelRXfs2Q== X-Received: by 2002:a05:6e02:190d:b0:3a0:a385:911d with SMTP id e9e14a558f8ab-3a4d5826967mr27388675ab.0.1729687931330; Wed, 23 Oct 2024 05:52:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:b4e:b0:3a3:6ada:9a4d with SMTP id e9e14a558f8ab-3a3e4b0bf39ls31536305ab.2.-pod-prod-09-us; Wed, 23 Oct 2024 05:52:10 -0700 (PDT) X-Received: by 2002:a05:6602:15d1:b0:83a:c4e1:7d69 with SMTP id ca18e2360f4ac-83af614d24bmr281745439f.1.1729687930494; Wed, 23 Oct 2024 05:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729687930; cv=none; d=google.com; s=arc-20240605; b=N8lYOjTFOpRU9B5Qe7DNbe4thz/XCaeddz4vtjuM7zZvWehV3GDBWne0cI6HgaW4ge 72O5ITsp81IHgT5MR5sm0gN35zvqBHnZglu52Goo3q4U7JWbDDUPy35mnGVaSCvolc/J IgoX5G2rfxXGISqDeVmzQYXNc7Mlo0v0iWWY6keCNWtd9mAWWOVKJDCoXaEIUZ9Za1RI lbeQZVIyGRm4bXFVLwJ4pi8voVwAxI2h54AG1fYo5lWWwlvGH6zQwqXFlaYMXZxpqaK0 LzBKuNUQodwewJAoIHwnbrqhlPgdhvsToE78Hj3UBfcOzWZaKZTMEKqBCioAqJNOzG5k g8Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=dAXdeYUkG2BFJ6P25f4TsZxnA03hKxf/bOfLWF/Tn6E=; fh=7w8uPGiMToa9ZVDAMG2h4OTikUm4uxVmIZ1hUqaFJ54=; b=A+1lKifbcquGyCXH3EZXiHQONdu8h2oyP6w0qU2cd/gSvcISuexg4QEa/X9ZRMlbsp wjL4o2heyZV8aCPdIQ+U+7RKNFUwysIkmKm3jjo++A7psD58ST6KNxd7C6nfu7eAPKHE j3X0IoS0W5UO6di32Hwm66AMLT1CXmLhfF4A5SoeCXuZKYPt4+2yeob39RyfOqzry296 nzCZd3Z2wIbPY/zY8vO12VxafMjrkeUpwwPSuEAFAh4Vxzuz02SWmzRMX6OoQ//6Nwic 5JNnUS4AIDV4XFeZIPsEIbiHgm8EvZWXDfSqC886zU2ztkKqubPD1v/5OknAbA5AukVx cETw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QL+hXV+k; spf=pass (google.com: domain of fm-1324425-20241023125208b3d902c3b9fd8d598a-en2mbc@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-20241023125208b3d902c3b9fd8d598a-en2MBc@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4dc2a594a33si317044173.4.2024.10.23.05.52.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2024 05:52:10 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-20241023125208b3d902c3b9fd8d598a-en2mbc@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20241023125208b3d902c3b9fd8d598a for ; Wed, 23 Oct 2024 14:52:08 +0200 X-Patchwork-Original-From: "srinuvasan.a via isar-users" From: "srinuvasan.a" To: isar-users@googlegroups.com Cc: cedric.hombourger@siemens.com, jan.kiszka@siemens.com, srinuvasan Subject: [PATCH v2 2/2] linux-custom: Add a provision to support CONFIG_LOCALVERSION_AUTO Date: Wed, 23 Oct 2024 18:23:07 +0530 Message-Id: <20241023125307.1402533-2-srinuvasan.a@siemens.com> In-Reply-To: <20241023125307.1402533-1-srinuvasan.a@siemens.com> References: <3a6be839-a3a9-4b0f-970a-29ea3509b8a7@siemens.com> <20241023125307.1402533-1-srinuvasan.a@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1324425:519-21489:flowmailer X-Original-Sender: srinuvasan.a@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QL+hXV+k; spf=pass (google.com: domain of fm-1324425-20241023125208b3d902c3b9fd8d598a-en2mbc@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-20241023125208b3d902c3b9fd8d598a-en2MBc@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: srinuvasan.a@siemens.com Reply-To: srinuvasan.a@siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: srinuvasan This change might be useful for downstream layers to set the CONFIG_LOCALVERSION_AUTO in their base defconfig to append the version automatically to kernel release. Presently ISAR doesn't have this support, hence add this provision. Here we try to find the CONFIG_LOCALVERSION_AUTO availability and .git present during build the kernel package, unfortunately we are not getting the .git directory in the dpkg_build stage even if we are fetching the git repo, this is due to sbuild always uses the sources (dsc) file to build the package, when we generate the dsc file it create the tar ball without .git, hence during dpkg_build stage it is not possible to get the latest commit HEAD value using "git rev-parse --verify HEAD" To solve this issue we have base .config and .git available in the do_dpkg_source stage, here we try to find the latest commit and write them into .scmversion file, later during the kernel build package stage we are calling the kernelrelease target to set the localversion, this setlocalversion script handle the availability of .scmversion file and append the string accordingly to the kernelrelease. Added qemuamd64-cip BSP to demonstrate this feature. Signed-off-by: srinuvasan Signed-off-by: srinuvasan --- meta-isar/recipes-kernel/linux/files/x86_64_defconfig | 2 +- .../linux/files/debian/isar/version.cfg.tmpl | 1 - meta/recipes-kernel/linux/linux-custom.inc | 11 +++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/meta-isar/recipes-kernel/linux/files/x86_64_defconfig b/meta-isar/recipes-kernel/linux/files/x86_64_defconfig index f3bafe00..c27a5a61 100644 --- a/meta-isar/recipes-kernel/linux/files/x86_64_defconfig +++ b/meta-isar/recipes-kernel/linux/files/x86_64_defconfig @@ -1,6 +1,6 @@ # Copy of linux/arch/x86/configs/x86_64_defconfig for demonstration purposes -# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCALVERSION_AUTO=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y diff --git a/meta/recipes-kernel/linux/files/debian/isar/version.cfg.tmpl b/meta/recipes-kernel/linux/files/debian/isar/version.cfg.tmpl index 17effe52..1ab699f5 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/version.cfg.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/version.cfg.tmpl @@ -1,2 +1 @@ CONFIG_LOCALVERSION="${LINUX_VERSION_EXTENSION}" -# CONFIG_LOCALVERSION_AUTO is not set diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index 0f23d6f0..04c3fdb6 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -296,6 +296,17 @@ EOF done } +get_localversion_auto() { + if grep -q "^CONFIG_LOCALVERSION_AUTO=y" ${S}/${KERNEL_BUILD_DIR}/.config; then + cd ${S} + if (git rev-parse --git-dir >/dev/null 2>&1) && + head=$(git rev-parse --verify --short HEAD 2>/dev/null); then + echo "-g${head}" >${S}/.scmversion + fi + fi +} + do_dpkg_source:prepend() { dpkg_configure_kernel + get_localversion_auto }