1 Star 0 Fork 7

liuxu/kuasar

forked from src-openEuler/kuasar 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kuasar.spec 4.25 KB
一键复制 编辑 原始数据 按行查看 历史
%global debug_package %{nil}
Name: kuasar
Version: 1.0.0
Release: 5
Summary: Kuasar is an efficient container runtime that supports multiple sandbox techniques.
License: Apache License 2.0
URL: https://github.com/kuasar-io/kuasar
Source0: kuasar-openeuler.tar.gz
Source1: kernel.tar.gz
BuildRequires: automake golang bc glibc-devel glibc-static busybox glib2-devel glib2 ipvsadm conntrack-tools nfs-utils bash gcc cmake gcc-c++
BuildRequires: patch elfutils-libelf-devel openssl-devel bison flex rust cargo rust-packaging libgcc dtc-devel runc
%define _cargo /usr/bin/env CARGO_HOME=.cargo /usr/bin/cargo
%define hypervisor qemu
%define localbindir /usr/local/bin
%define kuasarconfdir /var/lib/kuasar
%define kuasarbuilddir %{_builddir}/kuasar-%{version}/kuasar-openeuler
%description
Kuasar is an efficient container runtime that provides cloud-native, all-scenario container solutions by supporting multiple sandbox techniques.
%prep
%setup -T -c -a 0 -n kuasar-%{version}
%setup -T -c -a 1 -n kernel
cd %{kuasarbuilddir}
sh -x apply-patches
cd %{_builddir}/kernel
mv kernel linux
cd %{_builddir}/kernel/linux
%ifarch %{ix86} x86_64
cp %{kuasarbuilddir}/kernel-config/kuasar-openeuler-kernel-x86_64.config ./.config
%else
cp %{kuasarbuilddir}/kernel-config/kuasar-openeuler-kernel-aarch64.config ./.config
%endif
%build
# build vmm-sandboxer and vmm-task
cd %{kuasarbuilddir}
sed -i '$a\[build\]\nrustflags = \["-Clink-arg=-s", "-Clink-arg=-Wl,-z,relro,-z,now"]' ./vmm/sandbox/.cargo/config.toml
sed -i '$a\[build\]\nrustflags = \["-Clink-arg=-s", "-Clink-arg=-Wl,-z,relro,-z,now"]' ./vmm/task/.cargo/config.toml
HYPERVISOR=%{hypervisor} make bin/vmm-sandboxer
%ifarch %{ix86} x86_64
ARCH=x86_64 HYPERVISOR=%{hypervisor} make bin/vmm-task
%else
ARCH=aarch64 HYPERVISOR=%{hypervisor} make bin/vmm-task
%endif
# build initrd
cp %{kuasarbuilddir}/bin/vmm-task ./initrd
cd initrd && sh -x make_kuasar_initrd.sh
# build kernel
cd %{_builddir}/kernel/linux/
make olddefconfig
make %{?_smp_mflags}
%install
mkdir -p -m 750 %{buildroot}/%{kuasarconfdir}
%ifarch %{ix86} x86_64
install -p -m 750 -D %{_builddir}/kernel/linux/arch/x86/boot/bzImage %{buildroot}/%{kuasarconfdir}/vmlinux.bin
install -p -m 640 -D %{kuasarbuilddir}/vmm/sandbox/config_%{hypervisor}_x86_64.toml %{buildroot}/%{kuasarconfdir}/config.toml
%else
install -p -m 750 -D %{_builddir}/kernel/linux/arch/arm64/boot/Image %{buildroot}/%{kuasarconfdir}/vmlinux.bin
install -p -m 640 -D %{kuasarbuilddir}/vmm/sandbox/config_%{hypervisor}_aarch64.toml %{buildroot}/%{kuasarconfdir}/config.toml
%endif
install -p -m 750 -D %{kuasarbuilddir}/initrd/kuasar.initrd %{buildroot}/%{kuasarconfdir}/kuasar.initrd
install -p -m 750 -D %{kuasarbuilddir}/bin/vmm-sandboxer %{buildroot}/%{localbindir}/vmm-sandboxer
install -p -m 640 -D %{kuasarbuilddir}/vmm/service/kuasar-vmm.service %{buildroot}/%{_unitdir}/kuasar-vmm.service
install -p -m 640 -D %{kuasarbuilddir}/vmm/service/kuasar-vmm %{buildroot}/etc/sysconfig/kuasar-vmm
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%config(noreplace) %{_unitdir}/kuasar-vmm.service
%config(noreplace) /etc/sysconfig/kuasar-vmm
%{localbindir}/vmm-sandboxer
%{kuasarconfdir}/vmlinux.bin
%{kuasarconfdir}/kuasar.initrd
%config(noreplace) %{kuasarconfdir}/config.toml
%changelog
* Mon Jan 6 liuxu <liuxu156@huawei.com> -1.0.0-5
- logfix:print warn instead of error when dir not found.
* Fri Nov 29 liuxu <liuxu156@huawei.com> -1.0.0-4
- fix:use ttrpc-rust in vendor
* Thu Nov 28 liuxu <liuxu156@huawei.com> -1.0.0-3
- vmm:add ttrpc-rust to use vendor
* Mon Nov 4 liuxu <liuxu156@huawei.com> -1.0.0-2
- vmm:adapt qemu
* Wed Oct 23 liuxu <liuxu156@huawei.com> -1.0.0-1
- update to 1.0.0
* Tue Feb 6 jiangpengfei <jiangpengfei9@huawei.com> -0.1.0-6
- update build_require from docker-runc to runc
* Mon Sep 19 Vanient <xidanni1@huawei.com> -0.1.0-5
- set CONFIG_INITRAMFS_FILE_METADATA empty
* Mon Sep 4 flyflyflypeng <jiangpengfei9@huawei.com> -0.1.0-4
- remove ExecReload field in the systemd service file
* Fri Sep 1 Vanient <xidanni1@huawei.com> -0.1.0-3
- revert musl build -static-pie
* Tue Aug 29 Vanient <xiadanni1@huawei.com> - 0.1.0-2
- optimize compile options
* Thu Aug 24 Vanient <xiadanni1@huawei.com> - 0.1.0-1
- update to 0.1.0
* Tue Jul 18 2023 flyflyflypeng <jiangpengfei9@huawei.com> - 0.0.1-1
- init package
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuxu180400617/kuasar.git
git@gitee.com:liuxu180400617/kuasar.git
liuxu180400617
kuasar
kuasar
master

搜索帮助