[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [microblaze-uclinux] setenv in uClinux



I've tried to compile bash (to make use of source command) and that
fails:

/leonid/lm125/uClinux/petalinux-v0.10-rc1/software/petalinux-dist
-Dlinux -D__linux__ -Dunix -D__uClinux__ -I./lib/termcap -o bash shell.o
eval.o y.tab.o general.o make_cmd.o print_cmd.o  dispose_cmd.o
execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o
subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o
pathexp.o sig.o test.o version.o alias.o array.o braces.o bracecomp.o
bashhist.o bashline.o siglist.o list.o stringlib.o locale.o findcmd.o
redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lsh
-lreadline -lhistory ./lib/termcap/libtermcap.a -lglob -ltilde -lmalloc
microblaze-uclinux-gcc: unrecognized option `-rdynamic'
ls -l bash
-rwxr--r--  1 root root 654172 May 25 18:41 bash
microblaze-uclinux-size bash
microblaze-uclinux-size: bash: File format not recognized
make[2]: *** [bash] Error 3
make[2]: Leaving directory
`/home/leonid/lm125/uClinux/petalinux-v0.10-rc1/software/petalinux-dist/
user/bash'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/home/leonid/lm125/uClinux/petalinux-v0.10-rc1/software/petalinux-dist/
user'
make: *** [subdirs] Error 1

Is it known issue?

Leonid.

-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of John
Williams
Sent: Thursday, May 24, 2007 8:05 PM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: Re: [microblaze-uclinux] setenv in uClinux

Leonid wrote:
> I basically want to be able to run u-boot HUSH script in the Linux
> shell. U-boot has "setenv" commands with effect, similar to that of
bash
> "export" - it defines global variables, visible from everywhere:

export makes environment variables visible to *child* processes of the 
current process - not the parent process.

> setenv ipaddr 1.2.3.4
> echo $ipaddr
> 1.2.3.4


> I thought I'll write small application "setenv" which will be setting
> environment variables... Do you have a better idea?

In bash you can use "source"

*** ipaddr.sh ***
export ipaddr 1.2.3.4


# source ipaddr.sh
# echo $ipaddr
1.2.3.4

I'm not sure which shells support source.

Another option is to put in /etc/rc, that gets interpreted on startup 
and any environment variables placed there will be visible to the login 
shell

Finally you have the option of using temp files, in /var for example.

Regards,

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/