[v2,2/2] wic: Update to the latest revision

Message ID 20220613075401.2059119-3-Vijaikumar_Kanagarajan@mentor.com
State Superseded, archived
Headers show
Series Update WIC to bring in fspassno feature | expand

Commit Message

Vijai Kumar K June 12, 2022, 11:54 p.m. UTC
Update to the latest wic from OE-core.

OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
 scripts/lib/wic/help.py                  |  6 ++++++
 scripts/lib/wic/ksparser.py              |  1 +
 scripts/lib/wic/partition.py             |  1 +
 scripts/lib/wic/plugins/imager/direct.py |  5 +++--
 5 files changed, 30 insertions(+), 2 deletions(-)

Comments

Henning Schild June 13, 2022, 1:02 a.m. UTC | #1
Am Mon, 13 Jun 2022 13:24:01 +0530
schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:

> Update to the latest wic from OE-core.
> 
> OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
>  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
>  scripts/lib/wic/help.py                  |  6 ++++++
>  scripts/lib/wic/ksparser.py              |  1 +
>  scripts/lib/wic/partition.py             |  1 +
>  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
>  5 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 2998824..436b204 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -406,3 +406,22 @@ groups are now created after all packages are
> installed. 
>  Changes in next
>  ---------------
> +
> +### Wic adds / mountpoint to fstab
> +
> +In the older version of wic, any mount point named / is skipped from
> adding +into the fstab entry.
> +
> +With the latest wic, this is not the case. / mount point, if any, is
> added +to /etc/fstab for automount.
> +
> +Any wks file which assumed that / would be skipped from /etc/fstab
> should +now be corrected. Otherwise, it might result in multiple /
> entries in /etc/fstab. +One by the image_configure_fstab function
> from image class and one by wic. +
> +Below is an example wks entry that might cause an issue.
> +Replace "part /" with "part" to avoid adding duplicate entry for /.

I am not sure multiple entries would be an issue, i think the last one
will simply always win. It is good to have a note about that change, but
i doubt people really have to do anything.
And if anything has to be done, isar should drop the first one
centrally.

The fstab entry for root is purely for adding some weird mount options,
usually root is not mounted with fstab but with cmdline and initrd. And
not having / in fstab just makes that rootfs more generic ... it can
become part of nfs and next guy takes it as btrfs while next guy takes
it as ext4.

Note is good, advise is not

Henning

> +
> +```
> +part / --source rootfs --ondisk sda --fstype ext4 --label platform
> --align 1024 --use-uuid +```
> diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> index 4ff7470..73e3380 100644
> --- a/scripts/lib/wic/help.py
> +++ b/scripts/lib/wic/help.py
> @@ -940,6 +940,12 @@ DESCRIPTION
>                        quotes.  If not specified, the default string
> is "defaults".
>  
> +         --fspassno: Specifies the order in which filesystem checks
> are done
> +                     at boot time by fsck.  See fs_passno parameter
> of
> +                     fstab(5).  This parameter will be copied into
> the
> +                     /etc/fstab file of the installed system.  If not
> +                     specified the default value of "0" will be used.
> +
>           --label label: Specifies the label to give to the filesystem
>                          to be made on the partition. If the given
>                          label is already in use by another
> filesystem, diff --git a/scripts/lib/wic/ksparser.py
> b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> --- a/scripts/lib/wic/ksparser.py
> +++ b/scripts/lib/wic/ksparser.py
> @@ -155,6 +155,7 @@ class KickStart():
>          part.add_argument('--change-directory')
>          part.add_argument("--extra-space", type=sizetype("M"))
>          part.add_argument('--fsoptions', dest='fsopts')
> +        part.add_argument('--fspassno', dest='fspassno')
>          part.add_argument('--fstype', default='vfat',
>                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
>                                     'squashfs', 'vfat', 'msdos',
> 'erofs', diff --git a/scripts/lib/wic/partition.py
> b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -33,6 +33,7 @@ class Partition():
>          self.include_path = args.include_path
>          self.change_directory = args.change_directory
>          self.fsopts = args.fsopts
> +        self.fspassno = args.fspassno
>          self.fstype = args.fstype
>          self.label = args.label
>          self.use_label = args.use_label
> diff --git a/scripts/lib/wic/plugins/imager/direct.py
> b/scripts/lib/wic/plugins/imager/direct.py index 4d0b836..c44159b
> 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> +++ b/scripts/lib/wic/plugins/imager/direct.py
> @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
>          updated = False
>          for part in self.parts:
>              if not part.realnum or not part.mountpoint \
> -               or part.mountpoint == "/" or not
> part.mountpoint.startswith('/'):
> +               or not part.mountpoint.startswith('/'):
>                  continue
>  
>              if part.use_uuid:
> @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
>                  device_name = "/dev/%s%s%d" % (part.disk, prefix,
> part.realnum) 
>              opts = part.fsopts if part.fsopts else "defaults"
> +            passno = part.fspassno if part.fspassno else "0"
>              line = "\t".join([device_name, part.mountpoint,
> part.fstype,
> -                              opts, "0", "0"]) + "\n"
> +                              opts, "0", passno]) + "\n"
>  
>              fstab_lines.append(line)
>              updated = True
Vijai Kumar K June 13, 2022, 1:18 a.m. UTC | #2
> -----Original Message-----
> From: Henning Schild <henning.schild@siemens.com>
> Sent: 13 June 2022 14:32
> To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> 
> Am Mon, 13 Jun 2022 13:24:01 +0530
> schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:
> 
> > Update to the latest wic from OE-core.
> >
> > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> >
> > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > ---
> >  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
> >  scripts/lib/wic/help.py                  |  6 ++++++
> >  scripts/lib/wic/ksparser.py              |  1 +
> >  scripts/lib/wic/partition.py             |  1 +
> >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> >  5 files changed, 30 insertions(+), 2 deletions(-)
> >
> > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index
> > 2998824..436b204 100644
> > --- a/RECIPE-API-CHANGELOG.md
> > +++ b/RECIPE-API-CHANGELOG.md
> > @@ -406,3 +406,22 @@ groups are now created after all packages are
> > installed.
> >  Changes in next
> >  ---------------
> > +
> > +### Wic adds / mountpoint to fstab
> > +
> > +In the older version of wic, any mount point named / is skipped from
> > adding +into the fstab entry.
> > +
> > +With the latest wic, this is not the case. / mount point, if any, is
> > added +to /etc/fstab for automount.
> > +
> > +Any wks file which assumed that / would be skipped from /etc/fstab
> > should +now be corrected. Otherwise, it might result in multiple /
> > entries in /etc/fstab. +One by the image_configure_fstab function from
> > image class and one by wic. +
> > +Below is an example wks entry that might cause an issue.
> > +Replace "part /" with "part" to avoid adding duplicate entry for /.
> 
> I am not sure multiple entries would be an issue, i think the last one will
> simply always win. It is good to have a note about that change, but i doubt
> people really have to do anything.
> And if anything has to be done, isar should drop the first one centrally.
> 
> The fstab entry for root is purely for adding some weird mount options,
> usually root is not mounted with fstab but with cmdline and initrd. And not
> having / in fstab just makes that rootfs more generic ... it can become part of
> nfs and next guy takes it as btrfs while next guy takes it as ext4.
> 
> Note is good, advise is not

Noted. Will change the text accordingly in V3.

Thanks,
Vijai Kumar K

> 
> Henning
> 
> > +
> > +```
> > +part / --source rootfs --ondisk sda --fstype ext4 --label platform
> > --align 1024 --use-uuid +```
> > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index
> > 4ff7470..73e3380 100644
> > --- a/scripts/lib/wic/help.py
> > +++ b/scripts/lib/wic/help.py
> > @@ -940,6 +940,12 @@ DESCRIPTION
> >                        quotes.  If not specified, the default string
> > is "defaults".
> >
> > +         --fspassno: Specifies the order in which filesystem checks
> > are done
> > +                     at boot time by fsck.  See fs_passno parameter
> > of
> > +                     fstab(5).  This parameter will be copied into
> > the
> > +                     /etc/fstab file of the installed system.  If not
> > +                     specified the default value of "0" will be used.
> > +
> >           --label label: Specifies the label to give to the filesystem
> >                          to be made on the partition. If the given
> >                          label is already in use by another
> > filesystem, diff --git a/scripts/lib/wic/ksparser.py
> > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> > --- a/scripts/lib/wic/ksparser.py
> > +++ b/scripts/lib/wic/ksparser.py
> > @@ -155,6 +155,7 @@ class KickStart():
> >          part.add_argument('--change-directory')
> >          part.add_argument("--extra-space", type=sizetype("M"))
> >          part.add_argument('--fsoptions', dest='fsopts')
> > +        part.add_argument('--fspassno', dest='fspassno')
> >          part.add_argument('--fstype', default='vfat',
> >                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
> >                                     'squashfs', 'vfat', 'msdos',
> > 'erofs', diff --git a/scripts/lib/wic/partition.py
> > b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> > --- a/scripts/lib/wic/partition.py
> > +++ b/scripts/lib/wic/partition.py
> > @@ -33,6 +33,7 @@ class Partition():
> >          self.include_path = args.include_path
> >          self.change_directory = args.change_directory
> >          self.fsopts = args.fsopts
> > +        self.fspassno = args.fspassno
> >          self.fstype = args.fstype
> >          self.label = args.label
> >          self.use_label = args.use_label diff --git
> > a/scripts/lib/wic/plugins/imager/direct.py
> > b/scripts/lib/wic/plugins/imager/direct.py index 4d0b836..c44159b
> > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> >          updated = False
> >          for part in self.parts:
> >              if not part.realnum or not part.mountpoint \
> > -               or part.mountpoint == "/" or not
> > part.mountpoint.startswith('/'):
> > +               or not part.mountpoint.startswith('/'):
> >                  continue
> >
> >              if part.use_uuid:
> > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> >                  device_name = "/dev/%s%s%d" % (part.disk, prefix,
> > part.realnum)
> >              opts = part.fsopts if part.fsopts else "defaults"
> > +            passno = part.fspassno if part.fspassno else "0"
> >              line = "\t".join([device_name, part.mountpoint,
> > part.fstype,
> > -                              opts, "0", "0"]) + "\n"
> > +                              opts, "0", passno]) + "\n"
> >
> >              fstab_lines.append(line)
> >              updated = True
Vijai Kumar K June 16, 2022, 9:45 p.m. UTC | #3
> -----Original Message-----
> From: Kanagarajan, Vijaikumar
> Sent: 13 June 2022 14:48
> To: 'Henning Schild' <henning.schild@siemens.com>
> Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> 
> 
> 
> > -----Original Message-----
> > From: Henning Schild <henning.schild@siemens.com>
> > Sent: 13 June 2022 14:32
> > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> >
> > Am Mon, 13 Jun 2022 13:24:01 +0530
> > schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:
> >
> > > Update to the latest wic from OE-core.
> > >
> > > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > >
> > > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > > ---
> > >  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
> > >  scripts/lib/wic/help.py                  |  6 ++++++
> > >  scripts/lib/wic/ksparser.py              |  1 +
> > >  scripts/lib/wic/partition.py             |  1 +
> > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > index
> > > 2998824..436b204 100644
> > > --- a/RECIPE-API-CHANGELOG.md
> > > +++ b/RECIPE-API-CHANGELOG.md
> > > @@ -406,3 +406,22 @@ groups are now created after all packages are
> > > installed.
> > >  Changes in next
> > >  ---------------
> > > +
> > > +### Wic adds / mountpoint to fstab
> > > +
> > > +In the older version of wic, any mount point named / is skipped
> > > +from
> > > adding +into the fstab entry.
> > > +
> > > +With the latest wic, this is not the case. / mount point, if any,
> > > +is
> > > added +to /etc/fstab for automount.
> > > +
> > > +Any wks file which assumed that / would be skipped from /etc/fstab
> > > should +now be corrected. Otherwise, it might result in multiple /
> > > entries in /etc/fstab. +One by the image_configure_fstab function
> > > from image class and one by wic. +
> > > +Below is an example wks entry that might cause an issue.
> > > +Replace "part /" with "part" to avoid adding duplicate entry for /.
> >
> > I am not sure multiple entries would be an issue, i think the last one
> > will simply always win. It is good to have a note about that change,
> > but i doubt people really have to do anything.
> > And if anything has to be done, isar should drop the first one centrally.
> >
> > The fstab entry for root is purely for adding some weird mount
> > options, usually root is not mounted with fstab but with cmdline and
> > initrd. And not having / in fstab just makes that rootfs more generic
> > ... it can become part of nfs and next guy takes it as btrfs while next guy
> takes it as ext4.
> >
> > Note is good, advise is not
> 
> Noted. Will change the text accordingly in V3.

