mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Programatically write in a file in the environnent with a hush command
@ 2015-05-26 15:41 Jean-Christophe BEGUE
  2015-05-27  6:08 ` Alexander Richter
  2015-05-27  6:53 ` Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Jean-Christophe BEGUE @ 2015-05-26 15:41 UTC (permalink / raw)
  To: barebox

Hello,

I'm trying to pass a value from Barebox to the operating system, using
the usreland command bareboxenv -l.

My problem is : How should I write that status from my hush barebox script?

echo $mystatus > /env/data/my_status_file

The above command doesn't work as '>' is not implemented.

I've the feeling that I'm missing something?

Jean-Christophe BEGUE

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Programatically write in a file in the environnent with a hush command
  2015-05-26 15:41 Programatically write in a file in the environnent with a hush command Jean-Christophe BEGUE
@ 2015-05-27  6:08 ` Alexander Richter
  2015-05-27  6:24   ` Alexander Richter
  2015-05-27  6:53 ` Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Richter @ 2015-05-27  6:08 UTC (permalink / raw)
  To: Jean-Christophe BEGUE; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 699 bytes --]

Hello,
> Am 26.05.2015 um 17:42 schrieb Jean-Christophe BEGUE <begue.jc@gmail.com>:
> 
> Hello,
> 
> I'm trying to pass a value from Barebox to the operating system, using
> the usreland command bareboxenv -l.
> 
> My problem is : How should I write that status from my hush barebox script?
> 
> echo $mystatus > /env/data/my_status_file
You can use the command nv to create non volatile shell variables. Don’t forget to save the Environment.
> 
> The above command doesn't work as '>' is not implemented.
> 
> I've the feeling that I'm missing something?
> 
To access the new variable (/env/nv/foo.bar) from userspace, you can use the „bareboxenv“ tool

Alexander Richter

[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Programatically write in a file in the environnent with a hush command
  2015-05-27  6:08 ` Alexander Richter
@ 2015-05-27  6:24   ` Alexander Richter
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Richter @ 2015-05-27  6:24 UTC (permalink / raw)
  To: Jean-Christophe BEGUE; +Cc: barebox


> Am 27.05.2015 um 08:10 schrieb Alexander Richter <alexander.richter@atsonline.de>:
> 
> Hello,
>> Am 26.05.2015 um 17:42 schrieb Jean-Christophe BEGUE <begue.jc@gmail.com>:
>> 
>> Hello,
>> 
>> I'm trying to pass a value from Barebox to the operating system, using
>> the usreland command bareboxenv -l.
>> 
>> My problem is : How should I write that status from my hush barebox script?
>> 
>> echo $mystatus > /env/data/my_status_file
> You can use the command nv to create non volatile shell variables. Don’t forget to save the Environment.
Additionally, a echo -a / -o might be useful in your case.
-a <file>",  "instead of outputting to stdout append to <file>
-o <file>",  "instead of outputting to stdout overwrite <file>
>> 
>> The above command doesn't work as '>' is not implemented.
>> 
>> I've the feeling that I'm missing something?
>> 
> To access the new variable (/env/nv/foo.bar) from userspace, you can use the „bareboxenv“ tool
> 
> Alexander Richter
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Programatically write in a file in the environnent with a hush command
  2015-05-26 15:41 Programatically write in a file in the environnent with a hush command Jean-Christophe BEGUE
  2015-05-27  6:08 ` Alexander Richter
@ 2015-05-27  6:53 ` Sascha Hauer
  2015-05-27 13:52   ` Jean-Christophe BEGUE
  1 sibling, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2015-05-27  6:53 UTC (permalink / raw)
  To: Jean-Christophe BEGUE; +Cc: barebox

Hi Jean-Christophe,

On Tue, May 26, 2015 at 05:41:06PM +0200, Jean-Christophe BEGUE wrote:
> Hello,
> 
> I'm trying to pass a value from Barebox to the operating system, using
> the usreland command bareboxenv -l.
> 
> My problem is : How should I write that status from my hush barebox script?
> 
> echo $mystatus > /env/data/my_status_file
> 
> The above command doesn't work as '>' is not implemented.
> 
> I've the feeling that I'm missing something?

Besides the ways Alexander just mentioned you could also add something
to the kernel cmdline and parse /proc/cmdline later in userspace.
Still another possibility is to add nodes/properties to the device tree
using the of_* commands.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Programatically write in a file in the environnent with a hush command
  2015-05-27  6:53 ` Sascha Hauer
@ 2015-05-27 13:52   ` Jean-Christophe BEGUE
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Christophe BEGUE @ 2015-05-27 13:52 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

I didn't noticed -a and -o options for echo. That suits my needs, but
"nv" is exactly what I'm trying to acheive.

I'll use the kernel command line as well on early phases of my software boot.

Thank you!

Jean-Christophe BEGUE
http://www.devisubox.com


On Wed, May 27, 2015 at 8:53 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Hi Jean-Christophe,
>
> On Tue, May 26, 2015 at 05:41:06PM +0200, Jean-Christophe BEGUE wrote:
>> Hello,
>>
>> I'm trying to pass a value from Barebox to the operating system, using
>> the usreland command bareboxenv -l.
>>
>> My problem is : How should I write that status from my hush barebox script?
>>
>> echo $mystatus > /env/data/my_status_file
>>
>> The above command doesn't work as '>' is not implemented.
>>
>> I've the feeling that I'm missing something?
>
> Besides the ways Alexander just mentioned you could also add something
> to the kernel cmdline and parse /proc/cmdline later in userspace.
> Still another possibility is to add nodes/properties to the device tree
> using the of_* commands.
>
> Sascha
>
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-27 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 15:41 Programatically write in a file in the environnent with a hush command Jean-Christophe BEGUE
2015-05-27  6:08 ` Alexander Richter
2015-05-27  6:24   ` Alexander Richter
2015-05-27  6:53 ` Sascha Hauer
2015-05-27 13:52   ` Jean-Christophe BEGUE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox