public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.18 --> 2.4.19. Ramdisk requires floppy?
@ 2002-09-03 16:51 Jakob Sandgren
  2002-09-04  2:16 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Jakob Sandgren @ 2002-09-03 16:51 UTC (permalink / raw)
  To: linux-kernel

Hi,

I've noticed that the 2.4.19 version of "prepare_namespace"
(init/do_mounts.c) not allows you to mount a non floppy as a
ramdisk(?). This has changed since 2.4.18 (split of main.c ->
{do_mounts,main}.c).

2.4.18 does a very simple check (below):

--- 2.4.18 ---
#ifdef CONFIG_BLK_DEV_RAM
#ifdef CONFIG_BLK_DEV_INITRD
        if (mount_initrd)
                initrd_load();
        else
#endif
        rd_load();
#endif
--- 2.4.18 ---

however, in 2.4.19 it just tries to load a ramdisk if it's on a
floppy. Why? There may still be a ramdisk on an other device, NOT
using initrd. 

--- 2.4.19 ---
if (mount_initrd) {
       if (initrd_load() && ROOT_DEV != MKDEV(RAMDISK_MAJOR, 0)) {
              handle_initrd();
              goto out;
       }
} else if (is_floppy && rd_doload && rd_load_disk(0))
       ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
mount_root();
out:
--- 2.4.19 ---


Best Regards,
Jakob Sandgren
South Pole AB
-- 
Jakob Sandgren                  South Pole AB
Phone:  +46 8 51420420          Gelbjutarvägen 5
Fax:    +46 8 51420429          SE - 17148 Solna 
e-mail: jakob@southpole.se      www.southpole.se

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

* Re: 2.4.18 --> 2.4.19. Ramdisk requires floppy?
  2002-09-03 16:51 2.4.18 --> 2.4.19. Ramdisk requires floppy? Jakob Sandgren
@ 2002-09-04  2:16 ` H. Peter Anvin
  2002-09-04  9:32   ` Jakob Sandgren
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2002-09-04  2:16 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20020903165133.GA8726@southpole.se>
By author:    jakob@southpole.se (Jakob Sandgren)
In newsgroup: linux.dev.kernel
>
> Hi,
> 
> I've noticed that the 2.4.19 version of "prepare_namespace"
> (init/do_mounts.c) not allows you to mount a non floppy as a
> ramdisk(?). This has changed since 2.4.18 (split of main.c ->
> {do_mounts,main}.c).
> 
> 2.4.18 does a very simple check (below):
> 
> --- 2.4.18 ---
> #ifdef CONFIG_BLK_DEV_RAM
> #ifdef CONFIG_BLK_DEV_INITRD
>         if (mount_initrd)
>                 initrd_load();
>         else
> #endif
>         rd_load();
> #endif
> --- 2.4.18 ---
> 
> however, in 2.4.19 it just tries to load a ramdisk if it's on a
> floppy. Why? There may still be a ramdisk on an other device, NOT
> using initrd. 
> 

You can't search every device hunting for a ramdisk.  rd_load() is
ancient cruft that should be nuked, and will be pushed into userspace
as part of the initramfs/early userspace work.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

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

* Re: 2.4.18 --> 2.4.19. Ramdisk requires floppy?
  2002-09-04  2:16 ` H. Peter Anvin
@ 2002-09-04  9:32   ` Jakob Sandgren
  0 siblings, 0 replies; 3+ messages in thread
From: Jakob Sandgren @ 2002-09-04  9:32 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

On Tue, Sep 03, 2002 at 07:16:38PM -0700, H. Peter Anvin wrote:
> Followup to:  <20020903165133.GA8726@southpole.se>
> By author:    jakob@southpole.se (Jakob Sandgren)
> In newsgroup: linux.dev.kernel
> >
> > Hi,
> > 
> > I've noticed that the 2.4.19 version of "prepare_namespace"
> > (init/do_mounts.c) not allows you to mount a non floppy as a
> > ramdisk(?). This has changed since 2.4.18 (split of main.c ->
> > {do_mounts,main}.c).
> > 


> > 
> > however, in 2.4.19 it just tries to load a ramdisk if it's on a
> > floppy. Why? There may still be a ramdisk on an other device, NOT
> > using initrd. 
> > 
> 
> You can't search every device hunting for a ramdisk.  rd_load() is
> ancient cruft that should be nuked, and will be pushed into userspace
> as part of the initramfs/early userspace work.


I agree, but why is there such a check for mounting the root file 
system during startup. After removing the check from
prepare_namespace(), rd_load_image() will still get called with
"/dev/root" as argument and "/dev/root" should allready be pointing to
ROOT_DEV.  The target I'm working on is using a ramdisk for it's root
file system, however, it's not using initrd.



--- do_mounts.c-orig	Wed Sep  4 11:01:15 2002
+++ do_mounts.c	Wed Sep  4 11:02:11 2002
@@ -828,7 +828,6 @@
  */
 void prepare_namespace(void)
 {
-	int is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
 #ifdef CONFIG_ALL_PPC
 	extern void arch_discover_root(void);
 	arch_discover_root();
@@ -852,7 +851,7 @@
 			handle_initrd();
 			goto out;
 		}
-	} else if (is_floppy && rd_doload && rd_load_disk(0))
+	} else if (rd_doload && rd_load_disk(0))
 		ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
 	mount_root();
 out:





Best Regards,
Jakob Sandgren
South Pole AB

-- 
Jakob Sandgren                  South Pole AB
Phone:  +46 8 51420420          Gelbjutarvägen 5
Fax:    +46 8 51420429          SE - 17148 Solna 
e-mail: jakob@southpole.se      www.southpole.se

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

end of thread, other threads:[~2002-09-04  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-03 16:51 2.4.18 --> 2.4.19. Ramdisk requires floppy? Jakob Sandgren
2002-09-04  2:16 ` H. Peter Anvin
2002-09-04  9:32   ` Jakob Sandgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox