From: "Kay Sievers" Date: Mon, 30 Apr 2007 13:43:35 +0000 Subject: Re: Matching something against an environment-variable Message-Id: <3ae72650704300643m42a77183j471991235fa1dacd@mail.gmail.com> List-Id: References: <200704271339.04976.zzam@gentoo.org> In-Reply-To: <200704271339.04976.zzam@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On 4/27/07, Matthias Schwarzott wrote: > I just have noticed that comparisons like this are not possible with udev: > > something=ENV{MY_VAR} Key names can't appear on the right side, it's always a quoted value. > or > something="$env{MY_VAR}" Right, this version could be made working, but today we don't apply format chars before we compare the values. > The reason I want to use that is: creating /dev/root without executing a > program for every blockdev. > > With some rule like this: > SUBSYSTEM="block", ATTR{dev}=ENV{ROOT_DEV_NR}, SYMLINK+="root" > > with variable ROOT_DEV_NR be either set by > A. SUBSYSTEM="block", IMPORT{file}+="/dev/.udev/root_dev_nr" > and that file is created by udev-startscript > > B. injecting the env-var with > udevcontrol env ROOT_DEV_NR=$(get_root_dev) > after udevd has been started > > I think the variant something=ENV{MY_VAR} should not be too complicated to > realize. Why don't you write out a 50-rootdev.rules file before starting udevd? So you don't need to import anything, or match on globel variables: SUBSYSTEM="block", ENV{MAJOR}="8", ENV{MINOR}="5", SYMLINK+="root" Kay ------------------------------------------------------------------------- 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/ _______________________________________________ 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