mirror of
https://github.com/clearlinux/bundle-chroot-builder.git
synced 2026-07-14 00:17:01 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b44cd8c2c6 | |||
| 8468405d9a | |||
| 2024792039 | |||
| 4afdbd6c8e | |||
| 2f17b8187e | |||
| df44fd82f0 | |||
| 2b92b2eff2 | |||
| e6e3bab777 | |||
| ff6a30cc43 |
@@ -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
|
Configuration File
|
||||||
==================
|
==================
|
||||||
Please update the configuration file paths to point to where your
|
Please update the configuration file paths to point to where your
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import argparse
|
|||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import io
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
@@ -54,9 +55,20 @@ def get_config(args):
|
|||||||
if args.config:
|
if args.config:
|
||||||
buildconf = args.config
|
buildconf = args.config
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
print("Reading from %s" % buildconf)
|
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
|
return config
|
||||||
|
|
||||||
|
|
||||||
@@ -237,12 +249,21 @@ def create_chroots(args, state_dir, bundles, yum_conf):
|
|||||||
|
|
||||||
out_dir = state_dir + "/image/" + out_version
|
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")
|
print("using dnf instead of yum")
|
||||||
packager = ["dnf"]
|
packager = ["dnf"]
|
||||||
else:
|
else:
|
||||||
packager = ["yum"]
|
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:
|
if 'local' in config == False:
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen(conf_baseurl)
|
urllib.request.urlopen(conf_baseurl)
|
||||||
@@ -288,7 +309,7 @@ def create_chroots(args, state_dir, bundles, yum_conf):
|
|||||||
|
|
||||||
print("Noting os-core package list")
|
print("Noting os-core package list")
|
||||||
with open(out_dir + "/versions", "w") as file:
|
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:
|
with open(out_dir + "/packages-os-core", "w") as file:
|
||||||
subprocess.Popen(['rpm', '--root={}/os-core'.format(out_dir),
|
subprocess.Popen(['rpm', '--root={}/os-core'.format(out_dir),
|
||||||
'-qa', '--queryformat', '%{NAME}\t%{SOURCERPM}\n'], stdout=file).wait()
|
'-qa', '--queryformat', '%{NAME}\t%{SOURCERPM}\n'], stdout=file).wait()
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
AC_PREREQ([2.68])
|
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])
|
AM_INIT_AUTOMAKE([foreign silent-rules color-tests no-dist-gzip dist-xz])
|
||||||
AC_CONFIG_FILES(Makefile)
|
AC_CONFIG_FILES(Makefile)
|
||||||
AC_PREFIX_DEFAULT(/usr/local)
|
AC_PREFIX_DEFAULT(/usr/local)
|
||||||
|
|||||||
Reference in New Issue
Block a user