mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: "U-Boot Version 2 (barebox)" <barebox@lists.infradead.org>
Subject: need some clarification on how environments work
Date: Tue, 7 Feb 2012 19:11:42 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1202071802010.5917@oneiric> (raw)


  ok, i'm trying to figure out how environments work so bear with me
as i'm going to ask a number of questions.  i'm reading this page:

http://wiki.barebox.org/doku.php?id=user:environment

and based on that, i took a look at what i have running on my beagle
xM having configured and built *entirely* using defaults.
confusingly, i have no /dev/env0 as that web page seems to suggest.
here's what's in my dev directory:

barebox@Texas Instrument's Beagle:/ ls -l dev
cr-------- 4294967295 zero
crw-------  134217728 ram0
crw-------       7496 defaultenv
crw------- 4294967295 mem
crw-------       1024 twl4030
crw------- 3963617280 disk0
crw-------  123346944 disk0.0

  so i have a "defaultenv" file there.  i puzzled over this for a
while until i noticed that there is no arch/arm/boards/beagle/env/
directory, as there is for most of the other boards.

  so let's step back and look at the relevant source in
common/Makefile:

=====

ifdef CONFIG_DEFAULT_ENVIRONMENT
$(obj)/startup.o: include/generated/barebox_default_env.h
$(obj)/env.o: include/generated/barebox_default_env.h

ifeq ($(CONFIG_DEFAULT_ENVIRONMENT_GENERIC),y)
DEFAULT_ENVIRONMENT_PATH = "defaultenv"
endif

ifneq ($(CONFIG_DEFAULT_ENVIRONMENT_PATH),"")
DEFAULT_ENVIRONMENT_PATH += $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
endif

ENV_FILES := $(shell cd $(srctree); for i in
$(DEFAULT_ENVIRONMENT_PATH); do find $${i} -type f -exec readlink -f
'{}' \;; done)

endif # ifdef CONFIG_DEFAULT_ENVIRONMENT

barebox_default_env: $(ENV_FILES)
        $(Q)$(srctree)/scripts/genenv $(srctree) $(objtree)
$(DEFAULT_ENVIRONMENT_PATH)

=====

   as well as the menu selections from "make menuconfig":

      [*] Compile in default environment
      [*]   Default environment generic
      ()    Default environment path

so now, the questions.

  first, what is the "default" environment?  is that the one found
for the board in arch/arm/boards/<board>/env/config?  so that there is
*no* current default environment for the beagleboard right now?

  also, from the Kconfig help text:

CONFIG_DEFAULT_ENVIRONMENT:

Enabling this option will give you a default environment when
the environment found in the environment sector is invalid

  is that true?  as in, the "default" environment will only be used if
what's in the environment sector is found to be invalid?

  next, what is meant by the "generic" default environment?  from the
Kconfig file,

"With this option barebox will use the generic default
environment found under defaultenv/ in the src tree.
The Directory given with DEFAULT_ENVIRONMENT_PATH
will be added to the default environment. This should
at least contain a /env/config file.
This will be able to overwrite the files from defaultenv."

  ok, i can appreciate that -- it's a "generic" environment, defined
by the file defaultenv/config, and it's apparently what i got, is that
it?  but why the reference to DEFAULT_ENVIRONMENT_PATH, which is an
entirely separate Kconfig option?

  and regarding the final setting, CONFIG_DEFAULT_ENVIRONMENT_PATH,
how does that affect the first two settings?  i'm just trying to
puzzle all this out.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

             reply	other threads:[~2012-02-08  0:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  0:11 Robert P. J. Day [this message]
2012-02-08  8:19 ` Premi, Sanjeev
2012-02-08  8:54   ` Sascha Hauer
2012-02-08 11:01     ` Robert P. J. Day
2012-02-09  7:52       ` Sascha Hauer

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=alpine.DEB.2.02.1202071802010.5917@oneiric \
    --to=rpjday@crashcourse.ca \
    --cc=barebox@lists.infradead.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