mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Android Kernel Team <kernel-team@android.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] scripts/dev-needs: Add script to list device dependencies
Date: Tue, 27 Oct 2020 10:30:44 -0700	[thread overview]
Message-ID: <CAGETcx9MVi53Fp3sGXap8iyfHO5VMVpwe9BV7B7SLwmkxR4WOQ@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUcxX1Zvb7X+uxLa1u0WkOtS8hAZ000+Ta+7SCdkeJO8g@mail.gmail.com>

On Tue, Oct 27, 2020 at 3:12 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Saravana,
>
> On Wed, Sep 2, 2020 at 12:51 AM Saravana Kannan <saravanak@google.com> wrote:
> > This script can be useful for:
> > - Figuring out the list of modules you need to pack in initrd
> > - Figuring out the list of drivers you need to modularize for a device
> >   to be fully functional without building in any dependencies.
> > - Figuring out which drivers to enable first, when porting drivers
> >   between kernels (say, to upstream).
> > - Plotting graphs of system dependencies, etc.
> >
> > Usage: dev-needs.sh [-c|-d|-m|-f] [filter options] <list of devices>
> >
> > This script needs to be run on the target device once it has booted to a
> > shell.
> >
> > The script takes as input a list of one or more device directories under
> > /sys/devices and then lists the probe dependency chain (suppliers and
> > parents) of these devices. It does a breadth first search of the dependency
> > chain, so the last entry in the output is close to the root of the
> > dependency chain.
>
> Thanks for your patch!
>
> > --- /dev/null
> > +++ b/scripts/dev-needs.sh
> > @@ -0,0 +1,315 @@
> > +#! /bin/sh
>
> On Debian, where /bin/sh -> dash:
>
>     dev-needs.sh: 6: dev-needs.sh: Syntax error: "(" unexpected

dash doesn't like () after the function name maybe? If so, we could
drop it. I think it'll still work with toybox and bash.

>
> When using bash, I get:
>
> # ./dev-needs.sh /sys/devices/platform/soc/feb00000.display
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
>
> # ./dev-needs.sh -c /sys/devices/platform/soc/feb00000.display
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found
> ./dev-needs.sh: line 255: detail: command not found

This is odd. bash definitely works with this script on my Debian x86 machine.

This error happens when the "detail" alias is not "seen" by the shell
when it interprets detail_chosen function. Sigh, every shell seems to
want a different order. Can you try to debug it on your end?

This is the version I have:
GNU bash, version 5.1.0(1)-rc1

> Which shell should I use?

I've tested with toybox and bash.

-Saravana

  reply	other threads:[~2020-10-27 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 22:48 Saravana Kannan
2020-10-27 10:11 ` Geert Uytterhoeven
2020-10-27 17:30   ` Saravana Kannan [this message]
2020-10-27 18:09     ` Geert Uytterhoeven
2020-10-27 18:23       ` Saravana Kannan

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=CAGETcx9MVi53Fp3sGXap8iyfHO5VMVpwe9BV7B7SLwmkxR4WOQ@mail.gmail.com \
    --to=saravanak@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh@kernel.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

all inboxes | Powered by JetHome®