[elbe-devel] [PATCH v2 10/12] command init: add --skip-build-* options and pass to buildrepo
Torben Hohn
torben.hohn at linutronix.de
Mon Nov 12 17:43:11 CET 2018
allow speeding up initvm creation, by passing these option to buildrepo.
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
Signed-off-by: Manuel Traut <manut at linutronix.de>
Reviewed-by: Manuel Traut <manut 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 e43307e4..3bb36551 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 e9c9e620..81f6b454 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} fetch_initvm_pkgs --cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0 /var/cache/elbe/source.xml
+ in-target ${elbe_exe} fetch_initvm_pkgs ${buildrepo_opts} --cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0 /var/cache/elbe/source.xml
% else:
- in-target ${elbe_exe} fetch_initvm_pkgs /var/cache/elbe/source.xml
+ in-target ${elbe_exe} fetch_initvm_pkgs ${buildrepo_opts} /var/cache/elbe/source.xml
% endif
exit 0
--
2.11.0
More information about the elbe-devel
mailing list