Skip to content

Commit

Permalink
scripts: adapt to UOS/deepin scripting
Browse files Browse the repository at this point in the history
Update scripts for use with build_kernel.sh.

Signed-off-by: Lugang He <[email protected]>
Signed-off-by: Mingcong Bai <[email protected]>
  • Loading branch information
matrix-wsk authored and MingcongBai committed Jun 20, 2024
1 parent 288481d commit c04398f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ else # !mixed-build
include $(srctree)/scripts/Kbuild.include

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(call read-file, include/config/kernel.release)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION

Expand Down Expand Up @@ -1168,11 +1168,8 @@ vmlinux: vmlinux.o $(KBUILD_LDS) modpost
# make sure no implicit rule kicks in
$(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): . ;

ifeq ($(origin KERNELRELEASE),file)
filechk_kernel.release = $(srctree)/scripts/setlocalversion $(srctree)
else
filechk_kernel.release = echo $(KERNELRELEASE)
endif
filechk_kernel.release = \
echo "$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"

# Store (new) KERNELRELEASE string in include/config/kernel.release
include/config/kernel.release: FORCE
Expand Down
9 changes: 7 additions & 2 deletions init/build-version
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@

prev_ver=$(cat .version 2>/dev/null) &&
ver=$(expr ${prev_ver} + 1 2>/dev/null) ||
ver=1

#ver=1
if [ X$prev_ver = "X" ]
then
ver=1
else
ver=$prev_ver
fi
echo ${ver} > .version

echo ${ver}
2 changes: 1 addition & 1 deletion scripts/package/mkdebian
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ version=$KERNELRELEASE
if [ -n "$KDEB_PKGVERSION" ]; then
packageversion=$KDEB_PKGVERSION
else
packageversion=$(${srctree}/scripts/setlocalversion --no-local ${srctree})-$($srctree/init/build-version)
packageversion=$($srctree/init/build-version)
fi
sourcename=${KDEB_SOURCENAME:-linux-upstream}

Expand Down

0 comments on commit c04398f

Please sign in to comment.