[elbe-devel] [PATCH v2 4/6] src-cdrom: add size limit in XML

bage at linutronix.de bage at linutronix.de
Mon Sep 2 12:46:51 CEST 2019


From: Bastian Germann <bage at linutronix.de>

Add a size element to split the src-cdrom into several iso files.
Use this element with a lower priority than the --cdrom-size parameter.
Add such an element to the example with existing src-cdrom section.

Signed-off-by: Bastian Germann <bage at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/elbeproject.py    |  4 ++++
 examples/x86_64-docker.xml |  1 +
 schema/dbsfed.xsd          | 13 +++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 53f03986..0c2bbb33 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -23,6 +23,7 @@ from elbepack.rfs import BuildEnv
 from elbepack.rpcaptcache import get_rpcaptcache
 from elbepack.efilesystem import TargetFs
 from elbepack.efilesystem import extract_target
+from elbepack.filesystem import size_to_int
 
 from elbepack.dump import elbe_report
 from elbepack.dump import dump_debootstrappkgs, dump_initvmpkgs, dump_fullpkgs
@@ -454,6 +455,9 @@ class ElbeProject (object):
                                                     self.xml,
                                                     self.builddir)
             if build_sources:
+                if not cdrom_size and self.xml.has("src-cdrom/size"):
+                    cdrom_size = size_to_int(self.xml.text("src-cdrom/size"))
+
                 validation.info("Source CD %s", sysrootstr)
                 try:
                     self.repo_images += mk_source_cdrom(env.rfs,
diff --git a/examples/x86_64-docker.xml b/examples/x86_64-docker.xml
index 669bc3b0..c4cbbd61 100644
--- a/examples/x86_64-docker.xml
+++ b/examples/x86_64-docker.xml
@@ -37,6 +37,7 @@
 		</pkg-list>
 	</target>
 	<src-cdrom>
+		<size>50M</size>
 		<src-opts>
 			<publisher>TUX</publisher>
 		</src-opts>
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index 745abd5f..87fd9d08 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -2526,10 +2526,19 @@
       </documentation>
     </annotation>
     <all>
+      <element name="size" type="rfs:memory" minOccurs="0" maxOccurs="1">
+        <annotation>
+          <documentation>
+            The size limit for each source cdrom ISO image.
+            The files are distributed on several cdroms as needed.
+            Omitting this element means no size limit.
+          </documentation>
+        </annotation>
+      </element>
       <element name="src-opts" type="rfs:iso-opts" minOccurs="0" maxOccurs="1">
-	<annotation>
+        <annotation>
           <documentation>
-	    Give options for the source cdrom ISO image.
+            Options for the source cdrom ISO images.
           </documentation>
         </annotation>
       </element>
-- 
2.20.1




More information about the elbe-devel mailing list