From patchwork Tue Oct 22 11:58:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "srinuvasan.a" X-Patchwork-Id: 3878 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 22 Oct 2024 13:57:48 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f192.google.com (mail-il1-f192.google.com [209.85.166.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49MBvkBQ006054 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Oct 2024 13:57:47 +0200 Received: by mail-il1-f192.google.com with SMTP id e9e14a558f8ab-3a3c90919a2sf54720805ab.0 for ; Tue, 22 Oct 2024 04:57:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729598261; cv=pass; d=google.com; s=arc-20240605; b=EAmqSa43RBYGIPArQvJv9e0czTzalPLrnmbdzpdIszIhVH1kxEGlk2oEaRkzaj09AV xi5T6y6G53ASuKHitcu3syYNoi5J50TOxL3TiJFd8DGYY5Z5Ys5QuexIXhb2OnjzrKuy O2y0zgVO4VlUNjHAWRDPLVrYohSWnSUerF+5/ZOQtk/Z8Xzzftb+GDbmsQ2rnqVYOtxA 2o1jP1MjYwMdV014HKJsQjgloXUUZpGbYFlGrL9A/KwpCgbTi7NH7uSzIDFNR1odszUt IDJFllpxsQCQvKaxvJ/yuOnfIpkcy+78WvU9CyD2RIekIhrC7hU9xtucgmrQgIRlSlUb 4K+A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=FUH4FfKeBKgW9aMpm+ROy7WuNGKh7ufP+WEngVUBZJY=; fh=I0+VOxcRi0SRtuM/AMGhor56s+rzy+k2mOpsHQ7IXxg=; b=LaBWuh4hixJ7EzMtOYTnZpBcOlXlhTfBBhH0I4dLY0+cwzxTiC/WHErsN1NMGaJCSP iYHFraMR1gTM8BK9QwQqR+kMXISnj7px9aHTEQq550U1cXRVphd2NzzGPUCvF9hxe00f YcXxlKh6YHPaYElhNokxPzJTTGzeqBviT5X7lKIORtn9eQNqhVXhrO3ADeorr+/DXzxF wxBDL8U7QVbEZVlF+M7Ydz8PwW5fom4UmxKUXF8JYpgbob17SdICRbJJgQcuXgnRpvC2 dBeblP/3L0UYIqf6e7CnnKb6yZvGPoif7s+DFQRAfRARWnB0jcdN1mkl1ziXEIc52dxY BCHA==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=egxJLEn0; spf=pass (google.com: domain of fm-1324425-202410221157378f552d550f68e17e23-x6suxp@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-202410221157378f552d550f68e17e23-x6sUXp@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=1729598261; x=1730203061; 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:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FUH4FfKeBKgW9aMpm+ROy7WuNGKh7ufP+WEngVUBZJY=; b=BcG3m6IaxHSyLidCIRtd5/33qGSk/kpx3UIN5FZuPzzHFz+IbsriJYJ26Ic4ULVbzD +78CM1Z3qmIU7151CAlE/KbFlXEjmZrWvMqtP2A7BRSJq0zUIzp4aHVkTlTvhCD2CiN+ 6RNHi0nMMqtpOifjoOzofQFYoAeBqef2FJzjKmmjaX323V1N9PZy1Z177PMnHNjM9nQG u68Sp3IOCbiLiA8W5ZElxk2AtTH+4XNv/69LUFjsuwrJsgWvaCgfb2WyWl6Kveuha0rG mWr2FxF9Id0WSXv9APP5pO++2LjR05erd1iaCjglMWjfeCyerGf2Zu6D9qJcbgcccQAt H1iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729598261; x=1730203061; 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:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FUH4FfKeBKgW9aMpm+ROy7WuNGKh7ufP+WEngVUBZJY=; b=Djk6ZwCWrGjcYMNEW9nrs9tnGpwRWanfAwWpLkjUCVD4Jjt5Bu5vHYvbNf8DVpGA5J kzNEv5l/aWmohWqBKfJ9yH2E+r1SXYUxWLqbO+GPHNVtGbV1/+CX9jftD46pKn6Tp9FR VCjti9Auixus6Q5mT5i7mfbxs6EiptLTvmpXvaySRUTg7PoeNjb+7w9Qub6CN6+iLCaR 6BkKZQMIR5DRPw+IzVk06QqlSIMeFrEU/F7AG2vy9frStYlL6Fdas8YhII+HkL2ExElL FpsFBkD4XELy/hH/K/geyCJavZSbF8OdjQWs03WnHZ3MuY2jYo1l7YASl5uh54lYzvAI yjOQ== X-Forwarded-Encrypted: i=2; AJvYcCWmhGcTHfhEh/0U2PWewM5/jVbrjnFXflShf8qF1TSlTlMXjOqAYEoGiDew4G2rH/QcZuZFE/g=@isar-build.org X-Gm-Message-State: AOJu0YzeqXKuG+k3xJQ1n4vFKwl3sPy1MApb1FZo07guPUjLbH2B6JL4 b3kss3jo3YndKE1ck919Z/CmR4ofK5U4RK1rMsUr6xHfdrT+4JEU X-Google-Smtp-Source: AGHT+IEtNBXZ2+CaKhCANRTnQcGemD+ENcXyL99upiVJLDPYg0iBgEFO/BufLEiiAqdPi81rJsX2DA== X-Received: by 2002:a05:6e02:1d9b:b0:3a0:b631:76d4 with SMTP id e9e14a558f8ab-3a3f4045790mr148483125ab.1.1729598260625; Tue, 22 Oct 2024 04:57:40 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:1b01:b0:3a2:6eaf:d929 with SMTP id e9e14a558f8ab-3a3e4b0383cls28400495ab.2.-pod-prod-08-us; Tue, 22 Oct 2024 04:57:40 -0700 (PDT) X-Received: by 2002:a05:6602:6186:b0:835:46cb:6747 with SMTP id ca18e2360f4ac-83aba5ccb56mr1293012439f.4.1729598259770; Tue, 22 Oct 2024 04:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729598259; cv=none; d=google.com; s=arc-20240605; b=ZIavW4fB44ev1w6cfF4oEp9GQ0gvcGeL25qWoPTICoRCAY7HepckGAjWfJKD9QoHNb lbUuN/R5p7OzUtwKHNX2IL5hdvL5uX4hV92lKUlnuUcD9PqJJP892RO95xCXVlLYvJH/ V+kLtAxgDG/JRlG4XbCMU2PfAAp+OE0l51MXPou2Xf77P5lPCHLUQR5DxglDn8Ssvm+S rp5eQqHz2hH/NwlbrNehID1RBTVnAd9Eg5l4ofAKgJrZWNgHFgfsvKbHmzQ/rFzq+7Ig uy2wc5WSwxzru5UEJrRsG3xARN+65nWRpKLStUDz/0FGWc/ai+fCMqbHkhvdv+KnFRD4 MnEA== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=QKi9zRyyXu+rXQdLqOYfJLMgm5sjpw8j86jRmBgQAvk=; fh=7w8uPGiMToa9ZVDAMG2h4OTikUm4uxVmIZ1hUqaFJ54=; b=D8ogGT+EbnF9iBcKNRRdIYivZZuPwABvLi81BuR34xBmr64mMO/9SOr72reKl826IT xW6nyEQVDvmYIyTWl6BS7wpFhrAF9HX2Wb1wJ2Fun9wuf5wFOc4ZRbM7VVYs59gDY5OQ sPPxESGHWdUCtJtJIb9GnXB63ksqSXc2sr33jBppoUUmfLNor3ctDrgk1m44hqyqne3X NXU8Ih0HZ2A1xj7qc97thK5S1GS9yP/puzTR4ewKP/HCgCDWfk/f+FREGZoXiBLpUvm2 3TC14KpZNa+TGhIVidonYZv61wFjdf/fxq4bDC7nJKtFcWjDX7wfoR4xq/vaUkH5nakZ nNdw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=egxJLEn0; spf=pass (google.com: domain of fm-1324425-202410221157378f552d550f68e17e23-x6suxp@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-202410221157378f552d550f68e17e23-x6sUXp@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id ca18e2360f4ac-83af19de2e2si1154839f.4.2024.10.22.04.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2024 04:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-202410221157378f552d550f68e17e23-x6suxp@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202410221157378f552d550f68e17e23 for ; Tue, 22 Oct 2024 13:57:37 +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: [RFC][PATCH v1] linux-custom: Add a provision to support CONFIG_LOCALVERSION_AUTO Date: Tue, 22 Oct 2024 17:28:36 +0530 Message-Id: <20241022115836.1395681-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=egxJLEn0; spf=pass (google.com: domain of fm-1324425-202410221157378f552d550f68e17e23-x6suxp@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-202410221157378f552d550f68e17e23-x6sUXp@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. Signed-off-by: srinuvasan --- .../linux/files/debian/isar/version.cfg.tmpl | 1 - meta/recipes-kernel/linux/linux-custom.inc | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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..d0787aad 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 test -z "$(git rev-parse --show-cdup 2>/dev/null)" && + 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 }