Ok we cannot drop / mountpoint name(though optional). We would be lose the ability to find out UUID of root using rootdev api.
This is used by some plugins. So the better way would be to use the --no-fstab-update. Seems like we can set them per partition now.

Thanks,
Vijai Kumar K

> 
> Thanks,
> Vijai Kumar K
> 
> >
> > Henning
> >
> > > +
> > > +```
> > > +part / --source rootfs --ondisk sda --fstype ext4 --label platform
> > > --align 1024 --use-uuid +```
> > > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index
> > > 4ff7470..73e3380 100644
> > > --- a/scripts/lib/wic/help.py
> > > +++ b/scripts/lib/wic/help.py
> > > @@ -940,6 +940,12 @@ DESCRIPTION
> > >                        quotes.  If not specified, the default string
> > > is "defaults".
> > >
> > > +         --fspassno: Specifies the order in which filesystem checks
> > > are done
> > > +                     at boot time by fsck.  See fs_passno parameter
> > > of
> > > +                     fstab(5).  This parameter will be copied into
> > > the
> > > +                     /etc/fstab file of the installed system.  If not
> > > +                     specified the default value of "0" will be used.
> > > +
> > >           --label label: Specifies the label to give to the filesystem
> > >                          to be made on the partition. If the given
> > >                          label is already in use by another
> > > filesystem, diff --git a/scripts/lib/wic/ksparser.py
> > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> > > --- a/scripts/lib/wic/ksparser.py
> > > +++ b/scripts/lib/wic/ksparser.py
> > > @@ -155,6 +155,7 @@ class KickStart():
> > >          part.add_argument('--change-directory')
> > >          part.add_argument("--extra-space", type=sizetype("M"))
> > >          part.add_argument('--fsoptions', dest='fsopts')
> > > +        part.add_argument('--fspassno', dest='fspassno')
> > >          part.add_argument('--fstype', default='vfat',
> > >                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
> > >                                     'squashfs', 'vfat', 'msdos',
> > > 'erofs', diff --git a/scripts/lib/wic/partition.py
> > > b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> > > --- a/scripts/lib/wic/partition.py
> > > +++ b/scripts/lib/wic/partition.py
> > > @@ -33,6 +33,7 @@ class Partition():
> > >          self.include_path = args.include_path
> > >          self.change_directory = args.change_directory
> > >          self.fsopts = args.fsopts
> > > +        self.fspassno = args.fspassno
> > >          self.fstype = args.fstype
> > >          self.label = args.label
> > >          self.use_label = args.use_label diff --git
> > > a/scripts/lib/wic/plugins/imager/direct.py
> > > b/scripts/lib/wic/plugins/imager/direct.py index 4d0b836..c44159b
> > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > >          updated = False
> > >          for part in self.parts:
> > >              if not part.realnum or not part.mountpoint \
> > > -               or part.mountpoint == "/" or not
> > > part.mountpoint.startswith('/'):
> > > +               or not part.mountpoint.startswith('/'):
> > >                  continue
> > >
> > >              if part.use_uuid:
> > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > >                  device_name = "/dev/%s%s%d" % (part.disk, prefix,
> > > part.realnum)
> > >              opts = part.fsopts if part.fsopts else "defaults"
> > > +            passno = part.fspassno if part.fspassno else "0"
> > >              line = "\t".join([device_name, part.mountpoint,
> > > part.fstype,
> > > -                              opts, "0", "0"]) + "\n"
> > > +                              opts, "0", passno]) + "\n"
> > >
> > >              fstab_lines.append(line)
> > >              updated = True
MOESSBAUER, Felix Sept. 26, 2022, 1:40 a.m. UTC | #4
Hi Vijai & Henning,

Are there any news on this?
I just discovered that still many (if not all) of our images are affected by this bug.

While it is not serios, having error messages in the journal is still pretty bad:
systemd-fstab-generator[1491]: Failed to create unit file /run/systemd/generator/-.mount, as it already exists. Duplicate entry in /etc/fstab?

Felix

> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Kanagarajan, Vijaikumar
> Sent: Friday, June 17, 2022 1:46 PM
> To: isar-users@googlegroups.com
> Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild, Henning (T CED SES-
> DE) <henning.schild@siemens.com>
> Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> 
> 
> 
> > -----Original Message-----
> > From: Kanagarajan, Vijaikumar
> > Sent: 13 June 2022 14:48
> > To: 'Henning Schild' <henning.schild@siemens.com>
> > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> >
> >
> >
> > > -----Original Message-----
> > > From: Henning Schild <henning.schild@siemens.com>
> > > Sent: 13 June 2022 14:32
> > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> > >
> > > Am Mon, 13 Jun 2022 13:24:01 +0530
> > > schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:
> > >
> > > > Update to the latest wic from OE-core.
> > > >
> > > > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > >
> > > > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > > > ---
> > > >  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
> > > >  scripts/lib/wic/help.py                  |  6 ++++++
> > > >  scripts/lib/wic/ksparser.py              |  1 +
> > > >  scripts/lib/wic/partition.py             |  1 +
> > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > > index
> > > > 2998824..436b204 100644
> > > > --- a/RECIPE-API-CHANGELOG.md
> > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > @@ -406,3 +406,22 @@ groups are now created after all packages are
> > > > installed.
> > > >  Changes in next
> > > >  ---------------
> > > > +
> > > > +### Wic adds / mountpoint to fstab
> > > > +
> > > > +In the older version of wic, any mount point named / is skipped
> > > > +from
> > > > adding +into the fstab entry.
> > > > +
> > > > +With the latest wic, this is not the case. / mount point, if any,
> > > > +is
> > > > added +to /etc/fstab for automount.
> > > > +
> > > > +Any wks file which assumed that / would be skipped from
> > > > +/etc/fstab
> > > > should +now be corrected. Otherwise, it might result in multiple /
> > > > entries in /etc/fstab. +One by the image_configure_fstab function
> > > > from image class and one by wic. +
> > > > +Below is an example wks entry that might cause an issue.
> > > > +Replace "part /" with "part" to avoid adding duplicate entry for /.
> > >
> > > I am not sure multiple entries would be an issue, i think the last
> > > one will simply always win. It is good to have a note about that
> > > change, but i doubt people really have to do anything.
> > > And if anything has to be done, isar should drop the first one centrally.
> > >
> > > The fstab entry for root is purely for adding some weird mount
> > > options, usually root is not mounted with fstab but with cmdline and
> > > initrd. And not having / in fstab just makes that rootfs more
> > > generic ... it can become part of nfs and next guy takes it as btrfs
> > > while next guy
> > takes it as ext4.
> > >
> > > Note is good, advise is not
> >
> > Noted. Will change the text accordingly in V3.
> 
> Ok we cannot drop / mountpoint name(though optional). We would be lose the
> ability to find out UUID of root using rootdev api.
> This is used by some plugins. So the better way would be to use the --no-fstab-
> update. Seems like we can set them per partition now.
> 
> Thanks,
> Vijai Kumar K
> 
> >
> > Thanks,
> > Vijai Kumar K
> >
> > >
> > > Henning
> > >
> > > > +
> > > > +```
> > > > +part / --source rootfs --ondisk sda --fstype ext4 --label
> > > > +platform
> > > > --align 1024 --use-uuid +```
> > > > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> > > > index
> > > > 4ff7470..73e3380 100644
> > > > --- a/scripts/lib/wic/help.py
> > > > +++ b/scripts/lib/wic/help.py
> > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > >                        quotes.  If not specified, the default
> > > > string is "defaults".
> > > >
> > > > +         --fspassno: Specifies the order in which filesystem
> > > > + checks
> > > > are done
> > > > +                     at boot time by fsck.  See fs_passno
> > > > + parameter
> > > > of
> > > > +                     fstab(5).  This parameter will be copied
> > > > + into
> > > > the
> > > > +                     /etc/fstab file of the installed system.  If not
> > > > +                     specified the default value of "0" will be used.
> > > > +
> > > >           --label label: Specifies the label to give to the filesystem
> > > >                          to be made on the partition. If the given
> > > >                          label is already in use by another
> > > > filesystem, diff --git a/scripts/lib/wic/ksparser.py
> > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> > > > --- a/scripts/lib/wic/ksparser.py
> > > > +++ b/scripts/lib/wic/ksparser.py
> > > > @@ -155,6 +155,7 @@ class KickStart():
> > > >          part.add_argument('--change-directory')
> > > >          part.add_argument("--extra-space", type=sizetype("M"))
> > > >          part.add_argument('--fsoptions', dest='fsopts')
> > > > +        part.add_argument('--fspassno', dest='fspassno')
> > > >          part.add_argument('--fstype', default='vfat',
> > > >                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
> > > >                                     'squashfs', 'vfat', 'msdos',
> > > > 'erofs', diff --git a/scripts/lib/wic/partition.py
> > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> > > > --- a/scripts/lib/wic/partition.py
> > > > +++ b/scripts/lib/wic/partition.py
> > > > @@ -33,6 +33,7 @@ class Partition():
> > > >          self.include_path = args.include_path
> > > >          self.change_directory = args.change_directory
> > > >          self.fsopts = args.fsopts
> > > > +        self.fspassno = args.fspassno
> > > >          self.fstype = args.fstype
> > > >          self.label = args.label
> > > >          self.use_label = args.use_label diff --git
> > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > b/scripts/lib/wic/plugins/imager/direct.py index 4d0b836..c44159b
> > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > >          updated = False
> > > >          for part in self.parts:
> > > >              if not part.realnum or not part.mountpoint \
> > > > -               or part.mountpoint == "/" or not
> > > > part.mountpoint.startswith('/'):
> > > > +               or not part.mountpoint.startswith('/'):
> > > >                  continue
> > > >
> > > >              if part.use_uuid:
> > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > >                  device_name = "/dev/%s%s%d" % (part.disk, prefix,
> > > > part.realnum)
> > > >              opts = part.fsopts if part.fsopts else "defaults"
> > > > +            passno = part.fspassno if part.fspassno else "0"
> > > >              line = "\t".join([device_name, part.mountpoint,
> > > > part.fstype,
> > > > -                              opts, "0", "0"]) + "\n"
> > > > +                              opts, "0", passno]) + "\n"
> > > >
> > > >              fstab_lines.append(line)
> > > >              updated = True
> 
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.g
> oogle.com%2Fd%2Fmsgid%2Fisar-
> users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;data=
> 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca5408
> da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104
> 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo
> iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata
> =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;rese
> rved=0.
Vijai Kumar K Sept. 26, 2022, 4:53 a.m. UTC | #5
> -----Original Message-----
> From: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>
> Sent: 26 September 2022 07:11
> To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>;
> Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> users@googlegroups.com
> Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> 
> Hi Vijai & Henning,
> 
> Are there any news on this?
> I just discovered that still many (if not all) of our images are affected by this
> bug.

Hi Felix,

Unfortunately not. If we already have the latest wic, --no-fstab-update[1] might help.(untested).

[1] https://github.com/openembedded/openembedded-core/commit/ab4c95af8ecd15dc136194ab761afae756db5803

Thanks,
Vijai Kumar K

