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