diff options
author | arnd@arndb.de <arnd@arndb.de> | 2003-11-24 23:41:40 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:13:04 -0700 |
commit | 5c6f0f141d43703fe84b8c0ddcebf9b79001daf9 (patch) | |
tree | 6cec78137e2845ed0b46f2062e8c06fb02569cb9 | |
parent | befd83cc4ee33f6a557b531d4a1be13472ec67cd (diff) |
[PATCH] Add format modifier for devfs like naming
On Monday 24 November 2003 01:29, Greg KH wrote:
> I think with the ability to capture the output of the CALLOUT rule,
> combined with the ability to put format modifiers in the CALLOUT program
> string, we now have everything in place to emulate the existing devfs
> naming scheme. Anyone want to verify this or not?
I would prefer to have the ability of creating partition nodes in devfs
style built-in to udev. Devfs used to call the whole disk e.g.
"/dev/dasd/0123/disk" and the partitions "/dev/dasd/0123/part[1-3]".
This can obviously be done with a CALLOUT rule, but its common enough
to make it a format modifier. AFAIK, this scheme has been used for
ide, scsi and dasd disks, which is about 99% of all disks ever connected
to Linux.
-rw-r--r-- | namedev.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -527,6 +527,15 @@ static void apply_format(struct udevice *udev, unsigned char *string) strcat(pos, udev->kernel_number); dbg("substitute kernel number '%s'", udev->kernel_number); break; + case 'D': + if (strlen(udev->kernel_number) == 0) { + strcat(pos, "disk"); + break; + } + strcat(pos, "part"); + strcat(pos, udev->kernel_number); + dbg("substitute kernel number '%s'", udev->kernel_number); + break; case 'm': sprintf(pos, "%u", udev->minor); dbg("substitute minor number '%u'", udev->minor); |