> 
> While it is not serios, having error messages in the journal is still pretty bad:
> systemd-fstab-generator[1491]: Failed to create unit file
> /run/systemd/generator/-.mount, as it already exists. Duplicate entry in
> /etc/fstab?
> 
> Felix
> 
> > -----Original Message-----
> > From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> > Behalf Of Kanagarajan, Vijaikumar
> > Sent: Friday, June 17, 2022 1:46 PM
> > To: isar-users@googlegroups.com
> > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild, Henning (T
> > CED SES-
> > DE) <henning.schild@siemens.com>
> > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> >
> >
> >
> > > -----Original Message-----
> > > From: Kanagarajan, Vijaikumar
> > > Sent: 13 June 2022 14:48
> > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Henning Schild <henning.schild@siemens.com>
> > > > Sent: 13 June 2022 14:32
> > > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > >
> > > > > Update to the latest wic from OE-core.
> > > > >
> > > > > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > > >
> > > > > Signed-off-by: Vijai Kumar K
> <Vijaikumar_Kanagarajan@mentor.com>
> > > > > ---
> > > > >  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
> > > > >  scripts/lib/wic/help.py                  |  6 ++++++
> > > > >  scripts/lib/wic/ksparser.py              |  1 +
> > > > >  scripts/lib/wic/partition.py             |  1 +
> > > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-
> CHANGELOG.md
> > > > index
> > > > > 2998824..436b204 100644
> > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > @@ -406,3 +406,22 @@ groups are now created after all packages
> > > > > are installed.
> > > > >  Changes in next
> > > > >  ---------------
> > > > > +
> > > > > +### Wic adds / mountpoint to fstab
> > > > > +
> > > > > +In the older version of wic, any mount point named / is skipped
> > > > > +from
> > > > > adding +into the fstab entry.
> > > > > +
> > > > > +With the latest wic, this is not the case. / mount point, if
> > > > > +any, is
> > > > > added +to /etc/fstab for automount.
> > > > > +
> > > > > +Any wks file which assumed that / would be skipped from
> > > > > +/etc/fstab
> > > > > should +now be corrected. Otherwise, it might result in multiple
> > > > > / entries in /etc/fstab. +One by the image_configure_fstab
> > > > > function from image class and one by wic. +
> > > > > +Below is an example wks entry that might cause an issue.
> > > > > +Replace "part /" with "part" to avoid adding duplicate entry for /.
> > > >
> > > > I am not sure multiple entries would be an issue, i think the last
> > > > one will simply always win. It is good to have a note about that
> > > > change, but i doubt people really have to do anything.
> > > > And if anything has to be done, isar should drop the first one centrally.
> > > >
> > > > The fstab entry for root is purely for adding some weird mount
> > > > options, usually root is not mounted with fstab but with cmdline
> > > > and initrd. And not having / in fstab just makes that rootfs more
> > > > generic ... it can become part of nfs and next guy takes it as
> > > > btrfs while next guy
> > > takes it as ext4.
> > > >
> > > > Note is good, advise is not
> > >
> > > Noted. Will change the text accordingly in V3.
> >
> > Ok we cannot drop / mountpoint name(though optional). We would be
> lose
> > the ability to find out UUID of root using rootdev api.
> > This is used by some plugins. So the better way would be to use the
> > --no-fstab- update. Seems like we can set them per partition now.
> >
> > Thanks,
> > Vijai Kumar K
> >
> > >
> > > Thanks,
> > > Vijai Kumar K
> > >
> > > >
> > > > Henning
> > > >
> > > > > +
> > > > > +```
> > > > > +part / --source rootfs --ondisk sda --fstype ext4 --label
> > > > > +platform
> > > > > --align 1024 --use-uuid +```
> > > > > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> > > > > index
> > > > > 4ff7470..73e3380 100644
> > > > > --- a/scripts/lib/wic/help.py
> > > > > +++ b/scripts/lib/wic/help.py
> > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > >                        quotes.  If not specified, the default
> > > > > string is "defaults".
> > > > >
> > > > > +         --fspassno: Specifies the order in which filesystem
> > > > > + checks
> > > > > are done
> > > > > +                     at boot time by fsck.  See fs_passno
> > > > > + parameter
> > > > > of
> > > > > +                     fstab(5).  This parameter will be copied
> > > > > + into
> > > > > the
> > > > > +                     /etc/fstab file of the installed system.  If not
> > > > > +                     specified the default value of "0" will be used.
> > > > > +
> > > > >           --label label: Specifies the label to give to the filesystem
> > > > >                          to be made on the partition. If the given
> > > > >                          label is already in use by another
> > > > > filesystem, diff --git a/scripts/lib/wic/ksparser.py
> > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> > > > > --- a/scripts/lib/wic/ksparser.py
> > > > > +++ b/scripts/lib/wic/ksparser.py
> > > > > @@ -155,6 +155,7 @@ class KickStart():
> > > > >          part.add_argument('--change-directory')
> > > > >          part.add_argument("--extra-space", type=sizetype("M"))
> > > > >          part.add_argument('--fsoptions', dest='fsopts')
> > > > > +        part.add_argument('--fspassno', dest='fspassno')
> > > > >          part.add_argument('--fstype', default='vfat',
> > > > >                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
> > > > >                                     'squashfs', 'vfat', 'msdos',
> > > > > 'erofs', diff --git a/scripts/lib/wic/partition.py
> > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> > > > > --- a/scripts/lib/wic/partition.py
> > > > > +++ b/scripts/lib/wic/partition.py
> > > > > @@ -33,6 +33,7 @@ class Partition():
> > > > >          self.include_path = args.include_path
> > > > >          self.change_directory = args.change_directory
> > > > >          self.fsopts = args.fsopts
> > > > > +        self.fspassno = args.fspassno
> > > > >          self.fstype = args.fstype
> > > > >          self.label = args.label
> > > > >          self.use_label = args.use_label diff --git
> > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > 4d0b836..c44159b
> > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > >          updated = False
> > > > >          for part in self.parts:
> > > > >              if not part.realnum or not part.mountpoint \
> > > > > -               or part.mountpoint == "/" or not
> > > > > part.mountpoint.startswith('/'):
> > > > > +               or not part.mountpoint.startswith('/'):
> > > > >                  continue
> > > > >
> > > > >              if part.use_uuid:
> > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > >                  device_name = "/dev/%s%s%d" % (part.disk,
> > > > > prefix,
> > > > > part.realnum)
> > > > >              opts = part.fsopts if part.fsopts else "defaults"
> > > > > +            passno = part.fspassno if part.fspassno else "0"
> > > > >              line = "\t".join([device_name, part.mountpoint,
> > > > > part.fstype,
> > > > > -                              opts, "0", "0"]) + "\n"
> > > > > +                              opts, "0", passno]) + "\n"
> > > > >
> > > > >              fstab_lines.append(line)
> > > > >              updated = True
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "isar-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to isar-users+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrou
> > ps.g
> > oogle.com%2Fd%2Fmsgid%2Fisar-
> >
> users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat
> a=
> >
> 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540
> 8
> >
> da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104
> >
> 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> Ijo
> >
> iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda
> ta
> >
> =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re
> se
> > rved=0.
MOESSBAUER, Felix Sept. 26, 2022, 5:57 a.m. UTC | #6
> -----Original Message-----
> From: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> Sent: Monday, September 26, 2022 12:53 PM
> To: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>; Schild,
> Henning (T CED SES-DE) <henning.schild@siemens.com>
> Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> users@googlegroups.com
> Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> 
> 
> 
> > -----Original Message-----
> > From: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>
> > Sent: 26 September 2022 07:11
> > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>;
> > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > users@googlegroups.com
> > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> >
> > Hi Vijai & Henning,
> >
> > Are there any news on this?
> > I just discovered that still many (if not all) of our images are
> > affected by this bug.
> 
> Hi Felix,
> 
> Unfortunately not. If we already have the latest wic, --no-fstab-update[1] might
> help.(untested).

We already have a wic version with this option, but it doesn't look right to add it to the root partition.
Instead this option can be used for partitions that should not show up in the fstab at all.

Indeed, the fstab entry has to be set by WIC to set settings like UUID and filesystem.
But this requires that we either remove the entry set by ISAR in image_configure_fstab, or we remove the entry after generating the rootfs, but before WIC.

Opinions? @Kiszka, Jan (T CED)

Felix

