public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org>,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dracut-functions.sh: avoid tokenizing ldconfig output with 'read'
Date: Thu, 08 Jan 2015 16:36:18 +0100	[thread overview]
Message-ID: <54AEA3F2.2030102@redhat.com> (raw)
In-Reply-To: <1419368590-2052-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>

On 23.12.2014 22:03, Lubomir Rintel wrote:
> The space does not separate the elements reliably, spaces can be
> embedded in parenthesized expressions too:
> 
>   libgmpxx.so.4 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmpxx.so.4
>   libgmp.so.10 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmp.so.10
> 
> This results in dracut creating '0x0000000004000000' and '=>'
> directories in the initramfs image.
> ---
>  dracut-functions.sh | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/dracut-functions.sh b/dracut-functions.sh
> index 410960d..37ddca2 100755
> --- a/dracut-functions.sh
> +++ b/dracut-functions.sh
> @@ -104,17 +104,7 @@ fi
>  
>  ldconfig_paths()
>  {
> -    local a i
> -    declare -A a
> -    for i in $(
> -        ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
> -            d=${d%/*}
> -            printf "%s\n" "$d";
> -        done
> -    ); do
> -        a["$i"]=1;
> -    done;
> -    printf "%s\n" ${!a[@]}
> +    ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
>  }
>  
>  # Detect lib paths
> 

Thanks! pushed

      parent reply	other threads:[~2015-01-08 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 21:03 [PATCH] dracut-functions.sh: avoid tokenizing ldconfig output with 'read' Lubomir Rintel
     [not found] ` <1419368590-2052-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2015-01-08 15:36   ` Harald Hoyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54AEA3F2.2030102@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lkundrak-NGH9Lh4a5iE@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox