28ab1c
From c2f193cc422eac475bbc17261413c83ff13172d4 Mon Sep 17 00:00:00 2001
28ab1c
From: Alexander Tsoy <alexander@tsoy.me>
28ab1c
Date: Mon, 25 May 2020 17:49:20 +0300
28ab1c
Subject: [PATCH] busybox: simplify listing of supported utilities
28ab1c
28ab1c
'--list' option is supported since busybox-1.20.0, which was released
28ab1c
in 2010.
28ab1c
28ab1c
(cherry picked from commit 50cc23ba32b0fda63eff7623b529dbeb4e6a38c6)
28ab1c
28ab1c
Resolves: #1959336
28ab1c
---
28ab1c
 modules.d/05busybox/module-setup.sh | 11 ++++++-----
28ab1c
 1 file changed, 6 insertions(+), 5 deletions(-)
28ab1c
28ab1c
diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh
28ab1c
index ecbd6a13..5d88c5d1 100755
28ab1c
--- a/modules.d/05busybox/module-setup.sh
28ab1c
+++ b/modules.d/05busybox/module-setup.sh
28ab1c
@@ -14,15 +14,16 @@ depends() {
28ab1c
 
28ab1c
 # called by dracut
28ab1c
 install() {
28ab1c
-    local _i _progs _path _busybox
28ab1c
+    local _i _path _busybox
28ab1c
+    local _progs=()
28ab1c
     _busybox=$(type -P busybox)
28ab1c
     inst $_busybox /usr/bin/busybox
28ab1c
-    for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
28ab1c
-    do
28ab1c
-        _progs="$_progs $_i"
28ab1c
+    for _i in $($_busybox --list); do
28ab1c
+        [[ ${_i} == busybox ]] && continue
28ab1c
+        _progs+=("${_i}")
28ab1c
     done
28ab1c
 
28ab1c
-    for _i in $_progs; do
28ab1c
+    for _i in "${_progs[@]}"; do
28ab1c
         _path=$(find_binary "$_i")
28ab1c
         [ -z "$_path" ] && continue
28ab1c
         ln_r /usr/bin/busybox $_path
28ab1c