Commit Graph
137 Commits
Author SHA1 Message Date
Reagan Lopez 159e8c1ee4 Updated artifacts for initramfs creation rootfs-v2.00 2018-03-21 04:59:08 +00:00
Reagan Lopez a65e836677 Experimentation code for dm-verity on rootfs data partition
- used systemd-veritysetup-generator
- kernel panic. not good.
rootfs-v1.00
2018-03-21 03:31:38 +00:00
Reagan Lopez 471f90709f Removed need for veritysetup in the target image 2018-03-21 01:33:25 +00:00
Reagan Lopez 3ad9948a76 Updated the ister config file to remove extra storedev partition v10.00 2018-03-21 01:23:05 +00:00
Reagan Lopez 75d1375f2b Modified artifacts for verifying non-rootfs data partition
using the kernel command line parameters solution.
2018-03-20 22:16:33 +00:00
Reagan Lopez 05e93fbd1e Updated the kernel command line parameters 2018-03-20 20:11:18 +00:00
Reagan Lopez 34a28029b8 Added new code to create initramfs 2018-03-15 06:32:13 +00:00
Reagan Lopez f1c374b7fc Modified code to pass veritysetup commands as kernel commandline options 2018-03-09 02:04:05 +00:00
Reagan Lopez f0c485e4a1 Experimental: Added code to modify kernel cmdline parameters 2018-03-03 04:08:45 +00:00
Reagan Lopez 1e38a3c919 Renamed files.
Fixed block size issue.
2018-03-01 02:42:42 +00:00
Reagan Lopez c963c72426 Added new program to streamline dmverity implementation 2018-02-28 08:46:44 +00:00
Reagan Lopez 60c253f34c Updated code to write veritysetup create command to store_dev partition. 2018-02-25 22:20:25 +00:00
Reagan Lopez 12c6e6feb1 Corrected the code to write data files.
Updated image config file to include store_dev partition.
Updated code to write hash and salt to the store_dev partition.
2018-02-23 10:01:37 +00:00
Reagan Lopez 266cbd3de5 Updated code to create dummy files in data_dev 2018-02-23 05:59:28 +00:00
Reagan Lopez e93ef490e9 Added loopdev-poc script 2018-02-22 18:42:21 +00:00
Reagan Lopez e2bee1bc96 Initial commit for dm-verity 2018-02-06 02:27:20 +00:00
Tudor Marcu 45fc288cfb Release v3.2.1
This release fixes a bug where UPSTREAM_URL was not substituted in the
yum config, updates the Makefile providing better options, introduces a
travis config for the repo, creates a separate ister statedir for
build-image to not conflict with the system's main statedir, and updates
the package structure to follow regular Go conventions.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.2.1
2017-12-21 12:53:29 -08:00
Tudor Marcu ac2ef5b9b8 Add travis config
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-12-21 12:55:09 -08:00
Caio Marcelo de Oliveira Filho af76e073ca Add a 'make check' target to the Makefile
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-12-21 12:17:33 -08:00
Caio Marcelo de Oliveira Filho 3389b9794b Keep the version number in a single place
Create a const in the mixer/main.go and let the release target grab
it, instead of keeping the release number in two places.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-12-21 12:17:33 -08:00
Caio Marcelo de Oliveira Filho c78013af3d Change Makefile to create its own GOPATH when needed
When not being called from inside of what looks like a GOPATH, create
a local directory to use as GOPATH. The Makefile now will work
correctly with the generated release tarball.

Also done a few other cleanups in the Makefile.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-12-21 12:17:33 -08:00
Tudor Marcu aab6e7cca9 Always set UPSTREAM_URL
This was not set in the codepath where a user does not have a local
rpmdir defined. It must always be substituted else yum will fail because
the URL is incorrect.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-12-21 11:44:06 -08:00
Caio Marcelo de Oliveira Filho 1eda116165 builder: create a temp dir and use as stage dir for ister
Mixer calls ister, that calls swupd (client), that uses a staging
directory to cache downloaded files. If not specified, it defaults to
the system one, which is not what we want, since the system might not
be using the mix we are creating.

