[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH GRUB] Allow initrd concatenation on ARM64



Hi Vladimir,

Sorry for late response, I turned to work on other tasks and haven't
sent the test resulted to you.

Last weekend I got a email from Julien about a xen boot problem on
arm64, I just noticed that you have simplified the xen_boot.c to drop
xen_linux, xen_initrd and xen_xsm.

By this way, we still can boot xen on arm64 by loading modules in a
specific order, and simplified the xen boot code.  I guess that is also
a good way to make  a patch for updating boot entrance in grub.cfg.

Is this still OK to update grub.cfg by this way:
(1) in xen_boot.c
  grub_env_set ("grub_xen_boot", "y");
  grub_env_export ("grub_xen_boot");

(2)in util/grub.d/20_linux_xen.in

----
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index f532fb9..49aa709 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -120,16 +120,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}
+ ${multiboot_cmd} ${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_linux_cmd} ${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_initrd_cmd}  ${rel_dirname}/${initrd}
 EOF
   fi
   sed "s/^/$submenu_indentation/" << EOF
@@ -185,6 +185,16 @@ case "$machine" in
     *) GENKERNEL_ARCH="$machine" ;;
 esac

+if [ "x$grub_xen_boot" != xy ]; then
+ multiboot_cmd="multiboot"
+ module_linux_cmd="module"
+ module_initrd_cmd="module --nounzip"
+else
+ multiboot_cmd="xen_hypervisor"
+ module_linux_cmd="xen_module"
+ module_initrd_cmd="xen_module"
+fi
+
 # Extra indentation to add to menu entries in a submenu. We're not in a submenu
 # yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
 submenu_indentation=""
----

(3)add xen_* aliases on x86,
----
diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c
index c4d9689..b88d51b 100644
--- a/grub-core/loader/i386/xen.c
+++ b/grub-core/loader/i386/xen.c
@@ -696,10 +696,14 @@ GRUB_MOD_INIT (xen)
                                   0, N_("Load Linux."));
   cmd_multiboot = grub_register_command ("multiboot", grub_cmd_xen,
                                         0, N_("Load Linux."));
+  cmd_multiboot = grub_register_command ("xen_hypervisor", grub_cmd_xen,
+                                        0, N_("Load Linux."));
   cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
                                      0, N_("Load initrd."));
   cmd_module = grub_register_command ("module", grub_cmd_module,
                                      0, N_("Load module."));
+  cmd_module = grub_register_command ("xen_module", grub_cmd_module,
+                                     0, N_("Load module."));
   my_mod = mod;
 }
----

Please correct me if I misunderstand something, thanks for your help,  :-)
and sorry for delay  :-(



On 12 November 2015 at 21:48, Vladimir 'Ï-coder/phcoder' Serbinenko
<phcoder@xxxxxxxxx> wrote:
> On 12.11.2015 14:27, Ian Campbell wrote:
>> On Thu, 2015-11-12 at 14:08 +0100, Vladimir 'Ï-coder/phcoder' Serbinenko
>> wrote:
>>> While on it also change "xen_linux" to "xen_kernel" to be vendor-neutral
>>> Could someone test please? I only compile-tested it
>>
>> I was expecting this patch to include a change
>> to ./util/grub.d/20_linux_xen.in to update the naming there, but it looks
>> like that aspect of the original series isn't in tree yet?
>>
> We need to figure out what we should do on x86 wrt multiboot vs
> multiboot2 before adapting 20_linux_xen
>> BTW, you have a stray "linux" in the description of the (now) xen_kernel
>> command.
>>
> Fixed locally, thank you
>> Ian.
>>
>> .
>>
>
>



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.