commit:     14aa6eae52b8b9ae476ad2de13cb87f45e28f38b
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 10 19:35:39 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Aug 10 19:35:39 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=14aa6eae

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 <AT> gentoo.org>

 gen_funcs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 3c9c56f..da9bc08 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -1746,7 +1746,7 @@ make_bootdir_writable() {
        # Based on mount-boot.eclass code
        local fstabstate=$(awk "!/^#|^[[:blank:]]+#|^${BOOTDIR//\//\\/}/ {print 
\$2}" /etc/fstab 2>/dev/null | egrep "^${BOOTDIR}$" )
        local procstate=$(awk "\$2 ~ /^${BOOTDIR//\//\\/}\$/ {print \$2}" 
/proc/mounts 2>/dev/null)
-       local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null 
| sed -n "/${BOOTDIR//\//\\/} .*,ro,/p")
+       local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts 2>/dev/null 
| sed -n "/^${BOOTDIR//\//\\/} .*,ro,/p")
 
        if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]
        then

Reply via email to