mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Samuelson <peter@cadcamlab.org>
To: Andries.Brouwer@cwi.nl
Cc: tigran@veritas.com, torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [patch-2.4.0-test13-pre3] rootfs boot param. support
Date: Mon, 18 Dec 2000 09:22:19 -0600	[thread overview]
Message-ID: <20001218092219.H3199@cadcamlab.org> (raw)
In-Reply-To: <UTC200012181417.PAA167011.aeb@aak.cwi.nl>
In-Reply-To: <UTC200012181417.PAA167011.aeb@aak.cwi.nl>; from Andries.Brouwer@cwi.nl on Mon, Dec 18, 2000 at 03:17:10PM +0100


[Andries Brouwer]
> (i) I prefer "rootfstype". Indeed, "rootfs" is ambiguous.
> It gives some property of the root filesystem, but which?

> (ii) It is a bad idea to arbitrarily select "ext2".

> (iii) [...] Thus, if the boot option rootfstype is given, I prefer a
> boot failure over a kernel attempt to try all filesystems it knows

Agreed on all counts.

Peter

--- test13pre3+rootfs/fs/super.c~	Mon Dec 18 09:06:47 2000
+++ test13pre3+rootfs/fs/super.c	Mon Dec 18 09:18:02 2000
@@ -18,7 +18,7 @@
  *    Torbjörn Lindh (torbjorn.lindh@gopta.se), April 14, 1996.
  *  Added devfs support: Richard Gooch <rgooch@atnf.csiro.au>, 13-JAN-1998
  *  Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000
- *  Added rootfs boot param. used by mount_root(): Tigran Aivazian. Dec 2000.
+ *  Added rootfstype boot param. used by mount_root(): Tigran Aivazian. Dec 2000.
  */
 
 #include <linux/config.h>
@@ -59,11 +59,11 @@
 /* this is initialized in init/main.c */
 kdev_t ROOT_DEV;
 
-/* this can be set at boot time, e.g. rootfs=ext2 
+/* this can be set at boot time, e.g. rootfstype=ext2 
  * if set to invalid value or if read_super() fails on the specified
  * filesystem type then mount_root() will go through all registered filesystems.
  */
-static char rootfs[128] __initdata = "ext2";
+static char rootfstype[32] __initdata = "";
 
 int nr_super_blocks;
 int max_super_blocks = NR_SUPER;
@@ -90,11 +90,11 @@
 	int n = strlen(line) + 1;
 
 	if (n > 1 && n < 128)
-		strncpy(rootfs, line, n);
+		strncpy(rootfstype, line, n);
 	return 1;
 }
 
-__setup("rootfs=", rootfs_setup);
+__setup("rootfstype=", rootfs_setup);
 
 /* WARNING: This can be used only if we _already_ own a reference */
 static void get_filesystem(struct file_system_type *fs)
@@ -1479,7 +1479,7 @@
 
 void __init mount_root(void)
 {
-	struct file_system_type * fs_type;
+	struct file_system_type * fs_type = NULL;
 	struct super_block * sb;
 	struct vfsmount *vfsmnt;
 	struct block_device *bdev = NULL;
@@ -1597,11 +1597,15 @@
 		goto mount_it;
 	}
 
-	fs_type = get_fs_type(rootfs);
-	if (fs_type) {
-  		sb = read_super(ROOT_DEV,bdev,fs_type,root_mountflags,NULL,1);
-		if (sb)
-			goto mount_it;
+	if (*rootfstype) {
+		fs_type = get_fs_type(rootfstype);
+		if (fs_type) {
+  			sb = read_super(ROOT_DEV,bdev,fs_type,root_mountflags,NULL,1);
+			if (sb)
+				goto mount_it;
+		}
+		/* do NOT try all filesystems - user explicitly wanted this one */
+		goto fail;
 	}
 	read_lock(&file_systems_lock);
 	for (fs_type = file_systems ; fs_type ; fs_type = fs_type->next) {
@@ -1617,6 +1621,7 @@
 		put_filesystem(fs_type);
 	}
 	read_unlock(&file_systems_lock);
+fail:
 	panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV));
 
 mount_it:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-12-18 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-18 14:17 Andries.Brouwer
2000-12-18 15:22 ` Peter Samuelson [this message]
2000-12-18 15:36   ` Tigran Aivazian
2000-12-18 16:00   ` [patch-2.4.0-test13-pre3] rootfs (2nd attempt) Tigran Aivazian
2000-12-18 16:03     ` Oops " Tigran Aivazian
2000-12-18 18:23     ` Andreas Dilger
2000-12-18 18:31       ` [final] " Tigran Aivazian
2000-12-19  7:03         ` Is there a devfs patch for 2.2.18? Tri D. Hoang
     [not found] <Pine.LNX.4.21.0012111102480.801-100000@penguin.homenet>
2000-12-18 11:56 ` [patch-2.4.0-test13-pre3] rootfs boot param. support Tigran Aivazian
2000-12-18 12:11   ` Andrzej Krzysztofowicz
2000-12-18 12:45   ` Peter Samuelson
2000-12-18 13:24     ` Tigran Aivazian
2000-12-18 15:12       ` Peter Samuelson
2000-12-18 15:21         ` Tigran Aivazian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001218092219.H3199@cadcamlab.org \
    --to=peter@cadcamlab.org \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tigran@veritas.com \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®