* [PATCH] init: fix name of root device in /proc/mounts
@ 2013-02-05 20:07 William Hubbs
2013-02-05 20:10 ` William Hubbs
0 siblings, 1 reply; 4+ messages in thread
From: William Hubbs @ 2013-02-05 20:07 UTC (permalink / raw)
To: linux-next; +Cc: mpagano, William Hubbs
On a system that does not use an initramfs, /dev/root is always
listed in /proc/mounts. This breaks software which scans /proc/mounts to
determine which file systems are mounted since /dev/root is not a valid
device name.
This changes that processing so that "/dev/root" is only added to
/proc/mounts if a root device is not specified with the root= option on
the kernel command line.
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
---
init/do_mounts.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 1d1b634..efc37d2 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -480,7 +480,10 @@ void __init change_floppy(char *fmt, ...)
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
- fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
+ if (saved_root_name[0])
+ fd = sys_open(saved_root_name, O_RDWR | O_NDELAY, 0);
+ else
+ fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
if (fd >= 0) {
sys_ioctl(fd, FDEJECT, 0);
sys_close(fd);
@@ -523,8 +526,13 @@ void __init mount_root(void)
}
#endif
#ifdef CONFIG_BLOCK
- create_dev("/dev/root", ROOT_DEV);
- mount_block_root("/dev/root", root_mountflags);
+ if (saved_root_name[0]) {
+ create_dev(saved_root_name, ROOT_DEV);
+ mount_block_root(saved_root_name, root_mountflags);
+ } else {
+ create_dev("/dev/root", ROOT_DEV);
+ mount_block_root("/dev/root", root_mountflags);
+ }
#endif
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] init: fix name of root device in /proc/mounts
2013-02-05 20:07 [PATCH] init: fix name of root device in /proc/mounts William Hubbs
@ 2013-02-05 20:10 ` William Hubbs
2013-02-05 21:45 ` Stephen Rothwell
0 siblings, 1 reply; 4+ messages in thread
From: William Hubbs @ 2013-02-05 20:10 UTC (permalink / raw)
To: linux-next; +Cc: mpagano, w.d.hubbs
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
All,
this patch was originally sent to linux-kernel, but I was told it might
be better to send it to this list since this section of the kernel does
not have a specific maintainer.
Thanks,
William
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] init: fix name of root device in /proc/mounts
2013-02-05 20:10 ` William Hubbs
@ 2013-02-05 21:45 ` Stephen Rothwell
2013-02-05 23:36 ` William Hubbs
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2013-02-05 21:45 UTC (permalink / raw)
To: William Hubbs; +Cc: linux-next, mpagano
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
Hi William,
On Tue, 5 Feb 2013 14:10:35 -0600 William Hubbs <w.d.hubbs@gmail.com> wrote:
>
> this patch was originally sent to linux-kernel, but I was told it might
> be better to send it to this list since this section of the kernel does
> not have a specific maintainer.
You were misinformed. The linux-next list is for discussion of things
about the linux-next releases and not for general development.
linux-kernel was the right place.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] init: fix name of root device in /proc/mounts
2013-02-05 21:45 ` Stephen Rothwell
@ 2013-02-05 23:36 ` William Hubbs
0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2013-02-05 23:36 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, mpagano
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
On Wed, Feb 06, 2013 at 08:45:46AM +1100, Stephen Rothwell wrote:
> Hi William,
>
> On Tue, 5 Feb 2013 14:10:35 -0600 William Hubbs <w.d.hubbs@gmail.com> wrote:
> >
> > this patch was originally sent to linux-kernel, but I was told it might
> > be better to send it to this list since this section of the kernel does
> > not have a specific maintainer.
>
> You were misinformed. The linux-next list is for discussion of things
> about the linux-next releases and not for general development.
> linux-kernel was the right place.
Ok, no problem, I'll just wait for responses from there. Sorry about the
noise on this list.
William
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-05 23:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-05 20:07 [PATCH] init: fix name of root device in /proc/mounts William Hubbs
2013-02-05 20:10 ` William Hubbs
2013-02-05 21:45 ` Stephen Rothwell
2013-02-05 23:36 ` William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox