Patchwork [v2] wic: --fsoptions handling

login
register
mail settings
Submitter Maciej Borzecki
Date July 24, 2014, 12:17 p.m.
Message ID <1406204223-16935-1-git-send-email-maciej.borzecki@open-rnd.pl>
Download mbox | patch
Permalink /patch/76585/
State Accepted
Commit 5e7de54d3d444e4a1b7f7c2a4d20ae7d5ab2fbba
Headers show

Comments

Maciej Borzecki - July 24, 2014, 12:17 p.m.
Add handling of --fsoptions in parition definition. If no options are
specified, 'defaults' is used.

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
---
 scripts/lib/mic/imager/direct.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Tom Zanussi - July 25, 2014, 12:17 a.m.
On Thu, 2014-07-24 at 14:17 +0200, Maciej Borzecki wrote:
> Add handling of --fsoptions in parition definition. If no options are
> specified, 'defaults' is used.
> 
> Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>

Acked-by: Tom Zanussi <tom.zanussi@intel.com>

> ---
>  scripts/lib/mic/imager/direct.py | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
> index 77a118a..7e2b63a 100644
> --- a/scripts/lib/mic/imager/direct.py
> +++ b/scripts/lib/mic/imager/direct.py
> @@ -113,7 +113,15 @@ class DirectImageCreator(BaseImageCreator):
>                  device_name = "/dev/" + p.disk + str(num + 1)
>              else:
>                  device_name = "/dev/" + p.disk + str(num)
> -            fstab_entry = device_name + "\t" + p.mountpoint + "\t" + p.fstype + "\tdefaults\t0\t0\n"
> +
> +            opts = "defaults"
> +            if p.fsopts:
> +                opts = p.fsopts
> +
> +            fstab_entry = device_name + "\t" + \
> +                          p.mountpoint + "\t" + \
> +                          p.fstype + "\t" + \
> +                          opts + "\t0\t0\n"
>              fstab_lines.append(fstab_entry)
>  
>      def _write_fstab(self, fstab, fstab_lines):

Patch

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 77a118a..7e2b63a 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -113,7 +113,15 @@  class DirectImageCreator(BaseImageCreator):
                 device_name = "/dev/" + p.disk + str(num + 1)
             else:
                 device_name = "/dev/" + p.disk + str(num)
-            fstab_entry = device_name + "\t" + p.mountpoint + "\t" + p.fstype + "\tdefaults\t0\t0\n"
+
+            opts = "defaults"
+            if p.fsopts:
+                opts = p.fsopts
+
+            fstab_entry = device_name + "\t" + \
+                          p.mountpoint + "\t" + \
+                          p.fstype + "\t" + \
+                          opts + "\t0\t0\n"
             fstab_lines.append(fstab_entry)
 
     def _write_fstab(self, fstab, fstab_lines):