]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Add option to not change fstab pyro+ossystems
authorFabio Berton <fabio.berton@ossystems.com.br>
Wed, 19 Apr 2017 16:42:47 +0000 (13:42 -0300)
committerFabio Berton <fabio.berton@ossystems.com.br>
Mon, 9 Nov 2020 18:33:14 +0000 (15:33 -0300)
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

Change-Id: I078e64dc1fe7e5d745e75ad50314ef1dcc796d81
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
scripts/lib/wic/help.py
scripts/lib/wic/plugins/imager/direct.py
scripts/wic

index d6e027d25360940847d38d3fda9b9b1bcdae8035..03aabfbcc0eb84d5d837c7de0f34c1946c65de4a 100644 (file)
@@ -154,7 +154,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]
 
 DESCRIPTION
     This command creates an OpenEmbedded image based on the 'OE
@@ -226,6 +226,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 = """
index f2e612733162f5adbc8151485afdc5dcd438db2c..a5afec9a14c0280df42ba36ff4e28da79ebcf38b 100644 (file)
@@ -68,6 +68,7 @@ class DirectPlugin(ImagerPlugin):
         self.outdir = options.outdir
         self.compressor = options.compressor
         self.bmap = options.bmap
+        self.no_fstab_update = options.no_fstab_update
 
         self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
                                strftime("%Y%m%d%H%M"))
@@ -156,7 +157,10 @@ class DirectPlugin(ImagerPlugin):
         filesystems from the artifacts directly and combine them into
         a partitioned image.
         """
-        fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+        if self.no_fstab_update:
+            fstab_path = None
+        else:
+            fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
 
         for part in self.parts:
             # get rootfs size from bitbake variable if it's not set in .ks file
index a5f2dbfc6f2f20e5e6415b0c260cc34ffff97e96..5907098b3ae67c6b12abda1636ac4946d5042381 100755 (executable)
@@ -133,6 +133,8 @@ def wic_create_subcommand(args, usage_str):
                       dest='compressor',
                       help="compress image with specified compressor")
     parser.add_option("-m", "--bmap", action="store_true", help="generate .bmap")
+    parser.add_option("", "--no-fstab-update" ,action="store_true",
+                      help="Do not change fstab file.")
     parser.add_option("-v", "--vars", dest='vars_dir',
                       help="directory with <image>.env files that store "
                            "bitbake variables")