> 
> Thanks,
> Vijai Kumar K
> 
> >
> > While it is not serios, having error messages in the journal is still pretty bad:
> > systemd-fstab-generator[1491]: Failed to create unit file
> > /run/systemd/generator/-.mount, as it already exists. Duplicate entry
> > in /etc/fstab?
> >
> > Felix
> >
> > > -----Original Message-----
> > > From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> > > Behalf Of Kanagarajan, Vijaikumar
> > > Sent: Friday, June 17, 2022 1:46 PM
> > > To: isar-users@googlegroups.com
> > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild, Henning (T
> > > CED SES-
> > > DE) <henning.schild@siemens.com>
> > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Kanagarajan, Vijaikumar
> > > > Sent: 13 June 2022 14:48
> > > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Henning Schild <henning.schild@siemens.com>
> > > > > Sent: 13 June 2022 14:32
> > > > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> > > > >
> > > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > > >
> > > > > > Update to the latest wic from OE-core.
> > > > > >
> > > > > > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > > > >
> > > > > > Signed-off-by: Vijai Kumar K
> > <Vijaikumar_Kanagarajan@mentor.com>
> > > > > > ---
> > > > > >  RECIPE-API-CHANGELOG.md                  | 19 +++++++++++++++++++
> > > > > >  scripts/lib/wic/help.py                  |  6 ++++++
> > > > > >  scripts/lib/wic/ksparser.py              |  1 +
> > > > > >  scripts/lib/wic/partition.py             |  1 +
> > > > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > > >
> > > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-
> > CHANGELOG.md
> > > > > index
> > > > > > 2998824..436b204 100644
> > > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > > @@ -406,3 +406,22 @@ groups are now created after all packages
> > > > > > are installed.
> > > > > >  Changes in next
> > > > > >  ---------------
> > > > > > +
> > > > > > +### Wic adds / mountpoint to fstab
> > > > > > +
> > > > > > +In the older version of wic, any mount point named / is
> > > > > > +skipped from
> > > > > > adding +into the fstab entry.
> > > > > > +
> > > > > > +With the latest wic, this is not the case. / mount point, if
> > > > > > +any, is
> > > > > > added +to /etc/fstab for automount.
> > > > > > +
> > > > > > +Any wks file which assumed that / would be skipped from
> > > > > > +/etc/fstab
> > > > > > should +now be corrected. Otherwise, it might result in
> > > > > > multiple / entries in /etc/fstab. +One by the
> > > > > > image_configure_fstab function from image class and one by
> > > > > > wic. +
> > > > > > +Below is an example wks entry that might cause an issue.
> > > > > > +Replace "part /" with "part" to avoid adding duplicate entry for /.
> > > > >
> > > > > I am not sure multiple entries would be an issue, i think the
> > > > > last one will simply always win. It is good to have a note about
> > > > > that change, but i doubt people really have to do anything.
> > > > > And if anything has to be done, isar should drop the first one centrally.
> > > > >
> > > > > The fstab entry for root is purely for adding some weird mount
> > > > > options, usually root is not mounted with fstab but with cmdline
> > > > > and initrd. And not having / in fstab just makes that rootfs
> > > > > more generic ... it can become part of nfs and next guy takes it
> > > > > as btrfs while next guy
> > > > takes it as ext4.
> > > > >
> > > > > Note is good, advise is not
> > > >
> > > > Noted. Will change the text accordingly in V3.
> > >
> > > Ok we cannot drop / mountpoint name(though optional). We would be
> > lose
> > > the ability to find out UUID of root using rootdev api.
> > > This is used by some plugins. So the better way would be to use the
> > > --no-fstab- update. Seems like we can set them per partition now.
> > >
> > > Thanks,
> > > Vijai Kumar K
> > >
> > > >
> > > > Thanks,
> > > > Vijai Kumar K
> > > >
> > > > >
> > > > > Henning
> > > > >
> > > > > > +
> > > > > > +```
> > > > > > +part / --source rootfs --ondisk sda --fstype ext4 --label
> > > > > > +platform
> > > > > > --align 1024 --use-uuid +```
> > > > > > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> > > > > > index
> > > > > > 4ff7470..73e3380 100644
> > > > > > --- a/scripts/lib/wic/help.py
> > > > > > +++ b/scripts/lib/wic/help.py
> > > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > > >                        quotes.  If not specified, the default
> > > > > > string is "defaults".
> > > > > >
> > > > > > +         --fspassno: Specifies the order in which filesystem
> > > > > > + checks
> > > > > > are done
> > > > > > +                     at boot time by fsck.  See fs_passno
> > > > > > + parameter
> > > > > > of
> > > > > > +                     fstab(5).  This parameter will be copied
> > > > > > + into
> > > > > > the
> > > > > > +                     /etc/fstab file of the installed system.  If not
> > > > > > +                     specified the default value of "0" will be used.
> > > > > > +
> > > > > >           --label label: Specifies the label to give to the filesystem
> > > > > >                          to be made on the partition. If the given
> > > > > >                          label is already in use by another
> > > > > > filesystem, diff --git a/scripts/lib/wic/ksparser.py
> > > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9 100644
> > > > > > --- a/scripts/lib/wic/ksparser.py
> > > > > > +++ b/scripts/lib/wic/ksparser.py
> > > > > > @@ -155,6 +155,7 @@ class KickStart():
> > > > > >          part.add_argument('--change-directory')
> > > > > >          part.add_argument("--extra-space", type=sizetype("M"))
> > > > > >          part.add_argument('--fsoptions', dest='fsopts')
> > > > > > +        part.add_argument('--fspassno', dest='fspassno')
> > > > > >          part.add_argument('--fstype', default='vfat',
> > > > > >                            choices=('ext2', 'ext3', 'ext4', 'btrfs',
> > > > > >                                     'squashfs', 'vfat',
> > > > > > 'msdos', 'erofs', diff --git a/scripts/lib/wic/partition.py
> > > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b 100644
> > > > > > --- a/scripts/lib/wic/partition.py
> > > > > > +++ b/scripts/lib/wic/partition.py
> > > > > > @@ -33,6 +33,7 @@ class Partition():
> > > > > >          self.include_path = args.include_path
> > > > > >          self.change_directory = args.change_directory
> > > > > >          self.fsopts = args.fsopts
> > > > > > +        self.fspassno = args.fspassno
> > > > > >          self.fstype = args.fstype
> > > > > >          self.label = args.label
> > > > > >          self.use_label = args.use_label diff --git
> > > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > > 4d0b836..c44159b
> > > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > > >          updated = False
> > > > > >          for part in self.parts:
> > > > > >              if not part.realnum or not part.mountpoint \
> > > > > > -               or part.mountpoint == "/" or not
> > > > > > part.mountpoint.startswith('/'):
> > > > > > +               or not part.mountpoint.startswith('/'):
> > > > > >                  continue
> > > > > >
> > > > > >              if part.use_uuid:
> > > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > > >                  device_name = "/dev/%s%s%d" % (part.disk,
> > > > > > prefix,
> > > > > > part.realnum)
> > > > > >              opts = part.fsopts if part.fsopts else "defaults"
> > > > > > +            passno = part.fspassno if part.fspassno else "0"
> > > > > >              line = "\t".join([device_name, part.mountpoint,
> > > > > > part.fstype,
> > > > > > -                              opts, "0", "0"]) + "\n"
> > > > > > +                              opts, "0", passno]) + "\n"
> > > > > >
> > > > > >              fstab_lines.append(line)
> > > > > >              updated = True
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "isar-users" group.
> > > To unsubscribe from this group and stop receiving emails from it,
> > > send an email to isar-users+unsubscribe@googlegroups.com.
> > > To view this discussion on the web visit
> > >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrou
> > > ps.g
> > > oogle.com%2Fd%2Fmsgid%2Fisar-
> > >
> > users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat
> > a=
> > >
> > 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540
> > 8
> > >
> >
> da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104
> > >
> > 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > Ijo
> > >
> > iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda
> > ta
> > >
> > =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re
> > se
> > > rved=0.
Henning Schild Sept. 26, 2022, 7:46 a.m. UTC | #7
Am Mon, 26 Sep 2022 07:57:41 +0200
schrieb "Moessbauer, Felix (T CED SES-DE)"
<felix.moessbauer@siemens.com>:

> > -----Original Message-----
> > From: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > Sent: Monday, September 26, 2022 12:53 PM
> > To: Moessbauer, Felix (T CED SES-DE)
> > <felix.moessbauer@siemens.com>; Schild, Henning (T CED SES-DE)
> > <henning.schild@siemens.com> Cc: Kiszka, Jan (T CED)
> > <jan.kiszka@siemens.com>; isar- users@googlegroups.com
> > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > 
> > 
> >   
> > > -----Original Message-----
> > > From: Moessbauer, Felix (T CED SES-DE)
> > > <felix.moessbauer@siemens.com> Sent: 26 September 2022 07:11
> > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>;
> > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > users@googlegroups.com
> > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > >
> > > Hi Vijai & Henning,
> > >
> > > Are there any news on this?
> > > I just discovered that still many (if not all) of our images are
> > > affected by this bug.  
> > 
> > Hi Felix,
> > 
> > Unfortunately not. If we already have the latest wic,
> > --no-fstab-update[1] might help.(untested).  
> 
> We already have a wic version with this option, but it doesn't look
> right to add it to the root partition. Instead this option can be
> used for partitions that should not show up in the fstab at all.

We do want the one from WIC. It is only coming since we patched WIC to
support /.

> Indeed, the fstab entry has to be set by WIC to set settings like
> UUID and filesystem. But this requires that we either remove the
> entry set by ISAR in image_configure_fstab, or we remove the entry
> after generating the rootfs, but before WIC.

I think we should try and remove the entry from that template. It
should not be required.

If we decide to solve the problem somewhere in/with WIC, we should do
that upstream in OE. They have the same "we now have two" problem,
where wic adds on top of a template instead of replacing the original.

Henning

> Opinions? @Kiszka, Jan (T CED)
> 
> Felix
> 
> > 
> > Thanks,
> > Vijai Kumar K
> >   
> > >
> > > While it is not serios, having error messages in the journal is
> > > still pretty bad: systemd-fstab-generator[1491]: Failed to create
> > > unit file /run/systemd/generator/-.mount, as it already exists.
> > > Duplicate entry in /etc/fstab?
> > >
> > > Felix
> > >  
> > > > -----Original Message-----
> > > > From: isar-users@googlegroups.com <isar-users@googlegroups.com>
> > > > On Behalf Of Kanagarajan, Vijaikumar
> > > > Sent: Friday, June 17, 2022 1:46 PM
> > > > To: isar-users@googlegroups.com
> > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild,
> > > > Henning (T CED SES-
> > > > DE) <henning.schild@siemens.com>
> > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > >
> > > >  
> > > > > -----Original Message-----
> > > > > From: Kanagarajan, Vijaikumar
> > > > > Sent: 13 June 2022 14:48
> > > > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > >
> > > > >
> > > > >  
> > > > > > -----Original Message-----
> > > > > > From: Henning Schild <henning.schild@siemens.com>
> > > > > > Sent: 13 June 2022 14:32
> > > > > > To: Kanagarajan, Vijaikumar
> > > > > > <Vijaikumar_Kanagarajan@mentor.com> Cc:
> > > > > > isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest
> > > > > > revision
> > > > > >
> > > > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > > > >  
> > > > > > > Update to the latest wic from OE-core.
> > > > > > >
> > > > > > > OE-core Revision: 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > > > > >
> > > > > > > Signed-off-by: Vijai Kumar K  
> > > <Vijaikumar_Kanagarajan@mentor.com>  
> > > > > > > ---
> > > > > > >  RECIPE-API-CHANGELOG.md                  | 19
> > > > > > > +++++++++++++++++++ scripts/lib/wic/help.py
> > > > > > >    |  6 ++++++ scripts/lib/wic/ksparser.py              |
> > > > > > >  1 + scripts/lib/wic/partition.py             |  1 +
> > > > > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > > > >
> > > > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-  
> > > CHANGELOG.md  
> > > > > > index  
> > > > > > > 2998824..436b204 100644
> > > > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > > > @@ -406,3 +406,22 @@ groups are now created after all
> > > > > > > packages are installed.
> > > > > > >  Changes in next
> > > > > > >  ---------------
> > > > > > > +
> > > > > > > +### Wic adds / mountpoint to fstab
> > > > > > > +
> > > > > > > +In the older version of wic, any mount point named / is
> > > > > > > +skipped from
> > > > > > > adding +into the fstab entry.
> > > > > > > +
> > > > > > > +With the latest wic, this is not the case. / mount
> > > > > > > point, if +any, is
> > > > > > > added +to /etc/fstab for automount.
> > > > > > > +
> > > > > > > +Any wks file which assumed that / would be skipped from
> > > > > > > +/etc/fstab
> > > > > > > should +now be corrected. Otherwise, it might result in
> > > > > > > multiple / entries in /etc/fstab. +One by the
> > > > > > > image_configure_fstab function from image class and one by
> > > > > > > wic. +
> > > > > > > +Below is an example wks entry that might cause an issue.
> > > > > > > +Replace "part /" with "part" to avoid adding duplicate
> > > > > > > entry for /.  
> > > > > >
> > > > > > I am not sure multiple entries would be an issue, i think
> > > > > > the last one will simply always win. It is good to have a
> > > > > > note about that change, but i doubt people really have to
> > > > > > do anything. And if anything has to be done, isar should
> > > > > > drop the first one centrally.
> > > > > >
> > > > > > The fstab entry for root is purely for adding some weird
> > > > > > mount options, usually root is not mounted with fstab but
> > > > > > with cmdline and initrd. And not having / in fstab just
> > > > > > makes that rootfs more generic ... it can become part of
> > > > > > nfs and next guy takes it as btrfs while next guy  
> > > > > takes it as ext4.  
> > > > > >
> > > > > > Note is good, advise is not  
> > > > >
> > > > > Noted. Will change the text accordingly in V3.  
> > > >
> > > > Ok we cannot drop / mountpoint name(though optional). We would
> > > > be  
> > > lose  
> > > > the ability to find out UUID of root using rootdev api.
> > > > This is used by some plugins. So the better way would be to use
> > > > the --no-fstab- update. Seems like we can set them per
> > > > partition now.
> > > >
> > > > Thanks,
> > > > Vijai Kumar K
> > > >  
> > > > >
> > > > > Thanks,
> > > > > Vijai Kumar K
> > > > >  
> > > > > >
> > > > > > Henning
> > > > > >  
> > > > > > > +
> > > > > > > +```
> > > > > > > +part / --source rootfs --ondisk sda --fstype ext4 --label
> > > > > > > +platform
> > > > > > > --align 1024 --use-uuid +```
> > > > > > > diff --git a/scripts/lib/wic/help.py
> > > > > > > b/scripts/lib/wic/help.py index
> > > > > > > 4ff7470..73e3380 100644
> > > > > > > --- a/scripts/lib/wic/help.py
> > > > > > > +++ b/scripts/lib/wic/help.py
> > > > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > > > >                        quotes.  If not specified, the
> > > > > > > default string is "defaults".
> > > > > > >
> > > > > > > +         --fspassno: Specifies the order in which
> > > > > > > filesystem
> > > > > > > + checks
> > > > > > > are done
> > > > > > > +                     at boot time by fsck.  See fs_passno
> > > > > > > + parameter
> > > > > > > of
> > > > > > > +                     fstab(5).  This parameter will be
> > > > > > > copied
> > > > > > > + into
> > > > > > > the
> > > > > > > +                     /etc/fstab file of the installed
> > > > > > > system.  If not
> > > > > > > +                     specified the default value of "0"
> > > > > > > will be used. +
> > > > > > >           --label label: Specifies the label to give to
> > > > > > > the filesystem to be made on the partition. If the given
> > > > > > >                          label is already in use by
> > > > > > > another filesystem, diff --git
> > > > > > > a/scripts/lib/wic/ksparser.py
> > > > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9
> > > > > > > 100644 --- a/scripts/lib/wic/ksparser.py +++
> > > > > > > b/scripts/lib/wic/ksparser.py @@ -155,6 +155,7 @@ class
> > > > > > > KickStart(): part.add_argument('--change-directory')
> > > > > > >          part.add_argument("--extra-space",
> > > > > > > type=sizetype("M")) part.add_argument('--fsoptions',
> > > > > > > dest='fsopts')
> > > > > > > +        part.add_argument('--fspassno', dest='fspassno')
> > > > > > >          part.add_argument('--fstype', default='vfat',
> > > > > > >                            choices=('ext2', 'ext3',
> > > > > > > 'ext4', 'btrfs', 'squashfs', 'vfat',
> > > > > > > 'msdos', 'erofs', diff --git
> > > > > > > a/scripts/lib/wic/partition.py
> > > > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b
> > > > > > > 100644 --- a/scripts/lib/wic/partition.py +++
> > > > > > > b/scripts/lib/wic/partition.py @@ -33,6 +33,7 @@ class
> > > > > > > Partition(): self.include_path = args.include_path
> > > > > > >          self.change_directory = args.change_directory
> > > > > > >          self.fsopts = args.fsopts
> > > > > > > +        self.fspassno = args.fspassno
> > > > > > >          self.fstype = args.fstype
> > > > > > >          self.label = args.label
> > > > > > >          self.use_label = args.use_label diff --git
> > > > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > > > 4d0b836..c44159b
> > > > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > > > >          updated = False
> > > > > > >          for part in self.parts:
> > > > > > >              if not part.realnum or not part.mountpoint \
> > > > > > > -               or part.mountpoint == "/" or not
> > > > > > > part.mountpoint.startswith('/'):
> > > > > > > +               or not part.mountpoint.startswith('/'):
> > > > > > >                  continue
> > > > > > >
> > > > > > >              if part.use_uuid:
> > > > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > > > >                  device_name = "/dev/%s%s%d" % (part.disk,
> > > > > > > prefix,
> > > > > > > part.realnum)
> > > > > > >              opts = part.fsopts if part.fsopts else
> > > > > > > "defaults"
> > > > > > > +            passno = part.fspassno if part.fspassno else
> > > > > > > "0" line = "\t".join([device_name, part.mountpoint,
> > > > > > > part.fstype,
> > > > > > > -                              opts, "0", "0"]) + "\n"
> > > > > > > +                              opts, "0", passno]) + "\n"
> > > > > > >
> > > > > > >              fstab_lines.append(line)
> > > > > > >              updated = True  
> > > >
> > > > --
> > > > You received this message because you are subscribed to the
> > > > Google Groups "isar-users" group.
> > > > To unsubscribe from this group and stop receiving emails from
> > > > it, send an email to isar-users+unsubscribe@googlegroups.com.
> > > > To view this discussion on the web visit
> > > >  
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrou
> > >  
> > > > ps.g
> > > > oogle.com%2Fd%2Fmsgid%2Fisar-
> > > >  
> > > users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat
> > > a=  
> > > >  
> > > 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540
> > > 8  
> > > >  
> > >  
> > da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104  
> > > >  
> > > 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > Ijo  
> > > >  
> > > iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda
> > > ta  
> > > >  
> > > =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re
> > > se  
> > > > rved=0.
Vijai Kumar K Sept. 26, 2022, 7:56 a.m. UTC | #8
> -----Original Message-----
> From: Henning Schild <henning.schild@siemens.com>
> Sent: 26 September 2022 13:17
> To: felix.moessbauer@siemens.com; Kanagarajan, Vijaikumar
> <Vijaikumar_Kanagarajan@mentor.com>; jan.kiszka@siemens.com
> Cc: isar-users@googlegroups.com
> Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> 
> Am Mon, 26 Sep 2022 07:57:41 +0200
> schrieb "Moessbauer, Felix (T CED SES-DE)"
> <felix.moessbauer@siemens.com>:
> 
> > > -----Original Message-----
> > > From: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > > Sent: Monday, September 26, 2022 12:53 PM
> > > To: Moessbauer, Felix (T CED SES-DE)
> <felix.moessbauer@siemens.com>;
> > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com> Cc:
> > > Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > users@googlegroups.com
> > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Moessbauer, Felix (T CED SES-DE)
> > > > <felix.moessbauer@siemens.com> Sent: 26 September 2022 07:11
> > > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>;
> > > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > > users@googlegroups.com
> > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > > Hi Vijai & Henning,
> > > >
> > > > Are there any news on this?
> > > > I just discovered that still many (if not all) of our images are
> > > > affected by this bug.
> > >
> > > Hi Felix,
> > >
> > > Unfortunately not. If we already have the latest wic,
> > > --no-fstab-update[1] might help.(untested).
> >
> > We already have a wic version with this option, but it doesn't look
> > right to add it to the root partition. Instead this option can be used
> > for partitions that should not show up in the fstab at all.
> 
> We do want the one from WIC. It is only coming since we patched WIC to
> support /.
> 
> > Indeed, the fstab entry has to be set by WIC to set settings like UUID
> > and filesystem. But this requires that we either remove the entry set
> > by ISAR in image_configure_fstab, or we remove the entry after
> > generating the rootfs, but before WIC.
> 
> I think we should try and remove the entry from that template. It should not
> be required.
> 
> If we decide to solve the problem somewhere in/with WIC, we should do
> that upstream in OE. They have the same "we now have two" problem,
> where wic adds on top of a template instead of replacing the original.

