From 681285fff08169abd175beafae9e4144735e8cd9 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Fri, 21 Aug 2020 12:59:03 +0200
Subject: [PATCH] Do not mount as RW in Dracut

Dracut do not have reason to mount sources as RW it's more that it wasn't
specified and until recently we just did not bother. However, we changed the
logic that installation sources in stage2 environment does not re-using mounts
from the Dracut so this will now fail to set the environment because you can't
mount one thing as RW and RO at once.

Resolves: rhbz#1871049
(cherry picked from commit 408ae390c9ed7d14ad6c51979a18d839720e8be6)
---
 dracut/anaconda-diskroot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 7e52e052b..8846b1108 100755
--- a/dracut/anaconda-diskroot
+++ b/dracut/anaconda-diskroot
@@ -64,6 +64,6 @@ if [ -e /tmp/dd_interactive -a ! -e /tmp/dd.done ]; then
 fi
 
 info "anaconda using disk root at $dev"
-mount $dev $repodir || warn "Couldn't mount $dev"
+mount -o ro $dev $repodir || warn "Couldn't mount $dev"
 anaconda_live_root_dir $repodir $path
 run_checkisomd5 $dev
-- 
2.23.0

