`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>
Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also use UTC to be independent of timezone.
This date call only works with GNU date.
Without this patch, kata-containers-initrd.img contained
varying var/lib/osbuilder/osbuilder.yaml with
version: "1.9.0-alpha0"
-rootfs-creation-time: "2019-08-06T18:40:27.402493939+0000Z"
+rootfs-creation-time: "2034-09-08T07:57:34.386990704+0000Z"
Fixes#340
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
kata-agent is moved to /sbin/init when AGENT_INIT is yes. Check
/sbin/init exists and it's not systemd
fixes#322
Signed-off-by: Julio Montes <julio.montes@intel.com>
Use .ci/setup.sh from tests repo, to make sure spell check packages are
correctly installed for the OS under test.
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
While calculating directory size in imagebuild script, we shoul use
`df -BM` instead of `df -h` to keep Mb format.
Fixes#336
image-builder: get mount directory size with Mb format
Signed-off-by: ClarkLee <clarklee1992@hotmail.com>
Add the option to build image and initrd using dracut.
Fixes: #311
Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
For some reason, busybox image crashed on fedora 30 rootfs on aarch64.
For now, we will switch back to use fedora 28.
Fixes: #334
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Move some of the functions in rootfs.sh (generate_dockerfile,
detect_go_version) in scripts/lib.sh, to make those functions reusable
outside of rootfs.sh.
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
- rootfs: upgrade docker images for fedora
- rootfs: Make sure etc exists.
edb770e rootfs: upgrade docker images for fedora
27dddf0 rootfs: Make sure etc exists.
Signed-off-by: Eric Ernst <eric.ernst@intel.com>