Skip to contentSkip to conversation

Allow initrd concatenation on ARM64

PATCH In review Vladimir 'φ-coder/phcoder' Serbinenko 3 participants 9 messages Nov 12, 2015 – Feb 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow initrd concatenation on ARM64

While on it also change "xen_linux" to "xen_kernel" to be vendor-neutral Could someone test please? I only compile-tested it

docs/grub.texi +4 -4
index 1df3db2..112b42b 100644
@@ -3859,7 +3859,7 @@ you forget a command, you can run the command @command{help}
 * 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_kernel::                  Load dom0 kernel for xen hypervisor
 * xen_initrd::                  Load dom0 initrd for dom0 kernel
 * xen_xsm::                     Load xen security module for xen hypervisor
 @end menu
@@ -5134,10 +5134,10 @@ verbatim as the @dfn{kernel command-line}. Any other binaries must be
 reloaded after using this command.
 @end deffn
 
-@node xen_linux
-@subsection xen_linux
+@node xen_kernel
+@subsection xen_kernel
 
-@deffn Command xen_linux file [arguments]
+@deffn Command xen_kernel file [arguments]
 Load a dom0 kernel image for xen hypervisor at the booting process of xen.
 The rest of the line is passed verbatim as the module command line.
 @end deffn
grub-core/Makefile.core.def +1 -0
index d9fa0e3..34f7b61 100644
@@ -1641,6 +1642,7 @@ module = {
 module = {
   name = xen_boot;
   common = lib/cmdline.c;
+  common = loader/linux.c;
   arm64 = loader/arm64/xen_boot.c;
   enable = arm64;
 };
grub-core/loader/arm64/xen_boot.c +112 -60

245 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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?

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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?

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Ian.

#7 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko

Hi Vladimir,

OK, I will test it.

Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

While on it also change "xen_linux" to "xen_kernel" to be vendor-neutral Could someone test please? I only compile-tested it

Signature · 15 lines
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
[email protected]
http://lists.xen.org/xen-devel
#8 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko

Hi Vladimir,

OK, I will test it.

Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

While on it also change "xen_linux" to "xen_kernel" to be vendor-neutral Could someone test please? I only compile-tested it

Signature · 10 lines
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
#3 lore raw
In reply to Ian Campbell
Quoted 9 lines · Ian Campbell
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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

Quoted 3 lines

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Fixed locally, thank you

Quoted 4 lines

Ian.

.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Ian Campbell
Quoted 9 lines · Ian Campbell
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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

Quoted 3 lines

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Fixed locally, thank you

Quoted 4 lines

Ian.

.

#5 lore raw

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

----

util/grub.d/20_linux_xen.in +1 -1
index f532fb9..49aa709 100644
@@ -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,
----

grub-core/loader/i386/xen.c +4 -1
index c4d9689..b88d51b 100644
@@ -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 :-(

Quoted 22 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 9 lines · Ian Campbell
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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

Quoted 3 lines

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Fixed locally, thank you

Quoted 4 lines

Ian.

.

Signature · 15 lines
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
[email protected]
http://lists.xen.org/xen-devel
#6 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko

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

----

util/grub.d/20_linux_xen.in +1 -1
index f532fb9..49aa709 100644
@@ -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,
----

grub-core/loader/i386/xen.c +4 -1
index c4d9689..b88d51b 100644
@@ -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 :-(

Quoted 22 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 9 lines · Ian Campbell
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko

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

Quoted 3 lines

BTW, you have a stray "linux" in the description of the (now) xen_kernel command.

Fixed locally, thank you

Quoted 4 lines

Ian.

.

Signature · 10 lines
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