In Fedora we are running the osbuilder scripts on the client machine,
to generate an initrd for the running host kernel. In this setup,
there's currently a runtime dependency on gcc for compiling the nsdax
tool, which is suboptimal.
Add NSDAX_BIN environment variable; if specified, image-builder.sh
will use that path as the nsdax tool. This let's ship a compiled
nsdax tool to users and drop the runtime gcc dependency
Fixes: #417
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Build rust agent and go agent using the same rootfs bulder image.
When building rust agent, just add RUST_AGENT=yes before command line.
The documentation will be updated later
Depends-on: github.com/kata-containers/tests#2287
Fixes: #360
Signed-off-by: Yang Bo <bo@hyper.sh>
Add DOCKER_RUNTIME variable to change container runtime depending on the
CI/environment.
fixes#397
Signed-off-by: Julio Montes <julio.montes@intel.com>
Leaving nsdax behind may create some isses for the distro packages
of kata-osbuilder, as every package would have to take care of purging
the file on each distro.
Knowing that, we better remove the file as part of the script, mainly
because the file is already regenerated everytime in any case.
Fixes: #394
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
- make: use `cd` instead of '--directory' option of `cpio`
38d0be3 make: use `cd` instead of '--directory' option of `cpio`
Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
Due to the option '--directory' just added from 'cpio' v2.12, so the
osbuilder will failed with old version 'cpio' before v2.12, such as in
Centos 7 with v2.11.
Fix it by replacing this option with '(cd ...; cat ...)'.
Fixes: #384
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
- osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
- README: Update how to use DEBUG variable
- Fix yq
- initrd_builder: Create empty resolv.conf in rootfs
- rootfs: update fedora to 29 for arm64.
1599601 osbuilder: Update README about `USE_PODMAN` variable
d1751a3 osbuilder: Add USE_PODMAN as an alternate for USE_DOCKER
d2d029c README: Update how to use DEBUG variable
9e10b34 rootfs_builder: Create /etc/resolv.conf in rootfs
5982e48 lib.sh: Fix curl error when using curl+yq
05428a6 rootfs: Install yq if not found instead of error
1eec032 rootfs: update fedora to 29 for arm64.
Signed-off-by: katacontainersbot <katacontainersbot@gmail.com>
`USE_PODMAN` variable needs to be set for the osbuilder
scripts to use podman as a containerization engine to
build initrd/rootfs images. If both are set, `USE_DOCKER`
would take precedence over `USE_PODMAN`
Fixes: #370
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
In case a user wants to use podman instead of
docker to build initrd/rootfs images, facilitate
it by setting the variable `USE_PODMAN=true`.
Fixes: #370
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
Update osbuilder README to use DEBUG
environment variable for executing scripts in
debug mode.
Fixes: #368
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
Create an empty /etc/resolv.conf in rootfs if
it does not already exists else preserve it if
not a symlink. This would allow the agent to bind
mount it for DNS in kata VM.
Fixes: #365
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
When you curl versions.yaml file and pipe into
yq, sometimes the piped program
closes the read pipe before the previous program
is finished leading to "curl: (23) Failed writing
body (1337 != 1371)". As a workaround we pipe the
stream through double "tac", an intermediary program
that always reads the whole page before feeding it
to the next program.
Fixes: #363
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
When building rootfs, yq is needed to parse
the version from versions.yaml file. If yq
is not found, it fails. In this PR, we install
yq if not found.
Fixes: #363
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
there is issue in fedora:28 when start systemd service.
update fedora to 29 will bypass this issue.
Fixes: #349
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
- dracut: increase base.conf priority from 00 to 05
- make: use bash to fetch dracut conf 'drivers' list
dec8013 make: use bash to fetch dracut conf 'drivers' list
6daec98 make: Move comment about dracut --no-kernel
2950b37 dracut: increase base.conf priority from 00 to 05
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
dracut will process conf files with bash, and in fact it's common to
use idioms like += in conf files for string concatenation. The current
grep usage in the Makefile won't catch all possible valid 'drivers'
variable cases.
Instead, use bash to parse and echo the 'drivers' content
Fixes: #356
Signed-off-by: Cole Robinson <crobinso@redhat.com>
The Makefile invokes dracut with a custom confdir. However dracut will
still pull site configuration from /usr/lib/dracut/dracut.conf.d/, which
on Fedora contains a 01-dist.conf that sets among other things
early_microcode="yes".
Because 01-dist.conf is processed after 00-base.conf, kata's
early_microcode="no" is overridden, which isn't intended.
Rename 00-base.conf to 05-base.conf to sidestep this
Fixes: #354
Signed-off-by: Cole Robinson <crobinso@redhat.com>
travis ppc64le has been very unstable when running
apt-get commands and are not allowing us to run the
job successfully.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
Since the image rootfs is readonly, we
create an empty /etc/resolv.conf which
the agent would later bind-remount as
read-write.
Fixes: #345
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
Support for loading kernel modules got merged. kmod package is needed for
loading kernel modules in the guest.
fixes#341
Signed-off-by: Julio Montes <julio.montes@intel.com>
Don't install chrony, iptables-bin and util-linux-bin when AGENT_INIT=yes,
these packages are only needed when the init process is systemd.
Signed-off-by: Julio Montes <julio.montes@intel.com>