LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH]: typo in init/initramfs.c
@ 2006-12-06 12:46 Jean-Paul Saman
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Paul Saman @ 2006-12-06 12:46 UTC (permalink / raw)
  To: linux-kernel

In populate_rootfs() the printk on line 554. It says "Unpacking 
initramfs..", which is confusing because if that line is reached the code 
has already decided that the image is an initrd image. The printk is thus 
wrong in stating that it is unpacking an "initramfs". It should says 
"initrd" instead. The attached patch corrects this typo.

Signed-off-by: Jean-Paul Saman <jean-paul.saman@nxp.com>

diff --git a/init/initramfs.c b/init/initramfs.c
index d28c109..f6020db 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -551,7 +551,7 @@ #ifdef CONFIG_BLK_DEV_RAM
                        free_initrd();
                }
 #else
-               printk(KERN_INFO "Unpacking initramfs...");
+              printk(KERN_INFO "Unpacking initrd...");
                err = unpack_to_rootfs((char *)initrd_start,
                        initrd_end - initrd_start, 0);
                if (err)

-
Kind greetings,

Jean-Paul Saman

NXP Semiconductors CTO/RTG DesignIP/OKC

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

* Re: [PATCH]: typo in init/initramfs.c
  2006-12-08 13:58   ` Al Boldi
@ 2006-12-11  9:34     ` Jean-Paul Saman
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Paul Saman @ 2006-12-11  9:34 UTC (permalink / raw)
  To: Al Boldi; +Cc: linux-kernel

linux-kernel-owner@vger.kernel.org wrote on 08-12-2006 14:58:24:

> Jean-Paul Saman wrote:
> > linux-kernel-owner@vger.kernel.org wrote on 06-12-2006 19:17:27:
> > > Jean-Paul Saman wrote:
> > > > In populate_rootfs() the printk on line 554. It says "Unpacking
> > > > initramfs..", which is confusing because if that line is reached 
the
> > > > code has already decided that the image is an initrd image.
> > >
> > > Are you sure?
> >
> > Yes.
> 
> Are you really sure?
> 

Not anymore ;-) 

> Maybe you're getting confused with the dual intitrd naming-convention. 
> InitRD used to mean InitRamDisk only, now it means InitRamFS and 
InitRamDisk 
> #ifdef CONFIG_BLK_DEV_RAM, else it means InitRamFS only.

Well, I am confused. Reading drivers/block/Kconfig again and again I came 
to the conclusion that I've been misinterpreted what it said. The way the 
code is written is counter-intuitive, using INITRD for initramfs and 
initrd made my head go spinning.

> But still, it's rather refreshing to see you so convinced.

Thanks for your kind words.

Kind greetings,

Jean-Paul Saman

NXP Semiconductors CTO/RTG DesignIP


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

