Steps to Reproduce: 1. Make sure /boot is mounted rw 2. mount <something> /some-path/with/boot --read-only 3. USE=initramfs emerge sys-kernel/linux-firmware Actual Results: /boot has been remouted ro Expected Results: /boot is still mounted rw Found by Dirk Sondermann via bug 691872: The problem seems to be caused by the following statement in /usr/share/genkernel/gen_funcs.sh: local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null | sed -n "/${BOOTDIR//\//\\/} .*,ro,/p") When it is replaced by local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null | sed -n "/^${BOOTDIR//\//\\/} .*,ro,/p") everything works as expected.
Code from eclass (https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/mount-boot.eclass?id=abc8dd8db1715f0d515e58644c6b84bdd7f4fce0#n54): > # note that /dev/BOOT is in the Gentoo default /etc/fstab file > local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) > local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) > local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/\/boot .*,ro,/p')
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7840e73dde3ff715806aff61708f134479581d9c commit 7840e73dde3ff715806aff61708f134479581d9c Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-08-10 19:40:36 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-08-12 13:02:54 +0000 mount-boot.eclass: Fix ro check Make sure we check only /boot mount and not any mount containing '/boot'. Closes: https://bugs.gentoo.org/691874 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> eclass/mount-boot.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)