linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] initramfs + sysfs as root fix
@ 2003-08-24  1:57 Garrett Kajmowicz
  2003-08-28  0:40 ` H. Peter Anvin
  0 siblings, 1 reply; 2+ messages in thread
From: Garrett Kajmowicz @ 2003-08-24  1:57 UTC (permalink / raw)
  To: linux-kernel

This is my first real patch, so please vet thoroughly

This patch allows a person to not require mounting a root device at startup.  
This works idealy for people trying to use the initramfs/sysfs as the only 
filesystem.

What happens is that when the root device is set to 0,0 mount_root is not 
called.  I have tested in VMWare extensively, and the patch is quite minimal.

Please let me know if I should send this somewhere else as well.

Also, please be adviased that I did not dream up the goto - I am just keeping 
in line with the existing file structure.


Garrett Kajmowicz
gkajmowi@tbaytel.net

--- linux-2.6.0-test3/init/do_mounts.c  2003-08-09 00:34:47.000000000 -0400
+++ linux/init/do_mounts.c      2003-08-23 17:22:59.000000000 -0400
@@ -380,6 +380,12 @@
        if (is_floppy && rd_doload && rd_load_disk(0))
                ROOT_DEV = Root_RAM0;

+#ifndef CONFIG_ROOT_NFS
+       if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR && MINOR(ROOT_DEV) == 0) {
+               goto out;
+       }
+#endif
+
        mount_root();
 out:
        umount_devfs("/dev");


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

* Re: [PATCH] initramfs + sysfs as root fix
  2003-08-24  1:57 [PATCH] initramfs + sysfs as root fix Garrett Kajmowicz
@ 2003-08-28  0:40 ` H. Peter Anvin
  0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2003-08-28  0:40 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <200308232157.53962.gkajmowi@tbaytel.net>
By author:    Garrett Kajmowicz <gkajmowi@tbaytel.net>
In newsgroup: linux.dev.kernel
>
> This is my first real patch, so please vet thoroughly
> 
> This patch allows a person to not require mounting a root device at startup.  
> This works idealy for people trying to use the initramfs/sysfs as the only 
> filesystem.
> 
> What happens is that when the root device is set to 0,0 mount_root is not 
> called.  I have tested in VMWare extensively, and the patch is quite minimal.
> 
> +++ linux/init/do_mounts.c      2003-08-23 17:22:59.000000000 -0400
> @@ -380,6 +380,12 @@
>         if (is_floppy && rd_doload && rd_load_disk(0))
>                 ROOT_DEV = Root_RAM0;
> 
> +#ifndef CONFIG_ROOT_NFS
> +       if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR && MINOR(ROOT_DEV) == 0) {
> +               goto out;
> +       }
> +#endif
> +
>         mount_root();

It seems ugly, to say the least, to conditionalize this on
CONFIG_ROOT_NFS.  If anything it should be conditionalized on no NFS
root actually configured, which is a very different thing.

(Of course, then nfsroot should be done via initramfs...)

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

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

end of thread, other threads:[~2003-08-28  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-24  1:57 [PATCH] initramfs + sysfs as root fix Garrett Kajmowicz
2003-08-28  0:40 ` H. Peter Anvin

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).