path: root/scripts
diff options
authorFabio Berton <>2017-04-19 13:42:47 -0300
committerRichard Purdie <>2017-09-25 22:17:40 +0100
commit00420ec42140c1b752132bda190dede85756d157 (patch)
tree8bc84e0d911de969dca1524b87615ca7588f0b81 /scripts
parent3b827eff306c484d78d61b259cd5d4eef8df381c (diff)
wic: Add option to not change fstab
Create an option to wic doesn't change fstab file, the final fstab file will be same that in rootfs and wic doesn't update file, e.g adding a new mount point. Users can control the fstab file content in base-files recipe. This is useful if you want to only create an partition but not add fstab mount point or add new mount point using label e.g: LABEL=recovery /recovery auto defaults 0 1 Signed-off-by: Fabio Berton <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
3 files changed, 13 insertions, 2 deletions
diff --git a/scripts/lib/wic/ b/scripts/lib/wic/
index 83bd86e7c5..bd9c62e2e8 100644
--- a/scripts/lib/wic/
+++ b/scripts/lib/wic/
@@ -155,7 +155,7 @@ SYNOPSIS
[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
[-r, --rootfs-dir] [-b, --bootimg-dir]
[-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
- [-c, --compress-with] [-m, --bmap]
+ [-c, --compress-with] [-m, --bmap] [--no-fstab-update]
This command creates an OpenEmbedded image based on the 'OE
@@ -227,6 +227,11 @@ DESCRIPTION
The -m option is used to produce .bmap file for the image. This file
can be used to flash image using bmaptool utility.
+ The --no-fstab-update option is used to doesn't change fstab file. When
+ using this option the final fstab file will be same that in rootfs and
+ wic doesn't update file, e.g adding a new mount point. User can control
+ the fstab file content in base-files recipe.
wic_list_usage = """
diff --git a/scripts/lib/wic/plugins/imager/ b/scripts/lib/wic/plugins/imager/
index a6abc3d09e..60317eed22 100644
--- a/scripts/lib/wic/plugins/imager/
+++ b/scripts/lib/wic/plugins/imager/
@@ -71,6 +71,7 @@ class DirectPlugin(ImagerPlugin):
self.outdir = options.outdir
self.compressor = options.compressor
self.bmap = options.bmap
+ self.no_fstab_update = options.no_fstab_update = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
@@ -165,7 +166,10 @@ class DirectPlugin(ImagerPlugin):
filesystems from the artifacts directly and combine them into
a partitioned image.
- new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+ if self.no_fstab_update:
+ new_rootfs = None
+ else:
+ new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
if new_rootfs:
# rootfs was copied to update fstab
self.rootfs_dir['ROOTFS_DIR'] = new_rootfs
diff --git a/scripts/wic b/scripts/wic
index 592a0e4c25..097084a603 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -342,6 +342,8 @@ def wic_init_parser_create(subparser):
help="compress image with specified compressor")
subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap")
+ subparser.add_argument("--no-fstab-update" ,action="store_true",
+ help="Do not change fstab file.")
subparser.add_argument("-v", "--vars", dest='vars_dir',
help="directory with <image>.env files that store "
"bitbake variables")