* Re: [PATCH]: typo in init/initramfs.c
  2006-12-08  8:32 ` Jean-Paul Saman
@ 2006-12-08 13:58   ` Al Boldi
  2006-12-11  9:34     ` Jean-Paul Saman
  0 siblings, 1 reply; 5+ messages in thread
From: Al Boldi @ 2006-12-08 13:58 UTC (permalink / raw)
  To: Jean-Paul Saman; +Cc: linux-kernel

Jean-Paul Saman wrote:
> linux-kernel-owner@vger.kernel.org wrote on 06-12-2006 19:17:27:
> > Jean-Paul Saman wrote:
> > > In populate_rootfs() the printk on line 554. It says "Unpacking
> > > initramfs..", which is confusing because if that line is reached the
> > > code has already decided that the image is an initrd image.
> >
> > Are you sure?
>
> Yes.

Are you really sure?

> > > The printk is thus
> > > wrong in stating that it is unpacking an "initramfs". It should says
> > > "initrd" instead. The attached patch corrects this typo.
> > >
> > > Signed-off-by: Jean-Paul Saman <jean-paul.saman@nxp.com>
> > >
> > > diff --git a/init/initramfs.c b/init/initramfs.c
> > > index d28c109..f6020db 100644
> > > --- a/init/initramfs.c
> > > +++ b/init/initramfs.c
> > > @@ -551,7 +551,7 @@ #ifdef CONFIG_BLK_DEV_RAM
> >
> > This is where initramfs is discerned from initrd, as both are available.
> >
> > >                         free_initrd();
> > >                 }
> > >  #else
> >
> > Otherwise it's initramfs only.
>
> No otherwise it falls under CONFIG_BLK_DEV_INITRD and it that suggests it
> must be a initrd, not a initramfs as the original printk() suggests.

This is what 2.6.19 says:

=========================
#ifdef CONFIG_BLK_DEV_INITRD
	if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM
		int fd;
		printk(KERN_INFO "checking if image is initramfs...");
		err = unpack_to_rootfs((char *)initrd_start,
			initrd_end - initrd_start, 1);
		if (!err) {
			printk(" it is\n");
			unpack_to_rootfs((char *)initrd_start,
				initrd_end - initrd_start, 0);
			free_initrd();
			return;
		}
		printk("it isn't (%s); looks like an initrd\n", err);
		fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700);
		if (fd >= 0) {
			sys_write(fd, (char *)initrd_start,
					initrd_end - initrd_start);
			sys_close(fd);
			free_initrd();
		}
#else // <=== of #ifdef CONFIG_BLK_DEV_RAM
		printk(KERN_INFO "Unpacking initramfs...");
		err = unpack_to_rootfs((char *)initrd_start,
			initrd_end - initrd_start, 0);
		if (err)
			panic(err);
		printk(" done\n");
		free_initrd();
#endif // <=== of #ifdef CONFIG_BLK_DEV_RAM
	}
#endif // <=== of #ifdef CONFIG_BLK_DEV_INITRD
=========================

Maybe you're getting confused with the dual intitrd naming-convention.  
InitRD used to mean InitRamDisk only, now it means InitRamFS and InitRamDisk 
#ifdef CONFIG_BLK_DEV_RAM, else it means InitRamFS only.

But still, it's rather refreshing to see you so convinced.


Thanks!

--
Al


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

* Re: [PATCH]: typo in init/initramfs.c
  2006-12-06 18:17 Al Boldi
@ 2006-12-08  8:32 ` Jean-Paul Saman
  2006-12-08 13:58   ` Al Boldi
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Paul Saman @ 2006-12-08  8:32 UTC (permalink / raw)
  To: linux-kernel

linux-kernel-owner@vger.kernel.org wrote on 06-12-2006 19:17:27:

> Jean-Paul Saman wrote:
> >
> > In populate_rootfs() the printk on line 554. It says "Unpacking
> > initramfs..", which is confusing because if that line is reached the 
code
> > has already decided that the image is an initrd image.
> 
> Are you sure?

Yes.

> 
> > The printk is thus
> > wrong in stating that it is unpacking an "initramfs". It should says
> > "initrd" instead. The attached patch corrects this typo.
> >
> > Signed-off-by: Jean-Paul Saman <jean-paul.saman@nxp.com>
> >
> > diff --git a/init/initramfs.c b/init/initramfs.c
> > index d28c109..f6020db 100644
> > --- a/init/initramfs.c
> > +++ b/init/initramfs.c
> > @@ -551,7 +551,7 @@ #ifdef CONFIG_BLK_DEV_RAM
> 
> This is where initramfs is discerned from initrd, as both are available.
> 
> >                         free_initrd();
> >                 }
> >  #else
> 
> Otherwise it's initramfs only.

No otherwise it falls under CONFIG_BLK_DEV_INITRD and it that suggests it 
must be a initrd, not a initramfs as the original printk() suggests.

> 
> > -               printk(KERN_INFO "Unpacking initramfs...");
> > +              printk(KERN_INFO "Unpacking initrd...");
> >                 err = unpack_to_rootfs((char *)initrd_start,
> >                         initrd_end - initrd_start, 0);
> >                 if (err)
> >
> > -

Kind greetings,

Jean-Paul Saman

NXP Semiconductors CTO/RTG DesignIP

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

* [PATCH]: typo in init/initramfs.c
@ 2006-12-06 18:17 Al Boldi
  2006-12-08  8:32 ` Jean-Paul Saman
  0 siblings, 1 reply; 5+ messages in thread
From: Al Boldi @ 2006-12-06 18:17 UTC (permalink / raw)
  To: linux-kernel

Jean-Paul Saman wrote:
>
> In populate_rootfs() the printk on line 554. It says "Unpacking
> initramfs..", which is confusing because if that line is reached the code
> has already decided that the image is an initrd image.

Are you sure?

> The printk is thus
> wrong in stating that it is unpacking an "initramfs". It should says
> "initrd" instead. The attached patch corrects this typo.
>
> Signed-off-by: Jean-Paul Saman <jean-paul.saman@nxp.com>
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index d28c109..f6020db 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -551,7 +551,7 @@ #ifdef CONFIG_BLK_DEV_RAM

This is where initramfs is discerned from initrd, as both are available.

>                         free_initrd();
>                 }
>  #else

Otherwise it's initramfs only.

> -               printk(KERN_INFO "Unpacking initramfs...");
> +              printk(KERN_INFO "Unpacking initrd...");
>                 err = unpack_to_rootfs((char *)initrd_start,
>                         initrd_end - initrd_start, 0);
>                 if (err)
>
> -


Thanks!

--
Al


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

end of thread, other threads:[~2006-12-11  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 12:46 [PATCH]: typo in init/initramfs.c Jean-Paul Saman
2006-12-06 18:17 Al Boldi
2006-12-08  8:32 ` Jean-Paul Saman
2006-12-08 13:58   ` Al Boldi
2006-12-11  9:34     ` Jean-Paul Saman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).