summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berton <fabio.berton@ossystems.com.br>2017-04-19 13:42:47 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-26 11:05:01 +0100
commit5c98f20f5c3e7c022737d766d25bb820149cd5fd (patch)
tree11d59db848c312ced55b369323a87d1bbfe609c5
parentb7485a088033356785407ce21e8f53ab6b8df21c (diff)
downloadpoky-5c98f20f5c3e7c022737d766d25bb820149cd5fd.tar.gz
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 (From OE-Core rev: 00420ec42140c1b752132bda190dede85756d157) Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/help.py7
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py6
-rwxr-xr-xscripts/wic2
3 files changed, 13 insertions, 2 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index 83bd86e7c5..bd9c62e2e8 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -155,7 +155,7 @@ SYNOPSIS
155 [-e | --image-name] [-s, --skip-build-check] [-D, --debug] 155 [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
156 [-r, --rootfs-dir] [-b, --bootimg-dir] 156 [-r, --rootfs-dir] [-b, --bootimg-dir]
157 [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs] 157 [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
158 [-c, --compress-with] [-m, --bmap] 158 [-c, --compress-with] [-m, --bmap] [--no-fstab-update]
159 159
160DESCRIPTION 160DESCRIPTION
161 This command creates an OpenEmbedded image based on the 'OE 161 This command creates an OpenEmbedded image based on the 'OE
@@ -227,6 +227,11 @@ DESCRIPTION
227 227
228 The -m option is used to produce .bmap file for the image. This file 228 The -m option is used to produce .bmap file for the image. This file
229 can be used to flash image using bmaptool utility. 229 can be used to flash image using bmaptool utility.
230
231 The --no-fstab-update option is used to doesn't change fstab file. When
232 using this option the final fstab file will be same that in rootfs and
233 wic doesn't update file, e.g adding a new mount point. User can control
234 the fstab file content in base-files recipe.
230""" 235"""
231 236
232wic_list_usage = """ 237wic_list_usage = """
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index a6abc3d09e..60317eed22 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -71,6 +71,7 @@ class DirectPlugin(ImagerPlugin):
71 self.outdir = options.outdir 71 self.outdir = options.outdir
72 self.compressor = options.compressor 72 self.compressor = options.compressor
73 self.bmap = options.bmap 73 self.bmap = options.bmap
74 self.no_fstab_update = options.no_fstab_update
74 75
75 self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0], 76 self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
76 strftime("%Y%m%d%H%M")) 77 strftime("%Y%m%d%H%M"))
@@ -165,7 +166,10 @@ class DirectPlugin(ImagerPlugin):
165 filesystems from the artifacts directly and combine them into 166 filesystems from the artifacts directly and combine them into
166 a partitioned image. 167 a partitioned image.
167 """ 168 """
168 new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) 169 if self.no_fstab_update:
170 new_rootfs = None
171 else:
172 new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
169 if new_rootfs: 173 if new_rootfs:
170 # rootfs was copied to update fstab 174 # rootfs was copied to update fstab
171 self.rootfs_dir['ROOTFS_DIR'] = new_rootfs 175 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):
342 dest='compressor', 342 dest='compressor',
343 help="compress image with specified compressor") 343 help="compress image with specified compressor")
344 subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap") 344 subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap")
345 subparser.add_argument("--no-fstab-update" ,action="store_true",
346 help="Do not change fstab file.")
345 subparser.add_argument("-v", "--vars", dest='vars_dir', 347 subparser.add_argument("-v", "--vars", dest='vars_dir',
346 help="directory with <image>.env files that store " 348 help="directory with <image>.env files that store "
347 "bitbake variables") 349 "bitbake variables")