OpenCloudOS-Kernel/dist/scripts/get-version.sh

24 lines
503 B
Bash
Raw Normal View History

dist: initial support Upstream: no Check-Patch: no Imported from OCKS-2303: https://github.com/openCloudOS/OpenCloudOS-Kernel-Stream/tree/ocks-2303 This build system is re-written from scratch except some code snips: - Compatible with systems that were using TK kernel. - Compatible with RHEL-like systems. - Resolved tons of hacks and workaround from TK/RHEL. (leftovers are marked as TODO) - All RPM builtin debuginfo utilities are well leveraged (buildid re-generate, dwarf compression, etc...) - For bpftool and BTF info extracting, this package will try self-bootstrap and don't depend on host kernel during build time. - Well commented, and targeted for maximum compatibility. - Integrated config management system. - Integrated with version management system. - Provides many utils. - Cross-build and cross packaging, also cross kABI checking/updating. - ... To start, just run: make dist-rpm And for help, just run: make dist-help It will build following packages: kernel Main meta package, empty, depend on kernel-core and kernel-modules kernel-core The package contains kernel image and core modules, able to boot all machines, all kinds of VMs etc. kernel-modules Contains extra modules and drivers, most modules that are not required for VMs and common hardware should go into this pacakge. kernel-devel Devel files for building custom kernel modules. kernel-headers Kernel headers. perf python3-perf Userspace tool perf. kernel-tools kernel-tools-libs kernel-tools-libs-devel Userspace tools like cpupower, slabinfo, etc... bpftool bpftool kernel-debuginfo kernel-debuginfo-common perf-debuginfo python3-perf-debuginfo kernel-tools-debuginfo bpftool-debuginfo All kinds of debuginfo Signed-off-by: Kairui Song <kasong@tencent.com>
2023-11-16 17:29:06 +08:00
#!/bin/bash --norc
# SPDX-License-Identifier: GPL-2.0
#
# Print out the tkernel version based on git commit and work tree.
#
# $1: git reference, tag or commit
# $2: version type, 'nvr' or 'unamer', defaults to 'unamer'
#
# shellcheck source=./lib-version.sh
. "$(dirname "$(realpath "$0")")/lib-version.sh"
prepare_kernel_ver "$1"
case $2 in
vr )
echo "$KERNEL_MAJVER"-"$KERNEL_RELVER"
;;
nvr )
echo "$KERNEL_NAME"-"$KERNEL_MAJVER"-"$KERNEL_RELVER"
;;
* )
dist: initial support Upstream: no Check-Patch: no Imported from OCKS-2303: https://github.com/openCloudOS/OpenCloudOS-Kernel-Stream/tree/ocks-2303 This build system is re-written from scratch except some code snips: - Compatible with systems that were using TK kernel. - Compatible with RHEL-like systems. - Resolved tons of hacks and workaround from TK/RHEL. (leftovers are marked as TODO) - All RPM builtin debuginfo utilities are well leveraged (buildid re-generate, dwarf compression, etc...) - For bpftool and BTF info extracting, this package will try self-bootstrap and don't depend on host kernel during build time. - Well commented, and targeted for maximum compatibility. - Integrated config management system. - Integrated with version management system. - Provides many utils. - Cross-build and cross packaging, also cross kABI checking/updating. - ... To start, just run: make dist-rpm And for help, just run: make dist-help It will build following packages: kernel Main meta package, empty, depend on kernel-core and kernel-modules kernel-core The package contains kernel image and core modules, able to boot all machines, all kinds of VMs etc. kernel-modules Contains extra modules and drivers, most modules that are not required for VMs and common hardware should go into this pacakge. kernel-devel Devel files for building custom kernel modules. kernel-headers Kernel headers. perf python3-perf Userspace tool perf. kernel-tools kernel-tools-libs kernel-tools-libs-devel Userspace tools like cpupower, slabinfo, etc... bpftool bpftool kernel-debuginfo kernel-debuginfo-common perf-debuginfo python3-perf-debuginfo kernel-tools-debuginfo bpftool-debuginfo All kinds of debuginfo Signed-off-by: Kairui Song <kasong@tencent.com>
2023-11-16 17:29:06 +08:00
echo "$KERNEL_UNAMER"
;;
esac