Without passing this, build-image works only if there is no conflict
with some previous version (from any stream) that it used before.

Fix based on diagnostic by Tudor and William.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-12-19 14:40:31 -08:00
Tudor Marcu 9607078d6d Update mixer-tools structure and Makefile
Follow the expected Go convention for packages, and put the project
under github.com/clearlinux/mixer-tools with the correct hierarchy.
Simplify Makfile for the time being.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-12-18 17:12:15 -08:00
Rodrigo Chiossi 3b8397ba9f Preserve GOPATH in Makefile
When building or testing, the existing GOPATH must be preserved for
dependencies to be found outside the project. This allows "go get" to be
used to download dependencies without mixing them with the project
source.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2017-12-15 18:18:35 -08:00
Tudor Marcu 5e115d99d2 Release v3.2.0
This release introduces several new features:
- Upstream url and version are saved in the respective
mixver directory to retain history of where content may have come
from.
- Environment variables are now usable in the builder.conf to do things
such as $HOME/mix/update.
- A new command 'add-bundles' is added which handles
copying over upstream bundle definitions into mix-bundles, while resolving
includes and pulling them in automatically.
- Error fixes for handling http get status codes.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.2.0
2017-12-09 22:47:58 -08:00
Tudor Marcu 742280e934 builder: Do not require .clearurl to exist
This is not a required file by mixer so it should not exit if it does not
exist. Only print out that we're saving it if we actually passed in an
upstream url on the cmd line.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-12-08 17:42:31 -08:00
Kevin C. Wells 8b5ee4ee76 Add -all flag to mixer add-bundles
Adds support for an '-all' flag to mixer add-bundles.
This flag takes precedence over the list passed with
the '-bundles' flag, and still supports '-force' and
'-git' options.

Note: this commit also passes the '-q' ('--quiet')
flag to git when making a commit, supressing the
potentially long output.
2017-12-08 15:59:17 -08:00
Mark Horn d4975e3d94 Save Mixer Upstream URL and Version
In order to known if there have been format bumps of the
version of ClearLinux this mix is based upon (upstream),
both the source URL and version will be needed.

Signed-off-by: Mark Horn <mark.d.horn@intel.com>
2017-12-08 15:58:37 -08:00
Mark Horn 044f11e8aa Enable Environment Variables in Configuration File
This code change enables the use of Linux Environment
variables in the configuration file. This is very useful
for paths to avoid having to hard-code paths.

Added Environment Variable Checking

For proper use, it will also require a similar patch to
the bundle-chroot-builder project.

See https://github.com/clearlinux/bundle-chroot-builder/pull/12

Signed-off-by: Mark Horn <mark.d.horn@intel.com>
2017-12-08 15:57:38 -08:00
Caio Marcelo de Oliveira Filho 0f0497d0ec helpers: check http.Get status code
Also change the caller code to show what error happened: useful to
distinguish 404 from timeouts. The PrintErrors were removed, since
they were leading to duplicated errors in the output, letting the
caller print the error message is enough.

This fixes the issue of writing invalid files (without error) if the
.clearversion do not exist. The contents would have the actual error
code.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-12-05 10:53:58 -08:00
Mark Horn 3db87b7093 Add new args for build-image
build-image wants a builder.conf file, but the -config option was
missing from this command.

build-image assumed the template file was a hard coded name; added
functionality to pass through with new -template argument.

Signed-off-by: Mark Horn <mark.d.horn@intel.com>
2017-12-01 10:30:27 -08:00
Kevin C. Wells 214149f12c Add mixer add-bundles command
Adds new "mixer add-bundles" command to automate the
addition of bundles to the mix-bundles/ directory.

Currently, adding bundles to your mix means copying
them manually from the pulled
clear-bundles/clear-bundles-<VER>/bundles/ dir to your
mix-bundles/ dir. This is a manual process, and thus
following bundle dependencies (i.e., “include
(other-bundle)”) is a manual process.

