Re: [PATCH 6/7] setup.c: clean up initrd related code

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

 



Atsushi Nemoto wrote:
> On Mon, 16 Oct 2006 10:48:37 +0200, Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> wrote:
>> thanks but it doesn't explain anything either...Anyways what about this
>> patch on top of the previous one ?
> 
>> +	initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + sizeof(u32) * 2 + 1));
> 
> This breaks the addinitrd.  You mean this perhaps?
> 
> initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + sizeof(u32) * 2)) - sizeof(u32) * 2;
> 

you're right, but I really don't see how this work and IMHO this
code is broken.

In my mind, I was thinking that initrd_head had to be PAGE_SIZE
aligned and that was the reason of that weird code...

> 
> BTW, I'm a bit uncomfortable with current automatic initrd detection.
> Now we have rd_start= option.  If I enabled BLK_DEV_INITRD and did
> pass nfsroot= instead of rd_start= option, I want kernel do not search
> initrd_header at all.  Note that in this case current kernel might
> misdetect initrd_header from garbage beyond "_end".
> 

Well that might happen if you want a nfs rootfs but want to execute
an initrd before mounting the rootfs and this initrd has been included
in the kernel image with the 'addinitrd' stuff.

> I think something like CONFIG_INITRD_AUTODETECT to control this
> behaviour is useful.  What do you think?
> 

It's safer although it can be enough to check against a magic number 
well chosen. Maybe we can introduce a new option to the command line, 
'initrd_noprobe' for example. But in any case make the default to
auto detect initrd to avoid breaking some old configs.

		Franck


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux