Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691874 - mount-boot.eclass gets confused when there is another mountpoint with "/boot" in name
Summary: mount-boot.eclass gets confused when there is another mountpoint with "/boot"...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://archives.gentoo.org/gentoo-de...
Whiteboard: InReview
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-10 02:44 UTC by Thomas Deutschmann (RETIRED)
Modified: 2019-08-12 13:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-10 02:44:01 UTC
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.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-10 02:46:43 UTC
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')
Comment 2 Larry the Git Cow gentoo-dev 2019-08-12 13:03:04 UTC
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(-)