This seems to me like the approach we should take. Make wic replace entries in fstab instead of appending to them like how it does now.

Thanks,
Vijai Kumar K

> 
> Henning
> 
> > Opinions? @Kiszka, Jan (T CED)
> >
> > Felix
> >
> > >
> > > Thanks,
> > > Vijai Kumar K
> > >
> > > >
> > > > While it is not serios, having error messages in the journal is
> > > > still pretty bad: systemd-fstab-generator[1491]: Failed to create
> > > > unit file /run/systemd/generator/-.mount, as it already exists.
> > > > Duplicate entry in /etc/fstab?
> > > >
> > > > Felix
> > > >
> > > > > -----Original Message-----
> > > > > From: isar-users@googlegroups.com <isar-
> users@googlegroups.com>
> > > > > On Behalf Of Kanagarajan, Vijaikumar
> > > > > Sent: Friday, June 17, 2022 1:46 PM
> > > > > To: isar-users@googlegroups.com
> > > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild,
> > > > > Henning (T CED SES-
> > > > > DE) <henning.schild@siemens.com>
> > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Kanagarajan, Vijaikumar
> > > > > > Sent: 13 June 2022 14:48
> > > > > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Henning Schild <henning.schild@siemens.com>
> > > > > > > Sent: 13 June 2022 14:32
> > > > > > > To: Kanagarajan, Vijaikumar
> > > > > > > <Vijaikumar_Kanagarajan@mentor.com> Cc:
> > > > > > > isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest
> > > > > > > revision
> > > > > > >
> > > > > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > > > > >
> > > > > > > > Update to the latest wic from OE-core.
> > > > > > > >
> > > > > > > > OE-core Revision:
> 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > > > > > >
> > > > > > > > Signed-off-by: Vijai Kumar K
> > > > <Vijaikumar_Kanagarajan@mentor.com>
> > > > > > > > ---
> > > > > > > >  RECIPE-API-CHANGELOG.md                  | 19
> > > > > > > > +++++++++++++++++++ scripts/lib/wic/help.py
> > > > > > > >    |  6 ++++++ scripts/lib/wic/ksparser.py              |
> > > > > > > >  1 + scripts/lib/wic/partition.py             |  1 +
> > > > > > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > > > > >
> > > > > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-
> > > > CHANGELOG.md
> > > > > > > index
> > > > > > > > 2998824..436b204 100644
> > > > > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > > > > @@ -406,3 +406,22 @@ groups are now created after all
> > > > > > > > packages are installed.
> > > > > > > >  Changes in next
> > > > > > > >  ---------------
> > > > > > > > +
> > > > > > > > +### Wic adds / mountpoint to fstab
> > > > > > > > +
> > > > > > > > +In the older version of wic, any mount point named / is
> > > > > > > > +skipped from
> > > > > > > > adding +into the fstab entry.
> > > > > > > > +
> > > > > > > > +With the latest wic, this is not the case. / mount
> > > > > > > > point, if +any, is
> > > > > > > > added +to /etc/fstab for automount.
> > > > > > > > +
> > > > > > > > +Any wks file which assumed that / would be skipped from
> > > > > > > > +/etc/fstab
> > > > > > > > should +now be corrected. Otherwise, it might result in
> > > > > > > > multiple / entries in /etc/fstab. +One by the
> > > > > > > > image_configure_fstab function from image class and one by
> > > > > > > > wic. +
> > > > > > > > +Below is an example wks entry that might cause an issue.
> > > > > > > > +Replace "part /" with "part" to avoid adding duplicate
> > > > > > > > entry for /.
> > > > > > >
> > > > > > > I am not sure multiple entries would be an issue, i think
> > > > > > > the last one will simply always win. It is good to have a
> > > > > > > note about that change, but i doubt people really have to do
> > > > > > > anything. And if anything has to be done, isar should drop
> > > > > > > the first one centrally.
> > > > > > >
> > > > > > > The fstab entry for root is purely for adding some weird
> > > > > > > mount options, usually root is not mounted with fstab but
> > > > > > > with cmdline and initrd. And not having / in fstab just
> > > > > > > makes that rootfs more generic ... it can become part of nfs
> > > > > > > and next guy takes it as btrfs while next guy
> > > > > > takes it as ext4.
> > > > > > >
> > > > > > > Note is good, advise is not
> > > > > >
> > > > > > Noted. Will change the text accordingly in V3.
> > > > >
> > > > > Ok we cannot drop / mountpoint name(though optional). We would
> > > > > be
> > > > lose
> > > > > the ability to find out UUID of root using rootdev api.
> > > > > This is used by some plugins. So the better way would be to use
> > > > > the --no-fstab- update. Seems like we can set them per partition
> > > > > now.
> > > > >
> > > > > Thanks,
> > > > > Vijai Kumar K
> > > > >
> > > > > >
> > > > > > Thanks,
> > > > > > Vijai Kumar K
> > > > > >
> > > > > > >
> > > > > > > Henning
> > > > > > >
> > > > > > > > +
> > > > > > > > +```
> > > > > > > > +part / --source rootfs --ondisk sda --fstype ext4 --label
> > > > > > > > +platform
> > > > > > > > --align 1024 --use-uuid +``` diff --git
> > > > > > > > a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index
> > > > > > > > 4ff7470..73e3380 100644
> > > > > > > > --- a/scripts/lib/wic/help.py
> > > > > > > > +++ b/scripts/lib/wic/help.py
> > > > > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > > > > >                        quotes.  If not specified, the
> > > > > > > > default string is "defaults".
> > > > > > > >
> > > > > > > > +         --fspassno: Specifies the order in which
> > > > > > > > filesystem
> > > > > > > > + checks
> > > > > > > > are done
> > > > > > > > +                     at boot time by fsck.  See fs_passno
> > > > > > > > + parameter
> > > > > > > > of
> > > > > > > > +                     fstab(5).  This parameter will be
> > > > > > > > copied
> > > > > > > > + into
> > > > > > > > the
> > > > > > > > +                     /etc/fstab file of the installed
> > > > > > > > system.  If not
> > > > > > > > +                     specified the default value of "0"
> > > > > > > > will be used. +
> > > > > > > >           --label label: Specifies the label to give to
> > > > > > > > the filesystem to be made on the partition. If the given
> > > > > > > >                          label is already in use by
> > > > > > > > another filesystem, diff --git
> > > > > > > > a/scripts/lib/wic/ksparser.py
> > > > > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9
> > > > > > > > 100644 --- a/scripts/lib/wic/ksparser.py +++
> > > > > > > > b/scripts/lib/wic/ksparser.py @@ -155,6 +155,7 @@ class
> > > > > > > > KickStart(): part.add_argument('--change-directory')
> > > > > > > >          part.add_argument("--extra-space",
> > > > > > > > type=sizetype("M")) part.add_argument('--fsoptions',
> > > > > > > > dest='fsopts')
> > > > > > > > +        part.add_argument('--fspassno', dest='fspassno')
> > > > > > > >          part.add_argument('--fstype', default='vfat',
> > > > > > > >                            choices=('ext2', 'ext3',
> > > > > > > > 'ext4', 'btrfs', 'squashfs', 'vfat', 'msdos', 'erofs',
> > > > > > > > diff --git a/scripts/lib/wic/partition.py
> > > > > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b
> > > > > > > > 100644 --- a/scripts/lib/wic/partition.py +++
> > > > > > > > b/scripts/lib/wic/partition.py @@ -33,6 +33,7 @@ class
> > > > > > > > Partition(): self.include_path = args.include_path
> > > > > > > >          self.change_directory = args.change_directory
> > > > > > > >          self.fsopts = args.fsopts
> > > > > > > > +        self.fspassno = args.fspassno
> > > > > > > >          self.fstype = args.fstype
> > > > > > > >          self.label = args.label
> > > > > > > >          self.use_label = args.use_label diff --git
> > > > > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > > > > 4d0b836..c44159b
> > > > > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > >          updated = False
> > > > > > > >          for part in self.parts:
> > > > > > > >              if not part.realnum or not part.mountpoint \
> > > > > > > > -               or part.mountpoint == "/" or not
> > > > > > > > part.mountpoint.startswith('/'):
> > > > > > > > +               or not part.mountpoint.startswith('/'):
> > > > > > > >                  continue
> > > > > > > >
> > > > > > > >              if part.use_uuid:
> > > > > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > >                  device_name = "/dev/%s%s%d" % (part.disk,
> > > > > > > > prefix,
> > > > > > > > part.realnum)
> > > > > > > >              opts = part.fsopts if part.fsopts else
> > > > > > > > "defaults"
> > > > > > > > +            passno = part.fspassno if part.fspassno else
> > > > > > > > "0" line = "\t".join([device_name, part.mountpoint,
> > > > > > > > part.fstype,
> > > > > > > > -                              opts, "0", "0"]) + "\n"
> > > > > > > > +                              opts, "0", passno]) + "\n"
> > > > > > > >
> > > > > > > >              fstab_lines.append(line)
> > > > > > > >              updated = True
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the
> > > > > Google Groups "isar-users" group.
> > > > > To unsubscribe from this group and stop receiving emails from
> > > > > it, send an email to isar-users+unsubscribe@googlegroups.com.
> > > > > To view this discussion on the web visit
> > > > >
> > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > > > grou
> > > >
> > > > > ps.g
> > > > > oogle.com%2Fd%2Fmsgid%2Fisar-
> > > > >
> > > >
> users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat
> > > > a=
> > > > >
> > > >
> 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540
> > > > 8
> > > > >
> > > >
> > >
> da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104
> > > > >
> > > >
> 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > > Ijo
> > > > >
> > > >
> iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda
> > > > ta
> > > > >
> > > >
> =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re
> > > > se
> > > > > rved=0.
MOESSBAUER, Felix Sept. 26, 2022, 8:02 a.m. UTC | #9
> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Kanagarajan, Vijaikumar
> Sent: Monday, September 26, 2022 3:57 PM
> To: Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>;
> Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>; Kiszka,
> Jan (T CED) <jan.kiszka@siemens.com>
> Cc: isar-users@googlegroups.com
> Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> 
> 
> 
> > -----Original Message-----
> > From: Henning Schild <henning.schild@siemens.com>
> > Sent: 26 September 2022 13:17
> > To: felix.moessbauer@siemens.com; Kanagarajan, Vijaikumar
> > <Vijaikumar_Kanagarajan@mentor.com>; jan.kiszka@siemens.com
> > Cc: isar-users@googlegroups.com
> > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> >
> > Am Mon, 26 Sep 2022 07:57:41 +0200
> > schrieb "Moessbauer, Felix (T CED SES-DE)"
> > <felix.moessbauer@siemens.com>:
> >
> > > > -----Original Message-----
> > > > From: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
> > > > Sent: Monday, September 26, 2022 12:53 PM
> > > > To: Moessbauer, Felix (T CED SES-DE)
> > <felix.moessbauer@siemens.com>;
> > > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com> Cc:
> > > > Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > > users@googlegroups.com
> > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Moessbauer, Felix (T CED SES-DE)
> > > > > <felix.moessbauer@siemens.com> Sent: 26 September 2022 07:11
> > > > > To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>;
> > > > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> > > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > > > users@googlegroups.com
> > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > >
> > > > > Hi Vijai & Henning,
> > > > >
> > > > > Are there any news on this?
> > > > > I just discovered that still many (if not all) of our images are
> > > > > affected by this bug.
> > > >
> > > > Hi Felix,
> > > >
> > > > Unfortunately not. If we already have the latest wic,
> > > > --no-fstab-update[1] might help.(untested).
> > >
> > > We already have a wic version with this option, but it doesn't look
> > > right to add it to the root partition. Instead this option can be
> > > used for partitions that should not show up in the fstab at all.
> >
> > We do want the one from WIC. It is only coming since we patched WIC to
> > support /.
> >
> > > Indeed, the fstab entry has to be set by WIC to set settings like
> > > UUID and filesystem. But this requires that we either remove the
> > > entry set by ISAR in image_configure_fstab, or we remove the entry
> > > after generating the rootfs, but before WIC.
> >
> > I think we should try and remove the entry from that template. It
> > should not be required.
> >
> > If we decide to solve the problem somewhere in/with WIC, we should do
> > that upstream in OE. They have the same "we now have two" problem,
> > where wic adds on top of a template instead of replacing the original.
> 
> This seems to me like the approach we should take. Make wic replace entries in
> fstab instead of appending to them like how it does now.

