summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-04-26 09:56:57 +0200
committerChristian Poessinger <christian@poessinger.com>2019-04-26 10:32:45 +0200
commitdee033f97cfc9818bcf2143d79ff18726beb7c22 (patch)
tree8c471c55e47b769d087d3b0b23d09d05f64847c6 /scripts
parentf4df31d37e9192dfcbe0a6d97ae8634fe20dae08 (diff)
downloadvyos-build-dee033f97cfc9818bcf2143d79ff18726beb7c22.tar.gz
vyos-build-dee033f97cfc9818bcf2143d79ff18726beb7c22.zip
Packages: use 'make kernelversion' instead of grep magic
Exract version by using the included "make kernelversion" instead of writing a custom grep script that was used before. VERSION=$(grep '^VERSION' Makefile | grep -Eo '[0-9]{1,4}') PATCHLEVEL=$(grep '^PATCHLEVEL' Makefile | grep -Eo '[0-9]{1,4}') SUBLEVEL=$(grep '^SUBLEVEL' Makefile | grep -Eo '[0-9]{1,4}') $ make kernelversion 4.19.36
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-packages9
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/build-packages b/scripts/build-packages
index 93618fbc..6d4b1c76 100755
--- a/scripts/build-packages
+++ b/scripts/build-packages
@@ -226,13 +226,10 @@ pkg_special.append( add_package('frr', url='https://github.com/FRRouting/frr.git
#
# Linux (VyOS) Kernel
#
-kernel_build_cmd = "export VERSION=$(grep '^VERSION' Makefile | grep -Eo '[0-9]{1,4}') && " \
- "export PATCHLEVEL=$(grep '^PATCHLEVEL' Makefile | grep -Eo '[0-9]{1,4}') && " \
- "export SUBLEVEL=$(grep '^SUBLEVEL' Makefile | grep -Eo '[0-9]{1,4}') && " \
- "echo ${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-amd64-vyos > " + repo_root + "/data/kernel_version && " \
- "make x86_64_vyos_defconfig && " \
+kernel_build_cmd = "make x86_64_vyos_defconfig && " \
+ "echo $(make kernelversion)-amd64-vyos > " + repo_root + "/data/kernel_version && " \
"LOCALVERSION='' make-kpkg --rootcmd fakeroot --initrd --append_to_version -amd64-vyos " \
- " --revision=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-0 kernel_headers kernel_image -j" + str(os.cpu_count())
+ " --revision=$(make kernelversion)-1 kernel_headers kernel_image -j" + str(os.cpu_count())
pkg_special.append( add_package('vyos-kernel', branch='linux-vyos-4.19.y', custombuild_cmd=kernel_build_cmd) )