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