Commit Graph

282 Commits

Author SHA1 Message Date
Fabiano Fidêncio
bbeebcdbba rootfs: Always add SYS_ADMIN, CHROOT, and MKNOD caps to docker cmdline
We use those, independently of the distro.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-01-08 21:35:10 +01:00
Fabiano Fidêncio
90ec2fa802 rootfs: Don't fallthrough in the docker_extra_args() switch
Falling through the switch cases in docker_extra_args() looks like a
typo and causes issues when building with podman, as `--security-opt
apparmor=unconfinded" shouldn't be passed if Apparmor is no enable on
the system.

Fixes: #1241

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2021-01-08 21:35:10 +01:00
GabyCT
a6d52d3da1
Merge pull request #1208 from GabyCT/topic/addgithu
github: Add github actions
2021-01-08 14:27:19 -06:00
Archana Shinde
ebd9fcc2c3 actions: Run static checks before make agent
Run static checks prior to building the agent.Checks
fail if run after since the compilation process
produces new rust code.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2021-01-08 11:04:54 -06:00
Peng Tao
d6a6f68fd7
Merge pull request #1177 from devimc/2020-12-07/osbuilder/gentoo
[forwardport] Add support for Gentoo
2020-12-23 18:39:12 +08:00
Julio Montes
8ac93f65fd rootfs-builder: add support for gentoo
Generate images based on gentoo

fixes #1178

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-12-10 09:36:15 -06:00
Julio Montes
9897238f3a rootfs: reduce size of debian image
Improve Kata Containers memory footprint by reducing debian
image size.

Without this change:
Debian image -> 256MB

With this change:
Debian image -> 128MB

Note: this change *will not* impact ubuntu image.

fixes #1188

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-12-10 09:23:48 -06:00
Julio Montes
faed2369a0 rootfs-builder: add functions to run before and after the container
Define `before_starting_container` and `after_stopping_container`
functions, these functions run before and after the container that
builds the rootfs respectively.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-12-08 10:14:00 -06:00
Ralf Haferkamp
e3cdc89b6c osbuilder: Create target directory for agent
When building with AGENT_SOURCE_BIN pointing to an already built
kata-agent binary, the target directory needs to be created in the
rootfs tree.

Fixes #873

Signed-off-by: Ralf Haferkamp <rhafer@suse.com>
2020-10-08 17:07:40 +02:00
zhanghj
ca501e5478 osbuilder: specify default toolchain verion in rust-init.
Specify default toolchain version in rust-init.

Fixes: #799

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-24 23:20:43 -04:00
Archana Shinde
55354d5509
Merge pull request #651 from Kvasscn/fix-rust-agent-default-value-rootfs.sh
osbuilder: update usage of RUST_AGENT variable
2020-09-10 13:35:11 -07:00
Pradipta Kumar
8667df4d09
Merge pull request #679 from Amulyam24/fix-initrd-ppc64le
osbuilder: fix rootfs build on ppc64le
2020-09-09 12:32:28 +05:30
Amulya Meka
ebd3f316f2 osbuilder: fix rootfs build on ppc64le
The default toolchain used for building the
rust agent would be different for ppc64le.

Fixes: #678

Signed-off-by: Amulya Meka <amulmek1@in.ibm.com>
2020-09-09 03:09:03 +00:00
Pavel Mores
2dfb8bc549 rootfs-builder: fix unbootable dracut-based initramfs on Fedora
This is a forward port of Kata 1.x PR's
https://github.com/kata-containers/osbuilder/pull/480 and
https://github.com/kata-containers/osbuilder/pull/494 .

Fixes #646

Signed-off-by: Pavel Mores <pmores@redhat.com>
2020-09-08 20:10:38 +02:00
Bo Chen
d2a89d668e
Merge pull request #569 from devimc/2020-08-25/port/noReflink
[port] image-builder: disable reflink
2020-09-04 12:50:01 -07:00
zhanghj
dae6c7d967 osbuilder: update usage of RUST_AGENT variable
Update the default value of RUST_AGENT variable to 'yes' in
usage description.

fixes: #650

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-01 05:23:29 -04:00
Peng Tao
c624fa7469 osbuilder: install musl for aarch64
So that it can do musl static build.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:10:32 +08:00
Peng Tao
cf1b72d6c6 osbuilder: install rust before sourcing cargo env
Otherwise we cannot find it.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
76c18aa345 osbuilder: fix alpine agent build
Since we always build musl kata-agent, there is no need to build
it inside a musl container. We can just build on the host and then
copy the binary to the target rootfs.

There are still a lot to clean up and it should be made so for ALL
target distros instead of just alpine. But this is at least working
for alpine first.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
dadab1febf osbuilder: build rust agent by default
Since we only have the rust agent.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Gabriela Cervantes
f879acd6e7 scripts: Foward port osbuilder scripts to update yq
This PR ports kata-containers/osbuilder#454 to kata 2.0

Fixes #576

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-08-27 15:00:03 -05:00
Julio Montes
f7ff6d3297 image-builder: disable reflink
Disable reflink when using DAX. Reflink is a xfs feature that cannot be
used together with DAX.

fixes kata-containers/osbuilder#456
fixes #577

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-08-26 09:42:17 -05:00
Amulya Meka
64b0694436 ppc64le: Support for rust agent based rootfs
For building rust agent on ppc64le, the rust toolchain is built using
the LIBC implementation - gnu instead of musl.

Fixes: #481

Signed-off-by: Amulya Meka <amulmek1@in.ibm.com>
2020-08-18 16:00:26 +05:30
liangxianlong
7bbb9e8122 rootfs-builder: Don't modify /sbin/init on the build host
Don't modify /sbin/init on the build host when using command `AGENT_INIT="yes" ./rootfs.sh centos` to build rootfs.

Fixes: #430

Signed-off-by: liangxianlong <liang.xianlong@zte.com.cn>
2020-07-18 14:19:06 +08:00
Peng Tao
a8430b3791 gitignore: ignore more files
We don't need to track them.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-29 01:27:05 -07:00
Peng Tao
ebfbca031b osbuilder: use newest golang
Instead of the oldest one.

Fixes: #345
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-27 20:42:30 -07:00
Peng Tao
a1ef594d2a cleanup: remove redundant files
And use top level VERSION for all components.

Fixes: #334
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-24 15:57:23 -07:00
Salvador Fuentes
81e11c9f7c osbuilder: remove references to agent and runtime repos
tools/osbuilder/scripts/lib.sh was making references to agent and
runtime repositories to get golang, rust, cmake and musl versions.
Since runtime and agent repos are consolidating, we only need to
make reference to our versions.yaml in this (kata-containers) repo.

Fixes: #234.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-05-28 10:33:25 -05:00
Salvador Fuentes
629cc0ae8d rootfs-builder: remove EulerOS
EulerOS does not work with rust agent.

further info:
https://github.com/kata-containers/osbuilder/issues/387

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-30 08:27:25 -05:00
Salvador Fuentes
586d26480c rootfs-builder: Add license header to rootfs_lib_template.sh
Add license header to `tools/osbuilder/rootfs-builder/template/rootfs_lib_template.sh`

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-30 08:20:46 -05:00
Salvador Fuentes
11c3d81f68 docs: fix markdown check issues
- Removes `CODE_OF_CONDUCT.md` and `CONTRIBUTING.md` from osbuilder
directory.
- Fixes a reference from `image-builder/README.md` to
`rootfs-builder/README.md`
- Updates the main `README.md` making a reference to the local
`tools/osbuilder/README.md`

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-29 17:51:44 -05:00
Salvador Fuentes
715d342519 osbuilder: move code into tools directory
move all osbuilder files into `tools` directory to be able
to merge this into kata-containers repo.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-29 16:45:00 -05:00