[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.
This commit is contained in:
arnd@arndb.de 2003-11-24 23:41:40 -08:00 committed by Greg KH
parent befd83cc4e
commit 5c6f0f141d
1 changed files with 9 additions and 0 deletions

View File

@ -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);