summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorDalon Westergreen <dwesterg@gmail.com>2017-02-07 15:46:29 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-15 09:29:56 -0800
commit6f3f9457a6d26a89cbb31d880828d7cda116ec99 (patch)
treee3f124aa981df0507ca17fd63b33ff22648f6a79 /meta
parent4794518720fedb5c1179c9e2e20065e345194d53 (diff)
downloadpoky-6f3f9457a6d26a89cbb31d880828d7cda116ec99.tar.gz
uboot-extlinux-config.bbclass: add support for timeout & default
When multible targets are defined it is useful to allow for a default target along with a timeout. After timeout, the default target will be selected. (From OE-Core rev: 1e01c2e32c168805a9b71c1dba4b487916955813) Signed-off-by: Dalon Westergreen <dwesterg@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/uboot-extlinux-config.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/uboot-extlinux-config.bbclass b/meta/classes/uboot-extlinux-config.bbclass
index 904d5b3cfd..aae21713e3 100644
--- a/meta/classes/uboot-extlinux-config.bbclass
+++ b/meta/classes/uboot-extlinux-config.bbclass
@@ -16,6 +16,10 @@
16# concatenate and use as an initrd (optional). 16# concatenate and use as an initrd (optional).
17# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description. 17# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
18# UBOOT_EXTLINUX_ROOT - Root kernel cmdline. 18# UBOOT_EXTLINUX_ROOT - Root kernel cmdline.
19# UBOOT_EXTLINUX_TIMEOUT - Timeout before DEFAULT selection is made.
20# Measured in 1/10 of a second.
21# UBOOT_EXTLINUX_DEFAULT_LABEL - Target to be selected by default after
22# the timeout period
19# 23#
20# If there's only one label system will boot automatically and menu won't be 24# If there's only one label system will boot automatically and menu won't be
21# created. If you want to use more than one labels, e.g linux and alternate, 25# created. If you want to use more than one labels, e.g linux and alternate,
@@ -25,6 +29,9 @@
25# 29#
26# UBOOT_EXTLINUX_LABELS ??= "default fallback" 30# UBOOT_EXTLINUX_LABELS ??= "default fallback"
27# 31#
32# UBOOT_EXTLINUX_DEFAULT_LABEL ??= "Linux Default"
33# UBOOT_EXTLINUX_TIMEOUT ??= "30"
34#
28# UBOOT_EXTLINUX_KERNEL_IMAGE_default ??= "../zImage" 35# UBOOT_EXTLINUX_KERNEL_IMAGE_default ??= "../zImage"
29# UBOOT_EXTLINUX_MENU_DESCRIPTION_default ??= "Linux Default" 36# UBOOT_EXTLINUX_MENU_DESCRIPTION_default ??= "Linux Default"
30# 37#
@@ -34,6 +41,8 @@
34# Results: 41# Results:
35# 42#
36# menu title Select the boot mode 43# menu title Select the boot mode
44# TIMEOUT 30
45# DEFAULT Linux Default
37# LABEL Linux Default 46# LABEL Linux Default
38# KERNEL ../zImage 47# KERNEL ../zImage
39# FDTDIR ../ 48# FDTDIR ../
@@ -82,6 +91,15 @@ python create_extlinux_config() {
82 if len(labels.split()) > 1: 91 if len(labels.split()) > 1:
83 cfgfile.write('menu title Select the boot mode\n') 92 cfgfile.write('menu title Select the boot mode\n')
84 93
94 timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
95 if timeout:
96 cfgfile.write('TIMEOUT %s\n' % (timeout))
97
98 if len(labels.split()) > 1:
99 default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
100 if default:
101 cfgfile.write('DEFAULT %s\n' % (default))
102
85 for label in labels.split(): 103 for label in labels.split():
86 localdata = bb.data.createCopy(d) 104 localdata = bb.data.createCopy(d)
87 105