From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v3 1/2] wic: isoimage-isohybrid: add grubefi configfile support
Date: Thu, 21 Apr 2016 17:37:04 +0300 [thread overview]
Message-ID: <20160421143704.GA30824@linux.intel.com> (raw)
In-Reply-To: <36d7622248270bd13e2701d7a8c8caf66c67a128.1461233389.git.adrian.ratiu@ni.com>
Hi Ioan-Adrian,
Great! Thank you!
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
On Thu, Apr 21, 2016 at 01:10:12PM +0300, Ioan-Adrian Ratiu wrote:
> The latest wic kickstart refactoring introduced a bootloader option
> "--configfile" which lets wks' specify a custom grub.cfg for use
> while booting. This is very useful for creating stuff like boot menus.
>
> This change lets isoimage-isohybrid use --configfile; if this option is
> not specified in a wks, it generates a default cfg as before.
>
> Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
> ---
> .../lib/wic/plugins/source/isoimage-isohybrid.py | 53 +++++++++++++---------
> 1 file changed, 32 insertions(+), 21 deletions(-)
>
> diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> index bc99283..8440581 100644
> --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> @@ -27,6 +27,7 @@ import glob
>
> from wic import msger
> from wic.pluginbase import SourcePlugin
> +from wic.utils.misc import get_custom_config
> from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
>
> class IsoImagePlugin(SourcePlugin):
> @@ -94,33 +95,43 @@ class IsoImagePlugin(SourcePlugin):
> """
> Create loader-specific (grub-efi) config
> """
> - splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
> - if os.path.exists(splash):
> - splashline = "menu background splash.jpg"
> + configfile = creator.ks.bootloader.configfile
> + if configfile:
> + grubefi_conf = get_custom_config(configfile)
> + if grubefi_conf:
> + msger.debug("Using custom configuration file "
> + "%s for grub.cfg" % configfile)
> + else:
> + msger.error("configfile is specified but failed to "
> + "get it from %s." % configfile)
> else:
> - splashline = ""
> + splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
> + if os.path.exists(splash):
> + splashline = "menu background splash.jpg"
> + else:
> + splashline = ""
>
> - bootloader = creator.ks.bootloader
> + bootloader = creator.ks.bootloader
>
> - grubefi_conf = ""
> - grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> - grubefi_conf += "--parity=no --stop=1\n"
> - grubefi_conf += "default=boot\n"
> - grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> - grubefi_conf += "\n"
> - grubefi_conf += "search --set=root --label %s " % part.label
> - grubefi_conf += "\n"
> - grubefi_conf += "menuentry 'boot'{\n"
> + grubefi_conf = ""
> + grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> + grubefi_conf += "--parity=no --stop=1\n"
> + grubefi_conf += "default=boot\n"
> + grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> + grubefi_conf += "\n"
> + grubefi_conf += "search --set=root --label %s " % part.label
> + grubefi_conf += "\n"
> + grubefi_conf += "menuentry 'boot'{\n"
>
> - kernel = "/bzImage"
> + kernel = "/bzImage"
>
> - grubefi_conf += "linux %s rootwait %s\n" \
> - % (kernel, bootloader.append)
> - grubefi_conf += "initrd /initrd \n"
> - grubefi_conf += "}\n"
> + grubefi_conf += "linux %s rootwait %s\n" \
> + % (kernel, bootloader.append)
> + grubefi_conf += "initrd /initrd \n"
> + grubefi_conf += "}\n"
>
> - if splashline:
> - grubefi_conf += "%s\n" % splashline
> + if splashline:
> + grubefi_conf += "%s\n" % splashline
>
> msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
> % cr_workdir)
> --
> 2.8.0
>
--
--
Regards,
Ed
prev parent reply other threads:[~2016-04-21 16:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 10:10 [PATCH v3 1/2] wic: isoimage-isohybrid: add grubefi configfile support Ioan-Adrian Ratiu
2016-04-21 10:10 ` [PATCH v3 2/2] wic: isoimage-isohybrid: fix splash file paths Ioan-Adrian Ratiu
2016-04-21 14:37 ` Ed Bartosh [this message]
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=20160421143704.GA30824@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=adrian.ratiu@ni.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox