[elbe-devel] [PATCH 2/3] command init: add --skip-build-* options and pass to buildrepo
Torben Hohn
torben.hohn at linutronix.de
Fri Oct 12 11:32:39 CEST 2018
allow speeding up initvm creation, by passing these option to buildrepo.
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/commands/init.py | 14 ++++++++++++++
elbepack/init/init-elbe.sh.mako | 12 ++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 27c2332d..7b0329f6 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -73,6 +73,20 @@ def run_command(argv):
help="allow initvm to support nested kvm. "
"This makes /proc/cpuinfo inside initvm differ per host.")
+ oparser.add_option(
+ "--skip-build-bin",
+ action="store_false",
+ dest="build_bin",
+ default=True,
+ help="Skip building Binary Repository CDROM, for exact Reproduction")
+
+ oparser.add_option(
+ "--skip-build-sources",
+ action="store_false",
+ dest="build_sources",
+ default=True,
+ help="Skip building Source CDROM")
+
(opt, args) = oparser.parse_args(argv)
if not args:
diff --git a/elbepack/init/init-elbe.sh.mako b/elbepack/init/init-elbe.sh.mako
index 70356cf7..74702400 100644
--- a/elbepack/init/init-elbe.sh.mako
+++ b/elbepack/init/init-elbe.sh.mako
@@ -11,6 +11,14 @@ elbe_exe = 'elbe'
if opt.devel:
elbe_exe = '/var/cache/elbe/devel/elbe'
+
+buildrepo_opts = ''
+
+if not opt.build_bin:
+ buildrepo_opts += '--skip-build-bin'
+
+if not opt.build_sources:
+ buildrepo_opts += '--skip-build-source'
%>
# First unset the variables which are set by the debian-installer
@@ -48,9 +56,9 @@ cp vmlinuz /buildenv/var/cache/elbe/installer
in-target haveged
% if prj.has("mirror/cdrom"):
- in-target ${elbe_exe} buildrepo --cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0 /var/cache/elbe/source.xml
+ in-target ${elbe_exe} buildrepo ${buildrepo_opts} --cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0 /var/cache/elbe/source.xml
% else:
- in-target ${elbe_exe} buildrepo /var/cache/elbe/source.xml
+ in-target ${elbe_exe} buildrepo ${buildrepo_opts} /var/cache/elbe/source.xml
% endif
exit 0
--
2.11.0
More information about the elbe-devel
mailing list