From mboxrd@z Thu Jan 1 00:00:00 1970 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:28 +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 49O68GAY016675 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Oct 2024 08:08:22 +0200 Received: by mail-pg1-f192.google.com with SMTP id 41be03b00d2f7-7ea0069a8b0sf443253a12.0 for ; Wed, 23 Oct 2024 23:08:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1729750086; cv=pass; d=google.com; s=arc-20240605; b=UAWxjZGdBhz0Mg0VhkGtVTIq5qqBg5WHho493KCdUBoayCz+3Rm3qFVnnuDBb9S/z8 cTFXDn4sgE5er8VVeIgCQVmn+MLMVu/hdPrTqlnIx+lLuMoOX1etPEkkL779VYIApYkD 6FJMb69gm6ZHEOtWC21aiUkh3ZQvvjsQ1QBPFFRPA932Tfdg0hKjE6vZ1gQ4CiESgC38 R1lxZyiu8yr/T+2IC0KgGlq5wmg3MwNis84oufastI0VEQjs7CVuygDfxeex4aBSS+Do lov7YsxWppC2Tbo+rDXQi/s/PxlWCGOrJZ515t7t+HfAHd2jire0t8MIZOqW90+ISdbG +P4A== 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=q2SYLIN5tsveiuIntEI0+aLHqrIlqdqhxNmkTgvi2So=; b=dhGXDMG6LehEUB18tlsdp2xgIPdKLc/+EfpxTtMzmk/XHk9iPz/iZFBbVTScXa9rxm pcm3KFWAxtLcuLOL6njScLk1ghNeukGpKEOJ9thLeRgFLiWUR+ELzC8/Tw/7WWa7gFwu qRuG5pEhZXV/2WcGign/KN2Hb6mOTL3QP7t0LEFSs3km53/O231oWG5ETFeIkqwsRSmY CZMZn5i9YVVVr3LsLO525zhijua8kEUx2Chq5i7HmXvX7YQwn2naOS8yIl+vi8u5ALiG Ku6cdxN+8FIUndT9odcwj9oAt9wzKgHWLHXPMwocy/KTNG141cLzqjGJfEO/Zis20GLQ zTcg==; darn=ilbers.de 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=ilbers.de; 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=q1z+7ZYHw4uRnUQq73Yn5unyuFmSYqOEt44+V3gU/4QhU0HVNbIPqihvfwJRHj+dww cKMzxFmg4LW+AxsrO13dz0GZXONnbXMS39KMtGzacBm2xbGhHvBMwf7t1kLRjMvZRGoZ AYuQMRV2PvSStMSHZQO1a1FgD7YhdN+JqDUGYLaIanNgnTlaYjsrH44DGT6P4KxdPu48 g+pG+18dwSX3Vi7eP+eDLWMN3JK8L00BWoOsmpISAOHfQXANUjHtgJvhV2nEgplMcbmo Sqmu+EdN1OhogOQLJa8cXIGS1SwCR5h3kld6jYc4MfvYVNvNDlKPXB9ETJI+msZ/sO2l +1TQ== 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=SPa5vFZX/y/HnWvCPcESFqMBPDF8QPLDl02Upu1aOPUX4cbFG5JndoRQVBb6aPXQqy 3aW9chGnTtopRSB585uVGZeQsdnBldnhHrdcuK38J2xvaVwFZaf33/QI21oyv9jYl2aM Z29SHKQ900hy9Dj2z2CZyqZWgujDr8aQS8yjH6MivNAmv/ohB3gGyGzpunyzpwXAyauh 0OrVk4YVCa/tacXhkEtkOSW8CefPj9sE9TuvgNP4U9SWwwBbfqRqjjY3bA16MWS9YRHq 5n0Us7c8NnTX3EKvgw+iZOkzqspn2Y5d691PxH/qXXpcd/TiPSP3DO7ineYsw1kjjb4Q QnBw== X-Forwarded-Encrypted: i=2; AJvYcCWczNZPJ0CHnfY4KgDziPmsx30q2v2cvs0OMyrG3zMVWBzKJE4tHWoUttyYJSfgqhGZanka@ilbers.de X-Gm-Message-State: AOJu0Yzd7axR80IPHx5W18vgmmNjxvcRhqgCk863lsHbA2zOuFmDhnpq 1xAi0BufSeRc463oCkPGubra+HGnqzmTJUN8lFymaJvWdGmegz3E 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 From: "srinuvasan.a via isar-users" 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 Content-Type: text/plain; charset="UTF-8" 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-TUID: 7tTNdAU3SUXJ 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 } -- 2.39.5 -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/20241024060903.1407158-2-srinuvasan.a%40siemens.com.