wic: Warn if an ext filesystem affected by the Y2038 problem is used

Message ID 20210301151823.64574-1-florian.bezdeka@siemens.com
State Superseded, archived
Headers show
Series wic: Warn if an ext filesystem affected by the Y2038 problem is used | expand

Commit Message

Florian Bezdeka March 1, 2021, 5:18 a.m. UTC
This is the backport for upstream (openembedded-core)
eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 problem is used")

We are getting closer and closer to the year 2038 where the 32 bit
time_t overflow will happen. While products (= embedded systems) with an
expected life time of 15 years are still save the situation may change
if your system has to survive the next 20 years.

ext2 and ext3 filesystems are always affected by the time overflow, so
let's warn the user if these filesystems are still being used.

If ext4 is affected depends on the inode size chosen during filesystem
creation. At least 256 bytes are necessary to be safe. As ext4 is
used very often (and partitions may be created small first and extended
later) this might be an issue for many users.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 scripts/lib/wic/misc.py      |  1 +
 scripts/lib/wic/partition.py | 15 +++++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

vijai kumar March 1, 2021, 5:23 a.m. UTC | #1
On Monday, March 1, 2021 at 8:49:34 PM UTC+5:30 Florian Bezdeka wrote:

> This is the backport for upstream (openembedded-core) 
> eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 
> problem is used") 
>

I believe we could uprev wic to a version that includes this patch, instead 
of cherry-picking this.

Thanks,
Vijai Kumar K
 

