Skip to contentSkip to conversation

wic: add 'none' fstype for custom image

PATCH New JeongBong Seo 1 participant 1 message Aug 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic: add 'none' fstype for custom image

It's not possible to set the label (of gpt entry) normally when I want to use non-listed fstype as a rawcopy.

Example)
part ? --source rawcopy --ondisk mmcblk0 --label mypart --sourceparams file=mypart.raw

To resolve this problem, this patch addes a 'none' fstype
and ignore do_image_label on rawcopy (that actually set the partition label.)

---
 scripts/lib/wic/ksparser.py               | 2 +-
 scripts/lib/wic/plugins/source/rawcopy.py | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
scripts/lib/wic/ksparser.py +1 -1
index 452a160232..298e593ad4 100644
@@ -157,7 +157,7 @@ class KickStart():
         part.add_argument('--fsoptions', dest='fsopts')
         part.add_argument('--fstype', default='vfat',
                           choices=('ext2', 'ext3', 'ext4', 'btrfs',
-                                   'squashfs', 'vfat', 'msdos', 'swap'))
+                                   'squashfs', 'vfat', 'msdos', 'swap', 'none'))
         part.add_argument('--mkfs-extraopts', default='')
         part.add_argument('--label')
         part.add_argument('--use-label', action='store_true')
scripts/lib/wic/plugins/source/rawcopy.py +4 -0
index 3c4997d8ba..a71629282d 100644
@@ -21,6 +21,10 @@ class RawCopyPlugin(SourcePlugin):
 
     @staticmethod
     def do_image_label(fstype, dst, label):
+        # don't create label when fstype is none
+        if fstype == 'none':
+            return
+
         if fstype.startswith('ext'):
             cmd = 'tune2fs -L %s %s' % (label, dst)
         elif fstype in ('msdos', 'vfat'):
Signature · 1 line
2.17.1