From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] creating link /dev/root to device / is mounted from
Date: Sat, 21 Apr 2007 10:29:36 +0000 [thread overview]
Message-ID: <200704211429.40740.arvidjaar@mail.ru> (raw)
In-Reply-To: <200704201246.21524.zzam@gentoo.org>
[-- Attachment #1.1: Type: text/plain, Size: 2449 bytes --]
On Saturday 21 April 2007, Matthias Schwarzott wrote:
> On Freitag, 20. April 2007, Kay Sievers wrote:
> > On 4/20/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > > Some software (like hal) needs the /dev/root link (as /proc/mounts can
> > > contain it).
> >
> > Right, but HAL doesn't need it, it just assumes that device-file
> > entries in /proc/mounts are also available in /dev.
> >
> > The "/dev/root missing but in /proc/mounts" only happens for people
> > who run their own compiled kernels without an initramfs.
> >
> > > The attached patch contains one program which compares the major/minor
> > > number supplied to it on the command-line with the numbers of the
> > > device / is located on.
> > > It is used with this rule (see 60-root_link.rules):
> > > SUBSYSTEM=="block", PROGRAM=="blockdev_is_root $major $minor",
> > > SYMLINK+="root"
> >
> > Why do we want to run a program for _every_ block device, just to
> > create /dev/root? It's an operation you only need to do once at
> > bootup, and the root-device is obviously already there, before you
> > start udev out of the rootfs. :)
>
> I think this is not too bad, as the program itself is only around 3k size.
>
> > The udev init-script checks if /dev is already mounted with tmpfs from
> > initramfs, if not, it will need to do it, and at that point, we can
> > just mknod /dev/root, can't we?
>
> Well, our initramfs does not move its /dev to new mounted root filesystem,
> but we get a completely fresh tmpfs.
>
I believe, most iplementations do. Actually how you solve the issue
with /dev/null & Co. without it?
> We also can just have a program to write out major/minor of "/" and then
> mknod it (outside of udev)
> But I really like a link better.
> Here I also can search udev-database (or whatever)
>
Yes that is nice. What about a simple program that can manupulate udev
database? I am not sure if the format allows it though.
-andrey
> For example when /usr is already mounted (for udevinfo):
> dev_nr=$(root_get_dev_nr)
> dev_path=$(udevtrigger --verbose --attr-match=dev=${dev_nr})
> dev_name=$(udevinfo -q name --path ${dev_path})
> ln -s /dev/${dev_name} /dev/root
>
>
> Or inject some rule into udev like
> ATTR{dev}=="${dev_nr}", SYMLINK+="root"
> But how to inject? /etc is read-only at udevd starting. Or can rule-files
> include other rule files? Like in /dev/.udev/
>
> Matthias
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2007-04-21 10:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-20 10:46 [PATCH] creating link /dev/root to device / is mounted from Matthias Schwarzott
2007-04-20 14:55 ` Kay Sievers
2007-04-21 9:35 ` Matthias Schwarzott
2007-04-21 10:29 ` Andrey Borzenkov [this message]
2007-04-21 10:41 ` Kay Sievers
2007-04-21 13:31 ` Matthias Schwarzott
2007-04-21 17:47 ` Doug Goldstein
2007-04-22 12:01 ` Kay Sievers
2007-04-23 17:58 ` David Zeuthen
2007-04-24 9:37 ` Kay Sievers
2007-05-03 5:56 ` David Zeuthen
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=200704211429.40740.arvidjaar@mail.ru \
--to=arvidjaar@mail.ru \
--cc=linux-hotplug@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.