[elbe-devel] [PATCH] Add posibility to define squashfs package options
Daniel Braunwarth
daniel at braunwarth.dev
Fri Jan 7 10:16:55 CET 2022
This patch adds the possibility to define squashfs package options.
The defined options are appended to the mksquashfs command.
This patch fixes #316.
Signed-off-by: Daniel Braunwarth <daniel at braunwarth.dev>
---
elbepack/efilesystem.py | 8 ++++++--
schema/dbsfed.xsd | 7 +++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 496a9df52..bf5d4c403 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -467,8 +467,12 @@ class TargetFs(ChRootFilesystem):
sfs_name = self.xml.text("target/package/squashfs/name")
os.chdir(self.fname(''))
try:
- do("mksquashfs %s %s/%s -noappend -no-progress" %
- (self.fname(''), targetdir, sfs_name))
+ options = ''
+ if self.xml.has("target/package/squashfs/options"):
+ options = self.xml.text("target/package/squashfs/options")
+
+ do("mksquashfs %s %s/%s -noappend -no-progress %s" %
+ (self.fname(''), targetdir, sfs_name, options))
# only append filename if creating mksquashfs was successful
self.images.append(sfs_name)
except CommandError:
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index 26c43dbe8..5c11f94fa 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1762,6 +1762,13 @@
</documentation>
</annotation>
</element>
+ <element name="options" type="rfs:string" minOccurs="0">
+ <annotation>
+ <documentation>
+ options passed to the mksquashfs command
+ </documentation>
+ </annotation>
+ </element>
</all>
<attribute ref="xml:base"/>
</complexType>
--
2.34.1
More information about the elbe-devel
mailing list