From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AA730138334 for ; Fri, 6 Dec 2019 15:05:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22781E0886; Fri, 6 Dec 2019 15:04:59 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A821EE0872 for ; Fri, 6 Dec 2019 15:04:58 +0000 (UTC) Received: from pomiot (c134-66.icpnet.pl [85.221.134.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id E4E8834D7EC; Fri, 6 Dec 2019 15:04:56 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH] mount-boot.eclass: Check if /boot is sane, but don't try to mount it. From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Fri, 06 Dec 2019 16:04:52 +0100 In-Reply-To: References: Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-1xoCPqS5LKvNFlJudzUz" User-Agent: Evolution 3.32.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: ec094e82-61a7-4912-9378-ce090375beec X-Archives-Hash: 7c43dd4390eba9018f787e7e1c89d91e --=-1xoCPqS5LKvNFlJudzUz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2019-12-06 at 15:45 +0100, Ulrich Mueller wrote: > > > + local fstabstate=3D$(awk '!/^[[:blank:]]*#|^\/dev\/BOOT/ && $2 =3D= =3D "/boot" \ > > > + {print $2}' /etc/fstab) > > The 'print' here is used as a boolean... why not use a boolean output > > instead? >=20 > Changed, it's printing a 1 now. Well, I actually meant using exit status ;-). Would be also have the benefit of terminating early. >=20 > > > + local procstate=3D$(awk '$2 =3D=3D "/boot" \ > > > + {print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4)}' /proc/mount= s) > > Shouldn't this use /proc/self/mounts? >=20 > 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. >=20 > > > + mount-boot_check_status > > > + if ! ( shopt -s failglob; : "${ROOT}"/boot/.keep* ) 2>/dev/null ; t= hen > > EROOT? >=20 > Hm, we mount /boot, not ${EROOT}/boot. I've added an additional test for > [[ ${EROOT:-/} =3D=3D / ]] before touching the file. >=20 > Patch v2 will follow. >=20 Thanks. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-1xoCPqS5LKvNFlJudzUz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAl3qbhRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe JA7DsggAjxbzuNUsp8LwkBBSxVx32DD7tsfwDCIZ7ZuWjlIisle76HgH/LaHgueF LgZ9f5KIooF5FOQl+8KfVB60IDZWYa31F7wugClzlMHP1XcJeWmInRU/EBk68Dog K4ENwWPVvfP3zosksq0B0wuSPUhMUhVJW0iNduGu+e0zcPprUHc+Czb8R0DPHtHQ D//SckIEd49SeFvW3tLf2y0nEKShJYYbJRN77/MnhYx8GEUT/OawZxso9cYpcLej LjlY1lzMeiMHLkWbzeUUigZwlom1aA5JwY1M1P43qzLbm9/7es9JhaaFZxqrL8Xr s5LldH06DXdsRoh6XT+zi1I1lClgAg== =lVJ1 -----END PGP SIGNATURE----- --=-1xoCPqS5LKvNFlJudzUz--