Sounds like a plan!
Would you like to take care of writing the WIC patches, Vijai?

Happy Coding!
Felix

> 
> Thanks,
> Vijai Kumar K
> 
> >
> > Henning
> >
> > > Opinions? @Kiszka, Jan (T CED)
> > >
> > > Felix
> > >
> > > >
> > > > Thanks,
> > > > Vijai Kumar K
> > > >
> > > > >
> > > > > While it is not serios, having error messages in the journal is
> > > > > still pretty bad: systemd-fstab-generator[1491]: Failed to
> > > > > create unit file /run/systemd/generator/-.mount, as it already exists.
> > > > > Duplicate entry in /etc/fstab?
> > > > >
> > > > > Felix
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: isar-users@googlegroups.com <isar-
> > users@googlegroups.com>
> > > > > > On Behalf Of Kanagarajan, Vijaikumar
> > > > > > Sent: Friday, June 17, 2022 1:46 PM
> > > > > > To: isar-users@googlegroups.com
> > > > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild,
> > > > > > Henning (T CED SES-
> > > > > > DE) <henning.schild@siemens.com>
> > > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Kanagarajan, Vijaikumar
> > > > > > > Sent: 13 June 2022 14:48
> > > > > > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > > > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest
> > > > > > > revision
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Henning Schild <henning.schild@siemens.com>
> > > > > > > > Sent: 13 June 2022 14:32
> > > > > > > > To: Kanagarajan, Vijaikumar
> > > > > > > > <Vijaikumar_Kanagarajan@mentor.com> Cc:
> > > > > > > > isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest
> > > > > > > > revision
> > > > > > > >
> > > > > > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > > > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > > > > > >
> > > > > > > > > Update to the latest wic from OE-core.
> > > > > > > > >
> > > > > > > > > OE-core Revision:
> > 06ed2aa93fc25a681e3a00ee120d9395b04845da
> > > > > > > > >
> > > > > > > > > Signed-off-by: Vijai Kumar K
> > > > > <Vijaikumar_Kanagarajan@mentor.com>
> > > > > > > > > ---
> > > > > > > > >  RECIPE-API-CHANGELOG.md                  | 19
> > > > > > > > > +++++++++++++++++++ scripts/lib/wic/help.py
> > > > > > > > >    |  6 ++++++ scripts/lib/wic/ksparser.py              |
> > > > > > > > >  1 + scripts/lib/wic/partition.py             |  1 +
> > > > > > > > >  scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > > > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > > > > > >
> > > > > > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-
> > > > > CHANGELOG.md
> > > > > > > > index
> > > > > > > > > 2998824..436b204 100644
> > > > > > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > > > > > @@ -406,3 +406,22 @@ groups are now created after all
> > > > > > > > > packages are installed.
> > > > > > > > >  Changes in next
> > > > > > > > >  ---------------
> > > > > > > > > +
> > > > > > > > > +### Wic adds / mountpoint to fstab
> > > > > > > > > +
> > > > > > > > > +In the older version of wic, any mount point named / is
> > > > > > > > > +skipped from
> > > > > > > > > adding +into the fstab entry.
> > > > > > > > > +
> > > > > > > > > +With the latest wic, this is not the case. / mount
> > > > > > > > > point, if +any, is
> > > > > > > > > added +to /etc/fstab for automount.
> > > > > > > > > +
> > > > > > > > > +Any wks file which assumed that / would be skipped from
> > > > > > > > > +/etc/fstab
> > > > > > > > > should +now be corrected. Otherwise, it might result in
> > > > > > > > > multiple / entries in /etc/fstab. +One by the
> > > > > > > > > image_configure_fstab function from image class and one
> > > > > > > > > by wic. +
> > > > > > > > > +Below is an example wks entry that might cause an issue.
> > > > > > > > > +Replace "part /" with "part" to avoid adding duplicate
> > > > > > > > > entry for /.
> > > > > > > >
> > > > > > > > I am not sure multiple entries would be an issue, i think
> > > > > > > > the last one will simply always win. It is good to have a
> > > > > > > > note about that change, but i doubt people really have to
> > > > > > > > do anything. And if anything has to be done, isar should
> > > > > > > > drop the first one centrally.
> > > > > > > >
> > > > > > > > The fstab entry for root is purely for adding some weird
> > > > > > > > mount options, usually root is not mounted with fstab but
> > > > > > > > with cmdline and initrd. And not having / in fstab just
> > > > > > > > makes that rootfs more generic ... it can become part of
> > > > > > > > nfs and next guy takes it as btrfs while next guy
> > > > > > > takes it as ext4.
> > > > > > > >
> > > > > > > > Note is good, advise is not
> > > > > > >
> > > > > > > Noted. Will change the text accordingly in V3.
> > > > > >
> > > > > > Ok we cannot drop / mountpoint name(though optional). We would
> > > > > > be
> > > > > lose
> > > > > > the ability to find out UUID of root using rootdev api.
> > > > > > This is used by some plugins. So the better way would be to
> > > > > > use the --no-fstab- update. Seems like we can set them per
> > > > > > partition now.
> > > > > >
> > > > > > Thanks,
> > > > > > Vijai Kumar K
> > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Vijai Kumar K
> > > > > > >
> > > > > > > >
> > > > > > > > Henning
> > > > > > > >
> > > > > > > > > +
> > > > > > > > > +```
> > > > > > > > > +part / --source rootfs --ondisk sda --fstype ext4
> > > > > > > > > +--label platform
> > > > > > > > > --align 1024 --use-uuid +``` diff --git
> > > > > > > > > a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> > > > > > > > > index
> > > > > > > > > 4ff7470..73e3380 100644
> > > > > > > > > --- a/scripts/lib/wic/help.py
> > > > > > > > > +++ b/scripts/lib/wic/help.py
> > > > > > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > > > > > >                        quotes.  If not specified, the
> > > > > > > > > default string is "defaults".
> > > > > > > > >
> > > > > > > > > +         --fspassno: Specifies the order in which
> > > > > > > > > filesystem
> > > > > > > > > + checks
> > > > > > > > > are done
> > > > > > > > > +                     at boot time by fsck.  See
> > > > > > > > > + fs_passno parameter
> > > > > > > > > of
> > > > > > > > > +                     fstab(5).  This parameter will be
> > > > > > > > > copied
> > > > > > > > > + into
> > > > > > > > > the
> > > > > > > > > +                     /etc/fstab file of the installed
> > > > > > > > > system.  If not
> > > > > > > > > +                     specified the default value of "0"
> > > > > > > > > will be used. +
> > > > > > > > >           --label label: Specifies the label to give to
> > > > > > > > > the filesystem to be made on the partition. If the given
> > > > > > > > >                          label is already in use by
> > > > > > > > > another filesystem, diff --git
> > > > > > > > > a/scripts/lib/wic/ksparser.py
> > > > > > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9
> > > > > > > > > 100644 --- a/scripts/lib/wic/ksparser.py +++
> > > > > > > > > b/scripts/lib/wic/ksparser.py @@ -155,6 +155,7 @@ class
> > > > > > > > > KickStart(): part.add_argument('--change-directory')
> > > > > > > > >          part.add_argument("--extra-space",
> > > > > > > > > type=sizetype("M")) part.add_argument('--fsoptions',
> > > > > > > > > dest='fsopts')
> > > > > > > > > +        part.add_argument('--fspassno',
> > > > > > > > > + dest='fspassno')
> > > > > > > > >          part.add_argument('--fstype', default='vfat',
> > > > > > > > >                            choices=('ext2', 'ext3',
> > > > > > > > > 'ext4', 'btrfs', 'squashfs', 'vfat', 'msdos', 'erofs',
> > > > > > > > > diff --git a/scripts/lib/wic/partition.py
> > > > > > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b
> > > > > > > > > 100644 --- a/scripts/lib/wic/partition.py +++
> > > > > > > > > b/scripts/lib/wic/partition.py @@ -33,6 +33,7 @@ class
> > > > > > > > > Partition(): self.include_path = args.include_path
> > > > > > > > >          self.change_directory = args.change_directory
> > > > > > > > >          self.fsopts = args.fsopts
> > > > > > > > > +        self.fspassno = args.fspassno
> > > > > > > > >          self.fstype = args.fstype
> > > > > > > > >          self.label = args.label
> > > > > > > > >          self.use_label = args.use_label diff --git
> > > > > > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > > > > > 4d0b836..c44159b
> > > > > > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > > >          updated = False
> > > > > > > > >          for part in self.parts:
> > > > > > > > >              if not part.realnum or not part.mountpoint \
> > > > > > > > > -               or part.mountpoint == "/" or not
> > > > > > > > > part.mountpoint.startswith('/'):
> > > > > > > > > +               or not part.mountpoint.startswith('/'):
> > > > > > > > >                  continue
> > > > > > > > >
> > > > > > > > >              if part.use_uuid:
> > > > > > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > > >                  device_name = "/dev/%s%s%d" %
> > > > > > > > > (part.disk, prefix,
> > > > > > > > > part.realnum)
> > > > > > > > >              opts = part.fsopts if part.fsopts else
> > > > > > > > > "defaults"
> > > > > > > > > +            passno = part.fspassno if part.fspassno
> > > > > > > > > + else
> > > > > > > > > "0" line = "\t".join([device_name, part.mountpoint,
> > > > > > > > > part.fstype,
> > > > > > > > > -                              opts, "0", "0"]) + "\n"
> > > > > > > > > +                              opts, "0", passno]) + "\n"
> > > > > > > > >
> > > > > > > > >              fstab_lines.append(line)
> > > > > > > > >              updated = True
> > > > > >
> > > > > > --
> > > > > > You received this message because you are subscribed to the
> > > > > > Google Groups "isar-users" group.
> > > > > > To unsubscribe from this group and stop receiving emails from
> > > > > > it, send an email to isar-users+unsubscribe@googlegroups.com.
> > > > > > To view this discussion on the web visit
> > > > > >
> > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%
> > > > > 2F
> > > > > grou
> > > > >
> > > > > > ps.g
> > > > > > oogle.com%2Fd%2Fmsgid%2Fisar-
> > > > > >
> > > > >
> > users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat
> > > > > a=
> > > > > >
> > > > >
> > 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540
> > > > > 8
> > > > > >
> > > > >
> > > >
> >
> da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104
> > > > > >
> > > > >
> > 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > > > Ijo
> > > > > >
> > > > >
> > iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda
> > > > > ta
> > > > > >
> > > > >
> > =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re
> > > > > se
> > > > > > rved=0.
> 
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.g
> oogle.com%2Fd%2Fmsgid%2Fisar-
> users%2F7d23828243444e90afd49e7bb23717dc%2540mentor.com&amp;data=
> 05%7C01%7Cfelix.moessbauer%40siemens.com%7C7e073a4d25ec493e0d3408
> da9f94ad76%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379977
> 58159199068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo
> iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata
> =pT2NMVWp6ld7iDW%2BRStJABC02WCrzGDOV%2BXhvpxPKO4%3D&amp;reser
> ved=0.
Henning Schild Sept. 26, 2022, 12:34 p.m. UTC | #10
Am Mon, 26 Sep 2022 07:56:48 +0000
schrieb "Kanagarajan, Vijaikumar" <Vijaikumar_Kanagarajan@mentor.com>:

