Patchwork [OE-code] wic: include partition label in fs image file name

login
register
mail settings
Submitter Maciej Borzecki
Date July 21, 2014, 11:01 a.m.
Message ID <1405940517-30651-1-git-send-email-maciej.borzecki@open-rnd.pl>
Download mbox | patch
Permalink /patch/76175/
State Accepted
Commit f12ac6101c756a1925f36c8ff16883427592fc94
Headers show

Comments

Maciej Borzecki - July 21, 2014, 11:01 a.m.
Not including the label image but having multiple partitions of the same
type, the image file of one partition would overwrite the other.

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
---
 scripts/lib/mic/kickstart/custom_commands/partition.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Tom Zanussi - July 21, 2014, 9:23 p.m.
On Mon, 2014-07-21 at 13:01 +0200, Maciej Borzecki wrote:
> Not including the label image but having multiple partitions of the same
> type, the image file of one partition would overwrite the other.
> 

Right, the empty-partition case somehow missed the label - good catch.

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

> Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
> ---
>  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> index 06f29a9..d0f1b78 100644
> --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> @@ -343,7 +343,7 @@ class Wic_PartData(Mic_PartData):
>          """
>          Prepare an empty ext2/3/4 partition.
>          """
> -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
>  
>          dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
>              (fs, self.size)
> @@ -363,7 +363,7 @@ class Wic_PartData(Mic_PartData):
>          """
>          Prepare an empty btrfs partition.
>          """
> -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
>  
>          dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
>              (fs, self.size)
> @@ -384,7 +384,7 @@ class Wic_PartData(Mic_PartData):
>          """
>          Prepare an empty vfat partition.
>          """
> -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
>  
>          blocks = self.size * 1024
>
Maciej Borzecki - Aug. 11, 2014, 2:17 p.m.
On pon, 2014-07-21 at 16:23 -0500, Tom Zanussi wrote:
> On Mon, 2014-07-21 at 13:01 +0200, Maciej Borzecki wrote:
> > Not including the label image but having multiple partitions of the same
> > type, the image file of one partition would overwrite the other.
> > 
> 
> Right, the empty-partition case somehow missed the label - good catch.
> 
> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>


Saul, I think that the patch was missed by due to malformed subject
line. Would you be able to push it to master?

> 
> > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
> > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
> > ---
> >  scripts/lib/mic/kickstart/custom_commands/partition.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > index 06f29a9..d0f1b78 100644
> > --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
> > +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
> > @@ -343,7 +343,7 @@ class Wic_PartData(Mic_PartData):
> >          """
> >          Prepare an empty ext2/3/4 partition.
> >          """
> > -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> > +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
> >  
> >          dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
> >              (fs, self.size)
> > @@ -363,7 +363,7 @@ class Wic_PartData(Mic_PartData):
> >          """
> >          Prepare an empty btrfs partition.
> >          """
> > -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> > +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
> >  
> >          dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
> >              (fs, self.size)
> > @@ -384,7 +384,7 @@ class Wic_PartData(Mic_PartData):
> >          """
> >          Prepare an empty vfat partition.
> >          """
> > -        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
> > +        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
> >  
> >          blocks = self.size * 1024
> >  
> 
>

Patch

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 06f29a9..d0f1b78 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -343,7 +343,7 @@  class Wic_PartData(Mic_PartData):
         """
         Prepare an empty ext2/3/4 partition.
         """
-        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
+        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
             (fs, self.size)
@@ -363,7 +363,7 @@  class Wic_PartData(Mic_PartData):
         """
         Prepare an empty btrfs partition.
         """
-        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
+        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
 
         dd_cmd = "dd if=/dev/zero of=%s bs=1M seek=%d count=0" % \
             (fs, self.size)
@@ -384,7 +384,7 @@  class Wic_PartData(Mic_PartData):
         """
         Prepare an empty vfat partition.
         """
-        fs = "%s/fs.%s" % (cr_workdir, self.fstype)
+        fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
 
         blocks = self.size * 1024