mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] generic default environment - 2nd try
Date: Sun, 15 Apr 2012 18:22:39 +0200	[thread overview]
Message-ID: <1334506961-31245-1-git-send-email-s.hauer@pengutronix.de> (raw)

Hi All,

This adds a new set of default environment scripts. The old default
environment has a number of shortcomings:

- It grows more complex but doesn't seem to get more flexible.
- We base our decision where the kernel, oftree and rootfs is stored
  on variables which describe only a choice, like 'nand' or 'net'.
  This does not make it possible to store the files in individual
  places, instead each time someone wants to store a kernel in a
  unusual place he has to add a new location and parse it in
  /env/bin/boot.
- USB network devices are not really supported, they always require
  a manual 'usb' command on the commandline to discover them.

The new default environment uses a different approach. Rather then
trying to control the behaviour of /env/bin/boot with an external
script, the control now is in /env/config which uses a set of helper
functions to get its job done.

Highlights are:

- A 'ifup' script brings up networking (only once) when it is needed.
  This can also handle the USB network case.
- The automount support allows to access arbitrary files on tftp
  servers, disks, filesystems on disks just by accessing them,
  no manual mounting or detecting is needed.
- Simpler usage. For example starting a second stage barebox now
  works with "bootm /mnt/tftp-dhcp/barebox.bin" instead of
  "dhcp; tftp barebox.bin /dev/ram0; go /dev/ram0". Doing a
  "bootm /mnt/tftp-dhcp/zImage" now usually works without the need
  of a boot script.

As this environment requires adjustments to the board environment and
it does not (yet) have all features (what is missing?) of the old
environment I did not switch all boards to the new environment and
left the old one in place. If you want to switch your board to the
new environment you can do so by selecting the HAVE_DEFAULT_ENVIRONMENT_NEW
option from your board Kconfig snippet and by adjusting your board
env/config file. An example for my alltime favourite pcm038 is included
in this series.

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
      add 2nd generation default env
      ARM pcm038: switch to new default environment

 arch/arm/boards/pcm038/env/config      |   98 ++++++++++++++++++--------------
 arch/arm/mach-imx/Kconfig              |    1 +
 common/Kconfig                         |    4 ++
 common/Makefile                        |    4 ++
 defaultenv-2/bin/add-nand-bb           |    7 +++
 defaultenv-2/bin/boot                  |    5 ++
 defaultenv-2/bin/bootargs-ip-barebox   |    7 +++
 defaultenv-2/bin/bootargs-ip-dhcp      |    5 ++
 defaultenv-2/bin/bootargs-ip-none      |    5 ++
 defaultenv-2/bin/bootargs-ip-static    |    7 +++
 defaultenv-2/bin/bootargs-root-initrd  |   11 ++++
 defaultenv-2/bin/bootargs-root-jffs2   |    9 +++
 defaultenv-2/bin/bootargs-root-nfs     |   15 +++++
 defaultenv-2/bin/bootargs-root-ubi     |   13 +++++
 defaultenv-2/bin/ifup                  |   48 ++++++++++++++++
 defaultenv-2/bin/init                  |   29 ++++++++++
 defaultenv-2/bin/mount-tftp-dhcpserver |    5 ++
 defaultenv-2/bin/mtdparts-add          |   46 +++++++++++++++
 defaultenv-2/bin/mtdparts-init         |    3 +
 defaultenv-2/config                    |   72 +++++++++++++++++++++++
 defaultenv-2/network/eth0              |   12 ++++
 21 files changed, 363 insertions(+), 43 deletions(-)
 create mode 100644 defaultenv-2/bin/add-nand-bb
 create mode 100644 defaultenv-2/bin/boot
 create mode 100644 defaultenv-2/bin/bootargs-ip-barebox
 create mode 100644 defaultenv-2/bin/bootargs-ip-dhcp
 create mode 100644 defaultenv-2/bin/bootargs-ip-none
 create mode 100644 defaultenv-2/bin/bootargs-ip-static
 create mode 100644 defaultenv-2/bin/bootargs-root-initrd
 create mode 100644 defaultenv-2/bin/bootargs-root-jffs2
 create mode 100644 defaultenv-2/bin/bootargs-root-nfs
 create mode 100644 defaultenv-2/bin/bootargs-root-ubi
 create mode 100644 defaultenv-2/bin/ifup
 create mode 100644 defaultenv-2/bin/init
 create mode 100644 defaultenv-2/bin/mount-tftp-dhcpserver
 create mode 100644 defaultenv-2/bin/mtdparts-add
 create mode 100644 defaultenv-2/bin/mtdparts-init
 create mode 100644 defaultenv-2/config
 create mode 100644 defaultenv-2/network/eth0

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

             reply	other threads:[~2012-04-15 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-15 16:22 Sascha Hauer [this message]
2012-04-15 16:22 ` [PATCH 1/2] add 2nd generation default env Sascha Hauer
2012-04-15 16:57   ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-15 17:45     ` Sascha Hauer
2012-04-15 16:22 ` [PATCH 2/2] ARM pcm038: switch to new default environment 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=1334506961-31245-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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