For now, mirrorlist doesn't support non-x86_64 arch, so we need
create baseurl for arm64. Furthermore, we also need to offer
arm64-specific gpg keys along with the regular key.
Fixes: #111
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
If we set env USE_DOCKER true, we will use container as development
environment. After docker run command, this temporary container
would be no use. we could add -rm flag to automatically delete
intermediate container.
Fixes: #115
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
CentOS and some versions of Ubuntu do not provide
bats in their default repository. This change installs
bats from sources.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
`.ci/setup.sh` is using dnf instead of yum to install
centos dependencies. This fixes it to use yum.
Fixes: #104.
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
After building the images, perform a very basic test by configuring
the runtime to use them and creating a container.
Fixes#97.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Remove the rootfs tree before attempting to generate one to avoid
picking up any stale information if the function is run multiple times.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Moved the variable specifying the path to the osbuilder metadata file
to the top of the script and made it readonly.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Some of the globals were set as read-only variables whilst others
weren't. However, they can all be read-only.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
As the comment in the code showed, now that
https://github.com/kata-containers/osbuilder/issues/25 is fixed, it is
no longer necessary to specify an image size to the image builder as it
will auto-calculate it.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Don't default to a hard-coded Intel architecture - default to the host
architecture.
This requires the `coreutils` package to be installed both inside each
docker image (for `USE_DOCKER=true`) and in the host environments.
Added missing SPDX headers to `Dockerfile` templates to pacify the CI checks.
Fixes#100.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Building an image requires systemd to be installed in the rootfs as the
init daemon, so assert that systemd is available.
Updated tests so that alpine is only tested as an initrd (it cannot be
an image as it doesn't use systemd).
Added warning note about alpine to the docs.
Fixes#98.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Commit b8f1a68834 ("rootfs: Simplify
code") introduced a variable called destdir but accidentally used
dest_dir with cp(1) instead. This causes kernel modules to be copied to
the wrong location.
Rename the variable to dest_dir to be consistent with module_dir and
rootfs_dir variables used in this function.
Fixes: #94
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
The `getopts` call in the rootfs builder was incorrect
meaning the `-a $agent_version` option would never have worked.
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
For now, the flag "-a" or relevant shell variant "${AGENT_VERSION}"
hasn't been used, only defined. Using 'git checkout' command to go
into requested branch.
Fixes: #90
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Added the extra packages the user requested to the summary file as
previously only the default packages were listed.
Fixes#92.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Current rootfs.sh fails when GOPATH is a set of directories.We
simply choose the first one as the working directory, as go get
only works against the first item in the GOPATH.
Fixes: #87
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Add a new Usage section with basic examples of how to run the
builders from the `Makefile`.
Fixes#84.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Create a YAML metadata file inside the rootfs image
containing information about the environment:
```
/var/lib/osbuilder/osbuilder.yaml
```
Example contents:
```
---
osbuilder:
url: "https://github.com/kata-containers/osbuilder"
version: "unknown"
rootfs-creation-time: "2018-04-19T16:19:30.254610305+0000Z"
description: "osbuilder rootfs"
file-format-version: "0.0.1"
architecture: "x86_64"
base-distro:
name: "Centos"
version: "7"
packages:
- "iptables"
- "systemd"
agent:
url: "https://github.com/kata-containers/agent"
name: "kata-agent"
version: "0.0.1-2ec0b9593845b9a5e0eab5a85b20d74c35a2ca52-dirty"
agent-is-init-daemon: "no"
```
This change adds a new `-o` option to `rootfs.sh` for
specifying the version of osbuilder to the rootfs builder.
Fixes#35.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Removed `USE_DOCKER` from the initrd builder usage statement as that
builder does not use Docker.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
If the Clear Linux `OS_VERSION` is specified as `latest`,
resolve to an actual release number.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Add some checks to ensure function parameters are set.
This fixes a bug `copy_kernel_modules()` where a test would never
fail due to missing dollars.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
For consistency with the rest of the code, put the opening brace on the
line below the function name.
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>