Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691872 - sys-kernel/genkernel-4.0.0_beta11 mistakenly considers bootdir is mounted ro
Summary: sys-kernel/genkernel-4.0.0_beta11 mistakenly considers bootdir is mounted ro
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2019-08-10 00:55 UTC by Dirk Sondermann
Modified: 2019-08-11 21:54 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 Dirk Sondermann 2019-08-10 00:55:43 UTC
With MOUNTBOOT="yes" genkernel tries to mount the bootdir rw before installing the new kernel and tries to restore the state of the bootdir afterwards. If there is another directory that is mounted ro and whose mount point ends in "/boot" genkernel mistakenly considers the bootdir to be mounted ro and remounts it ro after the new kernel has been installed.

Reproducible: Always

Steps to Reproduce:
1. mount /boot rw
2. mount /some-path/boot ro
3. invoke genkernel --mountboot all
Actual Results:  
/boot has been remouted ro

Expected Results:  
/boot is still mounted rw

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:37:33 UTC
Congratulations, you found a bug in mount-boot.eclass, too! :-)
Comment 2 Larry the Git Cow gentoo-dev 2019-08-10 19:37:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=14aa6eae52b8b9ae476ad2de13cb87f45e28f38b

commit 14aa6eae52b8b9ae476ad2de13cb87f45e28f38b
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-08-10 19:35:39 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-08-10 19:35:39 +0000

    gen_funcs.sh: make_bootdir_writable(): Fix ro check
    
    Make sure we check $BOOTDIR only for ro and not any mount containing
    $BOOTDIR value.
    
    Bug: https://bugs.gentoo.org/691872
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 gen_funcs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-11 21:54:19 UTC
Thank you for the reported, fixed in >=sys-kernel/genkernel-4.0.0_beta12!