From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
ChangeLog: v8: http://lists.gnu.org/archive/html/grub-devel/2017-05/ Delete the redundant "#include <grub/env.h>" in patch 0001. Use $grub_file instead of "feature_xen_boot" mechanism to determine which xen boot commands we should use.
v7: http://lists.gnu.org/archive/html/grub-devel/2017-05/msg00000.html Delete patch 0001(v6) which is wrong. Improve the commit message of 0002(v6). Use "machine" variable instead of "feature_xen_boot" mechanism to determine which xen boot commands we should use. Update the introduction of xen_module commands in docs/grub.texi, emphasize xen_hypervisor and xen_module are only for AArch64.
v6: http://lists.gnu.org/archive/html/grub-devel/2016-07/msg00034.html Fix Coding style of util/grub.d/20_linux_xen.in, use soft tab.
v5: http://lists.gnu.org/archive/html/grub-devel/2016-07/msg00008.html Update the introduction of xen_module commands in docs/grub.texi, according to the suggestion from Julien Grall
v4: http://lists.gnu.org/archive/html/grub-devel/2016-05/ according to the XSM loading mechanism of Xen(upstreamed), update the introduction of xen_module commands in docs/grub.texi
v3: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00314.html reorder the patches update the introduction of xen_module commands in docs/grub.texi
v2: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00282.html add "--nounzip" option support in xen_module use "feature_xen_boot" instead of "grub_xen_boot" update the introduction of xen boot commands in docs/grub.texi
v1 :first upstream patchset: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00264.html Fu Wei (3): arm64: add "--nounzip" option support in xen_module command * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 arm64: update the introduction of xen boot commands in docs/grub.texi
docs/grub.texi | 38 +++++++++++++------------------------- grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++ util/grub.d/20_linux_xen.in | 14 +++++++++++--- 3 files changed, 40 insertions(+), 28 deletions(-)
From: Fu Wei fu.wei@linaro.org
This patch adds "--nounzip" option support in order to be compatible with the module command of multiboot on other architecture, by this way we can simplify grub-mkconfig support code.
This patch also allow us to use zip compressed module(like Linux kernel for Dom0).
Signed-off-by: Fu Wei fu.wei@linaro.org --- grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..2a42654 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -379,6 +379,20 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
struct xen_boot_binary *module = NULL; grub_file_t file = 0; + int nounzip = 0; + + if (!argc) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + goto fail; + } + + if (grub_strcmp (argv[0], "--nounzip") == 0) + { + argv++; + argc--; + nounzip = 1; + }
if (!argc) { @@ -403,6 +417,8 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
grub_dprintf ("xen_loader", "Init module and node info\n");
+ if (nounzip) + grub_file_filter_disable_compression (); file = grub_file_open (argv[0]); if (!file) goto fail;
From: Fu Wei fu.wei@linaro.org
This patch adds the support of xen_boot command for aarch64: xen_hypervisor xen_module These two commands are only for aarch64, since it has its own protocol and commands to boot xen hypervisor and Dom0, but not multiboot.
For other architectures, they are still using multiboot and module commands.
Signed-off-by: Fu Wei fu.wei@linaro.org --- util/grub.d/20_linux_xen.in | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..c002fc9 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,16 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi - multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} ${xen_rm_opts} + ${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} ${xen_rm_opts} echo '$(echo "$lmessage" | grub_quote)' - module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} + ${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' - module --nounzip ${rel_dirname}/${initrd} + ${module_loader} --nounzip ${rel_dirname}/${initrd} EOF fi sed "s/^/$submenu_indentation/" << EOF @@ -206,6 +206,14 @@ while [ "x${xen_list}" != "x" ] ; do if [ "x$is_top_level" != xtrue ]; then echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' $menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {" fi + $grub_file --is-arm64-efi $current_xen + if [ $? -ne 0 ]; then + xen_loader="multiboot" + module_loader="module" + else + xen_loader="xen_hypervisor" + module_loader="xen_module" + fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` gettext_printf "Found linux image: %s\n" "$linux" >&2
From: Fu Wei fu.wei@linaro.org
delete: xen_linux, xen_initrd, xen_xsm add: xen_module
This update bases on commit 0edd750e50698854068358ea53528100a9192902 Author: Vladimir Serbinenko phcoder@gmail.com Date: Fri Jan 22 10:18:47 2016 +0100
xen_boot: Remove obsolete module type distinctions.
Also bases on the module loading mechanism of Xen code: 488c2a8 docs/arm64: clarify the documention for loading XSM support 67831c4 docs/arm64: update the documentation for loading XSM support ca32012 xen/arm64: check XSM Magic from the second unknown module.
Signed-off-by: Fu Wei fu.wei@linaro.org Reviewed-by: Julien Grall julien.grall@arm.com --- docs/grub.texi | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-)
diff --git a/docs/grub.texi b/docs/grub.texi index e935af3..a0c4b9e 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -3873,11 +3873,9 @@ you forget a command, you can run the command @command{help} @comment * vbeinfo:: List available video modes * verify_detached:: Verify detached digital signature * videoinfo:: List available video modes -@comment * xen_*:: Xen boot commands -* xen_hypervisor:: Load xen hypervisor binary -* xen_linux:: Load dom0 kernel for xen hypervisor -* xen_initrd:: Load dom0 initrd for dom0 kernel -* xen_xsm:: Load xen security module for xen hypervisor +@comment * xen_*:: Xen boot commands for AArch64 +* xen_hypervisor:: Load xen hypervisor binary (only on AArch64) +* xen_module:: Load xen modules for xen hypervisor (only on AArch64) @end menu
@@ -5153,32 +5151,22 @@ List available video modes. If resolution is given, show only matching modes. Load a Xen hypervisor binary from @var{file}. The rest of the line is passed verbatim as the @dfn{kernel command-line}. Any other binaries must be reloaded after using this command. +This command is only available on AArch64 systems. @end deffn
-@node xen_linux -@subsection xen_linux +@node xen_module +@subsection xen_module
-@deffn Command xen_linux file [arguments] -Load a dom0 kernel image for xen hypervisor at the booting process of xen. +@deffn Command xen_module [--nounzip] file [arguments] +Load a module for xen hypervisor at the booting process of xen. The rest of the line is passed verbatim as the module command line. +Modules should be loaded in the following order: + - dom0 kernel image + - dom0 ramdisk if present + - XSM policy if present +This command is only available on AArch64 systems. @end deffn
-@node xen_initrd -@subsection xen_initrd - -@deffn Command xen_initrd file -Load a initrd image for dom0 kernel at the booting process of xen. -@end deffn - -@node xen_xsm -@subsection xen_xsm - -@deffn Command xen_xsm file -Load a xen security module for xen hypervisor at the booting process of xen. -See @uref{http://wiki.xen.org/wiki/XSM%7D for more detail. -@end deffn - - @node Networking commands @section The list of networking commands
On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.
Daniel
Hi Daniel,
On 15/05/17 14:38, Daniel Kiper wrote:
On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.
Thank you!
Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.
Cheers,
[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html
Hi Julien,
On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
Hi Daniel,
On 15/05/17 14:38, Daniel Kiper wrote:
On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.
Thank you!
Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.
Cheers,
[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html
Will do with this patch series.
Daniel
Hi Daniel,
On 15 May 2017 at 21:46, Daniel Kiper dkiper@net-space.pl wrote:
Hi Julien,
On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
Hi Daniel,
On 15/05/17 14:38, Daniel Kiper wrote:
On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.
Thank you!
Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.
Cheers,
[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html
Will do with this patch series.
Great thanks ! :-)
Daniel
On Mon, May 15, 2017 at 03:46:55PM +0200, Daniel Kiper wrote:
Hi Julien,
On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
Hi Daniel,
On 15/05/17 14:38, Daniel Kiper wrote:
On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.
Thank you!
Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.
Cheers,
[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html
Will do with this patch series.
Committed...
Daniel