Commit Graph

6 Commits

Author SHA1 Message Date
James O. D. Hunt
3151f35c86 rootfs: Add extra packages to summary file
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>
2018-05-14 14:39:49 +01:00
James O. D. Hunt
f90f65247e rootfs: Create a summary file inside the image
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>
2018-04-20 11:46:55 +01:00
James O. D. Hunt
93b632c328 lib: Check rootfs parameter
Add a check on the rootfs parameter in `build_rootfs()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 11:17:55 +01:00
James O. D. Hunt
f17b5c29f3 scripts/lib: Fix whitespace
Make whitespace consistent.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
019a80f304 refactor: Move more functions to script library
Moved the display functions to the script library to avoid duplication.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 08:29:23 +01:00
Erick Cardona
52022701db rootfs-builder: Refactor rootfs.sh
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 #39
Fixes #34

Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
2018-03-26 16:34:11 -06:00