From patchwork Sat Oct 26 01:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "srinuvasan.a" X-Patchwork-Id: 3886 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 26 Oct 2024 03:55:12 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qt1-f188.google.com (mail-qt1-f188.google.com [209.85.160.188]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49Q1sxI9026536 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 26 Oct 2024 03:55:05 +0200 Received: by mail-qt1-f188.google.com with SMTP id d75a77b69052e-460b35f8214sf37254151cf.1 for ; Fri, 25 Oct 2024 18:55:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729907689; cv=pass; d=google.com; s=arc-20240605; b=CDA45duk4a3ZtscSP2S2gP8FfUFnpO9Fv6rGCcUeTi/vh8ebjEI8Nr5SFqZFuZTUo0 3V88mflFo7vjzJ3oXVy8IuKraQwfVDU+sL0Ln7MDbv4rzm0N1u5eW8r6Abd97AR9S0c8 +VOauZaHbhQ9QUkbcb9DgLAhrd86VRQJCzdzJN1MLaltA5NVoYgMHJGSo/JuQYRKQR5z 3pan/vU++fx5YsOtsh78qRXPYgxH6SgaX66Arl/V6Mm/iyrQAwTHa7QyecS2J77GD4zE wN7rUROEPlu2uEH9QyBhtsos5GxHXjm2LYP1KeG2ghUpGJWAZnDlQmQ7kLTfpdZZceR0 1XJA== 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=2LAOaDPdEokJplAp0mhZ27GSqt8UyWtrV9Vl58y3VvQ=; fh=Bpqfpv7bcjUslIYrf7J3y9PkFYCw9tqQSeWIeVuhP0Q=; b=GJRlxTowFMqeD2+fmq2tdVYgCNrqr6PYsXSWobMoRhtL/Z/2NSwi618n3iTbx0e7JL W1+YDo3MJf2z30igxuKoBeY5fKyByIMWkCx/0XEvcyI65BI+/BCxJZIBb9IpupCe/gru srp+QgUbnUx3LdJ44+/L9t/hVPp4wEtLitr9e6TcsivD4aFMkUSAAQOZ1CP3T0tXdnEH SwZNGNmcDFSPq6+r/xtnIUVsaEOPX2qEHQ7Nf1fRsVIIHL9/s1gWoJkB/pkbgw1JUqdn gY1owGKWZ92Yo6FzuScfhnNwszp0goFG7ilMahBI6+I3ftKRjfbpuJxBZn2pFL1yutXV 9duw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=arSmk1k6; spf=pass (google.com: domain of fm-1324425-202410260154479c4002b1ca89721737-jhhtna@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-202410260154479c4002b1ca89721737-jhHtna@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=1729907689; x=1730512489; 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=2LAOaDPdEokJplAp0mhZ27GSqt8UyWtrV9Vl58y3VvQ=; b=nHDbkOZEvynv/bw1OKwVHagME9kYvHq+wRUaaRg5k6miLWNgmO1+iOnK/Q2PFM6H3d UPD+YXwXr5fd1BGuNJmWcxbpO8QhZPuKXckoNbOxXg5Chl7CxcL65fkKtLHLgOqQmZnD STK1OlawPJY/Z6dvUa6g0yzYLKXvfL7KJwwfRwqP7+cIIhld9ZnXRIYcc6TkXFzUzJ3C XX9lk2H57K/T/bkJEXsp8XpUYcGHUq6A9LI1SqqNz+NHxcrMeCqnq+2qVnMIA9UvFLOv 4oswWBoq8j0/WoQ7pUOm1OdeiZ8zMcxL6GjGEQdtEhNTcvxwZ4o8xDyMFypqnUNUViTM /dkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729907689; x=1730512489; 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=2LAOaDPdEokJplAp0mhZ27GSqt8UyWtrV9Vl58y3VvQ=; b=rj81B/YgQDDqWTES5Ei7bIqSiemyGN5YXzf+X9c4UVTbdPBO8nP8gBLh6jh8de217H yQOcwGHrh9R19/j5ZaJgoPPKPfhnEH+edgOLJqtNmv3QFbs7gsLMaS0DNaaERFXjDkTP 7XbkZupt7iN0irgBLGXxoDGbpToKANQ31owK1JHg+S0LwhLGpmcRoVxyV8ia9WCiGaFG hOKeAfL/B7Frx+j3FNXRVPlxIas4MrrTmMUYpBUGRwKyQ9H1qiZDmFOna3gtsQJQmnTV M4eOkizuA3k9+n6Y81/QQKTY1sSYC9p75em6Y9E0Wrl0DGj45Ha4MLNdhyyBzrMYbCVd 0SSw== X-Forwarded-Encrypted: i=2; AJvYcCWK8T3sRt+1P8hy75KxX79W1s1Xuzbc4q++Wzgm/zAp+ViE2zlfK7e2ztwYKdNFTCcu2ZKjnds=@isar-build.org X-Gm-Message-State: AOJu0YyQ9bPAzwu1Kchgc0723B/eFE7a8BGhDUPY44hkUHOOHNp3AoM2 9sF09kfxK7oTMyGn3nIYXNuv3TUmbWUxVOOeewWQgQrJNi0jdTTh X-Google-Smtp-Source: AGHT+IFjM1ws2IOUdyGopelZVoZ0WtfC9GuReKraLKd2FPthAC8RCWGeaPjU5OQypx2VdgtrEMJWiQ== X-Received: by 2002:a05:622a:341:b0:458:23e5:1342 with SMTP id d75a77b69052e-4613c1a028emr19169661cf.56.1729907689071; Fri, 25 Oct 2024 18:54:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:5841:0:b0:45d:920e:ce87 with SMTP id d75a77b69052e-46122b34987ls37715631cf.0.-pod-prod-02-us; Fri, 25 Oct 2024 18:54:48 -0700 (PDT) X-Received: by 2002:a05:620a:3184:b0:7b1:41c8:332a with SMTP id af79cd13be357-7b193f35b68mr212923385a.50.1729907688224; Fri, 25 Oct 2024 18:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729907688; cv=none; d=google.com; s=arc-20240605; b=ICBrqMZgPa4JO9xoeGH0fnMkFwZnkrN6yVsj6/YAr8gtaW4OML6KUnY2Rxw9rO3wPV 1XrLVXApDJt3AAmQ7EmR4i4jQWoTiuVdRtJJzWoZXqX7NuTRdhyT+Rlian8OkeHjClm8 RiyOZ/ML1VhS4Ur63rjynGq6mO5eMtjCzqN5yU2AgL/eDoZPlfPknjGMvXLUi5OtOwif alQId1E0u+SgQ4tRv72c39Lyn0O0f4+S/vhgh5B3PQACUQi3eM3ndpiVWpEcwVu0NRaP /nFcqjqeIHkJmyqx8uTdhoktnZOj7CNgqsdWXo7IWmxGw+dglg8dsFOoogeZ1suDyyjn MQ7Q== 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=wQtq+y3PWsB1r+GkrRtU+mv0uh27XMPNPlSRmFOXVPU=; fh=qEmUv7UYYyWiUby6ri6URwndIAhlHli3YTKYU6E217s=; b=gLfzjuIRIQ2kRCXMDxgZCjFGZujl5t0AKn19p0hn4MQlW2p+VUQY9u0wc5EuRzHS18 0CRL7kqrZ2pRqek7JQcuZcCJYZko/gkA1f+bBBcg8Wchdchu8rP+8LEXqmqwxQMLplBN 80q2jKhAjAv0pn49stVd4vTNP/PLVNHuqbiKuqky9boFKlj0ADk4bJFW9Eyl4bEF4ZOe 7xWecL67zzNsW5AeRnIne0JuWW5fmNhxR52j68VRftwNrLexCI2jm5O0Q9zRzQMk+9rL vg/DT6Odn6WJcH4mwmr3WzkZrxKm5QZPNhK8L3Vwrim1jeUNtoa2Me0CXIEyw3OhgrlM trsA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=arSmk1k6; spf=pass (google.com: domain of fm-1324425-202410260154479c4002b1ca89721737-jhhtna@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-202410260154479c4002b1ca89721737-jhHtna@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id af79cd13be357-7b18d282dadsi10329085a.2.2024.10.25.18.54.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2024 18:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-202410260154479c4002b1ca89721737-jhhtna@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202410260154479c4002b1ca89721737 for ; Sat, 26 Oct 2024 03:54:48 +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, ubely@ilbers.de, srinuvasan Subject: [PATCH v4 2/2] linux-custom: Add a provision to support CONFIG_LOCALVERSION_AUTO Date: Sat, 26 Oct 2024 07:25:50 +0530 Message-Id: <20241026015550.1419162-2-srinuvasan.a@siemens.com> In-Reply-To: <20241026015550.1419162-1-srinuvasan.a@siemens.com> References: <19e24d8e7b06465b0553cb95f2985b91466b220d.camel@ilbers.de> <20241026015550.1419162-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=arSmk1k6; spf=pass (google.com: domain of fm-1324425-202410260154479c4002b1ca89721737-jhhtna@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-202410260154479c4002b1ca89721737-jhHtna@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_H3,RCVD_IN_MSPIKE_WL, 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 CONFIG_LOCALVERSION_AUTO in their base defconfig to append the version automatically to the 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 using the sources (dsc) file to build the package, when we generate the dsc file it creates the tar ball without .git, hence during the 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 --- 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 | 10 ++++++++++ 3 files changed, 11 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..bf6c879b 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -296,6 +296,16 @@ EOF done } +get_localversion_auto() { + if grep -q "^CONFIG_LOCALVERSION_AUTO=y" ${S}/${KERNEL_BUILD_DIR}/.config; then + cd ${S} + if 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 }