9
0
Fork 0
Commit Graph

89 Commits

Author SHA1 Message Date
Sascha Hauer dd534571bd Merge branch 'for-next/misc' 2016-09-13 14:56:05 +02:00
Sascha Hauer 71df6f5bf1 defaultenv-2: remove unused *-menu-add-entry calls
The *-menu-add-entry functions no longer exist in defaultenv-2, so
remove the calls to these functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-26 07:35:49 +02:00
grodriguez 1dff49274b Call boot_board from boot, not from init.
This ensures that any board-specific code that must be run at
boot time will be run both when autobooting and when manually
running the 'boot' command from the console.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-24 12:32:54 +02:00
Alexander Shiyan eaacdd5876 defaultenv: Unblank cursor at startup
In some cases, the user program can disable the cursor,
for example, Qt4 library do this, so the cursor remains invisible
after the restart.
The patch adds a command to activate the cursor,
by sending DECTECM command to the terminal.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-03 07:43:23 +02:00
Uwe Kleine-König b31b7cf7e8 defaultenv-2: add automount for nfs
Automatically mount the path that is also used for net booting by
default to /mnt/nfs.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-08 08:11:47 +02:00
Sascha Hauer a73734c3c0 defaultenv2: Add automount for RATPFS
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-18 09:26:09 +01:00
Markus Pargmann 2803b258e6 defaultenv: boot/net: Boot initramfs from tftp if present
Use an 'initramfs' file if it exists instead of nfsroot. This offers the
possibility to quickly boot complete filesystems as initramfs without
the need to flash an SD-card or similar. If the initramfs does not
exist, it uses the default nfsroot mechanism.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-01 09:27:08 +01:00
Sascha Hauer 90e766a78f login: rework login mechanism
We used to have the login functionality in the /env/bin/init script.
This is hard to review and it's too easy to break the login functionality
with changes to this script. Move the places to ask for a password to
C code where we have only a few places where we have to ask for a password.
Mainly these are run_shell() and the menutree command.

This patch introduces a login() function which will only return if the correct
password has been entered. Following calls will return immediately without
asking for a password again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:27 +02:00
Sascha Hauer ac81a0d876 Merge branch 'for-next/misc' 2015-03-09 08:30:24 +01:00
Michael Olbrich acc69bdddc defaultenv-2: init: don't call timeout again if the user intervened
With autoboot_timeout=0 the second 'timeout' might not get another
character even if the user keeps a key pressed. So just reuse the key from
the first call.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-17 09:08:33 +01:00
Sascha Hauer cd7feae00b defaultenv-2: mtdparts-add: Use new partition parameter
mtd devices now have a partition parameter to create mtd partitions.
Use it to simplify the mtdparts-add script.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 341f7d5574 defaultenv-2: mtdparts-add: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 7649473f40 mtd: nand: remove automatically created bb devices
the bb devices which are created in add_mtd_device() must be removed
in del_mtd_device(). Also remove deletion of the bb devices in the
mtdparts-add environment file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Masahiro Yamada d7dc46d5d6 defaultenv: ignore barebox_zero_env
Since commit c4c2317fe8 (defaultenv: generate force-built-in
(zero) environment file), we have this generated file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 08:34:29 +01:00
Jan Luebbe c4c2317fe8 defaultenv: generate force-built-in (zero) environment file
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-04 12:47:13 +01:00
Masahiro Yamada 4aa6819ecb gitignore: move "barebox_default_env*" to subdirectory
"barebox_default_env*" is not "Top-level generic files" because they
are generated in the defaultenv/ directory since commit 7fa10256c3
(defaultenv: Allow multiple defaultenvironment overlays).

The comment block of the top-level .gitignore says as follows:

  # NOTE! Don't add files that are generated in specific
  # subdirectories here. Add them in the ".gitignore" file
  # in that subdirectory instead.

Let's follow this rule.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-02 11:46:30 +01:00
Sascha Hauer 7962e7a0b4 defaultenv-2: Make use of nonvolatile variables
This moves the variable assignments previously done in /env/config-board
to non volatile variables in /env/nv/. This makes the settings adjustable
by the user without editing a file.

Most of the changes are simple conversions which for many boards makes
/env/config-board unnecessary. Some boards had some logic to assign
global.boot.default based on the current bootsource. This has been
moved to /env/init/bootsource. An additional check is added to not
overwrite a nv.boot.default should it exist.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-06 12:23:12 +01:00
Teresa Gámez 22acbddd89 defaultenv: Reorder overlay append order
The defaultenv_add_base() functions adds the enviroment coming from
CONFIG_DEFAULT_ENVIRONMENT_PATH. But this is not only for
traditional enviroments, but also for external enviroments in e.g. build
systems. The external enviroment should override the enviroment set
in the board file and not the other way around. Made sure that
external enviroment is always added last.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-11 09:15:17 +02:00
Sascha Hauer b3a667cd84 remove unused boot-menu-add-entry
The boot-menu-add-entry script no longer exists. Remove it from
boot scripts.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-23 09:19:52 +02:00
Sascha Hauer 80f15899b1 Merge branch 'for-next/ifup' 2014-05-05 11:05:51 +02:00
Sascha Hauer 1a8800458b mtd: nand: create bb devices automatically
When a mtd device can have bad blocks we want to create a
bb device, so do this automatically. This allows us to
drop bb device creation from the environment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:45:09 +02:00
Juergen Borleis fb67ada79a default environment: force a specific return value
Since commit a162dfe503 the ifup command runs
this file as a script. Due to a hush misbehave it could happen it returns
an error code by accident.

For example if the last instructions in this file are:

 if [ false ]; then
    echo "friesel"
 fi

the hush returns 1 after running this script instead of 0 and in this case
the ifup command fails.

I know, the correct fix would be to fix the hush, because it is a generic
issue...but how?

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-24 09:03:31 +02:00
Sascha Hauer 294dc7160e defenv-2: replace menu with menutree
This makes the menu easier to extend and to maintain.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:44:44 +01:00
Sascha Hauer 144358e0aa Merge branch 'for-next/nfs'
Conflicts:
	defaultenv/defaultenv-2-base/bin/ifup
2014-03-07 09:25:44 +01:00
Sascha Hauer 24ae621e17 defaultenv: Add boot option for DFU
DFU is for device firmware upgrade, but for development purposes it's
sometmes useful to just start a kernel vie DFU. This adds a boot option
for doing this and also the corresponding counterpart on the host. With
this it's possible to boot a system with:

scripts/dfuboot.sh -k linuximage -d dtb -c "root=ubi0:root ubi.mtd=ubi rootfstype=ubifs ignore_loglevel"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer 7fa10256c3 defaultenv: Allow multiple defaultenvironment overlays
We can compile barebox for multiple boards at once, but currently
they all share a single default environment. This patch adds a
defaultenv_append() which boards can call to customize the default
environment during runtime. Each board now generate default environment
snippets using bbenv-y and add them during runtime with defaultenv_append()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer b850dbad65 move defaultenv-2 to defaultenv/defaultenv-2-*
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-21 17:06:50 +01:00
Sascha Hauer 464a531423 move defaultenv-1 to defaultenv/defaultenv-1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-21 17:06:46 +01:00
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