> > -----Original Message-----
> > From: Henning Schild <henning.schild@siemens.com>
> > Sent: 26 September 2022 13:17
> > To: felix.moessbauer@siemens.com; Kanagarajan, Vijaikumar
> > <Vijaikumar_Kanagarajan@mentor.com>; jan.kiszka@siemens.com
> > Cc: isar-users@googlegroups.com
> > Subject: Re: [PATCH v2 2/2] wic: Update to the latest revision
> > 
> > Am Mon, 26 Sep 2022 07:57:41 +0200
> > schrieb "Moessbauer, Felix (T CED SES-DE)"
> > <felix.moessbauer@siemens.com>:
> >   
> > > > -----Original Message-----
> > > > From: Kanagarajan, Vijaikumar
> > > > <Vijaikumar_Kanagarajan@mentor.com> Sent: Monday, September 26,
> > > > 2022 12:53 PM To: Moessbauer, Felix (T CED SES-DE)  
> > <felix.moessbauer@siemens.com>;  
> > > > Schild, Henning (T CED SES-DE) <henning.schild@siemens.com> Cc:
> > > > Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; isar-
> > > > users@googlegroups.com
> > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > >
> > > >
> > > >  
> > > > > -----Original Message-----
> > > > > From: Moessbauer, Felix (T CED SES-DE)
> > > > > <felix.moessbauer@siemens.com> Sent: 26 September 2022 07:11
> > > > > To: Kanagarajan, Vijaikumar
> > > > > <Vijaikumar_Kanagarajan@mentor.com>; Schild, Henning (T CED
> > > > > SES-DE) <henning.schild@siemens.com> Cc: Kiszka, Jan (T CED)
> > > > > <jan.kiszka@siemens.com>; isar- users@googlegroups.com
> > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest revision
> > > > >
> > > > > Hi Vijai & Henning,
> > > > >
> > > > > Are there any news on this?
> > > > > I just discovered that still many (if not all) of our images
> > > > > are affected by this bug.  
> > > >
> > > > Hi Felix,
> > > >
> > > > Unfortunately not. If we already have the latest wic,
> > > > --no-fstab-update[1] might help.(untested).  
> > >
> > > We already have a wic version with this option, but it doesn't
> > > look right to add it to the root partition. Instead this option
> > > can be used for partitions that should not show up in the fstab
> > > at all.  
> > 
> > We do want the one from WIC. It is only coming since we patched WIC
> > to support /.
> >   
> > > Indeed, the fstab entry has to be set by WIC to set settings like
> > > UUID and filesystem. But this requires that we either remove the
> > > entry set by ISAR in image_configure_fstab, or we remove the
> > > entry after generating the rootfs, but before WIC.  
> > 
> > I think we should try and remove the entry from that template. It
> > should not be required.
> > 
> > If we decide to solve the problem somewhere in/with WIC, we should
> > do that upstream in OE. They have the same "we now have two"
> > problem, where wic adds on top of a template instead of replacing
> > the original.  
> 
> This seems to me like the approach we should take. Make wic replace
> entries in fstab instead of appending to them like how it does now.

That is the more complicated way. I do not recall all the details but i
think we should rather drop the / line from the template. Such a line
is usually not needed, having it is rather limiting the use of the
rootfs because you might have a device name standing there which might
be wrong ... i.e. sda1 vs vda1 vs nfs

I think we could contribute both to OE. The removal of the / line from
their template, and the "wic will try and update not append".

But we could also simply drop the template line in isar ... not care
about OE and making our non wic images better in fact. There might be
weird cornercases, maybe a too old raspi image ... where that line is
needed. I would move it to those corner-case images if there are any.

Henning

