9
0
Fork 0
Commit Graph

61 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD 91b563613e dhcp: switch to global var support
This way you can specify as previously set the dhcp parameter via global.dhcp.xxx
and get the result via global.dhcp.xxx

This is need for the defaultenv-2 to add the bootp suppport.
Use it on defaultenv too to have only one set of var.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD 8166603baa defaultenv: switch hostname to global.hostname
Udpate dhcp with it too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4676721b30 defaultenv: enable glovalvar support
This will allow to do not have 2 set of var for defaultenv and the new
defaultenv-2.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jan Luebbe 4ef0846589 defaultenv/bin/init: skip autoboot if $autoboot_timeout is unset
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:04 +02:00
Uwe Kleine-König 3ba37aea2a defaultenv: don't overwrite $user in config
This patch prooved to be useful while working with a colleague on a single
machine. It allows to switch the user without editing /env/config by
just issuing:

	export user=me

. Note, in bash this construct (i.e. an if without body) bails out with:

	Syntax error: "fi" unexpected

but in hush it seems to do the right thing.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-13 11:06:08 +02:00
Sascha Hauer c3822d7aaf defaultenv: remove now unnecessary hush-hack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:08:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2b26b148f4 defaultenv: add binfmt support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-18 20:19:20 +08:00
Jean-Christophe PLAGNIOL-VILLARD a2d2e8868f config: switch machine to hostname
So we can use it for dhcp request too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-18 12:03:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD 1336fc9c43 defaultenv/update: add oftree support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 18:29:52 +02:00
Sascha Hauer fdc889de61 Merge branch 'master' into next 2012-04-11 09:08:49 +02:00
Jean-Christophe PLAGNIOL-VILLARD 32e630d182 defaultenv/update: fix dhcp-barebox support
call dhcp when ip mode is dhcp-barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-11 08:54:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 675afd265b defaultenv: add support for custom board boot
This will allow a board to have a custom boot choice with a boot menu as
example.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-11 08:46:53 +02:00
Jean-Christophe PLAGNIOL-VILLARD 1ffc13cf3c defaultenv: add support of oftree file pass via dhcp (option 224)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-10 09:54:43 +02:00
Jean-Christophe PLAGNIOL-VILLARD cc6fba79e6 defaultenv/boot: add support for oftree boot option support
you can now specify in the same way as it's done for the kernel where is
stored the oftree.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-10 09:54:43 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5b0ffe91c4 defaultenv: add dhcp-barebox option
barebox will use DHCP and pass the result to the kernel
update the help

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-17 17:20:18 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3374ddcc45 defaultenv: add bootp support
use rootpath as nfsroot and bootfile as kernelimage if present
when ip mode is dhcp

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-17 17:20:18 +01:00
Enrico Scholz 3661e874aa net: dhcp: allow to set transmitted vendor id
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish barebox from e.g. pxe machines,
a custom vendor id can be sent in dhcp discover/request messages.

E.g. the ISC dhcp server can be configured with

| if substring(option vendor-class-identifier,0,8) = "barebox:" {
|       next-server             192.168.3.24;
|       server-name             "192.168.3.24";
|       option tftp-server-name "192.168.3.24";
|       option root-path = concat("/srv/sysroots/by-mac/",
|          binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)));
| }

to sent boot params which are valid for barebox hosts only.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Jean-Christophe PLAGNIOL-VILLARD:
 - update the use dhcp command option
 - support to set the vendor via env dhcp_vendor_id
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-12 22:44:06 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4b06ebc820 defaultenv/boot: add getopt option support to select boot mode
boot: boot [-m <mode>] [-k <kernel_option>] [-r <rootfs_option>] [-i <ip_mode>]

options
 - kernel        nand, nor, nfs, tftp, disk
 - rootfs        nand, nor, net, disk
 - ip            dhcp, none, empty

mode option
   mode       kernel      rootfs
   nand       nand        nand
   nor        nor         nor
   nfs        nfs         net
   tftp       fttp        net
   disk       disk        disk

