mount-boot.eclass: Check if /boot is sane, but don't try to mount it.
authorUlrich Müller <ulm@gentoo.org>
Fri, 6 Dec 2019 13:11:31 +0000 (14:11 +0100)
committerUlrich Müller <ulm@gentoo.org>
Wed, 11 Dec 2019 06:04:49 +0000 (07:04 +0100)
commit2d90570e81469bf75b2d4a4275151e282632c18e
tree6b0be3e1d82b8fc53b8415d332882984da9c9e4f
parentd89b6907f4121bce1a4a0ea9e5ea45a3ff73c1af
mount-boot.eclass: Check if /boot is sane, but don't try to mount it.

The eclass failed to remount a read-only mounted /boot, because package
collision sanity checks in recent Portage versions prevented it from
reaching pkg_preinst() at all. Furthermore, with the "mount-sandbox"
feature enabled, the mount won't be propagated past pkg_preinst() and
installed files would end up under the (shadowed) mount point.

Therefore don't even attempt to mount /boot ourselves, but error out
if it isn't mounted read/write and ask the user to mount /boot.

Also clean up and simplify. (For example, awk is a grown-up program
which doesn't need any help from egrep or sed. :-)

Closes: https://bugs.gentoo.org/532264
See-also: https://bugs.gentoo.org/274130#c5
Acked-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
eclass/mount-boot.eclass