linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][Patch] Allow not mounting a root fs
@ 2007-07-06  2:00 Bodo Eggert
  2007-07-06  2:08 ` H. Peter Anvin
  0 siblings, 1 reply; 20+ messages in thread
From: Bodo Eggert @ 2007-07-06  2:00 UTC (permalink / raw)
  To: linux-kernel

This patch adds the option to not mount another root filesystem 
by specifying root=initramfs.

TODO: Documentation
---

BTW: Is it possible to mount a tmpfs on / before extracting the cpio?


While I'm at it:

In init/do_mounts.c, mount_root(void):
ROOT_NFS: Is it desirable to use the floppy as a root device if nfs-root 
failed? If I tell my system to d A, i usually dislike it to do B instead.

Is the boot-from-floppy code here still usable, even though booting from 
floppy is no longer supported?



diff -X dontdiff -pruN 2.6.21.ori/init/do_mounts.c 2.6.21/init/do_mounts.c
--- 2.6.21.ori/init/do_mounts.c	2007-07-06 03:31:57.000000000 +0200
+++ 2.6.21/init/do_mounts.c	2007-07-06 03:27:33.000000000 +0200
@@ -427,6 +427,9 @@ void __init prepare_namespace(void)
 			mount_block_root(root_device_name, root_mountflags);
 			goto out;
 		}
+		if (!strncmp(root_device_name, "initramfs", 3)) {
+			goto out_nomount;
+		}
 		ROOT_DEV = name_to_dev_t(root_device_name);
 		if (strncmp(root_device_name, "/dev/", 5) == 0)
 			root_device_name += 5;
@@ -444,6 +447,7 @@ void __init prepare_namespace(void)
 out:
 	sys_mount(".", "/", NULL, MS_MOVE, NULL);
 	sys_chroot(".");
+out_nomount:
 	security_sb_post_mountroot();
 }
 
-- 
Top 100 things you don't want the sysadmin to say:
65. What do you mean /home was on that disk?  I umounted it!

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [RFC][Patch] Allow not mounting a root fs
@ 2007-07-08 10:36 Al Boldi
  2007-07-11  0:46 ` H. Peter Anvin
  0 siblings, 1 reply; 20+ messages in thread
From: Al Boldi @ 2007-07-08 10:36 UTC (permalink / raw)
  To: linux-kernel

Bodo Eggert wrote:
> On Sat, 7 Jul 2007, Jan Engelhardt wrote:
> > On Jul 5 2007 19:08, H. Peter Anvin wrote:
> > >> BTW: Is it possible to mount a tmpfs on / before extracting the cpio?
> > >
> > >Not in the stock kernel.  There have been some patches floating around
> > >for that, I think.
> > 
> > What would it buy? rootfs is a tmpfs, is not it?
> 
> As far as I understand, it is a ramfs aka. non-swappable tmpfs without any 
> limit and including a chance of DoSing the system.
> 
> Since I'm toying with root-on-initcpio, I'm looking for things that might 
> make the task some easier.
> 
> Currently I'm thinking about changing the root=initramfs to root=tmpfs and
> additionally mounting a tmpfs on / before unpacking the cpios. OTOH, this 
> seems to be a little bit messy. OTOH again, in _that_ boot code, nobody
> should complain :)

Try this "[PATCH] initramfs: Allow rootfs to use tmpfs instead of ramfs".

It's trivial and should be in mainline.


Thanks!

--
Al



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

end of thread, other threads:[~2007-07-18 22:53 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06  2:00 [RFC][Patch] Allow not mounting a root fs Bodo Eggert
2007-07-06  2:08 ` H. Peter Anvin
2007-07-06 15:00   ` Bodo Eggert
2007-07-06 15:32     ` Dan Aloni
2007-07-06 17:00     ` Andre Noll
2007-07-06 17:16       ` H. Peter Anvin
2007-07-07 18:30   ` Jan Engelhardt
2007-07-07 20:56     ` H. Peter Anvin
2007-07-07 21:13       ` Jan Engelhardt
2007-07-07 21:17         ` H. Peter Anvin
2007-07-18 21:51           ` Rob Landley
2007-07-18 22:50             ` H. Peter Anvin
2007-07-18 22:53               ` Roland M. Kruggel
2007-07-07 21:18     ` Bodo Eggert
2007-07-07 21:39       ` Jan Engelhardt
2007-07-07 21:45         ` H. Peter Anvin
2007-07-07 21:46       ` Willy Tarreau
  -- strict thread matches above, loose matches on Subject: below --
2007-07-08 10:36 Al Boldi
2007-07-11  0:46 ` H. Peter Anvin
2007-07-11  4:47   ` Al Boldi

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