default mode are used from the /env/config

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 15:01:52 +01:00
Marc Kleine-Budde cd614b8f40 defaultenv: update: add nfs support
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:11:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD b5ba23865b defaultenv: enable progress for cp
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:10:13 +01:00
Jean-Christophe PLAGNIOL-VILLARD 36917282ea defaultenv: source the init_board so we can keep exported env
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:10:13 +01:00
Sascha Hauer 52fac4b1ff defaultenv: simplify boot
Now that we have a bootm command which boots everything we can
simplify the defaultenvironment. We can call bootm on every
image type and can remove the kernelimage_type variables.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:15 +01:00
Sascha Hauer 4de10d263a update configs and default envs for uncompress
uncompress is the replacement for unlzo. Adjust environments
and defconfigs accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Jean-Christophe PLAGNIOL-VILLARD fd552936d6 defaultenv: add bootm_opt var to allow the board to pass parameter to bootm
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-09 11:35:43 +02:00
Wolfram Sang 5eded01509 defaultenv: place eth0.ethaddr more visibly
The config file looks like you just need to set ethaddr when you do
static IP. This is misleading, so put the setting to a more prominent
place.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde 9c4dc73eaa defaultenv: add config template
This patch add a config template to the defaultenv.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde 217b9a5052 defaultenv: update: add support to update kernel on disk
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde cf8af385c7 defaultenv: boot: add support to boot from disk
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde cc891e8e95 defaultenv: boot: add serverip to static ip configuration
If a (different) server is supplied to the "nfsroot" parameter, the kernel
will choose that one.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde bd6d6adfc0 defaultenv: boot: add eth0 to ip configuration
When passing a fixed IP to the kernel set it explicit to eth0. Otherwise
on systems with more than one interface dhcp might be used.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde 3d7b2edb0c defaultenv: boot: add backwards compatibility for kernel_loc=net
Since commit 9eac282024, the boot script
doesn't understand kernel_loc=net anymore. This patch adds backwards
compatibility so that the kernel is loaded from tftp as before.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Marc Kleine-Budde 4ac5def38a defaultenv: simplify scripting
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:24 +02:00
Sascha Hauer c6abd61fa8 Merge branch 'master' into next 2011-06-20 09:08:13 +02:00
Jan Weitzel 21536365bb update: add xload
add xload as vaild update type. Default name should be stored in enviroment
variable "xloadimage"

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-11 10:53:04 +02:00
Teresa Gamez af2649b795 Check return values of erase and tftp/cp
The _update script does not check the return value of erasing a partiton or
flashing the image to the device. Added this check to get a evaluable return
value from the update script.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-10 08:25:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9eac282024 defaultenv: add kernel_loc nfs and tftp support
before we can only support tftp
so keep it as default

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-14 11:57:11 +01:00
Juergen Beisert 1194e279d6 Generic environment: Fix assembling of the 'mtdparts' variable
The semicolon is a delimiter, not an end marker. With a trailing semicolon the
kernel give the confusing message:

mtd: no mtd-id

With this patch, a semicolon gets added on demand only.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:51 +01:00
Marc Kleine-Budde c5dd4c4d0a defaultenv/bin/update: fix return values
This patch fixes the return values of the update script.

- Exit with an error of the "_update" script fails.
- Add a "else; true" to the crc check, otherwise the script
  exits with "1".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-07 22:10:28 +01:00
Marc Kleine-Budde 86ddd55dda defaultenv/bin/boot: fix ubi root's name assignment
This patch fixes a regression introduced in commit
d15cfafeef.

While there, use "-z" to check if ubiroot variable is empty.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-By: Eric Bnard<eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-03 09:56:47 +01:00
Sascha Hauer b82f0d4c09 Merge branch 'defenv' into next 2011-01-21 10:33:33 +01:00
Sascha Hauer 19c0219d4e defaultenv: do not print usage information for update script
This usage printout during startup more looks like there is
something wrong with the environment than a helpful message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Eric Bénard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-01-21 10:32:47 +01:00
Sascha Hauer 2f0109b1bb Merge branch 'master' into next 2011-01-17 09:43:40 +01:00
Wolfram Sang e7d81285c8 defaultenv: make 'boot' work from subdirs
Wrong pathnames prevented that.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-10 12:33:17 +01:00
Eric Bénard fe2eb54612 update: add bareboxenv update possibility
this is useful when building barebox without integrated env.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-08 13:26:48 +01:00
Eric Bénard ec604a5448 defaultenv/bin/update: let /env/config set default values
this patch allows for example device_type to be fixed in /env/config
(useful for configurations with only one memory type).

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-08 13:26:48 +01:00
Eric Bénard d15cfafeef defaultenv/bin/boot: make ubi root's name configurable
all root are not named root so give the possibility to
configure this in the config file.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-08 13:26:48 +01:00
Eric Bénard 22ef325692 _update_help: fix script name
$0 is _update_help so update -h leads to : usage: /env/bin/_update_help
so don't use $0 but hardcode update instead.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-08 13:26:48 +01:00
Sascha Hauer 4d7bef86e2 defaultenv: only try to add partitions when partition description exists
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 16:43:40 +01:00
Jean-Christophe PLAGNIOL-VILLARD 7e0982bdc2 defaultenv/udpate: in xmodem mode load the data before erasing
and abort the update if loadb failed or cancelled

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD a75df244b2 defaultenv/udpate: fix typo in default barebox image name
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00