From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH] mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
Date: Fri, 06 Dec 2019 16:04:52 +0100 [thread overview]
Message-ID: <bf3b196ff0536a560a6360d0d5ed179ca37c84e1.camel@gentoo.org> (raw)
In-Reply-To: <w6g4kyd5x7e.fsf@kph.uni-mainz.de>
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On Fri, 2019-12-06 at 15:45 +0100, Ulrich Mueller wrote:
> > > + local fstabstate=$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 == "/boot" \
> > > + {print $2}' /etc/fstab)
> > The 'print' here is used as a boolean... why not use a boolean output
> > instead?
>
> Changed, it's printing a 1 now.
Well, I actually meant using exit status ;-). Would be also have the
benefit of terminating early.
>
> > > + local procstate=$(awk '$2 == "/boot" \
> > > + {print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4)}' /proc/mounts)
> > Shouldn't this use /proc/self/mounts?
>
> I haven't actually changed this, it was /proc/mounts before (which is a
> symlink to self/mounts). Maybe we should keep it as-is for backwards
> compatibility? (But TBH, I have no idea with which kernel version
> /proc/self/mounts appeared.)
Ok.
>
> > > + mount-boot_check_status
> > > + if ! ( shopt -s failglob; : "${ROOT}"/boot/.keep* ) 2>/dev/null ; then
> > EROOT?
>
> Hm, we mount /boot, not ${EROOT}/boot. I've added an additional test for
> [[ ${EROOT:-/} == / ]] before touching the file.
>
> Patch v2 will follow.
>
Thanks.
--
Best regards,
Michał Górny
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 618 bytes --]
prev parent reply other threads:[~2019-12-06 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 13:11 [gentoo-dev] [PATCH] mount-boot.eclass: Check if /boot is sane, but don't try to mount it Ulrich Müller
2019-12-06 14:03 ` Michał Górny
2019-12-06 14:45 ` Ulrich Mueller
2019-12-06 15:04 ` Michał Górny [this message]
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=bf3b196ff0536a560a6360d0d5ed179ca37c84e1.camel@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/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