Commit Graph

115 Commits

Author SHA1 Message Date
Stefan Hajnoczi
fd8d9bdc2c rootfs: copy kernel modules to correct location
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>
2018-05-16 17:41:29 +01:00
Julio Montes
8de92c03c9
Merge pull request #93 from jodh-intel/add-extra-pkgs-to-summary
rootfs: Add extra packages to summary file
2018-05-16 10:28:11 -05:00
Peng Tao
be77118243
Merge pull request #91 from Pennyzct/agent_version
rootfs.sh: Add "${AGENT_VERSION}"/"-a" functionality
2018-05-16 16:05:24 +08:00
Penny Zheng
7732e0407a rootfs: Fix incorrect getopts call
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>
2018-05-16 03:14:35 +00:00
Penny Zheng
f7f267213c rootfs: Add "${AGENT_VERSION}"/"-a" functionality
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>
2018-05-16 03:14:25 +00:00
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
Peng Tao
49e3f814bc
Merge pull request #86 from Pennyzct/gopath
kata/osbuilder: Add support for multiple GOPATH directories
2018-04-27 19:11:23 +08:00
Penny Zheng
c3ac7180f8 rootfs: Add support for multiple GOPATH directories
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>
2018-04-27 02:44:43 +00:00
Graham Whaley
35269d2db4
Merge pull request #88 from stefanha/fix-paratition-typo
image-builder: fix "paratition" typo
2018-04-26 11:15:36 +01:00
Stefan Hajnoczi
32aee00673 image-builder: fix "paratition" typo
Fixes: #89
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-04-26 10:26:06 +01:00
James O. D. Hunt
cc33986bef
Merge pull request #85 from jodh-intel/improve-top-README
docs: Add a Usage section
2018-04-26 08:52:28 +01:00
James O. D. Hunt
3c19ea413e docs: Add a Usage section
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>
2018-04-26 08:06:44 +01:00
James O. D. Hunt
3e0e112e2b docs: Move TOC to top
Move the table of contents to the top of the page.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-23 09:16:16 +01:00
Jose Carlos Venegas Munoz
a099eafc60
Merge pull request #83 from jodh-intel/create-summary-file
refactor and create a summary file inside the image
2018-04-20 13:57:57 -05: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
b14d117a89 image-builder: Fix incorrect error message
Fixed an error message which was referring to an incorrect rootfs
variable name.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 11:17:15 +01:00
James O. D. Hunt
ddb71e8ef5 initrd: Remove mention of USE_DOCKER
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>
2018-04-20 11:17:02 +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
5b6ced536b rootfs/clearlinux: Resolve version
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>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
a2a65621a1 rootfs: Simplify code
Use more variables to avoid duplication and make the code cleaner.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
b8f1a68834 rootfs: Simplify code
Use a variable in `copy_kernel_modules()` to avoid the duplicated
string.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
f09d4c4626 rootfs: Check function parameters
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>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
2751de0768 rootfs: Reformat functions
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>
2018-04-20 08:29:27 +01:00
James O. D. Hunt
48b1ddabed rootfs: Fix comments
Improve a few comments and fix a typo.

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
James O. D. Hunt
a18753b2ff refactor: Remove duplicate variable
Some of the scripts had two variables to refer to the program name.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-19 16:00:37 +01:00
James O. D. Hunt
f3e89d38a9 refactor: Simplify enabling debug
Simplify the logic to enable debug and also enable debug as early as
possible.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-04-19 15:55:34 +01:00
Eric Ernst
2b2b68d6fa
Merge pull request #63 from erick0z/erick0z/refactor_rootfs_script
rootfs-builder: Refactor rootfs.sh
2018-04-04 07:39:11 -07:00
James O. D. Hunt
1c45f4f666
Merge pull request #79 from nitkon/patch-1
initrd-builder: fix initrd image name
2018-04-04 13:51:15 +01:00
Nitesh Konkar
6930c24d14 initrd-builder: fix initrd image name
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>
2018-04-04 17:55:32 +05:30
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
Salvador Fuentes
ae8a849b32
Merge pull request #76 from grahamwhaley/20180323_tests_repo
ci: lib: allow override of tests_repo
2018-03-23 08:51:19 -06:00
Julio Montes
d469cffc7a
Merge pull request #75 from harche/env_args_docker
Pass EXTRA_PKGS var to docker to build rootfs
2018-03-23 08:40:13 -05:00
Graham whaley
93146d91dc ci: lib: allow override of tests_repo
Only set the tests_repo url to the default if it is not
set already.

Fixes: #71

Signed-off-by: Graham whaley <graham.whaley@intel.com>
2018-03-23 09:54:59 +00:00
Graham Whaley
ee4a91a60a
Merge pull request #73 from harche/golang_fix
Install the right golang binaries for ppc64le
2018-03-23 09:35:49 +00:00
Harshal Patil
2972a33535 rootfs: Install the right golang binaries for ppc64le
On ppc64le golang binaries should be pulled correctly

Fixes #72

Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
2018-03-23 14:06:11 +05:30
Harshal Patil
7043e19671 rootfs: Pass EXTRA_PKGS var to docker to build rootfs
When docker is used for building rootfs the
EXTRA_PKGS should be passed as env var

Fixes #74

Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
2018-03-23 14:02:13 +05:30
James O. D. Hunt
d0b3cf6d36
Merge pull request #70 from bergwolf/build
allow to build image and initrd based on existing rootfs
2018-03-22 16:39:16 +00:00
Peng Tao
6e1f2e063d Makefile: allow to build image and initrd based on existing rootfs
Just so that we do not have to re-build rootfs every time for local
build/testing.

Fixes: #69

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-22 23:20:53 +08:00
Peng Tao
56ab8c99fe initrd-builder: fix ROOTFS_DIR typo
It should be just ROOTFS.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-22 23:18:07 +08:00
Julio Montes
0736e06193
Merge pull request #66 from jodh-intel/ci-fix-setup
CI: Make setup script fail on error
2018-03-20 09:36:13 -05:00
James O. D. Hunt
90d7b4dad6 CI: Make setup script fail on error
Run the `.ci/setup.sh` script with `set -e` to ensure all failures are
fatal.

Fixes #65.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-01 17:44:12 +00:00
James O. D. Hunt
6899dec884
Merge pull request #64 from nirmoy/fix_template_make
makefile: fix makefile to find Dockerfile.template
2018-03-01 17:41:12 +00:00
James O. D. Hunt
56eb88b8dd
Merge pull request #56 from liangchenye/time
skip euleros build due to timeout reason
2018-03-01 16:04:11 +00:00
Nirmoy Das
b21db8fc79 makefile: fix makefile to find Dockerfile.template
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>
2018-02-26 11:24:49 +01:00
Liang Chenye
55f0324878 skip euleros build due to timeout reason
Fixes #46.

Signed-off-by: Liang Chenye <liangchenye@huawei.com>
2018-02-22 10:02:44 +08:00
James O. D. Hunt
ec738d46c1
Merge pull request #61 from devimc/rootfs/arm
rootfs-builder: ARM64 support
2018-02-19 09:35:14 +00:00
Jose Carlos Venegas Munoz
eb3712a075
Merge pull request #62 from erick0z/erick0z/image_size
image-builder: Allow to specify root partition free space
2018-02-15 21:41:21 -06:00
Erick Cardona
ea4063095d image-builder: Allow to specify root partition free space
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>
2018-02-14 14:52:25 -06:00