All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for relocatable PowerPC kernels
@ 2010-07-13  5:45 Anton Blanchard
  2010-07-13  9:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Blanchard @ 2010-07-13  5:45 UTC (permalink / raw)
  To: grub-devel


Hi,

PowerPC Linux kernels can now be built relocatable so we need to check
for that in the loader.

Anton

--

2010-07-13  Anton Blanchard  <anton@samba.org>

	* loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject
	ET_DYN files.

Index: grub/loader/powerpc/ieee1275/linux.c
===================================================================
--- grub.orig/loader/powerpc/ieee1275/linux.c	2010-07-11 12:05:16.443242734 +1000
+++ grub/loader/powerpc/ieee1275/linux.c	2010-07-12 14:56:20.301991065 +1000
@@ -220,7 +220,7 @@ grub_cmd_linux (grub_command_t cmd __att
   if (! elf)
     goto out;
 
-  if (elf->ehdr.ehdr32.e_type != ET_EXEC)
+  if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN)
     {
       grub_error (GRUB_ERR_UNKNOWN_OS,
 		  "this ELF file is not of the right type");


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix for relocatable PowerPC kernels
  2010-07-13  5:45 [PATCH] Fix for relocatable PowerPC kernels Anton Blanchard
@ 2010-07-13  9:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-13 10:12   ` Anton Blanchard
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-13  9:21 UTC (permalink / raw)
  To: grub-devel; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]

On 07/13/2010 07:45 AM, Anton Blanchard wrote:
> Hi,
>
> PowerPC Linux kernels can now be built relocatable so we need to check
> for that in the loader.
>
> Anton
>
>   
Is building as ET_DYN supported upstream? We previously had reports of
building system of some distros to be plainly borked and usualy the
distro fixed their building system pretty fast. If upstream supports
ET_DYN, then this patch is accepted with no further questions. But if
it's a borked building system it may have subtle bugs and allowing it
would probably just suppress an early symptom of other problems.
> --
>
> 2010-07-13  Anton Blanchard  <anton@samba.org>
>
> 	* loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject
> 	ET_DYN files.
>
> Index: grub/loader/powerpc/ieee1275/linux.c
> ===================================================================
> --- grub.orig/loader/powerpc/ieee1275/linux.c	2010-07-11 12:05:16.443242734 +1000
> +++ grub/loader/powerpc/ieee1275/linux.c	2010-07-12 14:56:20.301991065 +1000
> @@ -220,7 +220,7 @@ grub_cmd_linux (grub_command_t cmd __att
>    if (! elf)
>      goto out;
>  
> -  if (elf->ehdr.ehdr32.e_type != ET_EXEC)
> +  if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN)
>      {
>        grub_error (GRUB_ERR_UNKNOWN_OS,
>  		  "this ELF file is not of the right type");
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix for relocatable PowerPC kernels
  2010-07-13  9:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-13 10:12   ` Anton Blanchard
  2010-07-14 12:27     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Blanchard @ 2010-07-13 10:12 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: linux-kernel


Hi,

> Is building as ET_DYN supported upstream? We previously had reports of
> building system of some distros to be plainly borked and usualy the
> distro fixed their building system pretty fast. If upstream supports
> ET_DYN, then this patch is accepted with no further questions. But if
> it's a borked building system it may have subtle bugs and allowing it
> would probably just suppress an early symptom of other problems.

This is supported upstream on a number of architectures, for example
the PowerPC configuration option is:

config RELOCATABLE
        bool "Build a relocatable kernel"
        help
          This builds a kernel image that is capable of running anywhere
          in the RMA (real memory area) at any 16k-aligned base address.
          The kernel is linked as a position-independent executable (PIE)
          and contains dynamic relocations which are processed early
          in the bootup process.

          One use is for the kexec on panic case where the recovery kernel
          must live at a different physical address than the primary
          kernel.

Regards,
Anton

> > 2010-07-13  Anton Blanchard  <anton@samba.org>
> >
> > 	* loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject
> > 	ET_DYN files.
> >
> > Index: grub/loader/powerpc/ieee1275/linux.c
> > ===================================================================
> > --- grub.orig/loader/powerpc/ieee1275/linux.c	2010-07-11 12:05:16.443242734 +1000
> > +++ grub/loader/powerpc/ieee1275/linux.c	2010-07-12 14:56:20.301991065 +1000
> > @@ -220,7 +220,7 @@ grub_cmd_linux (grub_command_t cmd __att
> >    if (! elf)
> >      goto out;
> >  
> > -  if (elf->ehdr.ehdr32.e_type != ET_EXEC)
> > +  if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN)
> >      {
> >        grub_error (GRUB_ERR_UNKNOWN_OS,
> >  		  "this ELF file is not of the right type");


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix for relocatable PowerPC kernels
  2010-07-13 10:12   ` Anton Blanchard
@ 2010-07-14 12:27     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-14 15:50       ` Colin Watson
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-14 12:27 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]

On 07/13/2010 12:12 PM, Anton Blanchard wrote:
> Hi,
>
>   
>> Is building as ET_DYN supported upstream? We previously had reports of
>> building system of some distros to be plainly borked and usualy the
>> distro fixed their building system pretty fast. If upstream supports
>> ET_DYN, then this patch is accepted with no further questions. But if
>> it's a borked building system it may have subtle bugs and allowing it
>> would probably just suppress an early symptom of other problems.
>>     
> This is supported upstream on a number of architectures, for example
> the PowerPC configuration option is:
>
>   
Then I'm ok with your patch but I'm on wacky connection and don't want
to risk a stale lock (unfortunately bzr-ssh isn't supported on
savannah). Could someone with good access commit it?
> config RELOCATABLE
>         bool "Build a relocatable kernel"
>         help
>           This builds a kernel image that is capable of running anywhere
>           in the RMA (real memory area) at any 16k-aligned base address.
>           The kernel is linked as a position-independent executable (PIE)
>           and contains dynamic relocations which are processed early
>           in the bootup process.
>
>           One use is for the kexec on panic case where the recovery kernel
>           must live at a different physical address than the primary
>           kernel.
>
> Regards,
> Anton
>
>   
>>> 2010-07-13  Anton Blanchard  <anton@samba.org>
>>>
>>> 	* loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Do not reject
>>> 	ET_DYN files.
>>>
>>> Index: grub/loader/powerpc/ieee1275/linux.c
>>> ===================================================================
>>> --- grub.orig/loader/powerpc/ieee1275/linux.c	2010-07-11 12:05:16.443242734 +1000
>>> +++ grub/loader/powerpc/ieee1275/linux.c	2010-07-12 14:56:20.301991065 +1000
>>> @@ -220,7 +220,7 @@ grub_cmd_linux (grub_command_t cmd __att
>>>    if (! elf)
>>>      goto out;
>>>  
>>> -  if (elf->ehdr.ehdr32.e_type != ET_EXEC)
>>> +  if (elf->ehdr.ehdr32.e_type != ET_EXEC && elf->ehdr.ehdr32.e_type != ET_DYN)
>>>      {
>>>        grub_error (GRUB_ERR_UNKNOWN_OS,
>>>  		  "this ELF file is not of the right type");
>>>       
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix for relocatable PowerPC kernels
  2010-07-14 12:27     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-14 15:50       ` Colin Watson
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Watson @ 2010-07-14 15:50 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Jul 14, 2010 at 02:27:01PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 07/13/2010 12:12 PM, Anton Blanchard wrote:
> > This is supported upstream on a number of architectures, for example
> > the PowerPC configuration option is:
> 
> Then I'm ok with your patch but I'm on wacky connection and don't want
> to risk a stale lock (unfortunately bzr-ssh isn't supported on
> savannah). Could someone with good access commit it?

Committed.  Thanks!

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-14 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-13  5:45 [PATCH] Fix for relocatable PowerPC kernels Anton Blanchard
2010-07-13  9:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-13 10:12   ` Anton Blanchard
2010-07-14 12:27     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-14 15:50       ` Colin Watson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.