Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: mark.jonas@de.bosch.com, Joshua Watt <jpewhacker@gmail.com>
Cc: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>,
	"raj.khem@gmail.com" <raj.khem@gmail.com>,
	"Simoes Ricardo (BT-FS/ENG1.1-2)" <Ricardo.Simoes@pt.bosch.com>
Subject: Re: [OE-core] [PATCH] udev-extraconf: Allow optionally skipping systemd-fsck
Date: Tue, 13 May 2025 09:46:02 +0100	[thread overview]
Message-ID: <8bbbcfe81a99f36e90718015150e135a4ef8202b.camel@linuxfoundation.org> (raw)
In-Reply-To: <DU0PR10MB7076F9B59B85FEC850F9A8D9AD97A@DU0PR10MB7076.EURPRD10.PROD.OUTLOOK.COM>

On Mon, 2025-05-12 at 18:16 +0000, Mark Jonas via
lists.openembedded.org wrote:
> Hi Joshua,
> 
> 
> > > From: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
> > > 
> > > When the fsck backend does not respect the exit codes predefined
> > > by
> > > fsck, systemd-fsck might not work as expected.
> > > 
> > > This is the case for fsck.fat from dosfstools [1]. When a FAT
> > > formatted and write protected partition is checked with fsck.fat
> > > it
> > > will terminate with exit code '6' [2]. What fsck.fat wants to
> > > signal
> > > is that a write protected device cannot be checked. However, that
> > code
> > > is interpreted by systemd-fsck as a bit mask:
> > > 
> > > - 2: System should be rebooted
> > > - 4: Filesystem errors left uncorrected
> > > 
> > > As a practical example, a write-protected, FAT formatted SD-card
> > will
> > > not be mounted in this case.
> > > 
> > > This patch introduces the environment variable
> > SKIP_SYSTEMD_MOUNT_FSCK.
> > > When SKIP_SYSTEMD_MOUNT_FSCK exists systemd-mount will be called
> > with
> > > the --fsck=no option. Thus, the partition will be mounted without
> > > running systemd-fsck.
> > > 
> > > In general, this new feature is useful when the filesystem is
> > > known
> > to
> > > be clean and the fsck backend does not respect the exit codes.
> > > 
> > > Finally, one way to use this new feature would be to add
> > > ENV{SKIP_SYSTEMD_MOUNT_FSCK}="1" to the udev rule calling the
> > > mount
> > > script.
> 
> 
> > This is a pretty generic work around for a very specific problem in
> > dosfstools. It would probably be better to patch dosfstools to have
> > the expected error codes instead.
> 
> You are right. We also thought at first that we should fix the
> problem in dosfstools. But the project appears to be abandoned. The
> last commit in the repository is from October 2023. And the last
> closed issue is from August 2023. Lastly, there is an issue which
> sounds as if the maintainer lost access to the repo
> (https://github.com/dosfstools/dosfstools/issues/210). But the
> maintainer(s) did not even reply.
> 
> Instead of fixing the problem upstream we could of course also add a
> patch to the meta-layer. But the patch would be rather big because
> the overall exit code generation is spread over the code. There is
> more to fix than only this single situation to make dosfstools adhere
> to the fsck standard return codes.
> 
> We would definitely not be able to maintain a fork of dosfstools.
> 
> How else could this be handled?

I think we should probably carry a patch to dosfstools until the
upstream situation gets resolved. I don't like doing that but
ultimately it will lead to a better end result. It is likely other
distros would be interested in such a patch too.

Attaching that patch to the github dosfstools so there was a patch
ready would also increase the chances of it merging too.

Cheers,

Richard



  reply	other threads:[~2025-05-13  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  9:44 [PATCH] udev-extraconf: Allow optionally skipping systemd-fsck mark.jonas
2025-05-12 16:43 ` Joshua Watt
2025-05-12 18:16   ` AW: " Jonas Mark (BT-FS/ENG1-Mue)
2025-05-13  8:46     ` Richard Purdie [this message]
2025-05-14 15:20       ` AW: [OE-core] " Jonas Mark (BT-FS/ENG1-Mue)
2025-05-14 15:34         ` Richard Purdie
2025-05-14 16:44           ` AW: " Jonas Mark (BT-FS/ENG1-Mue)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bbbcfe81a99f36e90718015150e135a4ef8202b.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Ricardo.Simoes@pt.bosch.com \
    --cc=jpewhacker@gmail.com \
    --cc=mark.jonas@de.bosch.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox