From: Grant Erickson <gerickson@nuovations.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Propagate Error Status to the Shell on fw_printenv Errors
Date: Wed, 07 May 2008 07:01:09 -0700 [thread overview]
Message-ID: <C4470435.F0B6%gerickson@nuovations.com> (raw)
In-Reply-To: <1210145357.32216.66.camel@gentoo-jocke.transmode.se>
On 5/7/08 12:29 AM, Joakim Tjernlund wrote:
> On Tue, 2008-05-06 at 20:16 -0700, Grant Erickson wrote:
>> root at kilauea# fw_printenv foobar
>> ## Error: "foobar" not defined
>
> This error message should not be there. It is enough to return exit
> status 1. Then one does not have to redirect stderr in scripts
>
>> root at kilauea# fw_printenv hostname ipaddr foobar
>> hostname=kilauea
>> ipaddr=192.168.1.12
>> ## Error: "foobar" not defined
>
> Same here.
>
>> root at kilauea# echo $?
>> 1
>>
>
> Could you also remove the messages printed during fw_setenv(show below)?
> root at jtd:~# fw_setenv kalle sven
> Unlocking flash...
> Done
> Erasing old environment...
> Done
> Writing environment to /dev/mtd2...
> Done
> Locking ...
> Done
>
> Perhaps hide them behind a -v(verbose) option?
Joakim,
Agreed that there should be a way to suppress or, alternatively, enable
these verbose status messages. However, these messages were all in the code
already.
So, to the extent that the maintainer (Wolfgang?) is amenable to adding
another option ("-v" or "-q"), I can evaluate working on this change as a
separate patch.
Another change I am also looking into is eliminating the write to flash even
when a variable does not exist:
root at kilauea# fw_printenv foobar
## Error: "foobar" not defined
root at kilauea# echo $?
1
root at kilauea# fw_setenv foobar
Unlocking flash...
Done
Erasing old environment...
Done
Writing environment to /dev/mtd4...
Done
Locking ...
Done
root at kilauea# echo $?
0
Regards,
Grant
next prev parent reply other threads:[~2008-05-07 14:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 3:16 [U-Boot-Users] [PATCH] Propagate Error Status to the Shell on fw_printenv Errors Grant Erickson
2008-05-07 6:44 ` Markus Klotzbücher
2008-05-07 7:10 ` Wolfgang Denk
2008-05-07 7:32 ` Markus Klotzbücher
2008-05-07 13:53 ` Grant Erickson
2008-05-07 14:49 ` Markus Klotzbücher
2008-05-07 15:50 ` Wolfgang Denk
2008-05-07 13:56 ` Grant Erickson
2008-05-07 15:55 ` Wolfgang Denk
2008-05-07 7:29 ` Joakim Tjernlund
2008-05-07 14:01 ` Grant Erickson [this message]
2008-05-09 21:41 ` Wolfgang Denk
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=C4470435.F0B6%gerickson@nuovations.com \
--to=gerickson@nuovations.com \
--cc=u-boot@lists.denx.de \
/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