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>
The initrd image name should be kata-containers-initrd.img,
as its referenced by this name later on.
Fixes#14
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
This patch introduces a bash library (scripts/lib.sh) that concentrates
common functions. This also enhances future additions of other OSes, making
it more simple. Also, new variables were introduced in each distro config.sh
in order to parameterise the creation of package manager config (dnf/yum, in this case).
A fix to the resulting rootfs directory name (include OS name) is also fixed in this
patch.
Fixes#39Fixes#34
Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
template rootfs creation fails:
$make -f template/Makefile ROOTFS_BASE_NAME=opensuse
<....>
sed: can't read Dockerfile.template: No such file or directory
make is unable to find Dockerfile.template, this patch fixes this.
Fixes#67.
Signed-off-by: Nirmoy Das <ndas@suse.de>
There is no way to specify the remaining free space of the root partition.
It can vary depending on the upper bound size of the image aligned to 128MB
and the size of the root filesystem.
The following patch allow the user to specify that at least a certain amount
of space (defined in MB) will be kept in the root partition.
Fixes: #45
Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
When user manually specifies root disk image
size the value should be greater than 0.
Fixes : #57
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
kata agent is installed in `${ROOTFS}/usr/bin/` rather than `${ROOTFS}/bin/`.
It just happended to work because `bin` is a symlink to `usr/bin`, which
might not be true in some distros. So do not rely on it.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Changed image-builder/image_builder.sh to
automatically calculate the size of the root disk
Fixes#25.
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
Caller of rootfs.sh can define `KERNEL_MODULES_DIR` as a kernel
module directory and then the directory will be copied to
`/lib/modules/` of the created rootfs. This allows additional
kernel modules to be put into rootfs image and initrd image.
Signed-off-by: Peng Tao <bergwolf@gmail.com>