This new command parses the requested bundle definitions
and recursively copies bundles into your mix dir. Skips
(with warning) by default if present, or overwrites with
optional "-force" flag. Also optionally auto git commits
new bundle addition with "-git" flag.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2017-11-28 12:27:09 -08:00
Tudor Marcu 6c1c038896 Release v3.1.0
This release adds fixes to remove unsuccessful curl download files,
merges the git helper functions into a generic one to use for all future
git commands, and rewrites the cmd-line code to a more maintainable and
extensible implementation.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.1.0
2017-08-24 15:30:18 -07:00
Caio Marcelo de Oliveira Filho 01bb863c3f Call check dependencies before doing work
Changed it to be a function in main.go instead of a method since it
wasn't using anything related to the Builder struct.

Minor tweaks to make code more idiomatic: avoid i for the non-index
variable in range, return an error instead of printing the error and
boolean.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 15:13:24 -07:00
Caio Marcelo de Oliveira Filho 149c17434a builder: remove the Get method
The method (and use of reflect package) is unnecessary when we are
using a literal string as argument.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 15:13:24 -07:00
Caio Marcelo de Oliveira Filho 4270a98458 Move command implementation to their own functions
Instead of having the flag specification, flag parsing, and command
processing in three different parts of the main function, move the
whole code for each command to its own function.

This patch also fixes the issue that build-all was always using the
default values of the flags, since the build-update specific flags
were not being added to its FlagSet. The problem was hard to see
because all commands shared the same scope.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 15:13:24 -07:00
Caio Marcelo de Oliveira Filho 90baf5a7b4 Avoid interface{} when not needed
Create a New variant that takes a configuration and returns a Builder
instead.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 15:13:24 -07:00
Caio Marcelo de Oliveira Filho 966ad1a646 Provide a help (and -h) command
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 15:13:24 -07:00
Tudor Marcu c2e09da997 Update comments to account for future use
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-08-24 14:59:34 -07:00
Caio Marcelo de Oliveira Filho 738910ecf3 Merge git helper functions into one
And also dump the Stderr of the command to os.Stderr. Without a git
failure might not give enough information about what gone wrong,
e.g. when trying to call "git commit" without a user.email configured.

The commit message was changed to include the Clear version from which
the Mix was based off.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-24 14:55:41 -07:00
Caio Marcelo de Oliveira Filho 9c21172ea4 When HTTP download fails, don't keep the file around
Only create the file if the HTTP connection succeeds, and in case of
failure later on during download, remove the partial file.

This let the user retries the operation, otherwise the empty/partial
file will prevent the download. One of such cases is forgetting to set
the https_proxy.

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2017-08-23 15:23:51 -07:00
Tudor Marcu f5c5726562 Release v3.06
This release fixes mixer to use absolute path for certificates so that
it can be run from different directories other than the workspace.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.06
2017-08-09 14:31:21 -07:00
Tudor Marcu d56bec40d7 Use absolute path for certificates
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-08-09 14:31:14 -07:00
Tudor Marcu 8cb61dff16 Release v3.05
This release updates the name of the release tarball to 'mixer-tools',
and adds better validation to the version file reading.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.05
2017-06-19 11:54:50 -07:00
Tudor Marcu a5eb816642 Change compressed name to 'mixer-tools'
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-06-19 11:45:58 -07:00
Tudor Marcu 2698d5017e Strip newline from version files
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-06-19 11:45:58 -07:00
Tudor Marcu ed401599ff Release v3.04
This release changes add-rpms to hardlink instead of copy if possible,
speeding up the operation when there are many local rpms, and falls back to
a regular copy if hardlinking fails.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.04
2017-05-25 14:14:47 -07:00
Tudor Marcu c2990fc2b7 Hardlink rpms when calling add-rpms
To save time on copying fullfiles, just make a hardlink from the files in
RPMDIR to the REPODIR.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-05-25 14:15:30 -07:00
Patrick McCarty 8c76142781 Release v3.03
This release fixes a bug for compatibility with the swupd-client v3.8.3
release; the /usr/share/clear/update-ca directory must now be manually
created in the os-core-update bundle before installing the certificate.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v3.03
2017-03-14 11:21:09 -07:00