From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Sat, 21 Apr 2007 10:29:36 +0000 Subject: Re: [PATCH] creating link /dev/root to device / is mounted from Message-Id: <200704211429.40740.arvidjaar@mail.ru> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============1774747757==" List-Id: References: <200704201246.21524.zzam@gentoo.org> In-Reply-To: <200704201246.21524.zzam@gentoo.org> To: linux-hotplug@vger.kernel.org --===============1774747757== Content-Type: multipart/signed; boundary="nextPart5210464.XSf00eGj6F"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart5210464.XSf00eGj6F Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 21 April 2007, Matthias Schwarzott wrote: > On Freitag, 20. April 2007, Kay Sievers wrote: > > On 4/20/07, Matthias Schwarzott 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=3D=3D"block", PROGRAM=3D=3D"blockdev_is_root $major $minor", > > > SYMLINK+=3D"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=20 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=20 database? I am not sure if the format allows it though. =2Dandrey > For example when /usr is already mounted (for udevinfo): > dev_nr=3D$(root_get_dev_nr) > dev_path=3D$(udevtrigger --verbose --attr-match=3Ddev=3D${dev_nr}) > dev_name=3D$(udevinfo -q name --path ${dev_path}) > ln -s /dev/${dev_name} /dev/root > > > Or inject some rule into udev like > ATTR{dev}=3D=3D"${dev_nr}", SYMLINK+=3D"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 --nextPart5210464.XSf00eGj6F Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGKeeRR6LMutpd94wRAryqAKC9jOXPOU2OPw8PTVjC6Tnjg4qB/ACaA8aG 4JhOcxHMOaPxcTfWebm3amQ= =sQiV -----END PGP SIGNATURE----- --nextPart5210464.XSf00eGj6F-- --===============1774747757== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --===============1774747757== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1774747757==--