build: fix KERNEL_GIT_DEPTH defaults

Matthias has reported, that his builds started failing recently and
we've found out, that its caused by the new `git clone --depth 1`
parameter being added by default, which is unwanted and obviously
results into unreachable Git history of some past `KERNEL_GIT_REF` Git
references for certain kernel branches.

So lets fix this by using the default Git clone depth `KERNEL_GIT_DEPTH`
of `0` to make it clear, that this feature should be disabled to keep
old behavior and assure backward compatibility.

Fixes: 00cad4113a ("build: add new KERNEL_GIT_DEPTH feature")
Reported-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4baf654eba)
This commit is contained in:
Petr Štetiar
2024-01-07 08:01:36 +00:00
committed by Petr Štetiar
parent 3068485194
commit 2cdf1ccd37
3 changed files with 9 additions and 3 deletions

View File

@@ -129,8 +129,12 @@ menuconfig DEVEL
config KERNEL_GIT_DEPTH config KERNEL_GIT_DEPTH
int "Shallow clone with a history truncated to the specified number of commits" if DEVEL int "Shallow clone with a history truncated to the specified number of commits" if DEVEL
depends on (KERNEL_GIT_CLONE_URI != "") depends on (KERNEL_GIT_CLONE_URI != "")
range 1 2147483647 range 0 2147483647
default 1 default 0
help
If having value greater then default 0, then the Git clone
is going to truncate the Git history to the specified number
of commits.
config KERNEL_GIT_BRANCH config KERNEL_GIT_BRANCH
string "Specify Git branch used during Git clone step" if DEVEL string "Specify Git branch used during Git clone step" if DEVEL

View File

@@ -49,8 +49,10 @@ ifneq ($(strip $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)),"")
endif endif
ifneq ($(strip $(CONFIG_KERNEL_GIT_DEPTH)),"") ifneq ($(strip $(CONFIG_KERNEL_GIT_DEPTH)),"")
ifneq ($(filter-out 0,$(CONFIG_KERNEL_GIT_DEPTH)),)
KERNEL_GIT_OPTS+=--depth $(CONFIG_KERNEL_GIT_DEPTH) KERNEL_GIT_OPTS+=--depth $(CONFIG_KERNEL_GIT_DEPTH)
endif endif
endif
ifneq ($(strip $(CONFIG_KERNEL_GIT_BRANCH)),"") ifneq ($(strip $(CONFIG_KERNEL_GIT_BRANCH)),"")
KERNEL_GIT_OPTS+=--branch $(CONFIG_KERNEL_GIT_BRANCH) KERNEL_GIT_OPTS+=--branch $(CONFIG_KERNEL_GIT_BRANCH)

View File

@@ -23,7 +23,7 @@ ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)) PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
PKG_SOURCE_VERSION:=$(call qstrip,$(CONFIG_KERNEL_GIT_REF)) PKG_SOURCE_VERSION:=$(call qstrip,$(CONFIG_KERNEL_GIT_REF))
PKG_MIRROR_HASH:=$(call qstrip,$(CONFIG_KERNEL_GIT_MIRROR_HASH)) PKG_MIRROR_HASH:=$(call qstrip,$(CONFIG_KERNEL_GIT_MIRROR_HASH))
PKG_MIRROR_DEPTH:=$(call qstrip,$(CONFIG_KERNEL_GIT_DEPTH)) PKG_MIRROR_DEPTH:=$(call qstrip,$(filter-out 0, $(CONFIG_KERNEL_GIT_DEPTH)))
PKG_MIRROR_BRANCH:=$(call qstrip,$(CONFIG_KERNEL_GIT_BRANCH)) PKG_MIRROR_BRANCH:=$(call qstrip,$(CONFIG_KERNEL_GIT_BRANCH))
ifdef CHECK ifdef CHECK
PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD))) PLATFORM_DIR:=$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(BOARD) $(TOPDIR)/target/linux/$(BOARD)))