Compare commits

...

9 Commits

Author SHA1 Message Date
Patrick McCarty b44cd8c2c6 Release v1.15
This release adds support for using DNF on Clear Linux.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-02-13 15:22:29 -08:00
Patrick McCarty 8468405d9a Add support for DNF on Clear Linux
DNF enablement was completed in Clear Linux builds > 20650, so
autodetect whether yum or DNF should be used for chroot creation when
running on Clear Linux.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-02-13 11:43:59 -08:00
Tudor Marcu 2024792039 Release v1.14
Suppress extra yum plugin output.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-02-01 11:24:56 -08:00
George T Kramer 4afdbd6c8e Filter yum output for parsing with yum plugins
Dependeing if plugins are enabled when yum is directed to honor plugin
usage, the output from yum list changes, and has the potential to break
the creation of the versions file.  Suppressing this additional plugin
output by operating yum in quiet mode avoids this risk.

Signed-off-by: George T Kramer <george.t.kramer@intel.com>
2018-02-01 11:19:01 -08:00
Tudor Marcu 2f17b8187e Release v1.13
This release enables yum plugin usage in bundle-chroot-builder.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-01-17 13:53:49 -08:00
George T Kramer df44fd82f0 Allow yum plugin usage
When doing a yum install, plugins should be able to modify how this
operation is performed.  Allowing the use of a priority plugin, or a
fastest mirror plugin, or other possibly useful plugins would be up to
the user and dependent on the yum configuration they use for building
the chroot for their bundles.

Signed-off-by: George T Kramer <george.t.kramer@intel.com>
2018-01-17 13:45:37 -08:00
Tudor Marcu 2b92b2eff2 Release v1.12
This release enables using environment variables in the builder.conf,
and adds a README for making/installing the program.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-01-04 11:44:55 -08:00
Mark Horn e6e3bab777 Added basic build instructions
Add the basic steps for building and installing this project.

Signed-off-by: Mark Horn <mark.d.horn@intel.com>
2018-01-04 10:15:43 -08:00
Mark Horn ff6a30cc43 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 error checking on the environment variables.

For proper use, it will also require a similar patch to
the mixer-tools project.

Signed-off-by: Mark Horn <mark.d.horn@intel.com>
2018-01-02 09:47:13 -08:00
3 changed files with 47 additions and 6 deletions
+20
View File
@@ -1,3 +1,23 @@
Building this Project
=====================
For help using automake see
http://www.gnu.org/software/automake/manual/html_node/index.html
Configure:
aclocal
autoconf
automake --add-missing
# Defaults to /usr/local or specific --prefix=/usr
# to overwrite the installed version
./configure
Build:
make
Install:
make -n install
sudo make install
Configuration File
==================
Please update the configuration file paths to point to where your
+26 -5
View File
@@ -25,6 +25,7 @@ import argparse
import configparser
import os
import os.path
import io
import platform
import re
import shutil
@@ -54,9 +55,20 @@ def get_config(args):
if args.config:
buildconf = args.config
config = configparser.ConfigParser()
print("Reading from %s" % buildconf)
config.read(buildconf)
cfg_txt = ""
# Check that the environment variables in the config file are valid
pattern = re.compile("\$\{?(\w+)\}?")
for i, line in enumerate(open(buildconf, 'r')):
for match in re.finditer(pattern, line):
if not match.group(1) in os.environ:
print("ERROR:\nbuilder.conf contains an undefined environment variable: %s on line %s\n"
% (i+1, match.group(1)))
exit(1)
cfg_txt += os.path.expandvars(line)
config = configparser.ConfigParser()
config.readfp(io.StringIO(cfg_txt))
return config
@@ -237,12 +249,21 @@ def create_chroots(args, state_dir, bundles, yum_conf):
out_dir = state_dir + "/image/" + out_version
if platform.dist()[0] == "fedora" and int(platform.dist()[1]) >= 22:
try:
with open("/usr/share/clear/version", "r") as verfile:
clrver = int(verfile.read().strip())
except Exception:
clrver = None
if clrver and clrver > 20650:
print("using dnf on clr")
packager = ["dnf"]
elif platform.dist()[0] == "fedora" and int(platform.dist()[1]) >= 22:
print("using dnf instead of yum")
packager = ["dnf"]
else:
packager = ["yum"]
yum_cmd = packager + ["--config={}".format(yum_conf), "-y", "--noplugins", "--releasever={}".format(build_version)]
yum_cmd = packager + ["--config={}".format(yum_conf), "-y", "--releasever={}".format(build_version)]
if 'local' in config == False:
try:
urllib.request.urlopen(conf_baseurl)
@@ -288,7 +309,7 @@ def create_chroots(args, state_dir, bundles, yum_conf):
print("Noting os-core package list")
with open(out_dir + "/versions", "w") as file:
subprocess.Popen(yum_cmd + ["--installroot={}/os-core".format(out_dir), "list"], stdout=file).wait()
subprocess.Popen(yum_cmd + ["--quiet", "--installroot={}/os-core".format(out_dir), "list"], stdout=file).wait()
with open(out_dir + "/packages-os-core", "w") as file:
subprocess.Popen(['rpm', '--root={}/os-core'.format(out_dir),
'-qa', '--queryformat', '%{NAME}\t%{SOURCERPM}\n'], stdout=file).wait()
+1 -1
View File
@@ -1,5 +1,5 @@
AC_PREREQ([2.68])
AC_INIT([bundle-chroot-builder],[1.11],[tudor.marcu@intel.com],[bundle-chroot-builder])
AC_INIT([bundle-chroot-builder],[1.15],[tudor.marcu@intel.com],[bundle-chroot-builder])
AM_INIT_AUTOMAKE([foreign silent-rules color-tests no-dist-gzip dist-xz])
AC_CONFIG_FILES(Makefile)
AC_PREFIX_DEFAULT(/usr/local)