diff --git a/anolis/Makefile b/anolis/Makefile index af080047b5a35c1722d62022cbffcea468a699d8..5346c50c96369dbd392166c3391befea42bfd43a 100644 --- a/anolis/Makefile +++ b/anolis/Makefile @@ -36,8 +36,11 @@ help: @echo ' DIST - the distribution suffix, eg: .an7, .an8, .an23' @echo ' DIST_DO_SIGNMODULES - should sign kernel modules. optional: 0/1, default: 0' @echo ' DIST_OUTPUT - the output directory, default: $(DIST_SHORT_OUTPUT)' - @echo ' DIST_OFFICIAL_BUILD - if offical build, the kernel version looks like: 5.10.134-15.1_rc1,' - @echo ' else it looks like: 5.10.134-1.git.6235a991a61d' + @echo ' DIST_BUILD_MODE - the build mode. optional: official/nightly/devel' + @echo ' !!! NOTE: BE CAUTIOUS ABOUT USING official BUILD !!!' + @echo ' - official build. kernel version: $(DIST_KERNELVERSION)-$(DIST_OFFICIAL_PKGRELEASEVERION), with srpm' + @echo ' - nightly build. kernel version: $(DIST_KERNELVERSION)-$(DIST_UNOFFICIAL_PKGRELEASEVERION), with srpm' + @echo ' - devel build. kernel version: $(DIST_KERNELVERSION)-$(DIST_UNOFFICIAL_PKGRELEASEVERION), without srpm' @echo ' DIST_BUILD_NUMBER - the build number for unofficial build, eg: 1/2' @echo ' DIST_BUILD_VARIANT & DIST_BUILD_EXTRA - see comments in buildpkg.sh' diff --git a/anolis/Makefile.variables b/anolis/Makefile.variables index 277493e51fa7a5cbc05c40f0912b9f0003454a17..318df6a83df61efda0dfbc3d42cb4a92d24c596e 100644 --- a/anolis/Makefile.variables +++ b/anolis/Makefile.variables @@ -4,9 +4,11 @@ # the dist suffix, eg: an7, an8, an23 DIST ?= .an8 -# if offical build, the kernel version looks like: 5.10.134-15.1_rc1 -# else it looks like: 5.10.134-1.git.6235a991a61d -DIST_OFFICIAL_BUILD ?= +# build mode: +# - official build, the kernel version looks like: 5.10.134-15.1_rc1, and also generate source rpm +# - nightly build, the kernel version looks like: 5.10.134-1.git.6235a991a61d, and also generate source rpm +# - devel build, same as nightly build, without source rpm +DIST_BUILD_MODE ?= devel # the package release version. # eg: for ANCK 5.10-015.1, the major version is 15, the minor version is 1 @@ -62,7 +64,11 @@ DIST_GIT_HEAD_FULL_COMMIT_ID = $(shell git rev-parse HEAD) DIST_UNOFFICIAL_PKGRELEASEVERION = ${DIST_BUILD_NUMBER}.git.$(DIST_GIT_HEAD_SHORT_COMMIT_ID) # final kernel version -DIST_PKGRELEASEVERION = $(if $(DIST_OFFICIAL_BUILD),$(DIST_OFFICIAL_PKGRELEASEVERION),$(DIST_UNOFFICIAL_PKGRELEASEVERION)) +ifeq ("${DIST_BUILD_MODE}", "official") +DIST_PKGRELEASEVERION = $(DIST_OFFICIAL_PKGRELEASEVERION) +else +DIST_PKGRELEASEVERION = $(DIST_UNOFFICIAL_PKGRELEASEVERION) +endif DIST_ANOLIS_VERSION = $(DIST_KERNELVERSION)-$(DIST_PKGRELEASEVERION) # the package id used for compress kernel tarball: diff --git a/anolis/buildpkg.sh b/anolis/buildpkg.sh index a0fb28a895f5d521b4a0bddd872968e0f88030d1..5a42161521e49470f2f93d348faf7482569fd480 100644 --- a/anolis/buildpkg.sh +++ b/anolis/buildpkg.sh @@ -1,20 +1,26 @@ set -xe function do_rpmbuild() { - if [ -z "$DIST_OFFICIAL_BUILD" ]; then - CMD="-bb" - else + if [ "$DIST_BUILD_MODE" == "official" ] || [ "$DIST_BUILD_MODE" == "nightly" ]; then CMD="-ba" + else + CMD="-bb" fi # Now we have: # + variants: default, only-debug, with-debug # + extras: base, with-debuginfo, full - # + modes: nightly, dev, pre-release + # + modes: official, nightly, dev #TODO: add with-gcov # # Matrix # + # | BuildMode | KernelName | GenerateSrpm | + # |-----------|-----------------|--------------| + # | official | without sha id | Yes | + # | nightly | with git sha id | Yes | + # | devel | with git sha id | No | + # # | Extra\Var | Default | Only-debug | With-debug | # |-----------|----------|------------|------------| # | Base | +default | -default | +default |