From patchwork Thu Oct 24 06:09:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "srinuvasan.a" X-Patchwork-Id: 3881 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 24 Oct 2024 08:08:20 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-pg1-f192.google.com (mail-pg1-f192.google.com [209.85.215.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49O68BdD016672 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Oct 2024 08:08:12 +0200 Received: by mail-pg1-f192.google.com with SMTP id 41be03b00d2f7-7edb8c3e743sf103292a12.1 for ; Wed, 23 Oct 2024 23:08:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729750086; cv=pass; d=google.com; s=arc-20240605; b=YFLg8xRrNatvLZv/PkERf7gVVqi6d+N+5caYH2afFsTLyQtoAZ2BUH+qdLX4Onf1zn 0aq4gJmM1ITq5s/69uM0/Gwik3IEvf25FHZE1b4pXiK5wM7TSlhR2JrpY/jKxUYvbNzw S5gcTT/dU/sSQEtdejZbsvmvFTfr/AWQ9wDq9PyBaGyMkGgjUc00EZY/tNiW89fzYEyR l9P/zSgTCn0PraqSeN3IiEsEh9YaEQgutdZE4850+N2yL96eBob718krqDRUSpUSJ/uw xzKKpy9JT8R2Urnn/fRsGvlKbWMA3Kfx0z1S4PtDql4TsOdTo3tdtzeQdrT+4W9kO4oJ /5eQ== 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=AB2yPvt/0YuW0uexkDmgvpo26Q+zl3xXmxldOde8VGI=; fh=jpjDESgBE5e5o3GNCFhQFF9jczJKcqNhc1SW8O/QVAg=; b=CGGp0u1Urv5jybEx1mYwY228lrWDewntP7ygjqXbUyNHuapwFqko0sTG/JPEWOuQq/ EOYnOVbNJD7ZDZ1RdJWIzmZhIMb0VN1O8WhVSGlSQ7/cw49hHYf2OOoK0WPInpSLpTlR Vg6qJ85G688VL9BoOc7HKZy43j3ILlRxzt1c+TP1Du3qnS5pLZ5VIlmGtitAX6YBr9Od NxsYdLvSmp4T1O8g/039P0fb+H+YE0H/Nda2yARHEUO2CR/a90LuYbi3yQRMWVRTxO+d rCqFcTvCIvOA48INAAJqfdokCEQxBtvqIe+XQyrvSwAaZHYYr2tp6YtUpJMrT6K7zlKy rlLw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=AOYIR7l3; spf=pass (google.com: domain of fm-1324425-2024102406080206b622b7718421a173-0cra3t@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-2024102406080206b622b7718421a173-0CrA3t@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=1729750086; x=1730354886; 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=AB2yPvt/0YuW0uexkDmgvpo26Q+zl3xXmxldOde8VGI=; b=p81qOq1WAGpA6LsDRWaKIe1zHKKx0yI9Ifrv4dp8JL0RtNslDwm9kLaOWOpiTxWyXY /0P9gRzG4dAA3+Qx/CKEVvo2n3/Wc6FSIK47W7b85tKHk6hQ9bIfbNz7FgP9U7Ijjkid 1qSJthoNCI08BL4gErCHMrukcVomGi0ROSje+Eyr1x/TtiT/4YQSX7jFTyKEAnAFaqXn ss2GTaBs9CPDp7r+q4k1iYPjuBGuE19OurmXEAj8Tq7d6EpAWfdBNTBUEitXIoN3lVLX 7P7lh/J4lsBNvjbgiBl7dWQ53RPdR9kguN6D319gnHjaHRybS5bjQq1KJG90qIlJdRpY kZ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729750086; x=1730354886; 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=AB2yPvt/0YuW0uexkDmgvpo26Q+zl3xXmxldOde8VGI=; b=AlxYKaM4rvV1lqXXP+gvG5z3TwTWL0tt88IxcWu0kIXRxhtZJImIUKVpe9n+ONFwMv qQEoqATIiuKYcLXKVop9Vw+LP+nG75fXRxJm1NBPi7Q2viD/nzPfn0a6LBYSNyzjbIwZ m8Qjg72ARUDZ+H5PsVLZMFby3yCYzO6du/oYqU71eP5nE+mk9Lzv73f5o6QFN1JnY7ZB Jz8bENzm9tiHgJhfkIUxDMi1Nt1E8sd+DTLJVFVLnzbOigcGWq5MWszrSMOC2TgO2rYt oMIOskBGhGLsz8aJeUlG+gPIyoUhXQfEOPvi4Z7iJ9KmnJJu7TfWkL8VQehAzsExTJoQ RMgw== X-Forwarded-Encrypted: i=2; AJvYcCXT8NEZksfVpaaok/ECSVQoaQUPZyyd5dF8k+DKoc4zC4oj14zhONML+y803AG1DVdsSegpp8Y=@isar-build.org X-Gm-Message-State: AOJu0YyDrwpyJkyawdBHVSnIMszWahrdvL/l8ovQswo6etoa8AAB/Hx8 oFMl0v1eWEU6R1juCPQjBRVxJUi2G5ufD64HvrP+YkLKWafFKjPs X-Google-Smtp-Source: AGHT+IEZE20+yhXseCmVJe9Qpr7VX42G06sXvrCPCYQySEgt1de5v4IDyBY5MhRvMhCD/XTzcpvCFQ== X-Received: by 2002:a05:6a21:1349:b0:1d9:fbc:457c with SMTP id adf61e73a8af0-1d978badf29mr6453738637.36.1729750085580; Wed, 23 Oct 2024 23:08:05 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6a00:cc3:b0:71e:6edf:b2ac with SMTP id d2e1a72fcca58-72040036840ls535857b3a.0.-pod-prod-01-us; Wed, 23 Oct 2024 23:08:04 -0700 (PDT) X-Received: by 2002:aa7:88ce:0:b0:71e:44f6:6900 with SMTP id d2e1a72fcca58-72030a8a42bmr7085210b3a.16.1729750084379; Wed, 23 Oct 2024 23:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729750084; cv=none; d=google.com; s=arc-20240605; b=OEi+miI1CQW37XHjnFumfiq9HlYfIeTd5mFiWCAtnyZhO0G1lR8AW80b4WfgV2IQwm rKT/1xYHv2Fcb3QU6+ZDbjwRtaimKKtX0vcqReC+/DIjyZirrTNauJQd4fCidI6oUNWv 2gbqfyHx/Qq27BMmblWxyh7fE9nvb/5kw4xZb5ONMgURXwbskEF/Gljq2BHdl2GdoCjJ p6dr6duxINDPV5osHw6a7h/5x4R0k3o2Ec976D4Mn81iFeSWlGn4RIPWHM6Qt5ZwlR38 FbvmdnYcS50p6ens+MpB2k/y2ae7ZzkVJWWSuU9WjJjyZl7gKXCyEpPASvjREBacnWVn XAXA== 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=7w8uPGiMToa9ZVDAMG2h4OTikUm4uxVmIZ1hUqaFJ54=; b=WF3saSap9CDTP5AToXv02jw3R/6r3GZxE4QUGKAYxq2PSwv2Tq/Z4KETb2fknyJMYv SKmzMz/h1HvSW871SUZDiLpiGn2+d/VRgCf9+Bka0EFixHdfE0bfLbVU0+E+WWjAML4t g8j4vbhHspvFC/5Dqh1YWXOBaTQ6DbUYdCv79zMBJUmiVm2uxsbzpsqnTx8d6vG/FZ5N Y79BOXy/qZbaFxoz3/OfRWC1LcgAYi4EBqDWAj0MQ8DJ268OvNJhVvBvYYgfXzYLQF27 nmopeHEJGcQpfi+T210aGXXaK4h4/SnGTP71kcBavbKsfUZ6u8pq/F9lVUoZdaU07kVi 3aVg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=AOYIR7l3; spf=pass (google.com: domain of fm-1324425-2024102406080206b622b7718421a173-0cra3t@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-2024102406080206b622b7718421a173-0CrA3t@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 41be03b00d2f7-7eaeab203c0si439422a12.2.2024.10.23.23.08.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2024 23:08:04 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-2024102406080206b622b7718421a173-0cra3t@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 2024102406080206b622b7718421a173 for ; Thu, 24 Oct 2024 08:08:02 +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 v3 2/2] linux-custom: Add a provision to support CONFIG_LOCALVERSION_AUTO Date: Thu, 24 Oct 2024 11:39:03 +0530 Message-Id: <20241024060903.1407158-2-srinuvasan.a@siemens.com> In-Reply-To: <20241024060903.1407158-1-srinuvasan.a@siemens.com> References: <20241024060903.1407158-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=AOYIR7l3; spf=pass (google.com: domain of fm-1324425-2024102406080206b622b7718421a173-0cra3t@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1324425-2024102406080206b622b7718421a173-0CrA3t@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 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 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 }