From: Dalon Westergreen <dwesterg@gmail.com>
To: Fabio Berton <fabio.berton@ossystems.com.br>
Cc: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] uboot-extlinux-config.bbclass: add support for timeout & default
Date: Thu, 09 Feb 2017 13:02:28 -0800 [thread overview]
Message-ID: <1486674148.7361.125.camel@gmail.com> (raw)
In-Reply-To: <CAAPZna0y4nMEUWrQQbBmXsu=4YSYekOATCe8e1c-NbDvGT9xvA@mail.gmail.com>
On Thu, 2017-02-09 at 18:25 -0200, Fabio Berton wrote:
> I get this error:
>
> Exception: UnboundLocalError: local variable 'localdata' referenced before
> assignment
>
> You are using localdata.getVar('UBOOT_EXTLINUX_TIMEOUT') before localdata =
> bb.data.createCopy(d).
>
thanks.
> On Thu, Feb 9, 2017 at 2:09 PM, Dalon Westergreen <dwesterg@gmail.com> wrote:
> > 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>
> > ---
> > meta/classes/uboot-extlinux-config.bbclass | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
> >
> > diff --git a/meta/classes/uboot-extlinux-config.bbclass
> > b/meta/classes/uboot-extlinux-config.bbclass
> > index ec5fffb..96b5a2e 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)
> >
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
>
next prev parent reply other threads:[~2017-02-09 21:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 16:09 [PATCH] uboot-extlinux-config.bbclass: add support for timeout & default Dalon Westergreen
2017-02-09 20:25 ` Fabio Berton
2017-02-09 21:02 ` Dalon Westergreen [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-02-07 23:46 Dalon Westergreen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486674148.7361.125.camel@gmail.com \
--to=dwesterg@gmail.com \
--cc=fabio.berton@ossystems.com.br \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.