summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/help.py1
-rw-r--r--scripts/lib/wic/ksparser.py7
-rw-r--r--scripts/lib/wic/partition.py16
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py6
4 files changed, 23 insertions, 7 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index bd3a2b97df..991e5094bb 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -930,6 +930,7 @@ DESCRIPTION
930 ext4 930 ext4
931 btrfs 931 btrfs
932 squashfs 932 squashfs
933 erofs
933 swap 934 swap
934 935
935 --fsoptions: Specifies a free-form string of options to be 936 --fsoptions: Specifies a free-form string of options to be
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 3eb669da39..7a4cc83af5 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -157,7 +157,8 @@ class KickStart():
157 part.add_argument('--fsoptions', dest='fsopts') 157 part.add_argument('--fsoptions', dest='fsopts')
158 part.add_argument('--fstype', default='vfat', 158 part.add_argument('--fstype', default='vfat',
159 choices=('ext2', 'ext3', 'ext4', 'btrfs', 159 choices=('ext2', 'ext3', 'ext4', 'btrfs',
160 'squashfs', 'vfat', 'msdos', 'swap')) 160 'squashfs', 'vfat', 'msdos', 'erofs',
161 'swap'))
161 part.add_argument('--mkfs-extraopts', default='') 162 part.add_argument('--mkfs-extraopts', default='')
162 part.add_argument('--label') 163 part.add_argument('--label')
163 part.add_argument('--use-label', action='store_true') 164 part.add_argument('--use-label', action='store_true')
@@ -229,6 +230,10 @@ class KickStart():
229 err = "%s:%d: SquashFS does not support LABEL" \ 230 err = "%s:%d: SquashFS does not support LABEL" \
230 % (confpath, lineno) 231 % (confpath, lineno)
231 raise KickStartError(err) 232 raise KickStartError(err)
233 # erofs does not support filesystem labels
234 if parsed.fstype == 'erofs' and parsed.label:
235 err = "%s:%d: erofs does not support LABEL" % (confpath, lineno)
236 raise KickStartError(err)
232 if parsed.fstype == 'msdos' or parsed.fstype == 'vfat': 237 if parsed.fstype == 'msdos' or parsed.fstype == 'vfat':
233 if parsed.fsuuid: 238 if parsed.fsuuid:
234 if parsed.fsuuid.upper().startswith('0X'): 239 if parsed.fsuuid.upper().startswith('0X'):
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 76d144d12d..e0b2c5bdf2 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -141,9 +141,9 @@ class Partition():
141 native_sysroot) 141 native_sysroot)
142 self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype) 142 self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
143 else: 143 else:
144 if self.fstype == 'squashfs': 144 if self.fstype in ('squashfs', 'erofs'):
145 raise WicError("It's not possible to create empty squashfs " 145 raise WicError("It's not possible to create empty %s "
146 "partition '%s'" % (self.mountpoint)) 146 "partition '%s'" % (self.fstype, self.mountpoint))
147 147
148 rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label, 148 rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
149 self.lineno, self.fstype) 149 self.lineno, self.fstype)
@@ -369,6 +369,16 @@ class Partition():
369 (rootfs_dir, rootfs, extraopts) 369 (rootfs_dir, rootfs, extraopts)
370 exec_native_cmd(squashfs_cmd, native_sysroot, pseudo=pseudo) 370 exec_native_cmd(squashfs_cmd, native_sysroot, pseudo=pseudo)
371 371
372 def prepare_rootfs_erofs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir,
373 native_sysroot, pseudo):
374 """
375 Prepare content for a erofs rootfs partition.
376 """
377 extraopts = self.mkfs_extraopts or ''
378 erofs_cmd = "mkfs.erofs %s -U %s %s %s" % \
379 (extraopts, self.fsuuid, rootfs, rootfs_dir)
380 exec_native_cmd(erofs_cmd, native_sysroot, pseudo=pseudo)
381
372 def prepare_empty_partition_ext(self, rootfs, oe_builddir, 382 def prepare_empty_partition_ext(self, rootfs, oe_builddir,
373 native_sysroot): 383 native_sysroot):
374 """ 384 """
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index 3c4997d8ba..fa7b1eb8ac 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -29,9 +29,9 @@ class RawCopyPlugin(SourcePlugin):
29 cmd = 'btrfs filesystem label %s %s' % (dst, label) 29 cmd = 'btrfs filesystem label %s %s' % (dst, label)
30 elif fstype == 'swap': 30 elif fstype == 'swap':
31 cmd = 'mkswap -L %s %s' % (label, dst) 31 cmd = 'mkswap -L %s %s' % (label, dst)
32 elif fstype == 'squashfs': 32 elif fstype in ('squashfs', 'erofs'):
33 raise WicError("It's not possible to update a squashfs " 33 raise WicError("It's not possible to update a %s "
34 "filesystem label '%s'" % (label)) 34 "filesystem label '%s'" % (fstype, label))
35 else: 35 else:
36 raise WicError("Cannot update filesystem label: " 36 raise WicError("Cannot update filesystem label: "
37 "Unknown fstype: '%s'" % (fstype)) 37 "Unknown fstype: '%s'" % (fstype))