From: Jeremy Kerr Date: Thu, 5 Apr 2007 05:35:30 +0000 (+1000) Subject: Ignore ramdisk devices. X-Git-Tag: v0.0.1~14 X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=167387fd92cc204a38bc0afa75b66889dec3decf;hp=eff968df2ac394b4ebbef0ad6f91d833ca0f22b6 Ignore ramdisk devices. Don't try and parse the config from ramdisk devices, and add a general system for device ignoring. Signed-off-by: Jeremy Kerr --- 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))