summaryrefslogtreecommitdiff
path: root/meta/classes
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:43 -0800
commit1e01c2e32c168805a9b71c1dba4b487916955813 (patch)
tree07de9d07ef877de80faf1002fbf766d0287a0100 /meta/classes
parenta16fbf6970056a79cac8b70ce54e55e61ef63a8d (diff)
downloadopenembedded-core-1e01c2e32c168805a9b71c1dba4b487916955813.tar.gz
openembedded-core-1e01c2e32c168805a9b71c1dba4b487916955813.tar.bz2
openembedded-core-1e01c2e32c168805a9b71c1dba4b487916955813.zip
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. Signed-off-by: Dalon Westergreen <dwesterg@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-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 @@
# concatenate and use as an initrd (optional).
# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
# UBOOT_EXTLINUX_ROOT - Root kernel cmdline.
+# UBOOT_EXTLINUX_TIMEOUT - Timeout before DEFAULT selection is made.
+# Measured in 1/10 of a second.
+# UBOOT_EXTLINUX_DEFAULT_LABEL - Target to be selected by default after
+# the timeout period
#
# If there's only one label system will boot automatically and menu won't be
# created. If you want to use more than one labels, e.g linux and alternate,
@@ -25,6 +29,9 @@
#
# UBOOT_EXTLINUX_LABELS ??= "default fallback"
#
+# UBOOT_EXTLINUX_DEFAULT_LABEL ??= "Linux Default"
+# UBOOT_EXTLINUX_TIMEOUT ??= "30"
+#
# UBOOT_EXTLINUX_KERNEL_IMAGE_default ??= "../zImage"
# UBOOT_EXTLINUX_MENU_DESCRIPTION_default ??= "Linux Default"
#
@@ -34,6 +41,8 @@
# Results:
#
# menu title Select the boot mode
+# TIMEOUT 30
+# DEFAULT Linux Default
# LABEL Linux Default
# KERNEL ../zImage
# FDTDIR ../
@@ -82,6 +91,15 @@ python create_extlinux_config() {
if len(labels.split()) > 1:
cfgfile.write('menu title Select the boot mode\n')
+ timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
+ if timeout:
+ cfgfile.write('TIMEOUT %s\n' % (timeout))
+
+ if len(labels.split()) > 1:
+ default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
+ if default:
+ cfgfile.write('DEFAULT %s\n' % (default))
+
for label in labels.split():
localdata = bb.data.createCopy(d)