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>
This commit is contained in:
parent
32e879f0a3
commit
7962e7a0b4
|
@ -1,5 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f /mnt/sd/zImage ]; then
|
||||
global.boot.default=sd-card-linux
|
||||
elif [ -f /mnt/sd/android ]; then
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# change network settings in /env/network/eth0
|
||||
# change mtd partition settings and automountpoints in /env/init/*
|
||||
|
||||
# set to false if you do not want to have colors
|
||||
global.allow_color=true
|
||||
|
||||
# user (used for network filenames)
|
||||
global.user=none
|
||||
|
||||
# timeout in seconds before the default boot entry is started
|
||||
global.autoboot_timeout=3
|
||||
|
||||
# default boot entry (one of /env/boot/*)
|
||||
global.boot.default=android
|
||||
|
||||
# base bootargs
|
||||
#global.linux.bootargs.base="console=ttyS0,115200"
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=at91sam9m10ihd
|
||||
global.linux.bootargs.base="console=ttyS0,115200"
|
||||
global.boot.default=android
|
|
@ -0,0 +1 @@
|
|||
android
|
|
@ -0,0 +1 @@
|
|||
at91sam9m10ihd
|
|
@ -0,0 +1 @@
|
|||
console=ttyS0,115200
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttyPS1,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttyPS1,115200
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttyO2,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttyO2,115200
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Timeout in seconds before the default boot entry is started
|
||||
global.autoboot_timeout=2
|
||||
|
||||
# Default boot entry (one of /env/boot/*)
|
||||
global.boot.default=nand
|
||||
|
||||
# Board bootargs
|
||||
global.linux.bootargs.base="earlyprintk console=ttymxc0,115200n8"
|
|
@ -0,0 +1 @@
|
|||
2
|
|
@ -0,0 +1 @@
|
|||
nand
|
|
@ -0,0 +1 @@
|
|||
earlyprintk console=ttymxc0,115200n8
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Timeout in seconds before the default boot entry is started
|
||||
global.autoboot_timeout=2
|
||||
|
||||
# Default boot entry (one of /env/boot/*)
|
||||
if [ -e /dev/nor0 ]; then
|
||||
global.boot.default=nor
|
||||
fi
|
||||
|
||||
# Board bootargs
|
||||
global.linux.bootargs.base="earlyprintk console=ttyCL0,57600n8"
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -e /dev/nor0 ]; then
|
||||
global.boot.default=nor
|
||||
fi
|
|
@ -0,0 +1 @@
|
|||
2
|
|
@ -0,0 +1 @@
|
|||
earlyprintk console=ttyCL0,57600n8
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttyAMA0,115200"
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
init-menu-add-entry "$0" "general config settings"
|
||||
exit
|
||||
fi
|
||||
|
||||
# timeout in seconds before the default boot entry is started
|
||||
global.autoboot_timeout=3
|
||||
|
||||
# default boot entry (one of /env/boot/*)
|
||||
global.boot.default=mmc-ext3
|
|
@ -0,0 +1 @@
|
|||
mmc-ext3
|
|
@ -0,0 +1 @@
|
|||
console=ttyAMA0,115200
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# change network settings in /env/network/eth0
|
||||
# change mtd partition settings and automountpoints in /env/init/*
|
||||
|
||||
#global.hostname=
|
||||
|
||||
# set to false if you do not want to have colors
|
||||
global.allow_color=true
|
||||
|
||||
# user (used for network filenames)
|
||||
global.user=none
|
||||
|
||||
# timeout in seconds before the default boot entry is started
|
||||
global.autoboot_timeout=1
|
||||
|
||||
# default boot entry (one of /env/boot/*)
|
||||
# (if not overwritten here, the bootdevice barebox comes from
|
||||
# is used)
|
||||
#global.boot.default=net
|
||||
|
||||
# base bootargs
|
||||
global.linux.bootargs.base="console=tty1"
|
||||
|
||||
# suitable for 800MHz
|
||||
global linux.bootargs.lpj="lpj=3997696"
|
||||
|
||||
# speed up booting by being more quiet
|
||||
global linux.bootargs.quiet="quiet"
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# by default pick kernel from MMC card if booting from
|
||||
# it, otherwise default to boot from internal harddisk
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1 @@
|
|||
console=tty1
|
|
@ -0,0 +1 @@
|
|||
lpj=3997696
|
|
@ -0,0 +1 @@
|
|||
quiet
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=e9
|
||||
global.boot.default=$bootsource$bootsource_instance
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
global.boot.default=$bootsource$bootsource_instance
|
|
@ -0,0 +1 @@
|
|||
e9
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttymxc3,115200"
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=vincell
|
||||
global.linux.bootargs.base="console=ttymxc0,115200"
|
|
@ -0,0 +1 @@
|
|||
vincell
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc0,115200
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.allow_color=true
|
||||
global.autoboot_timeout=3
|
||||
global.bootm.oftree="/dev/dtb"
|
||||
global.linux.bootargs.base="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0"
|
||||
global.boot.default=/env/boot.d
|
|
@ -0,0 +1 @@
|
|||
/env/boot.d
|
|
@ -0,0 +1 @@
|
|||
console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0
|
|
@ -0,0 +1 @@
|
|||
/dev/dtb
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.boot.default="usbmsd sd nor"
|
||||
global.linux.bootargs.base="console=ttymxc0,921600"
|
|
@ -0,0 +1 @@
|
|||
usbmsd sd nor
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc0,921600
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttyO2,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttyO2,115200
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.boot.default=nand
|
||||
|
||||
global.hostname=phyCARD-i.MX6
|
||||
global.linux.bootargs.base="console=ttymxc2,115200"
|
|
@ -0,0 +1 @@
|
|||
nand
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc2,115200
|
|
@ -0,0 +1 @@
|
|||
phyCARD-i.MX6
|
|
@ -1,10 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=pcm051
|
||||
global.linux.bootargs.base="console=ttyO0,115200"
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $bootsource = mmc ]; then
|
||||
global.boot.default="mmc nand spi net"
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
#otg1.mode=peripheral
|
||||
usbgadget -a -A /dev/nand0.kernel.bb(kernel)
|
|
@ -0,0 +1 @@
|
|||
console=ttyO0,115200
|
|
@ -0,0 +1 @@
|
|||
pcm051
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttymxc0,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc0,115200
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttymxc0,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc0,115200
|
|
@ -1,10 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=pfla03
|
||||
global.linux.bootargs.base="console=ttyO0,115200"
|
||||
if [ -n "$nv.boot.default" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $bootsource = mmc ]; then
|
||||
global.boot.default="mmc nand spi net"
|
|
@ -0,0 +1 @@
|
|||
pfla03
|
|
@ -0,0 +1 @@
|
|||
console=ttyO0,115200
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.boot.default=nand
|
||||
|
||||
global.hostname=phyFLEX-i.MX6
|
||||
global.linux.bootargs.base="console=ttymxc3,115200"
|
|
@ -0,0 +1 @@
|
|||
nand
|
|
@ -0,0 +1 @@
|
|||
phyFLEX-i.MX6
|
|
@ -0,0 +1 @@
|
|||
console=ttymxc3,115200
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.linux.bootargs.base="console=ttyS2,115200"
|
|
@ -0,0 +1 @@
|
|||
console=ttyS2,115200
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# board defaults, do not change in running system. Change /env/config
|
||||
# instead
|
||||
|
||||
global.hostname=evk-pro3
|
||||
global.linux.bootargs.base="console=ttyS0,115200"
|
||||
global.boot.default=nand-ubi
|
|
@ -0,0 +1 @@
|
|||
nand-ubi
|
|
@ -0,0 +1 @@
|
|||
console=ttyS0,115200
|
|
@ -0,0 +1 @@
|
|||
evk-pro3
|
|
@ -631,6 +631,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW
|
|||
select CMD_BASENAME
|
||||
select CMD_READLINK
|
||||
select CMD_DIRNAME
|
||||
select CMD_NV
|
||||
select FLEXIBLE_BOOTARGS
|
||||
select CMD_BOOT
|
||||
select NET_CMD_IFUP if NET
|
||||
|
|
|
@ -16,9 +16,12 @@ global editcmd
|
|||
|
||||
[ -z "${global.hostname}" ] && global.hostname=generic
|
||||
[ -z "${global.user}" ] && global.user=none
|
||||
magicvar -a global.user "username (used in network filenames)"
|
||||
[ -z "${global.autoboot_timeout}" ] && global.autoboot_timeout=3
|
||||
magicvar -a global.autoboot_timeout "timeout in seconds before automatic booting"
|
||||
[ -z "${global.boot.default}" ] && global.boot.default=net
|
||||
[ -z "${global.allow_color}" ] && global.allow_color=true
|
||||
magicvar -a global.allow_color "Allow color on the console (boolean)"
|
||||
[ -z "${global.editcmd}" ] && global.editcmd=sedit
|
||||
|
||||
[ -e /env/config-board ] && /env/config-board
|
||||
|
|
|
@ -3,23 +3,5 @@
|
|||
# change network settings in /env/network/eth0
|
||||
# change mtd partition settings and automountpoints in /env/init/*
|
||||
|
||||
#global.hostname=
|
||||
|
||||
# set to false if you do not want to have colors
|
||||
#global.allow_color=true
|
||||
|
||||
# user (used for network filenames)
|
||||
#global.user=none
|
||||
|
||||
# timeout in seconds before the default boot entry is started
|
||||
#global.autoboot_timeout=3
|
||||
|
||||
# list of boot entries. These are executed in order until one
|
||||
# succeeds. An entry can be:
|
||||
# - a filename in /env/boot/
|
||||
# - a full path to a directory. All files in this directory are
|
||||
# treated as boot files and executed in alphabetical order
|
||||
#global.boot.default=net
|
||||
|
||||
# base bootargs
|
||||
#global.linux.bootargs.base="console=ttyS0,115200"
|
||||
# The settings that used to be here are in nv variables now.
|
||||
# See 'help nv', 'magicvar'
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
true
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
none
|
Loading…
Reference in New Issue