diff mbox series

wic: fix wrong attempt to create file system in upartitioned regions

Message ID 20230818114413.3236712-1-Markus.Niebel@ew.tq-group.com
State Accepted, archived
Commit db771a4cd36bf291a8b68edfd905e03243f2c8b3
Headers show
Series wic: fix wrong attempt to create file system in upartitioned regions | expand

Commit Message

Markus Niebel Aug. 18, 2023, 11:44 a.m. UTC
The kickstart parser defaults fstype to "vfat". This leads to an attempt
to create an empty file system even for regions configured with "--no-table"
if used without fstype when no --sourceparams given.

The fix tests for fstype "none" or no_table in Partition prepare method.
This will omit the file system creation an the potential error for small
region with --no-table option.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
---
 scripts/lib/wic/partition.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexander Kanavin Aug. 18, 2023, 11:52 a.m. UTC | #1
Does this mean there is a missing test for wic? Can you add one?

Alex

On Fri, 18 Aug 2023 at 13:44, Markus Niebel
<Markus.Niebel@ew.tq-group.com> wrote:
>
> The kickstart parser defaults fstype to "vfat". This leads to an attempt
> to create an empty file system even for regions configured with "--no-table"
> if used without fstype when no --sourceparams given.
>
> The fix tests for fstype "none" or no_table in Partition prepare method.
> This will omit the file system creation an the potential error for small
> region with --no-table option.
>
> Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
> ---
>  scripts/lib/wic/partition.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
> index bda4aef1b4..f11c393df5 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -134,7 +134,7 @@ class Partition():
>              self.update_fstab_in_rootfs = True
>
>          if not self.source:
> -            if self.fstype == "none":
> +            if self.fstype == "none" or self.no_table:
>                  return
>              if not self.size and not self.fixed_size:
>                  raise WicError("The %s partition has a size of zero. Please "
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#186361): https://lists.openembedded.org/g/openembedded-core/message/186361
> Mute This Topic: https://lists.openembedded.org/mt/100818637/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Markus Niebel Aug. 21, 2023, 10:26 a.m. UTC | #2
Hello Alexander,

Am Freitag, dem 18.08.2023 um 11:52 +0000 schrieb Alexander Kanavin:
> 
> Does this mean there is a missing test for wic? Can you add one?
> 

sorry for being not an expert. I hope the basic test I will send with
v2 of the patch is usable as a starting point.

> Alex
> 

Markus

> On Fri, 18 Aug 2023 at 13:44, Markus Niebel
> <Markus.Niebel@ew.tq-group.com> wrote:
> > The kickstart parser defaults fstype to "vfat". This leads to an
> > attempt
> > to create an empty file system even for regions configured with "
> > --no-table"
> > if used without fstype when no --sourceparams given.
> > 
> > The fix tests for fstype "none" or no_table in Partition prepare
> > method.
> > This will omit the file system creation an the potential error for
> > small
> > region with --no-table option.
> > 
> > Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
> > ---
> >  scripts/lib/wic/partition.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/lib/wic/partition.py
> > b/scripts/lib/wic/partition.py
> > index bda4aef1b4..f11c393df5 100644
> > --- a/scripts/lib/wic/partition.py
> > +++ b/scripts/lib/wic/partition.py
> > @@ -134,7 +134,7 @@ class Partition():
> >              self.update_fstab_in_rootfs = True
> > 
> >          if not self.source:
> > -            if self.fstype == "none":
> > +            if self.fstype == "none" or self.no_table:
> >                  return
> >              if not self.size and not self.fixed_size:
> >                  raise WicError("The %s partition has a size of
> > zero. Please "
> > --
> > 2.25.1
> >
Alexander Kanavin Aug. 21, 2023, 10:29 a.m. UTC | #3
On Mon, 21 Aug 2023 at 12:26, Markus Niebel
<Markus.Niebel@ew.tq-group.com> wrote:
> > Does this mean there is a missing test for wic? Can you add one?
> >
>
> sorry for being not an expert. I hope the basic test I will send with
> v2 of the patch is usable as a starting point.

As long as the test fails without the fix, and passes with the fix, it
should be fine, thanks. Can you check the former (i.e. that it does
fail)?

Alex
diff mbox series

Patch

diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index bda4aef1b4..f11c393df5 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -134,7 +134,7 @@  class Partition():
             self.update_fstab_in_rootfs = True
 
         if not self.source:
-            if self.fstype == "none":
+            if self.fstype == "none" or self.no_table:
                 return
             if not self.size and not self.fixed_size:
                 raise WicError("The %s partition has a size of zero. Please "