mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
obs-packaging: support kernel fragments
use `merge_config.sh` script to generate the final `.config` file if the `${arch}_kata_kvm_*` file doesn't exist. Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
229411a5ae
commit
9e8cd7d6df
@ -17,7 +17,15 @@ override_dh_auto_build:
|
|||||||
tar xzf /usr/src/packages/SOURCES/$(KERNEL_CONFIGS).tar.gz
|
tar xzf /usr/src/packages/SOURCES/$(KERNEL_CONFIGS).tar.gz
|
||||||
rm -f .config
|
rm -f .config
|
||||||
find $(KERNEL_CONFIGS) -name "$(KERNEL_ARCH)_kata_kvm_*" -exec cp {} .config \;
|
find $(KERNEL_CONFIGS) -name "$(KERNEL_ARCH)_kata_kvm_*" -exec cp {} .config \;
|
||||||
|
if [ ! -f .config ]; then
|
||||||
|
# Use fragments to generate the .config
|
||||||
|
frag_dir="kata-kernel-configs/fragments"
|
||||||
|
err_msg="not in final"
|
||||||
|
r="$(KCONFIG_CONFIG=.config ARCH=${kernelArch} scripts/kconfig/merge_config.sh -r -n ${frag_dir}/common/* ${frag_dir}/${kernelArch}/* | grep "${err_msg}")" || true
|
||||||
|
[ -z "${r}" ] || (@echo "ERROR: ${r}"; exit 1)
|
||||||
|
fi
|
||||||
[ -f .config ] || (@echo "ERROR: cannot find the kernel config file for the $(KERNEL_ARCH) architecture"; exit 1)
|
[ -f .config ] || (@echo "ERROR: cannot find the kernel config file for the $(KERNEL_ARCH) architecture"; exit 1)
|
||||||
|
|
||||||
# https://github.com/kata-containers/packaging/issues/394 enable reproducible builds:
|
# https://github.com/kata-containers/packaging/issues/394 enable reproducible builds:
|
||||||
export KBUILD_BUILD_USER=katabuilduser
|
export KBUILD_BUILD_USER=katabuilduser
|
||||||
export KBUILD_BUILD_HOST=katabuildhost
|
export KBUILD_BUILD_HOST=katabuildhost
|
||||||
|
@ -80,6 +80,13 @@ BuildKernel() {
|
|||||||
# Runtime .config selection based on kernelArch
|
# Runtime .config selection based on kernelArch
|
||||||
rm -f .config
|
rm -f .config
|
||||||
find kata-kernel-configs -name "${kernelArch}_kata_kvm_*" -exec cp {} .config \;
|
find kata-kernel-configs -name "${kernelArch}_kata_kvm_*" -exec cp {} .config \;
|
||||||
|
if [ ! -f .config ]; then
|
||||||
|
# Use fragments to generate the .config
|
||||||
|
frag_dir="kata-kernel-configs/fragments"
|
||||||
|
err_msg="not in final"
|
||||||
|
r="$(KCONFIG_CONFIG=.config ARCH=${kernelArch} scripts/kconfig/merge_config.sh -r -n ${frag_dir}/common/* ${frag_dir}/${kernelArch}/* | grep "${err_msg}")" || true
|
||||||
|
[ -z "${r}" ] || (echo "ERROR: ${r}"; exit 1)
|
||||||
|
fi
|
||||||
[ -f .config ] || (echo "ERROR: cannot find the kernel config file for the ${kernelArch} architecture"; exit 1)
|
[ -f .config ] || (echo "ERROR: cannot find the kernel config file for the ${kernelArch} architecture"; exit 1)
|
||||||
|
|
||||||
%if 0%{?rhel_version} || 0%{?suse_version}
|
%if 0%{?rhel_version} || 0%{?suse_version}
|
||||||
|
@ -50,10 +50,10 @@ RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}")
|
|||||||
|
|
||||||
kernel_sha256=$(curl -L -s -f ${KR_SHA} | awk '/linux-'${VERSION}'.tar.xz/ {print $1}')
|
kernel_sha256=$(curl -L -s -f ${KR_SHA} | awk '/linux-'${VERSION}'.tar.xz/ {print $1}')
|
||||||
|
|
||||||
# Copy the kernel config files for all architecture
|
# Copy the kernel config files and fragments for all architecture
|
||||||
mkdir -p configs
|
mkdir -p configs
|
||||||
readonly configs_dir="kernel/configs"
|
readonly configs_dir="kernel/configs"
|
||||||
find "${SCRIPT_DIR}/../../${configs_dir}" -name "*_kata_kvm_${KR_LTS}.x" -exec tar --transform="s,${configs_dir},${KR_CONFIGS}," -czf ${KR_CONFIGS}.tar.gz {} +
|
find "${SCRIPT_DIR}/../../${configs_dir}" \( -name "*_kata_kvm_${KR_LTS}.x" -o -name fragments \) -exec tar --transform="s,${configs_dir},${KR_CONFIGS}," -czf ${KR_CONFIGS}.tar.gz {} +
|
||||||
|
|
||||||
replace_list=(
|
replace_list=(
|
||||||
"VERSION=${VERSION}"
|
"VERSION=${VERSION}"
|
||||||
|
Loading…
Reference in New Issue
Block a user