* [dunfell PATCH V2] recipes-kernel: setup-defconfig: Use SRCPV to update KERNEL_LOCALVERSION
@ 2022-04-28 3:14 Nishanth Menon
2022-04-28 12:15 ` Ryan Eatmon
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Menon @ 2022-04-28 3:14 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon
Cc: devarsht, meta-ti, praneeth, nikhil.nd, nsekhar, vigneshr, a-m1,
Nishanth Menon
Due to recent security update[1] in git, a subprocess will be unable
to run git rev-parse to fetch revision.
So instead, use the SRCPV to parse the short commit ID and set the
KERNEL_LOCALVERSION variable.
[1] https://github.blog/2022-04-12-git-security-vulnerability-announced/
Inspired-by: Devarsh Thakkar <devarsht@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
* Update to commit message and subjectline.
V1: https://lore.kernel.org/all/20220428030805.18623-1-nm@ti.com/
recipes-kernel/linux/setup-defconfig.inc | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc
index 850a1dd8d613..1e97acc0ee63 100644
--- a/recipes-kernel/linux/setup-defconfig.inc
+++ b/recipes-kernel/linux/setup-defconfig.inc
@@ -1,14 +1,6 @@
# KERNEL_LOCALVERSION can be set to add a tag to the end of the
# kernel version string. such as the commit id
-def get_git_revision(p):
- import subprocess
-
- try:
- return subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=p, shell=True, stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].rstrip()
- except OSError:
- return None
-
-KERNEL_LOCALVERSION = "-g${@get_git_revision('${S}').__str__()[:10]}"
+KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).split('+')[1]}"
# Check the defconfig file and see if it points to an in kernel
# defconfig that should be used, or if it is a complete config file
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [dunfell PATCH V2] recipes-kernel: setup-defconfig: Use SRCPV to update KERNEL_LOCALVERSION
2022-04-28 3:14 [dunfell PATCH V2] recipes-kernel: setup-defconfig: Use SRCPV to update KERNEL_LOCALVERSION Nishanth Menon
@ 2022-04-28 12:15 ` Ryan Eatmon
0 siblings, 0 replies; 2+ messages in thread
From: Ryan Eatmon @ 2022-04-28 12:15 UTC (permalink / raw)
To: Nishanth Menon, Denys Dmytriyenko
Cc: devarsht, meta-ti, praneeth, nikhil.nd, nsekhar, vigneshr, a-m1
Patch applied to dunfell-wip.
On 4/27/2022 22:14, Nishanth Menon wrote:
> Due to recent security update[1] in git, a subprocess will be unable
> to run git rev-parse to fetch revision.
>
> So instead, use the SRCPV to parse the short commit ID and set the
> KERNEL_LOCALVERSION variable.
>
> [1] https://github.blog/2022-04-12-git-security-vulnerability-announced/
>
> Inspired-by: Devarsh Thakkar <devarsht@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
> Changes since V1:
> * Update to commit message and subjectline.
>
> V1: https://lore.kernel.org/all/20220428030805.18623-1-nm@ti.com/
>
> recipes-kernel/linux/setup-defconfig.inc | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc
> index 850a1dd8d613..1e97acc0ee63 100644
> --- a/recipes-kernel/linux/setup-defconfig.inc
> +++ b/recipes-kernel/linux/setup-defconfig.inc
> @@ -1,14 +1,6 @@
> # KERNEL_LOCALVERSION can be set to add a tag to the end of the
> # kernel version string. such as the commit id
> -def get_git_revision(p):
> - import subprocess
> -
> - try:
> - return subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=p, shell=True, stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].rstrip()
> - except OSError:
> - return None
> -
> -KERNEL_LOCALVERSION = "-g${@get_git_revision('${S}').__str__()[:10]}"
> +KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).split('+')[1]}"
>
> # Check the defconfig file and see if it points to an in kernel
> # defconfig that should be used, or if it is a complete config file
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-28 12:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 3:14 [dunfell PATCH V2] recipes-kernel: setup-defconfig: Use SRCPV to update KERNEL_LOCALVERSION Nishanth Menon
2022-04-28 12:15 ` Ryan Eatmon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.