[elbe-devel] [PATCH 1/2] elbeproject: split build_cdroms() out of build()

Manuel Traut manut at linutronix.de
Fri Jun 8 11:29:43 CEST 2018


this allows building cdroms at different stages in the future.
e.g. after building the sysroot, to include the dev packages
on the cdroms.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbeproject.py | 55 ++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 26 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index de188d03..c54db92d 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -333,6 +333,34 @@ class ElbeProject (object):
         # pdebuild_build(-1) means use all cpus
         self.pdebuild_build(cpuset=-1)
 
+
+    def build_cdroms(self, build_bin=True, build_sources=False, cdrom_size=None):
+        self.repo_images = []
+        with self.buildenv:
+            init_codename = self.xml.get_initvm_codename()
+            if build_bin:
+                self.repo_images += mk_binary_cdrom(self.buildenv.rfs,
+                                                    self.arch,
+                                                    self.codename,
+                                                    init_codename,
+                                                    self.xml,
+                                                    self.builddir,
+                                                    self.log,
+                                                    cdrom_size=cdrom_size)
+            if build_sources:
+                try:
+                    self.repo_images += mk_source_cdrom(self.buildenv.rfs,
+                                                        self.arch,
+                                                        self.codename,
+                                                        init_codename,
+                                                        self.builddir,
+                                                        self.log,
+                                                        cdrom_size=cdrom_size,
+                                                        xml=self.xml)
+                except SystemError as e:
+                    # e.g. no deb-src urls specified
+                    self.log.printo(str(e))
+
     def build(self, skip_debootstrap=False, build_bin=False,
               build_sources=False, cdrom_size=None, debug=False,
               skip_pkglist=False, skip_pbuild=False):
@@ -489,32 +517,7 @@ class ElbeProject (object):
             grub_fw_type = ""
         self.targetfs.part_target(self.builddir, grub_version, grub_fw_type)
 
-        # Build cdrom images
-        self.repo_images = []
-        with self.buildenv:
-            init_codename = self.xml.get_initvm_codename()
-            if build_bin:
-                self.repo_images += mk_binary_cdrom(self.buildenv.rfs,
-                                                    self.arch,
-                                                    self.codename,
-                                                    init_codename,
-                                                    self.xml,
-                                                    self.builddir,
-                                                    self.log,
-                                                    cdrom_size=cdrom_size)
-            if build_sources:
-                try:
-                    self.repo_images += mk_source_cdrom(self.buildenv.rfs,
-                                                        self.arch,
-                                                        self.codename,
-                                                        init_codename,
-                                                        self.builddir,
-                                                        self.log,
-                                                        cdrom_size=cdrom_size,
-                                                        xml=self.xml)
-                except SystemError as e:
-                    # e.g. no deb-src urls specified
-                    self.log.printo(str(e))
+        self.build_cdroms(build_bin, build_sources, cdrom_size)
 
         if self.postbuild_file:
             self.log.h2("postbuild script:")
-- 
2.17.1




More information about the elbe-devel mailing list