~alpine/devel

1

[alpine-devel] [PATCH] main/openrc: Fix sed script in modules.initd.

Przemyslaw Pawelczyk
Details
Message ID
<1461101344-3537-1-git-send-email-przemoc@zoho.com>
Sender timestamp
1461101344
DKIM signature
missing
Download raw message
Patch: +1 -1
Old sed script did not remove blank lines, so one could easily get:

    modprobe: ERROR: missing parameters. See -h.

during boot, e.g. from comment in /etc/modules-load.d/lm_sensors.conf
generated by sensors-detect (from lm_sensors-detect package).
---
 main/openrc/modules.initd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/openrc/modules.initd b/main/openrc/modules.initd
index a9829f4..8d94f97 100644
--- a/main/openrc/modules.initd
+++ b/main/openrc/modules.initd
@@ -19,7 +19,7 @@ start() {
 			continue
 		fi
 
-		sed 's/\#.*//g' < "$f" | while read module args; do
+		sed 's/\#.*//g;/^[[:space:]]*$/d' < "$f" | while read module args; do
 			modprobe -q $module $args
 		done
 	done
-- 
2.6.6




---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20160421090459.3b769125@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1461101344-3537-1-git-send-email-przemoc@zoho.com> (view parent)
Sender timestamp
1461222299
DKIM signature
missing
Download raw message
On Tue, 19 Apr 2016 23:29:04 +0200
Przemyslaw Pawelczyk <przemoc@zoho.com> wrote:

> Old sed script did not remove blank lines, so one could easily get:
> 
>     modprobe: ERROR: missing parameters. See -h.
> 
> during boot, e.g. from comment in /etc/modules-load.d/lm_sensors.conf
> generated by sensors-detect (from lm_sensors-detect package).
> ---
>  main/openrc/modules.initd | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/main/openrc/modules.initd b/main/openrc/modules.initd
> index a9829f4..8d94f97 100644
> --- a/main/openrc/modules.initd
> +++ b/main/openrc/modules.initd
> @@ -19,7 +19,7 @@ start() {
>  			continue
>  		fi
>  
> -		sed 's/\#.*//g' < "$f" | while read module args; do
> +		sed 's/\#.*//g;/^[[:space:]]*$/d' < "$f" | while read module args; do
>  			modprobe -q $module $args
>  		done
>  	done

i rewrote it to be slightly more readable.

Thanks!

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---