>
> We are getting closer and closer to the year 2038 where the 32 bit 
> time_t overflow will happen. While products (= embedded systems) with an 
> expected life time of 15 years are still save the situation may change 
> if your system has to survive the next 20 years. 
>
> ext2 and ext3 filesystems are always affected by the time overflow, so 
> let's warn the user if these filesystems are still being used. 
>
> If ext4 is affected depends on the inode size chosen during filesystem 
> creation. At least 256 bytes are necessary to be safe. As ext4 is 
> used very often (and partitions may be created small first and extended 
> later) this might be an issue for many users. 
>
> Signed-off-by: Florian Bezdeka <florian...@siemens.com> 
> --- 
> scripts/lib/wic/misc.py | 1 + 
> scripts/lib/wic/partition.py | 15 +++++++-------- 
> 2 files changed, 8 insertions(+), 8 deletions(-) 
>
> diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py 
> index 4b08d64..c4332d5 100644 
> --- a/scripts/lib/wic/misc.py 
> +++ b/scripts/lib/wic/misc.py 
> @@ -26,6 +26,7 @@ logger = logging.getLogger('wic') 
>
> # executable -> recipe pairs for exec_native_cmd 
> NATIVE_RECIPES = {"bmaptool": "bmap-tools", 
> + "dumpe2fs": "e2fsprogs", 
> "grub-mkimage": "grub-efi", 
> "isohybrid": "syslinux", 
> "mcopy": "mtools", 
> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py 
> index 4a5a31e..e6bcc9e 100644 
> --- a/scripts/lib/wic/partition.py 
> +++ b/scripts/lib/wic/partition.py 
> @@ -432,26 +432,25 @@ class Partition(): 
> if part.mountpoint: 
> args = [part.fstype, "mounted at %s" % part.mountpoint] 
> elif part.label: 
> - args = [part.fstype, "labeled %s" % part.label] 
> + args = [part.fstype, "labeled '%s'" % part.label] 
> elif part.part_name: 
> - args = [part.fstype, "in partition %s" % part.part_name] 
> + args = [part.fstype, "in partition '%s'" % part.part_name] 
> else: 
> - args = [part.fstype, ""] 
> + args = [part.fstype, "in partition %s" % part.num] 
> return err.format(*args) 
>
> - ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) 
> - 
> # ext2 and ext3 are always affected by the Y2038 problem 
> if self.fstype in ["ext2", "ext3"]: 
> logger.warn(get_err_str(self)) 
> return 
>
> + ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) 
> + 
> # if ext4 is affected by the Y2038 problem depends on the inode size 
> - # Remember: inode size depends on the file system size 
> for line in out.splitlines(): 
> if line.startswith("Inode size:"): 
> size = int(line.split(":")[1].strip()) 
> if size < 256: 
> - logger.warn("%s Inodes (of size %d) are too small." % \ 
> + logger.warn("%s Inodes (of size %d) are too small." % 
> (get_err_str(self), size)) 
> - break 
> \ No newline at end of file 
> + break 
> -- 
> 2.29.2 
>
>
Florian Bezdeka March 1, 2021, 5:38 a.m. UTC | #2
On Mon, 2021-03-01 at 07:23 -0800, vijaikumar....@gmail.com wrote:
> 
> 
> On Monday, March 1, 2021 at 8:49:34 PM UTC+5:30 Florian Bezdeka
> wrote:
> > This is the backport for upstream (openembedded-core)
> > eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038
> > problem is used")
> > 
> 
> 
> I believe we could uprev wic to a version that includes this patch,
> instead of cherry-picking this.

It's not a cherry-pick because the RFC series has already been merged
into ISAR before it was merged upstream. It's a real backport. 

wic of ISAR and upstream (openembedded-core) have diverged, so just
picking the recent upstream version would overwrite all the changes
that were never upstreamed. I can't even test that, so someone else has
to do that.

> 
> Thanks,
> Vijai Kumar K
>  
> > 
> > We are getting closer and closer to the year 2038 where the 32 bit
> > time_t overflow will happen. While products (= embedded systems)
> > with
> > an
> > expected life time of 15 years are still save the situation may
> > change
> > if your system has to survive the next 20 years.
> > 
> > ext2 and ext3 filesystems are always affected by the time overflow,
> > so
> > let's warn the user if these filesystems are still being used.
> > 
> > If ext4 is affected depends on the inode size chosen during
> > filesystem
> > creation. At least 256 bytes are necessary to be safe. As ext4 is
> > used very often (and partitions may be created small first and
> > extended
> > later) this might be an issue for many users.
> > 
> > Signed-off-by: Florian Bezdeka <florian...@siemens.com>
> > ---
> >  scripts/lib/wic/misc.py | 1 +
> >  scripts/lib/wic/partition.py | 15 +++++++--------
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
> > index 4b08d64..c4332d5 100644
> > --- a/scripts/lib/wic/misc.py
> > +++ b/scripts/lib/wic/misc.py
> > @@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
> >  
> >  # executable -> recipe pairs for exec_native_cmd
> >  NATIVE_RECIPES = {"bmaptool": "bmap-tools",
> > + "dumpe2fs": "e2fsprogs",
> >  "grub-mkimage": "grub-efi",
> >  "isohybrid": "syslinux",
> >  "mcopy": "mtools",
> > diff --git a/scripts/lib/wic/partition.py
> > b/scripts/lib/wic/partition.py
> > index 4a5a31e..e6bcc9e 100644
> > --- a/scripts/lib/wic/partition.py
> > +++ b/scripts/lib/wic/partition.py
> > @@ -432,26 +432,25 @@ class Partition():
> >  if part.mountpoint:
> >  args = [part.fstype, "mounted at %s" % part.mountpoint]
> >  elif part.label:
> > - args = [part.fstype, "labeled %s" % part.label]
> > + args = [part.fstype, "labeled '%s'" % part.label]
> >  elif part.part_name:
> > - args = [part.fstype, "in partition %s" % part.part_name]
> > + args = [part.fstype, "in partition '%s'" % part.part_name]
> >  else:
> > - args = [part.fstype, ""]
> > + args = [part.fstype, "in partition %s" % part.num]
> >  return err.format(*args)
> >  
> > - ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
> > native_sysroot)
> > -
> >  # ext2 and ext3 are always affected by the Y2038 problem
> >  if self.fstype in ["ext2", "ext3"]:
> >  logger.warn(get_err_str(self))
> >  return
> >  
> > + ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
> > native_sysroot)
> > +
> >  # if ext4 is affected by the Y2038 problem depends on the inode
> > size
> > - # Remember: inode size depends on the file system size
> >  for line in out.splitlines():
> >  if line.startswith("Inode size:"):
> >  size = int(line.split(":")[1].strip())
> >  if size < 256:
> > - logger.warn("%s Inodes (of size %d) are too small." % \
> > + logger.warn("%s Inodes (of size %d) are too small." %
> >  (get_err_str(self), size))
> > - break
> > \ No newline at end of file
> > + break
> > -- 
> > 2.29.2
> >
vijai kumar March 1, 2021, 5:58 a.m. UTC | #3
On Monday, March 1, 2021 at 9:08:26 PM UTC+5:30 florian...@siemens.com 
wrote:

> On Mon, 2021-03-01 at 07:23 -0800, vijaikumar....@gmail.com wrote: 
> > 
> > 
> > On Monday, March 1, 2021 at 8:49:34 PM UTC+5:30 Florian Bezdeka 
> > wrote: 
> > > This is the backport for upstream (openembedded-core) 
> > > eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 
> > > problem is used") 
> > > 
> > 
> > 
> > I believe we could uprev wic to a version that includes this patch, 
> > instead of cherry-picking this. 
>
> It's not a cherry-pick because the RFC series has already been merged 
> into ISAR before it was merged upstream. It's a real backport.  
>

As I see, these are the missing pieces of the RFC patch which got merged 
recently.
The backport is actually spread across 2 commits.

Maybe we could modify the commit message to reflect that.

Thanks,
Vijai Kumar K


> wic of ISAR and upstream (openembedded-core) have diverged, so just 
> picking the recent upstream version would overwrite all the changes 
> that were never upstreamed. I can't even test that, so someone else has 
> to do that. 
>
> > 
> > Thanks, 
> > Vijai Kumar K 
> >   
> > > 
> > > We are getting closer and closer to the year 2038 where the 32 bit 
> > > time_t overflow will happen. While products (= embedded systems) 
> > > with 
> > > an 
> > > expected life time of 15 years are still save the situation may 
> > > change 
> > > if your system has to survive the next 20 years. 
> > > 
> > > ext2 and ext3 filesystems are always affected by the time overflow, 
> > > so 
> > > let's warn the user if these filesystems are still being used. 
> > > 
> > > If ext4 is affected depends on the inode size chosen during 
> > > filesystem 
> > > creation. At least 256 bytes are necessary to be safe. As ext4 is 
> > > used very often (and partitions may be created small first and 
> > > extended 
> > > later) this might be an issue for many users. 
> > > 
> > > Signed-off-by: Florian Bezdeka <florian...@siemens.com> 
> > > --- 
> > >  scripts/lib/wic/misc.py | 1 + 
> > >  scripts/lib/wic/partition.py | 15 +++++++-------- 
> > >  2 files changed, 8 insertions(+), 8 deletions(-) 
> > > 
> > > diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py 
> > > index 4b08d64..c4332d5 100644 
> > > --- a/scripts/lib/wic/misc.py 
> > > +++ b/scripts/lib/wic/misc.py 
> > > @@ -26,6 +26,7 @@ logger = logging.getLogger('wic') 
> > >   
> > >  # executable -> recipe pairs for exec_native_cmd 
> > >  NATIVE_RECIPES = {"bmaptool": "bmap-tools", 
> > > + "dumpe2fs": "e2fsprogs", 
> > >  "grub-mkimage": "grub-efi", 
> > >  "isohybrid": "syslinux", 
> > >  "mcopy": "mtools", 
> > > diff --git a/scripts/lib/wic/partition.py 
> > > b/scripts/lib/wic/partition.py 
> > > index 4a5a31e..e6bcc9e 100644 
> > > --- a/scripts/lib/wic/partition.py 
> > > +++ b/scripts/lib/wic/partition.py 
> > > @@ -432,26 +432,25 @@ class Partition(): 
> > >  if part.mountpoint: 
> > >  args = [part.fstype, "mounted at %s" % part.mountpoint] 
> > >  elif part.label: 
> > > - args = [part.fstype, "labeled %s" % part.label] 
> > > + args = [part.fstype, "labeled '%s'" % part.label] 
> > >  elif part.part_name: 
> > > - args = [part.fstype, "in partition %s" % part.part_name] 
> > > + args = [part.fstype, "in partition '%s'" % part.part_name] 
> > >  else: 
> > > - args = [part.fstype, ""] 
> > > + args = [part.fstype, "in partition %s" % part.num] 
> > >  return err.format(*args) 
> > >   
> > > - ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, 
> > > native_sysroot) 
> > > - 
> > >  # ext2 and ext3 are always affected by the Y2038 problem 
> > >  if self.fstype in ["ext2", "ext3"]: 
> > >  logger.warn(get_err_str(self)) 
> > >  return 
> > >   
> > > + ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, 
> > > native_sysroot) 
> > > + 
> > >  # if ext4 is affected by the Y2038 problem depends on the inode 
> > > size 
> > > - # Remember: inode size depends on the file system size 
> > >  for line in out.splitlines(): 
> > >  if line.startswith("Inode size:"): 
> > >  size = int(line.split(":")[1].strip()) 
> > >  if size < 256: 
> > > - logger.warn("%s Inodes (of size %d) are too small." % \ 
> > > + logger.warn("%s Inodes (of size %d) are too small." % 
> > >  (get_err_str(self), size)) 
> > > - break 
> > > \ No newline at end of file 
> > > + break 
> > > -- 
> > > 2.29.2 
> > > 
>
>
Jan Kiszka March 1, 2021, 7:22 a.m. UTC | #4
On 01.03.21 16:18, Florian Bezdeka wrote:
> This is the backport for upstream (openembedded-core)
> eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 problem is used")
> 

We need to sync to a specific commit of upstream, rather than expanding
the fork.

Jan

> We are getting closer and closer to the year 2038 where the 32 bit
> time_t overflow will happen. While products (= embedded systems) with an
> expected life time of 15 years are still save the situation may change
> if your system has to survive the next 20 years.
> 
> ext2 and ext3 filesystems are always affected by the time overflow, so
> let's warn the user if these filesystems are still being used.
> 
> If ext4 is affected depends on the inode size chosen during filesystem
> creation. At least 256 bytes are necessary to be safe. As ext4 is
> used very often (and partitions may be created small first and extended
> later) this might be an issue for many users.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  scripts/lib/wic/misc.py      |  1 +
>  scripts/lib/wic/partition.py | 15 +++++++--------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
> index 4b08d64..c4332d5 100644
> --- a/scripts/lib/wic/misc.py
> +++ b/scripts/lib/wic/misc.py
> @@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
>  
>  # executable -> recipe pairs for exec_native_cmd
>  NATIVE_RECIPES = {"bmaptool": "bmap-tools",
> +                  "dumpe2fs": "e2fsprogs",
>                    "grub-mkimage": "grub-efi",
>                    "isohybrid": "syslinux",
>                    "mcopy": "mtools",
> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
> index 4a5a31e..e6bcc9e 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -432,26 +432,25 @@ class Partition():
>              if part.mountpoint:
>                  args = [part.fstype, "mounted at %s" % part.mountpoint]
>              elif part.label:
> -                args = [part.fstype, "labeled %s" % part.label]
> +                args = [part.fstype, "labeled '%s'" % part.label]
>              elif part.part_name:
> -                args = [part.fstype, "in partition %s" % part.part_name]
> +                args = [part.fstype, "in partition '%s'" % part.part_name]
>              else:
> -                args = [part.fstype, ""]
> +                args = [part.fstype, "in partition %s" % part.num]
>              return err.format(*args)
>  
> -        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
> -
>          # ext2 and ext3 are always affected by the Y2038 problem
>          if self.fstype in ["ext2", "ext3"]:
>              logger.warn(get_err_str(self))
>              return
>  
> +        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
> +
>          # if ext4 is affected by the Y2038 problem depends on the inode size
> -        # Remember: inode size depends on the file system size
>          for line in out.splitlines():
>              if line.startswith("Inode size:"):
>                  size = int(line.split(":")[1].strip())
>                  if size < 256:
> -                    logger.warn("%s Inodes (of size %d) are too small." % \
> +                    logger.warn("%s Inodes (of size %d) are too small." %
>                                  (get_err_str(self), size))
> -                break
> \ No newline at end of file
> +                break
>
Florian Bezdeka March 1, 2021, 7:45 a.m. UTC | #5
On Mon, 2021-03-01 at 18:22 +0100, Jan Kiszka wrote:
> On 01.03.21 16:18, Florian Bezdeka wrote:
> > This is the backport for upstream (openembedded-core)
> > eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 problem is used")
> > 
> 
> We need to sync to a specific commit of upstream, rather than expanding
> the fork.

Repeating from the other thread:

wic in ISAR has diverged from upstream, so updating or synchronizing it
to the upstream version is not doable for me. I can't even test that.

As the RFC series was merged by accident the situation got even worse.
I can take the responsibility to synchronize that part with the
upstream version, but I can't take responsibility for a full
synchronization. 

As already suggested, I would update the commit message again, but no
way for me to do the full synchronization.

> 
> Jan
> 
> > We are getting closer and closer to the year 2038 where the 32 bit
> > time_t overflow will happen. While products (= embedded systems) with an
> > expected life time of 15 years are still save the situation may change
> > if your system has to survive the next 20 years.
> > 
> > ext2 and ext3 filesystems are always affected by the time overflow, so
> > let's warn the user if these filesystems are still being used.
> > 
> > If ext4 is affected depends on the inode size chosen during filesystem
> > creation. At least 256 bytes are necessary to be safe. As ext4 is
> > used very often (and partitions may be created small first and extended
> > later) this might be an issue for many users.
> > 
> > Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> > ---
> >  scripts/lib/wic/misc.py      |  1 +
> >  scripts/lib/wic/partition.py | 15 +++++++--------
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
> > index 4b08d64..c4332d5 100644
> > --- a/scripts/lib/wic/misc.py
> > +++ b/scripts/lib/wic/misc.py
> > @@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
> >  
> > 
> > 
> > 
> >  # executable -> recipe pairs for exec_native_cmd
> >  NATIVE_RECIPES = {"bmaptool": "bmap-tools",
> > +                  "dumpe2fs": "e2fsprogs",
> >                    "grub-mkimage": "grub-efi",
> >                    "isohybrid": "syslinux",
> >                    "mcopy": "mtools",
> > diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
> > index 4a5a31e..e6bcc9e 100644
> > --- a/scripts/lib/wic/partition.py
> > +++ b/scripts/lib/wic/partition.py
> > @@ -432,26 +432,25 @@ class Partition():
> >              if part.mountpoint:
> >                  args = [part.fstype, "mounted at %s" % part.mountpoint]
> >              elif part.label:
> > -                args = [part.fstype, "labeled %s" % part.label]
> > +                args = [part.fstype, "labeled '%s'" % part.label]
> >              elif part.part_name:
> > -                args = [part.fstype, "in partition %s" % part.part_name]
> > +                args = [part.fstype, "in partition '%s'" % part.part_name]
> >              else:
> > -                args = [part.fstype, ""]
> > +                args = [part.fstype, "in partition %s" % part.num]
> >              return err.format(*args)
> >  
> > 
> > 
> > 
> > -        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
> > -
> >          # ext2 and ext3 are always affected by the Y2038 problem
> >          if self.fstype in ["ext2", "ext3"]:
> >              logger.warn(get_err_str(self))
> >              return
> >  
> > 
> > 
> > 
> > +        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
> > +
> >          # if ext4 is affected by the Y2038 problem depends on the inode size
> > -        # Remember: inode size depends on the file system size
> >          for line in out.splitlines():
> >              if line.startswith("Inode size:"):
> >                  size = int(line.split(":")[1].strip())
> >                  if size < 256:
> > -                    logger.warn("%s Inodes (of size %d) are too small." % \
> > +                    logger.warn("%s Inodes (of size %d) are too small." %
> >                                  (get_err_str(self), size))
> > -                break
> > \ No newline at end of file
> > +                break
> > 
>
vijai kumar March 1, 2021, 7:54 a.m. UTC | #6
On Monday, March 1, 2021 at 11:15:08 PM UTC+5:30 florian...@siemens.com 
wrote:

> On Mon, 2021-03-01 at 18:22 +0100, Jan Kiszka wrote: 
> > On 01.03.21 16:18, Florian Bezdeka wrote: 
> > > This is the backport for upstream (openembedded-core) 
> > > eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 
> problem is used") 
> > > 
> > 
> > We need to sync to a specific commit of upstream, rather than expanding 
> > the fork. 
>
> Repeating from the other thread: 
>
> wic in ISAR has diverged from upstream, so updating or synchronizing it 
> to the upstream version is not doable for me. I can't even test that. 
>
> As the RFC series was merged by accident the situation got even worse. 
> I can take the responsibility to synchronize that part with the 
> upstream version, but I can't take responsibility for a full 
> synchronization.  
>
> As already suggested, I would update the commit message again, but no 
> way for me to do the full synchronization. 
>

I could do that. And probable those pending ISAR wic plugin alignment as 
well. But not immediately. It will have to wait till next week, probably 
weekend. I have some stuff to clear from my plate first.  

Thanks,
Vijai Kumar K


> > 
> > Jan 
> > 
> > > We are getting closer and closer to the year 2038 where the 32 bit 
> > > time_t overflow will happen. While products (= embedded systems) with 
> an 
> > > expected life time of 15 years are still save the situation may change 
> > > if your system has to survive the next 20 years. 
> > > 
> > > ext2 and ext3 filesystems are always affected by the time overflow, so 
> > > let's warn the user if these filesystems are still being used. 
> > > 
> > > If ext4 is affected depends on the inode size chosen during filesystem 
> > > creation. At least 256 bytes are necessary to be safe. As ext4 is 
> > > used very often (and partitions may be created small first and 
> extended 
> > > later) this might be an issue for many users. 
> > > 
> > > Signed-off-by: Florian Bezdeka <florian...@siemens.com> 
> > > --- 
> > >  scripts/lib/wic/misc.py | 1 + 
> > >  scripts/lib/wic/partition.py | 15 +++++++-------- 
> > >  2 files changed, 8 insertions(+), 8 deletions(-) 
> > > 
> > > diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py 
> > > index 4b08d64..c4332d5 100644 
> > > --- a/scripts/lib/wic/misc.py 
> > > +++ b/scripts/lib/wic/misc.py 
> > > @@ -26,6 +26,7 @@ logger = logging.getLogger('wic') 
> > >   
> > > 
> > > 
> > > 
> > >  # executable -> recipe pairs for exec_native_cmd 
> > >  NATIVE_RECIPES = {"bmaptool": "bmap-tools", 
> > > + "dumpe2fs": "e2fsprogs", 
> > >                    "grub-mkimage": "grub-efi", 
> > >                    "isohybrid": "syslinux", 
> > >                    "mcopy": "mtools", 
> > > diff --git a/scripts/lib/wic/partition.py 
> b/scripts/lib/wic/partition.py 
> > > index 4a5a31e..e6bcc9e 100644 
> > > --- a/scripts/lib/wic/partition.py 
> > > +++ b/scripts/lib/wic/partition.py 
> > > @@ -432,26 +432,25 @@ class Partition(): 
> > >              if part.mountpoint: 
> > >                  args = [part.fstype, "mounted at %s" % 
> part.mountpoint] 
> > >              elif part.label: 
> > > - args = [part.fstype, "labeled %s" % part.label] 
> > > + args = [part.fstype, "labeled '%s'" % part.label] 
> > >              elif part.part_name: 
> > > - args = [part.fstype, "in partition %s" % part.part_name] 
> > > + args = [part.fstype, "in partition '%s'" % part.part_name] 
> > >              else: 
> > > - args = [part.fstype, ""] 
> > > + args = [part.fstype, "in partition %s" % part.num] 
> > >              return err.format(*args) 
> > >   
> > > 
> > > 
> > > 
> > > - ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) 
> > > - 
> > >          # ext2 and ext3 are always affected by the Y2038 problem 
> > >          if self.fstype in ["ext2", "ext3"]: 
> > >              logger.warn(get_err_str(self)) 
> > >              return 
> > >   
> > > 
> > > 
> > > 
> > > + ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) 
> > > + 
> > >          # if ext4 is affected by the Y2038 problem depends on the 
> inode size 
> > > - # Remember: inode size depends on the file system size 
> > >          for line in out.splitlines(): 
> > >              if line.startswith("Inode size:"): 
> > >                  size = int(line.split(":")[1].strip()) 
> > >                  if size < 256: 
> > > - logger.warn("%s Inodes (of size %d) are too small." % \ 
> > > + logger.warn("%s Inodes (of size %d) are too small." % 
> > >                                  (get_err_str(self), size)) 
> > > - break 
> > > \ No newline at end of file 
> > > + break 
> > > 
> > 
>
>
Henning Schild March 1, 2021, 11:20 p.m. UTC | #7
We usually try to not backport but bump the whole bitbake. There have
been exceptions, but usually because maintainer did not enforce that,
not because commits have been "super important".
While this one looks good, i would say it does not justify such forking
and will need to wait for the next bitbake version bump.

But feel free to bump all of bitbake, might be smooth or a significant
amount of work.

Henning

Am Mon, 1 Mar 2021 16:18:23 +0100
schrieb Florian Bezdeka <florian.bezdeka@siemens.com>:

> This is the backport for upstream (openembedded-core)
> eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038
> problem is used")
> 
> We are getting closer and closer to the year 2038 where the 32 bit
> time_t overflow will happen. While products (= embedded systems) with
> an expected life time of 15 years are still save the situation may
> change if your system has to survive the next 20 years.
> 
> ext2 and ext3 filesystems are always affected by the time overflow, so
> let's warn the user if these filesystems are still being used.
> 
> If ext4 is affected depends on the inode size chosen during filesystem
> creation. At least 256 bytes are necessary to be safe. As ext4 is
> used very often (and partitions may be created small first and
> extended later) this might be an issue for many users.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  scripts/lib/wic/misc.py      |  1 +
>  scripts/lib/wic/partition.py | 15 +++++++--------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
> index 4b08d64..c4332d5 100644
> --- a/scripts/lib/wic/misc.py
> +++ b/scripts/lib/wic/misc.py
> @@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
>  
>  # executable -> recipe pairs for exec_native_cmd
>  NATIVE_RECIPES = {"bmaptool": "bmap-tools",
> +                  "dumpe2fs": "e2fsprogs",
>                    "grub-mkimage": "grub-efi",
>                    "isohybrid": "syslinux",
>                    "mcopy": "mtools",
> diff --git a/scripts/lib/wic/partition.py
> b/scripts/lib/wic/partition.py index 4a5a31e..e6bcc9e 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -432,26 +432,25 @@ class Partition():
>              if part.mountpoint:
>                  args = [part.fstype, "mounted at %s" %
> part.mountpoint] elif part.label:
> -                args = [part.fstype, "labeled %s" % part.label]
> +                args = [part.fstype, "labeled '%s'" % part.label]
>              elif part.part_name:
> -                args = [part.fstype, "in partition %s" %
> part.part_name]
> +                args = [part.fstype, "in partition '%s'" %
> part.part_name] else:
> -                args = [part.fstype, ""]
> +                args = [part.fstype, "in partition %s" % part.num]
>              return err.format(*args)
>  
> -        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
> native_sysroot) -
>          # ext2 and ext3 are always affected by the Y2038 problem
>          if self.fstype in ["ext2", "ext3"]:
>              logger.warn(get_err_str(self))
>              return
>  
> +        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
> native_sysroot) +
>          # if ext4 is affected by the Y2038 problem depends on the
> inode size
> -        # Remember: inode size depends on the file system size
>          for line in out.splitlines():
>              if line.startswith("Inode size:"):
>                  size = int(line.split(":")[1].strip())
>                  if size < 256:
> -                    logger.warn("%s Inodes (of size %d) are too
> small." % \
> +                    logger.warn("%s Inodes (of size %d) are too
> small." % (get_err_str(self), size))
> -                break
> \ No newline at end of file
> +                break
Jan Kiszka March 2, 2021, 12:12 a.m. UTC | #8
On 02.03.21 10:20, Henning Schild wrote:
> We usually try to not backport but bump the whole bitbake. There have
> been exceptions, but usually because maintainer did not enforce that,
> not because commits have been "super important".
> While this one looks good, i would say it does not justify such forking
> and will need to wait for the next bitbake version bump.
> 
> But feel free to bump all of bitbake, might be smooth or a significant
> amount of work.

s/bitbake/wic/g, I suspect...

Jan

> 
> Henning
> 
> Am Mon, 1 Mar 2021 16:18:23 +0100
> schrieb Florian Bezdeka <florian.bezdeka@siemens.com>:
> 
>> This is the backport for upstream (openembedded-core)
>> eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038
>> problem is used")
>>
>> We are getting closer and closer to the year 2038 where the 32 bit
>> time_t overflow will happen. While products (= embedded systems) with
>> an expected life time of 15 years are still save the situation may
>> change if your system has to survive the next 20 years.
>>
>> ext2 and ext3 filesystems are always affected by the time overflow, so
>> let's warn the user if these filesystems are still being used.
>>
>> If ext4 is affected depends on the inode size chosen during filesystem
>> creation. At least 256 bytes are necessary to be safe. As ext4 is
>> used very often (and partitions may be created small first and
>> extended later) this might be an issue for many users.
>>
>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>> ---
>>  scripts/lib/wic/misc.py      |  1 +
>>  scripts/lib/wic/partition.py | 15 +++++++--------
>>  2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
>> index 4b08d64..c4332d5 100644
>> --- a/scripts/lib/wic/misc.py
>> +++ b/scripts/lib/wic/misc.py
>> @@ -26,6 +26,7 @@ logger = logging.getLogger('wic')
>>  
>>  # executable -> recipe pairs for exec_native_cmd
>>  NATIVE_RECIPES = {"bmaptool": "bmap-tools",
>> +                  "dumpe2fs": "e2fsprogs",
>>                    "grub-mkimage": "grub-efi",
>>                    "isohybrid": "syslinux",
>>                    "mcopy": "mtools",
>> diff --git a/scripts/lib/wic/partition.py
>> b/scripts/lib/wic/partition.py index 4a5a31e..e6bcc9e 100644
>> --- a/scripts/lib/wic/partition.py
>> +++ b/scripts/lib/wic/partition.py
>> @@ -432,26 +432,25 @@ class Partition():
>>              if part.mountpoint:
>>                  args = [part.fstype, "mounted at %s" %
>> part.mountpoint] elif part.label:
>> -                args = [part.fstype, "labeled %s" % part.label]
>> +                args = [part.fstype, "labeled '%s'" % part.label]
>>              elif part.part_name:
>> -                args = [part.fstype, "in partition %s" %
>> part.part_name]
>> +                args = [part.fstype, "in partition '%s'" %
>> part.part_name] else:
>> -                args = [part.fstype, ""]
>> +                args = [part.fstype, "in partition %s" % part.num]
>>              return err.format(*args)
>>  
>> -        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
>> native_sysroot) -
>>          # ext2 and ext3 are always affected by the Y2038 problem
>>          if self.fstype in ["ext2", "ext3"]:
>>              logger.warn(get_err_str(self))
>>              return
>>  
>> +        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs,
>> native_sysroot) +
>>          # if ext4 is affected by the Y2038 problem depends on the
>> inode size
>> -        # Remember: inode size depends on the file system size
>>          for line in out.splitlines():
>>              if line.startswith("Inode size:"):
>>                  size = int(line.split(":")[1].strip())
>>                  if size < 256:
>> -                    logger.warn("%s Inodes (of size %d) are too
>> small." % \
>> +                    logger.warn("%s Inodes (of size %d) are too
>> small." % (get_err_str(self), size))
>> -                break
>> \ No newline at end of file
>> +                break
>

Patch

diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py
index 4b08d64..c4332d5 100644
--- a/scripts/lib/wic/misc.py
+++ b/scripts/lib/wic/misc.py
@@ -26,6 +26,7 @@  logger = logging.getLogger('wic')
 
 # executable -> recipe pairs for exec_native_cmd
 NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+                  "dumpe2fs": "e2fsprogs",
                   "grub-mkimage": "grub-efi",
                   "isohybrid": "syslinux",
                   "mcopy": "mtools",
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 4a5a31e..e6bcc9e 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -432,26 +432,25 @@  class Partition():
             if part.mountpoint:
                 args = [part.fstype, "mounted at %s" % part.mountpoint]
             elif part.label:
-                args = [part.fstype, "labeled %s" % part.label]
+                args = [part.fstype, "labeled '%s'" % part.label]
             elif part.part_name:
-                args = [part.fstype, "in partition %s" % part.part_name]
+                args = [part.fstype, "in partition '%s'" % part.part_name]
             else:
-                args = [part.fstype, ""]
+                args = [part.fstype, "in partition %s" % part.num]
             return err.format(*args)
 
-        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
-
         # ext2 and ext3 are always affected by the Y2038 problem
         if self.fstype in ["ext2", "ext3"]:
             logger.warn(get_err_str(self))
             return
 
+        ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot)
+
         # if ext4 is affected by the Y2038 problem depends on the inode size
-        # Remember: inode size depends on the file system size
         for line in out.splitlines():
             if line.startswith("Inode size:"):
                 size = int(line.split(":")[1].strip())
                 if size < 256:
-                    logger.warn("%s Inodes (of size %d) are too small." % \
+                    logger.warn("%s Inodes (of size %d) are too small." %
                                 (get_err_str(self), size))
-                break
\ No newline at end of file
+                break