X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=devices%2Fudev-helper.c;h=84b2bef95947cd16ea70ce5d311998f250ff5bd9;hp=d70a1d716718e1ea4d6e3e88eb13140a6ddb5389;hb=167387fd92cc204a38bc0afa75b66889dec3decf;hpb=eff968df2ac394b4ebbef0ad6f91d833ca0f22b6 diff --git a/devices/udev-helper.c b/devices/udev-helper.c index d70a1d7..84b2bef 100644 --- a/devices/udev-helper.c +++ b/devices/udev-helper.c @@ -401,6 +401,18 @@ static int is_removable_device(const char *sysfs_path) return strtol(buf, NULL, 10); } +static int is_ignored_device(const char *devname) +{ + static const char *ignored_devices[] = { "/dev/ram", NULL }; + const char **dev; + + for (dev = ignored_devices; *dev; dev++) + if (!strncmp(devname, *dev, strlen(*dev))) + return 1; + + return 0; +} + static int found_new_device(const char *dev_path) { char mountpoint[PATH_MAX]; @@ -573,6 +585,9 @@ int main(int argc, char **argv) return EXIT_FAILURE; } + if (is_ignored_device(dev_path)) + return EXIT_SUCCESS; + if (streq(action, "add")) { char *sysfs_path = getenv("DEVPATH"); if (sysfs_path && is_removable_device(sysfs_path))