From: Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Victor Lowther <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/5] Even more dracut functionality
Date: Thu, 12 Feb 2009 12:18:59 +0100 [thread overview]
Message-ID: <20090212111859.GA3201@nb.net.home> (raw)
In-Reply-To: <921e043f0902111835h1975c2f5y87e67d6314df97a2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Feb 11, 2009 at 08:35:21PM -0600, Victor Lowther wrote:
> On Wed, Feb 11, 2009 at 6:21 PM, Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> >
> > I know, that's nit-picking, but I cannot resist ;-)
> >
> > On Wed, Feb 11, 2009 at 03:41:56PM -0800, Victor Lowther wrote:
> >> +find_binary() {
> >> + local binpath="/bin /sbin /usr/bin /usr/sbin" p
btw, what when you want to generate initramfs from a different set of
utils than you have in your standard system? What about to support
something like
dracut --prefix=/usr/local
or follow $PATH rather than hardcode paths to the dracut script.
> >> + [[ ${1##*/} = $1 ]] || { echo $1; return 0; }
> >> + for p in $binpath; do
> >> + [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
> >> + done
> >> + return 1
> >> +}
> >
> > [...]
> >
> >> + local src=$(find_binary "$1") || {
> >
> > PATH="/bin:/sbin:/usr/bin:/usr/sbin"
> > local src=$(type -Pa "$1")
>
> What will that do when passed an absolute path to a file that is not
> an executable?
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
src=$(type -Pa "$1") || src="$1"
[[ ! -f "$src" ]] && {
echo "Cannot find requested file $1. Exiting."
exit 1
}
... but that's real nit-picking (and I love shell or awk exercises ;-)
Your find_binary() is good of course. I look forward to see your patches
in dracut git repository.
Karel
--
Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-02-12 11:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 23:41 [PATCH 1/5] Even more dracut functionality Victor Lowther
[not found] ` <255e595fd4f868ab0f6e085deb0bfd4a2afc8ae7.1234395178.git.victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-11 23:42 ` [PATCH 2/5] Even more dracut cleanups Victor Lowther
2009-02-11 23:42 ` [PATCH 3/5] " Victor Lowther
2009-02-11 23:42 ` [PATCH 4/5] " Victor Lowther
2009-02-11 23:42 ` [PATCH 5/5] " Victor Lowther
2009-02-11 23:53 ` [PATCH 6/5] Even more dracut functionality Victor Lowther
2009-02-12 0:21 ` [PATCH 1/5] " Karel Zak
[not found] ` <20090212002109.GE21052-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2009-02-12 2:35 ` Victor Lowther
[not found] ` <921e043f0902111835h1975c2f5y87e67d6314df97a2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-12 11:18 ` Karel Zak [this message]
[not found] ` <20090212111859.GA3201-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2009-02-12 12:06 ` Victor Lowther
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=20090212111859.GA3201@nb.net.home \
--to=kzak-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.