From bc8779761fe60313a1c754a6b24c2861e86a5e62 Mon Sep 17 00:00:00 2001
From: Jan Stodola <honza.stodola@gmail.com>
Date: Sat, 14 Nov 2020 21:27:45 +0100
Subject: [PATCH] Fix error in initrd: shift count out of range

anaconda_live_root_dir() can be called with just one argument (for example
when booting boot.iso) and the following error is reported:

20:26:12,641 INFO dracut-initqueue:anaconda using disk root at /dev/sr0
20:26:12,650 DEBUG kernel:ISO 9660 Extensions: Microsoft Joliet Level 3
20:26:12,654 DEBUG kernel:ISO 9660 Extensions: RRIP_1991A
20:26:12,654 INFO dracut-initqueue:/lib/anaconda-lib.sh: line 71: shift: 2: shift count out of range
20:26:12,656 INFO dracut-initqueue:anaconda: found /run/install/repo//images/install.img

Remove the shift call, since it has no use.
---
 dracut/anaconda-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 3b86f3df9..0dc8c817e 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -68,7 +68,7 @@ rulesfile="/etc/udev/rules.d/90-anaconda.rules"
 # try to find a usable runtime image from the repo mounted at $mnt.
 # if successful, move the mount(s) to $repodir/$isodir.
 anaconda_live_root_dir() {
-    local img="" iso="" srcdir="" mnt="$1" path="$2"; shift 2
+    local img="" iso="" srcdir="" mnt="$1" path="$2"
     img=$(find_runtime $mnt/$path)
     if [ -n "$img" ]; then
         info "anaconda: found $img"
-- 
2.23.0

