summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-03-30 13:37:15 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-31 12:12:17 +0100
commit21af89a6d44ccea6aef975ffd2483a8fad1231de (patch)
treec1003333fc91d66a2e03afbfe1122a74310c60fb /scripts/lib
parentcf06e6763d06e3e631bed85e2cb087f713808e6d (diff)
downloadopenembedded-core-21af89a6d44ccea6aef975ffd2483a8fad1231de.tar.gz
openembedded-core-21af89a6d44ccea6aef975ffd2483a8fad1231de.tar.bz2
openembedded-core-21af89a6d44ccea6aef975ffd2483a8fad1231de.zip
wic: allow only supported fstypes
Restricted possible values of --fstype to the list of supported types. This should catch incorrect values when .wks file is being parsed. Removed checks for empty fstype and mentioning of unsupported fstype 'ontrackdm6aux3'. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/ksparser.py4
-rw-r--r--scripts/lib/wic/partition.py8
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py2
3 files changed, 5 insertions, 9 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index a0393008eb..d026caad0f 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -136,7 +136,9 @@ class KickStart():
part.add_argument('--exclude-path', nargs='+')
part.add_argument("--extra-space", type=sizetype)
part.add_argument('--fsoptions', dest='fsopts')
- part.add_argument('--fstype')
+ part.add_argument('--fstype', default='vfat',
+ choices=('ext2', 'ext3', 'ext4', 'btrfs',
+ 'squashfs', 'vfat', 'msdos', 'swap'))
part.add_argument('--label')
part.add_argument('--no-table', action='store_true')
part.add_argument('--ondisk', '--ondrive', dest='disk', default='sda')
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 647a6fb3a7..f0e88fb4e8 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -136,11 +136,11 @@ class Partition():
"specify a non-zero --size/--fixed-size for that "
"partition." % self.mountpoint)
- if self.fstype and self.fstype == "swap":
+ if self.fstype == "swap":
self.prepare_swap_partition(cr_workdir, oe_builddir,
native_sysroot)
self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
- elif self.fstype:
+ else:
rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
self.lineno, self.fstype)
if os.path.isfile(rootfs):
@@ -217,10 +217,6 @@ class Partition():
if os.path.isfile(rootfs):
os.remove(rootfs)
- if not self.fstype:
- raise WicError("File system for partition %s not specified in "
- "kickstart, use --fstype option" % self.mountpoint)
-
# Get rootfs size from bitbake variable if it's not set in .ks file
if not self.size:
# Bitbake variable ROOTFS_SIZE is calculated in
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 67fd183670..79b948a739 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -487,8 +487,6 @@ class PartitionedImage():
parted_fs_type = "fat32"
elif part.fstype == "msdos":
parted_fs_type = "fat16"
- elif part.fstype == "ontrackdm6aux3":
- parted_fs_type = "ontrackdm6aux3"
else:
# Type for ext2/ext3/ext4/btrfs
parted_fs_type = "ext2"