summaryrefslogtreecommitdiffstats
path: root/defaultenv/defaultenv-2-base/bin/init
Commit message (Collapse)AuthorAgeFilesLines
* defaultenv: Convert init script to CSascha Hauer2019-04-241-79/+0
| | | | | | | | | | | It's hard to get more complicated things right in hush. This commit converts the /env/bin/init script to C code. With this we get a better error handling and better control what is being done. If /env/bin/init exists in the environment then it is still executed instead of the corresponding C code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: forbid ctrlc during startupSascha Hauer2019-04-241-0/+2
| | | | | | | | | | | | | | | When global.autoboot_abort_key is set to ctrl-c then the user is expected to press ctrl-c to get to the prompt. The user might press ctrl-c before the init script runs the "timeout" command. In this case the init script is aborted at arbitrary places which leads to inconsistent results depending on the place it is aborted. This patch introduces the global.console.ctrlc_allowed variable. When this variable is set to false ctrl-c is ignored entirely. The variable is set to false by default and changed to true in the init script. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv-2: make abort key to stop autoboot configurableOleksij Rempel2018-06-071-3/+14
| | | | | | | | | | | | currently supported only two options: any key and ctrl-c "any key" is default option. To configure it, use: nv autoboot_abort_key=any or nv autoboot_abort_key=ctrl-c Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: move global.allow_color handling to C codeSascha Hauer2018-02-221-3/+0
| | | | | | | | | We have global.allow_color, but this is limited to the environment only. Move creation and handling of this variable to C code so that we can add support for colored output to commands/console controlled by the same variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv: Unblank cursor at startupAlexander Shiyan2016-08-031-0/+1
| | | | | | | | | | | 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>
* login: rework login mechanismSascha Hauer2015-08-281-18/+0
| | | | | | | | | | | | | | 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>
* defaultenv-2: init: don't call timeout again if the user intervenedMichael Olbrich2015-02-171-2/+5
| | | | | | | | | 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>
* defaultenv-2: Make use of nonvolatile variablesSascha Hauer2014-11-061-0/+3
| | | | | | | | | | | | | | 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>
* move defaultenv-2 to defaultenv/defaultenv-2-*Sascha Hauer2014-02-211-0/+80
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>