!24 sync patch from 20.03-LTS branch to revert kata-containers package split
From: @holyfei Reviewed-by: @flyflyflypeng Signed-off-by: @flyflyflypeng
This commit is contained in:
commit
91dc310b36
19
apply-patches
Executable file
19
apply-patches
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -f ./patch_flag ]];then
|
||||
echo "kata_integration patched!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tar -zxvf kata_integration-*.tar.gz
|
||||
cat ./series.conf | while read line
|
||||
do
|
||||
if [[ $line == '' || $line =~ ^\s*# ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "====patch $line======"
|
||||
pwd
|
||||
patch -p1 -F1 -s < ./patches/$line
|
||||
done
|
||||
|
||||
touch ./patch_flag
|
||||
@ -1,8 +1,9 @@
|
||||
#needsrootforbuild
|
||||
%global debug_package %{nil}
|
||||
%global kernel_version 4.19.36
|
||||
|
||||
%define VERSION v1.11.1
|
||||
%define RELEASE 5
|
||||
%define RELEASE 6
|
||||
|
||||
Name: kata-containers
|
||||
Version: %{VERSION}
|
||||
@ -10,26 +11,78 @@ Release: %{RELEASE}
|
||||
Summary: Kata Container integration
|
||||
License: Apache 2.0
|
||||
URL: https://gitee.com/src-openeuler/kata_integration
|
||||
Source0: kata_integration-v1.0.0.tar.gz
|
||||
Source1: kata-runtime-%{version}.tar.gz
|
||||
Source2: kata-agent-%{version}.tar.gz
|
||||
Source3: kata-proxy-%{version}.tar.gz
|
||||
Source4: kata-shim-%{version}.tar.gz
|
||||
Source5: linux-%{kernel_version}.tar.gz
|
||||
|
||||
BuildRoot: %_topdir/BUILDROOT
|
||||
BuildRequires: automake golang gcc bc glibc-devel glibc-static busybox glib2-devel glib2 ipvsadm conntrack-tools nfs-utils
|
||||
BuildRequires: patch elfutils-libelf-devel openssl-devel bison flex
|
||||
BuildRequires: kata-runtime kata-agent kata-proxy kata-shim kata-micro-kernel
|
||||
|
||||
%description
|
||||
This is core component of Kata Container, to make it work, you need a docker engine.
|
||||
|
||||
%prep
|
||||
%setup -T -c -a 0 -n %{name}-%{version}
|
||||
%setup -T -c -a 1 -n runtime
|
||||
%setup -T -c -a 2 -n agent
|
||||
%setup -T -c -a 3 -n proxy
|
||||
%setup -T -c -a 4 -n shim
|
||||
%setup -T -c -a 5 -n kernel
|
||||
|
||||
# extract the kata_integration.tar.gz file
|
||||
cd %{_builddir}/%{name}-%{version}
|
||||
# apply kata_integration patches
|
||||
sh apply-patches
|
||||
|
||||
# mv build components into kata_integration dir
|
||||
pushd %{_builddir}/%{name}-%{version}
|
||||
mv ../runtime .
|
||||
mv ../agent .
|
||||
mv ../proxy .
|
||||
mv ../shim .
|
||||
popd
|
||||
|
||||
# build kernel
|
||||
cd %{_builddir}/kernel
|
||||
mv kernel linux
|
||||
cd %{_builddir}/kernel/linux/
|
||||
%ifarch %{ix86} x86_64
|
||||
cp %{_builddir}/%{name}-%{version}/hack/config-kata-x86_64 ./.config
|
||||
%else
|
||||
cp %{_builddir}/%{name}-%{version}/hack/config-kata-arm64 ./.config
|
||||
%endif
|
||||
|
||||
%build
|
||||
echo %{_builddir}
|
||||
echo %{name}-%{version}
|
||||
cd %{_builddir}/kernel/linux/
|
||||
make %{?_smp_mflags}
|
||||
|
||||
cd %{_builddir}/%{name}-%{version}
|
||||
mkdir -p -m 750 build
|
||||
make runtime
|
||||
make proxy
|
||||
make shim
|
||||
make initrd
|
||||
|
||||
%install
|
||||
mkdir -p -m 755 %{buildroot}/var/lib/kata
|
||||
%ifarch %{ix86} x86_64
|
||||
install -p -m 755 -D %{_builddir}/kernel/linux/arch/x86_64/boot/bzImage %{buildroot}/var/lib/kata/kernel
|
||||
%else
|
||||
install -p -m 755 -D %{_builddir}/kernel/linux/arch/arm64/boot/Image %{buildroot}/var/lib/kata/kernel
|
||||
%endif
|
||||
|
||||
cd %{_builddir}/%{name}-%{version}
|
||||
mkdir -p -m 750 %{buildroot}/usr/bin
|
||||
install -p -m 750 /usr/bin/kata-runtime /usr/bin/kata-proxy /usr/bin/kata-shim /usr/bin/kata-netmon %{buildroot}/usr/bin/
|
||||
install -p -m 755 /var/lib/kata/kernel %{buildroot}/var/lib/kata/
|
||||
install -p -m 640 /var/lib/kata/kata-containers-initrd.img %{buildroot}/var/lib/kata/
|
||||
install -p -m 750 ./build/kata-runtime ./build/kata-proxy ./build/kata-shim ./build/kata-netmon %{buildroot}/usr/bin/
|
||||
install -p -m 640 ./build/kata-containers-initrd.img %{buildroot}/var/lib/kata/
|
||||
mkdir -p -m 750 %{buildroot}/usr/share/defaults/kata-containers/
|
||||
install -p -m 640 -D /usr/share/defaults/kata-containers/configuration.toml %{buildroot}/usr/share/defaults/kata-containers/configuration.toml
|
||||
install -p -m 640 -D ./runtime/cli/config/configuration-qemu.toml %{buildroot}/usr/share/defaults/kata-containers/configuration.toml
|
||||
|
||||
%clean
|
||||
|
||||
@ -44,7 +97,14 @@ install -p -m 640 -D /usr/share/defaults/kata-containers/configuration.toml %{bu
|
||||
|
||||
%doc
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Nov 6 2020 yangfeiyu<yangfeiyu2@huawei.com> - 1.11.1-6
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:revert the kata-containers.spec to still build kata-containers components into one package
|
||||
|
||||
* Fri Oct 9 2020 yangfeiyu<yangfeiyu2@huawei.com> - 1.11.1-5
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
%global debug_package %{nil}
|
||||
%define VERSION v1.0.0
|
||||
%define RELEASE 1
|
||||
%define RELEASE 2
|
||||
|
||||
Name: kata-integration
|
||||
Version: %{VERSION}
|
||||
Release: %{RELEASE}
|
||||
Summary: Kata Container integration
|
||||
License: Apache 2.0
|
||||
URL: https://gitee.com/src-openeuler/kata_integration
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: https://gitee.com/openeuler/kata_integration
|
||||
Source0: https://gitee.com/openeuler/kata_integration/repository/archive/v1.0.0?format=tar.gz#/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRoot: %_topdir/BUILDROOT
|
||||
BuildRequires: automake gcc glibc-devel glibc-static patch
|
||||
@ -28,6 +28,12 @@ This is a usefult tool for building Kata Container components.
|
||||
%doc
|
||||
|
||||
%changelog
|
||||
* Sat Sep 5 2020 jiangpengf<jiangpengfei9@huawei.com> - 1.0.0-2
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:change Source format to URL
|
||||
|
||||
* Wed Aug 26 2020 jiangpengf<jiangpengfei9@huawei.com> - 1.0.0-1
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
%global debug_package %{nil}
|
||||
%global TarballVer 4.19.138
|
||||
|
||||
%define VERSION 4.19.138
|
||||
%define RELEASE 1
|
||||
|
||||
%define with_patch 0
|
||||
%define with_source 1
|
||||
|
||||
Name: kata-micro-kernel
|
||||
Version: %{VERSION}
|
||||
Release: %{RELEASE}
|
||||
Summary: Micro Linux Kernel For Kata-containers
|
||||
License: GPLv2
|
||||
URL: http://www.kernel.org/
|
||||
Source0: kernel.tar.gz
|
||||
Source1: kata_integration-v1.0.0.tar.gz
|
||||
|
||||
BuildRoot: %_topdir/BUILDROOT
|
||||
BuildRequires: patch bash perl automake make gcc binutils hostname bc openssl-devel glibc-devel glibc-static
|
||||
BuildRequires: ncurses-devel elfutils-devel elfutils-libelf-devel elfutils binutils-devel bison flex
|
||||
|
||||
%description
|
||||
This kernel is customed as kata-containers guest kernel, which is core of the kata-containers.
|
||||
|
||||
%prep
|
||||
%setup -q -c -a 0 -n kernel
|
||||
%setup -q -c -a 1 -n kata_integration
|
||||
|
||||
# extract the kata_integration.tar.gz file
|
||||
cd %{_builddir}/kata_integration
|
||||
tar -xzf kata_integration-v1.0.0.tar.gz
|
||||
|
||||
# build kernel
|
||||
cd %{_builddir}/kernel
|
||||
mv kernel linux-%{version}
|
||||
cd %{_builddir}/kernel/linux-%{version}
|
||||
|
||||
%ifarch %{ix86} x86_64
|
||||
cp %{_builddir}/kata_integration/hack/config-kata-x86_64 ./.config
|
||||
%else
|
||||
cp %{_builddir}/kata_integration/hack/config-kata-arm64 ./.config
|
||||
%endif
|
||||
|
||||
%build
|
||||
cd %{_builddir}/kernel/linux-%{version}
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
mkdir -p -m 755 %{buildroot}/var/lib/kata
|
||||
%ifarch %{ix86} x86_64
|
||||
install -p -m 755 -D %{_builddir}/kernel/linux-%{version}/arch/x86_64/boot/bzImage %{buildroot}/var/lib/kata/kernel
|
||||
%else
|
||||
install -p -m 755 -D %{_builddir}/kernel/linux-%{version}/arch/arm64/boot/Image %{buildroot}/var/lib/kata/kernel
|
||||
%endif
|
||||
|
||||
%clean
|
||||
|
||||
%files
|
||||
/var/lib/kata/kernel
|
||||
|
||||
%doc
|
||||
|
||||
%changelog
|
||||
* Thu Aug 27 2020 jiangpengfei<jiangpengfei9@huawei.com> - 4.19.138-1
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:restart
|
||||
- DESC:init kata-micro-kernel package
|
||||
35
patches/0001-kata-containers-disable-netmon-by-default.patch
Normal file
35
patches/0001-kata-containers-disable-netmon-by-default.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From 553338441418935cfe76db0c90a8fa58f12cfa37 Mon Sep 17 00:00:00 2001
|
||||
From: holyfei <yangfeiyu20102011@163.com>
|
||||
Date: Sun, 1 Nov 2020 21:03:25 +0800
|
||||
Subject: [PATCH] kata-containers: disable netmon by default
|
||||
|
||||
reason: disable netmon by default, user can modify the
|
||||
enable_netmon config to enable netmon components.
|
||||
|
||||
Signed-off-by: holyfei <yangfeiyu20102011@163.com>
|
||||
---
|
||||
scripts/make_default_configuration.sh | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/make_default_configuration.sh b/scripts/make_default_configuration.sh
|
||||
index 1cd5d61..c998c46 100755
|
||||
--- a/scripts/make_default_configuration.sh
|
||||
+++ b/scripts/make_default_configuration.sh
|
||||
@@ -27,13 +27,12 @@ sed -i 's/^#enable_blk_mount/enable_blk_mount/' $KATA_CONFIG_PATH
|
||||
sed -i 's#/usr/libexec/kata-containers/kata-proxy#/usr/bin/kata-proxy#' $KATA_CONFIG_PATH
|
||||
sed -i 's#/usr/libexec/kata-containers/kata-shim#/usr/bin/kata-shim#' $KATA_CONFIG_PATH
|
||||
sed -i 's#/usr/libexec/kata-containers/kata-netmon#/usr/bin/kata-netmon#' $KATA_CONFIG_PATH
|
||||
-sed -i 's/^#enable_netmon/enable_netmon/' $KATA_CONFIG_PATH
|
||||
sed -i 's/^#disable_new_netns/disable_new_netns/' $KATA_CONFIG_PATH
|
||||
sed -i 's/^#disable_vhost_net/disable_vhost_net/' $KATA_CONFIG_PATH
|
||||
sed -i 's/^#block_device_cache_set/block_device_cache_set/' $KATA_CONFIG_PATH
|
||||
sed -i 's/^#block_device_cache_direct/block_device_cache_direct/' $KATA_CONFIG_PATH
|
||||
sed -i 's#path = \"/usr/bin/qemu-.*\"#path = \"/usr/bin/qemu-kvm\"#' $KATA_CONFIG_PATH
|
||||
-sed -i 's/^internetworking_model.*$/internetworking_model=\"bridged\"/' $KATA_CONFIG_PATH
|
||||
+sed -i 's/^internetworking_model.*$/internetworking_model = \"none\"/' $KATA_CONFIG_PATH
|
||||
|
||||
if [ "$ARCH" == "aarch64" ];then
|
||||
sed -i 's/^machine_type.*$/machine_type = \"virt\"/' $KATA_CONFIG_PATH
|
||||
--
|
||||
2.11.0
|
||||
|
||||
1
series.conf
Normal file
1
series.conf
Normal file
@ -0,0 +1 @@
|
||||
0001-kata-containers-disable-netmon-by-default.patch
|
||||
Loading…
x
Reference in New Issue
Block a user