From c6eb20d05e2fe35c48ddfe0499c27e1b4729d741 Mon Sep 17 00:00:00 2001 From: jikui Date: Tue, 24 Aug 2021 11:26:25 +0800 Subject: [PATCH] kata_integration: add kata-mirco-kernel spec file Signed-off-by: jikui --- kata-integration.spec | 8 +++++- kata-micro-kernel.spec | 65 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 kata-micro-kernel.spec diff --git a/kata-integration.spec b/kata-integration.spec index 63fd2d9..de2e02f 100644 --- a/kata-integration.spec +++ b/kata-integration.spec @@ -1,6 +1,6 @@ %global debug_package %{nil} %define VERSION v1.0.0 -%define RELEASE 5 +%define RELEASE 6 Name: kata-integration Version: %{VERSION} @@ -28,6 +28,12 @@ This is a usefult tool for building Kata Container components. %doc %changelog +* Tue Aug 24 2021 jikui - 1.0.0-6 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:add kata-mirco-kernel spec file + * Wed Aug 25 2021 Wei Gao - 1.0.0-5 - Type:bugfix - ID:NA diff --git a/kata-micro-kernel.spec b/kata-micro-kernel.spec new file mode 100644 index 0000000..c1a62b5 --- /dev/null +++ b/kata-micro-kernel.spec @@ -0,0 +1,65 @@ +%global debug_package %{nil} + +%define VERSION 5.10.0 +%define RELEASE 1 + +Name: kata-micro-kernel +Version: %{VERSION} +Release: %{RELEASE} +Summary: Micro 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: automake gcc bc glibc-devel glibc-static glib2-devel glib2 +BuildRequires: patch elfutils-libelf-devel bison flex + +%description +This is a micro kernel for kata-containers. + +%prep +%setup -T -c -a 0 -n kernel +%setup -T -c -a 1 -n kata_integration + +# extract the kata_integration.tar.gz file +cd %{_builddir}/kata_integration +# apply kata_integration patches +sh apply-patches + +# build kernel +cd %{_builddir}/kernel +mv kernel linux +cd %{_builddir}/kernel/linux/ +%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/ +make %{?_smp_mflags} + +%install +mkdir -p -m 755 %{buildroot}/var/lib/kata +%ifarch %{ix86} x86_64 +install -p -m 640 -D %{_builddir}/kernel/linux/arch/x86_64/boot/bzImage %{buildroot}/var/lib/kata/kernel +%else +install -p -m 640 -D %{_builddir}/kernel/linux/arch/arm64/boot/Image %{buildroot}/var/lib/kata/kernel +%endif + +%clean + +%files +/var/lib/kata/kernel + +%doc + +%changelog +* Fri Aug 20 2021 jikui - 5.10.0-1 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:init kata-micro-kernel package -- Gitee