summaryrefslogtreecommitdiff
path: root/sys-kernel/dracut/files/055-fix-base-do-not-quote-initargs-for-switch_root.patch
blob: 5568c22aede611ded0ba66a85aad5eb0bf510b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 285e2ad01035743ff51005a74e486e09fcbb0a0d Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Fri, 23 Jul 2021 14:35:07 -0400
Subject: [PATCH] fix(base): do not quote $initargs for switch_root

We want word splitting to occur so that the arguments are passed
separately, and we don't end up passing an empty string if no arguments
are specified.

Bug: https://bugs.gentoo.org/803548
Fixes: 2fabaaa62dcfd31e593ca45e1374e55adae29d6b
---
 modules.d/99base/init.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 978adb6f..ab62bb44 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -387,7 +387,8 @@ if [ -f /etc/capsdrop ]; then
         }
 else
     unset RD_DEBUG
-    exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" "$initargs" || {
+    # shellcheck disable=SC2086
+    exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" $initargs || {
         warn "Something went very badly wrong in the initramfs.  Please "
         warn "file a bug against dracut."
         emergency_shell
-- 
2.32.0