Subject: [alpine-aports] [PATCH] fix: cannot blacklist more than 2 modules

From: Kurnia D Win <[email-masked]>
Date: Tue, 3 Oct 2017 15:21:24 +0700

Use 'tr' instead of shell subtitution, because only first ',' char will be
replaced by shell subtitution

See: https://bugs.alpinelinux.org/issues/7954
---
 initramfs-init.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/initramfs-init.in b/initramfs-init.in
index f3a3ee5..2574ccb 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -325,7 +325,7 @@ ALPINE_REPO=${KOPT_alpine_repo}
 [ "$KOPT_quiet" = yes ] && dmesg -n 1
 
 # optional blacklist
-for i in ${KOPT_blacklist/,/ }; do
+for i in $(echo "$KOPT_blacklist" | tr ',' ' ' ); do
 	echo "blacklist $i" >> /etc/modprobe.d/boot-opt-blacklist.conf
 done
 
-- 
2.14.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teras <[email-masked]>
Date: Fri, 20 Oct 2017 08:36:42 +0300

On Tue,  3 Oct 2017 15:21:24 +0700
Kurnia D Win <[email-masked]> wrote:

> Use 'tr' instead of shell subtitution, because only first ',' char
> will be replaced by shell subtitution
> 

Thanks for finding the issue.

>  	echo "blacklist $i"
> >> /etc/modprobe.d/boot-opt-blacklist.conf done

Please use instead ${foo//,/ } which is a global substitution. Forking
is slower.

---