> Thanks,
> Vijai Kumar K
> 
> > 
> > Henning
> >   
> > > Opinions? @Kiszka, Jan (T CED)
> > >
> > > Felix
> > >  
> > > >
> > > > Thanks,
> > > > Vijai Kumar K
> > > >  
> > > > >
> > > > > While it is not serios, having error messages in the journal
> > > > > is still pretty bad: systemd-fstab-generator[1491]: Failed to
> > > > > create unit file /run/systemd/generator/-.mount, as it
> > > > > already exists. Duplicate entry in /etc/fstab?
> > > > >
> > > > > Felix
> > > > >  
> > > > > > -----Original Message-----
> > > > > > From: isar-users@googlegroups.com <isar-  
> > users@googlegroups.com>  
> > > > > > On Behalf Of Kanagarajan, Vijaikumar
> > > > > > Sent: Friday, June 17, 2022 1:46 PM
> > > > > > To: isar-users@googlegroups.com
> > > > > > Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Schild,
> > > > > > Henning (T CED SES-
> > > > > > DE) <henning.schild@siemens.com>
> > > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest
> > > > > > revision
> > > > > >
> > > > > >
> > > > > >  
> > > > > > > -----Original Message-----
> > > > > > > From: Kanagarajan, Vijaikumar
> > > > > > > Sent: 13 June 2022 14:48
> > > > > > > To: 'Henning Schild' <henning.schild@siemens.com>
> > > > > > > Cc: isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > > Subject: RE: [PATCH v2 2/2] wic: Update to the latest
> > > > > > > revision
> > > > > > >
> > > > > > >
> > > > > > >  
> > > > > > > > -----Original Message-----
> > > > > > > > From: Henning Schild <henning.schild@siemens.com>
> > > > > > > > Sent: 13 June 2022 14:32
> > > > > > > > To: Kanagarajan, Vijaikumar
> > > > > > > > <Vijaikumar_Kanagarajan@mentor.com> Cc:
> > > > > > > > isar-users@googlegroups.com; jan.kiszka@siemens.com
> > > > > > > > Subject: Re: [PATCH v2 2/2] wic: Update to the latest
> > > > > > > > revision
> > > > > > > >
> > > > > > > > Am Mon, 13 Jun 2022 13:24:01 +0530 schrieb Vijai Kumar K
> > > > > > > > <Vijaikumar_Kanagarajan@mentor.com>:
> > > > > > > >  
> > > > > > > > > Update to the latest wic from OE-core.
> > > > > > > > >
> > > > > > > > > OE-core Revision:  
> > 06ed2aa93fc25a681e3a00ee120d9395b04845da  
> > > > > > > > >
> > > > > > > > > Signed-off-by: Vijai Kumar K  
> > > > > <Vijaikumar_Kanagarajan@mentor.com>  
> > > > > > > > > ---
> > > > > > > > >  RECIPE-API-CHANGELOG.md                  | 19
> > > > > > > > > +++++++++++++++++++ scripts/lib/wic/help.py
> > > > > > > > >    |  6 ++++++ scripts/lib/wic/ksparser.py
> > > > > > > > >   | 1 + scripts/lib/wic/partition.py             |  1
> > > > > > > > > + scripts/lib/wic/plugins/imager/direct.py |  5 +++--
> > > > > > > > >  5 files changed, 30 insertions(+), 2 deletions(-)
> > > > > > > > >
> > > > > > > > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-  
> > > > > CHANGELOG.md  
> > > > > > > > index  
> > > > > > > > > 2998824..436b204 100644
> > > > > > > > > --- a/RECIPE-API-CHANGELOG.md
> > > > > > > > > +++ b/RECIPE-API-CHANGELOG.md
> > > > > > > > > @@ -406,3 +406,22 @@ groups are now created after all
> > > > > > > > > packages are installed.
> > > > > > > > >  Changes in next
> > > > > > > > >  ---------------
> > > > > > > > > +
> > > > > > > > > +### Wic adds / mountpoint to fstab
> > > > > > > > > +
> > > > > > > > > +In the older version of wic, any mount point named /
> > > > > > > > > is +skipped from
> > > > > > > > > adding +into the fstab entry.
> > > > > > > > > +
> > > > > > > > > +With the latest wic, this is not the case. / mount
> > > > > > > > > point, if +any, is
> > > > > > > > > added +to /etc/fstab for automount.
> > > > > > > > > +
> > > > > > > > > +Any wks file which assumed that / would be skipped
> > > > > > > > > from +/etc/fstab
> > > > > > > > > should +now be corrected. Otherwise, it might result
> > > > > > > > > in multiple / entries in /etc/fstab. +One by the
> > > > > > > > > image_configure_fstab function from image class and
> > > > > > > > > one by wic. +
> > > > > > > > > +Below is an example wks entry that might cause an
> > > > > > > > > issue. +Replace "part /" with "part" to avoid adding
> > > > > > > > > duplicate entry for /.  
> > > > > > > >
> > > > > > > > I am not sure multiple entries would be an issue, i
> > > > > > > > think the last one will simply always win. It is good
> > > > > > > > to have a note about that change, but i doubt people
> > > > > > > > really have to do anything. And if anything has to be
> > > > > > > > done, isar should drop the first one centrally.
> > > > > > > >
> > > > > > > > The fstab entry for root is purely for adding some weird
> > > > > > > > mount options, usually root is not mounted with fstab
> > > > > > > > but with cmdline and initrd. And not having / in fstab
> > > > > > > > just makes that rootfs more generic ... it can become
> > > > > > > > part of nfs and next guy takes it as btrfs while next
> > > > > > > > guy  
> > > > > > > takes it as ext4.  
> > > > > > > >
> > > > > > > > Note is good, advise is not  
> > > > > > >
> > > > > > > Noted. Will change the text accordingly in V3.  
> > > > > >
> > > > > > Ok we cannot drop / mountpoint name(though optional). We
> > > > > > would be  
> > > > > lose  
> > > > > > the ability to find out UUID of root using rootdev api.
> > > > > > This is used by some plugins. So the better way would be to
> > > > > > use the --no-fstab- update. Seems like we can set them per
> > > > > > partition now.
> > > > > >
> > > > > > Thanks,
> > > > > > Vijai Kumar K
> > > > > >  
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Vijai Kumar K
> > > > > > >  
> > > > > > > >
> > > > > > > > Henning
> > > > > > > >  
> > > > > > > > > +
> > > > > > > > > +```
> > > > > > > > > +part / --source rootfs --ondisk sda --fstype ext4
> > > > > > > > > --label +platform
> > > > > > > > > --align 1024 --use-uuid +``` diff --git
> > > > > > > > > a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
> > > > > > > > > index 4ff7470..73e3380 100644
> > > > > > > > > --- a/scripts/lib/wic/help.py
> > > > > > > > > +++ b/scripts/lib/wic/help.py
> > > > > > > > > @@ -940,6 +940,12 @@ DESCRIPTION
> > > > > > > > >                        quotes.  If not specified, the
> > > > > > > > > default string is "defaults".
> > > > > > > > >
> > > > > > > > > +         --fspassno: Specifies the order in which
> > > > > > > > > filesystem
> > > > > > > > > + checks
> > > > > > > > > are done
> > > > > > > > > +                     at boot time by fsck.  See
> > > > > > > > > fs_passno
> > > > > > > > > + parameter
> > > > > > > > > of
> > > > > > > > > +                     fstab(5).  This parameter will
> > > > > > > > > be copied
> > > > > > > > > + into
> > > > > > > > > the
> > > > > > > > > +                     /etc/fstab file of the installed
> > > > > > > > > system.  If not
> > > > > > > > > +                     specified the default value of
> > > > > > > > > "0" will be used. +
> > > > > > > > >           --label label: Specifies the label to give
> > > > > > > > > to the filesystem to be made on the partition. If the
> > > > > > > > > given label is already in use by
> > > > > > > > > another filesystem, diff --git
> > > > > > > > > a/scripts/lib/wic/ksparser.py
> > > > > > > > > b/scripts/lib/wic/ksparser.py index 0df9eb0..a49b7b9
> > > > > > > > > 100644 --- a/scripts/lib/wic/ksparser.py +++
> > > > > > > > > b/scripts/lib/wic/ksparser.py @@ -155,6 +155,7 @@
> > > > > > > > > class KickStart():
> > > > > > > > > part.add_argument('--change-directory')
> > > > > > > > > part.add_argument("--extra-space",
> > > > > > > > > type=sizetype("M")) part.add_argument('--fsoptions',
> > > > > > > > > dest='fsopts')
> > > > > > > > > +        part.add_argument('--fspassno',
> > > > > > > > > dest='fspassno') part.add_argument('--fstype',
> > > > > > > > > default='vfat', choices=('ext2', 'ext3',
> > > > > > > > > 'ext4', 'btrfs', 'squashfs', 'vfat', 'msdos', 'erofs',
> > > > > > > > > diff --git a/scripts/lib/wic/partition.py
> > > > > > > > > b/scripts/lib/wic/partition.py index 09e491d..e50871b
> > > > > > > > > 100644 --- a/scripts/lib/wic/partition.py +++
> > > > > > > > > b/scripts/lib/wic/partition.py @@ -33,6 +33,7 @@ class
> > > > > > > > > Partition(): self.include_path = args.include_path
> > > > > > > > >          self.change_directory = args.change_directory
> > > > > > > > >          self.fsopts = args.fsopts
> > > > > > > > > +        self.fspassno = args.fspassno
> > > > > > > > >          self.fstype = args.fstype
> > > > > > > > >          self.label = args.label
> > > > > > > > >          self.use_label = args.use_label diff --git
> > > > > > > > > a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > b/scripts/lib/wic/plugins/imager/direct.py index
> > > > > > > > > 4d0b836..c44159b
> > > > > > > > > 100644 --- a/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > +++ b/scripts/lib/wic/plugins/imager/direct.py
> > > > > > > > > @@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > > >          updated = False
> > > > > > > > >          for part in self.parts:
> > > > > > > > >              if not part.realnum or not
> > > > > > > > > part.mountpoint \
> > > > > > > > > -               or part.mountpoint == "/" or not
> > > > > > > > > part.mountpoint.startswith('/'):
> > > > > > > > > +               or not
> > > > > > > > > part.mountpoint.startswith('/'): continue
> > > > > > > > >
> > > > > > > > >              if part.use_uuid:
> > > > > > > > > @@ -138,8 +138,9 @@ class DirectPlugin(ImagerPlugin):
> > > > > > > > >                  device_name = "/dev/%s%s%d" %
> > > > > > > > > (part.disk, prefix,
> > > > > > > > > part.realnum)
> > > > > > > > >              opts = part.fsopts if part.fsopts else
> > > > > > > > > "defaults"
> > > > > > > > > +            passno = part.fspassno if part.fspassno
> > > > > > > > > else "0" line = "\t".join([device_name,
> > > > > > > > > part.mountpoint, part.fstype,
> > > > > > > > > -                              opts, "0", "0"]) + "\n"
> > > > > > > > > +                              opts, "0", passno]) +
> > > > > > > > > "\n"
> > > > > > > > >
> > > > > > > > >              fstab_lines.append(line)
> > > > > > > > >              updated = True  
> > > > > >
> > > > > > --
> > > > > > You received this message because you are subscribed to the
> > > > > > Google Groups "isar-users" group.
> > > > > > To unsubscribe from this group and stop receiving emails
> > > > > > from it, send an email to
> > > > > > isar-users+unsubscribe@googlegroups.com. To view this
> > > > > > discussion on the web visit 
> > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > > > > grou
> > > > >  
> > > > > > ps.g
> > > > > > oogle.com%2Fd%2Fmsgid%2Fisar-
> > > > > >  
> > > > >  
> > users%2F8babb01d7eae44e0b9faecad59cdc1d4%2540mentor.com&amp;dat  
> > > > > a=  
> > > > > >  
> > > > >  
> > 05%7C01%7Cfelix.moessbauer%40siemens.com%7C237b0db9bb724580ca540  
> > > > > 8  
> > > > > >  
> > > > >  
> > > >  
> > da5024a3ad%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C6379104  
> > > > > >  
> > > > >  
> > 15537105828%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ  
> > > > > Ijo  
> > > > > >  
> > > > >  
> > iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sda  
> > > > > ta  
> > > > > >  
> > > > >  
> > =%2F%2F1Fxy%2B%2BEgDI4RfUEZ38qy1Q82esArdBuRftDuE1t6s%3D&amp;re  
> > > > > se  
> > > > > > rved=0.  
>

Patch

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 2998824..436b204 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -406,3 +406,22 @@  groups are now created after all packages are installed.
 
 Changes in next
 ---------------
+
+### Wic adds / mountpoint to fstab
+
+In the older version of wic, any mount point named / is skipped from adding
+into the fstab entry.
+
+With the latest wic, this is not the case. / mount point, if any, is added
+to /etc/fstab for automount.
+
+Any wks file which assumed that / would be skipped from /etc/fstab should
+now be corrected. Otherwise, it might result in multiple / entries in /etc/fstab.
+One by the image_configure_fstab function from image class and one by wic.
+
+Below is an example wks entry that might cause an issue.
+Replace "part /" with "part" to avoid adding duplicate entry for /.
+
+```
+part / --source rootfs --ondisk sda --fstype ext4 --label platform --align 1024 --use-uuid
+```
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index 4ff7470..73e3380 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -940,6 +940,12 @@  DESCRIPTION
                       quotes.  If not specified, the default string is
                       "defaults".
 
+         --fspassno: Specifies the order in which filesystem checks are done
+                     at boot time by fsck.  See fs_passno parameter of
+                     fstab(5).  This parameter will be copied into the
+                     /etc/fstab file of the installed system.  If not
+                     specified the default value of "0" will be used.
+
          --label label: Specifies the label to give to the filesystem
                         to be made on the partition. If the given
                         label is already in use by another filesystem,
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 0df9eb0..a49b7b9 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -155,6 +155,7 @@  class KickStart():
         part.add_argument('--change-directory')
         part.add_argument("--extra-space", type=sizetype("M"))
         part.add_argument('--fsoptions', dest='fsopts')
+        part.add_argument('--fspassno', dest='fspassno')
         part.add_argument('--fstype', default='vfat',
                           choices=('ext2', 'ext3', 'ext4', 'btrfs',
                                    'squashfs', 'vfat', 'msdos', 'erofs',
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 09e491d..e50871b 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -33,6 +33,7 @@  class Partition():
         self.include_path = args.include_path
         self.change_directory = args.change_directory
         self.fsopts = args.fsopts
+        self.fspassno = args.fspassno
         self.fstype = args.fstype
         self.label = args.label
         self.use_label = args.use_label
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 4d0b836..c44159b 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -117,7 +117,7 @@  class DirectPlugin(ImagerPlugin):
         updated = False
         for part in self.parts:
             if not part.realnum or not part.mountpoint \
-               or part.mountpoint == "/" or not part.mountpoint.startswith('/'):
+               or not part.mountpoint.startswith('/'):
                 continue
 
             if part.use_uuid:
@@ -138,8 +138,9 @@  class DirectPlugin(ImagerPlugin):
                 device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
 
             opts = part.fsopts if part.fsopts else "defaults"
+            passno = part.fspassno if part.fspassno else "0"
             line = "\t".join([device_name, part.mountpoint, part.fstype,
-                              opts, "0", "0"]) + "\n"
+                              opts, "0", passno]) + "\n"
 
             fstab_lines.append(line)
             updated = True