Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: dvhart@linux.intel.com, Openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 5/5] grub-efi.bbclass: Add serial and graphics menu options
Date: Thu, 12 Sep 2013 11:01:26 -0700	[thread overview]
Message-ID: <52320176.2070802@linux.intel.com> (raw)
In-Reply-To: <1379006387-20186-6-git-send-email-jason.wessel@windriver.com>

On 09/12/2013 10:19 AM, Jason Wessel wrote:
> The syslinux.bbclass already has support for automatically generated
> serial and graphics menu choices.  This patch adds the same concept to
> the grub-efi menu.  That makes it possible to generate a single image
> which can boot on a PCBIOS or EFI firmware with consistent looking
> boot options.
>
> [YOCTO #4100]
>
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
>   meta/classes/grub-efi.bbclass     |   41 ++++++++++++++++++++++++-------------
>   meta/conf/machine/qemux86-64.conf |    2 +-
>   meta/conf/machine/qemux86.conf    |    2 ++
>   3 files changed, 30 insertions(+), 15 deletions(-)
>
> diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
> index c6f5d4e..c07e4a1 100644
> --- a/meta/classes/grub-efi.bbclass
> +++ b/meta/classes/grub-efi.bbclass
> @@ -9,6 +9,7 @@
>   # External variables
>   # ${INITRD} - indicates a filesystem image to use as an initrd (optional)
>   # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
> +# ${GRUB_GFXSERIAL} - set this to 1 to have graphics and serial in the boot menu
>   # ${LABELS} - a list of targets for the automatic config
>   # ${APPEND} - an override list of append strings for each label
>   # ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
> @@ -16,6 +17,7 @@
>
>   do_bootimg[depends] += "grub-efi-${TRANSLATED_TARGET_ARCH}-native:do_deploy"
>
> +GRUB_SERIAL ?= "console=ttyS0,115200"
>   GRUBCFG = "${S}/grub.cfg"
>   GRUB_TIMEOUT ?= "10"
>   #FIXME: build this from the machine config
> @@ -55,6 +57,8 @@ python build_grub_cfg() {
>           bb.error("WORKDIR not defined, unable to package")
>           return
>
> +    gfxserial = d.getVar('GRUB_GFXSERIAL', True) or ""
> +
>       labels = d.getVar('LABELS', True)
>       if not labels:
>           bb.debug(1, "LABELS not defined, nothing to do")
> @@ -88,6 +92,12 @@ python build_grub_cfg() {
>       else:
>           cfgfile.write('timeout=50\n')
>
> +    if gfxserial == "1":
> +        btypes = [ [ " graphics console", "console=tty0" ],
> +            [ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
> +    else:
> +        btypes = [ [ "", "" ] ]
> +
>       for label in labels.split():
>           localdata = d.createCopy()
>
> @@ -95,24 +105,27 @@ python build_grub_cfg() {
>           if not overrides:
>               raise bb.build.FuncFailed('OVERRIDES not defined')
>
> -        localdata.setVar('OVERRIDES', label + ':' + overrides)
> -        bb.data.update_data(localdata)
> +        for btype in btypes:
> +            localdata.setVar('OVERRIDES', label + ':' + overrides)
> +            bb.data.update_data(localdata)
>
> -        cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
> -        if label == "install":
> -            label = "install-efi"
> -        cfgfile.write('linux /vmlinuz LABEL=%s' % (label))
> +            cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
> +            lb = label
> +            if label == "install":
> +                lb = "install-efi"
> +            cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
>
> -        append = localdata.getVar('APPEND', True)
> -        initrd = localdata.getVar('INITRD', True)
> +            append = localdata.getVar('APPEND', True)
> +            initrd = localdata.getVar('INITRD', True)
>
> -        if append:
> -            cfgfile.write('%s' % (append))
> -        cfgfile.write('\n')
> +            if append:
> +                cfgfile.write('%s' % (append))
> +            cfgfile.write(' %s' % btype[1])
> +            cfgfile.write('\n')
>
> -        if initrd:
> -            cfgfile.write('initrd /initrd')
> -        cfgfile.write('\n}\n')
> +            if initrd:
> +                cfgfile.write('initrd /initrd')
> +            cfgfile.write('\n}\n')
>
>       cfgfile.close()
>   }
> diff --git a/meta/conf/machine/qemux86-64.conf b/meta/conf/machine/qemux86-64.conf
> index c572225..6f68410 100644
> --- a/meta/conf/machine/qemux86-64.conf
> +++ b/meta/conf/machine/qemux86-64.conf
> @@ -21,6 +21,6 @@ XSERVER = "xserver-xorg \
>              xf86-input-evdev \
>              xf86-video-vmware"
>
> -MACHINE_FEATURES += "x86"
> +MACHINE_FEATURES += "x86 efi"
>
>   MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
> diff --git a/meta/conf/machine/qemux86.conf b/meta/conf/machine/qemux86.conf
> index 94ee573..57a9a50 100644
> --- a/meta/conf/machine/qemux86.conf
> +++ b/meta/conf/machine/qemux86.conf
> @@ -22,5 +22,7 @@ XSERVER = "xserver-xorg \
>              xf86-video-vmware"
>
>   MACHINE_FEATURES += "x86"
> +MACHINE_FEATURES += "efi"
> +#MACHINE_FEATURES += "pcbios"
>
Did you intend to keep the commented out like vs what you did above in 
x86-64?

>   MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
>

Will this affect the genericx86* also?

Sau!



  reply	other threads:[~2013-09-12 18:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 17:19 [PATCH 0/5] Improved EFI boot support Jason Wessel
2013-09-12 17:19 ` [PATCH 1/5] bootimage.bbclass: Move fat image creation into a function Jason Wessel
2013-09-12 17:38   ` Darren Hart
2013-09-12 17:19 ` [PATCH 2/5] cdrtools-native: Update from 3.00 to 3.01a17 Jason Wessel
2013-09-12 17:40   ` Darren Hart
2013-09-12 17:40   ` Saul Wold
2013-09-12 17:19 ` [PATCH 3/5] grub-efi-native: Add support for EFI ISO images Jason Wessel
2013-09-12 17:48   ` Darren Hart
2013-09-12 17:19 ` [PATCH 4/5] bootimage.bbclass: Improve EFI & PCBIOS+EFI ISO support Jason Wessel
2013-09-12 18:09   ` Darren Hart
2013-09-12 20:14     ` Jason Wessel
2013-09-12 20:28       ` Darren Hart
2013-09-12 17:19 ` [PATCH 5/5] grub-efi.bbclass: Add serial and graphics menu options Jason Wessel
2013-09-12 18:01   ` Saul Wold [this message]
2013-09-12 18:06     ` Jason Wessel
2013-09-12 18:11     ` Darren Hart
2013-09-12 18:16   ` Darren Hart
2013-09-12 19:52     ` Jason Wessel
2013-09-12 20:09       ` Darren Hart
2013-09-13 21:58         ` Jason Wessel
2013-09-16 17:49           ` Darren Hart
2013-09-17 12:19             ` Jason Wessel

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=52320176.2070802@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=Openembedded-core@lists.openembedded.org \
    --cc=dvhart@linux.intel.com \
    --cc=jason.wessel@windriver.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox