Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
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 15:05:02
Message-Id: bf3b196ff0536a560a6360d0d5ed179ca37c84e1.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] mount-boot.eclass: Check if /boot is sane, but don't try to mount it. by Ulrich Mueller
1 On Fri, 2019-12-06 at 15:45 +0100, Ulrich Mueller wrote:
2 > > > + local fstabstate=$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 == "/boot" \
3 > > > + {print $2}' /etc/fstab)
4 > > The 'print' here is used as a boolean... why not use a boolean output
5 > > instead?
6 >
7 > Changed, it's printing a 1 now.
8
9 Well, I actually meant using exit status ;-). Would be also have the
10 benefit of terminating early.
11
12 >
13 > > > + local procstate=$(awk '$2 == "/boot" \
14 > > > + {print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4)}' /proc/mounts)
15 > > Shouldn't this use /proc/self/mounts?
16 >
17 > I haven't actually changed this, it was /proc/mounts before (which is a
18 > symlink to self/mounts). Maybe we should keep it as-is for backwards
19 > compatibility? (But TBH, I have no idea with which kernel version
20 > /proc/self/mounts appeared.)
21
22 Ok.
23
24 >
25 > > > + mount-boot_check_status
26 > > > + if ! ( shopt -s failglob; : "${ROOT}"/boot/.keep* ) 2>/dev/null ; then
27 > > EROOT?
28 >
29 > Hm, we mount /boot, not ${EROOT}/boot. I've added an additional test for
30 > [[ ${EROOT:-/} == / ]] before touching the file.
31 >
32 > Patch v2 will follow.
33 >
34
35 Thanks.
36
37 --
38 Best regards,
39 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature