summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-04-05 15:35:30 +1000
committerJeremy Kerr <jk@ozlabs.org>2007-04-05 15:35:30 +1000
commit167387fd92cc204a38bc0afa75b66889dec3decf (patch)
treebf27774e66d76f4c935c701a0758ab82cc46c298 /devices
parenteff968df2ac394b4ebbef0ad6f91d833ca0f22b6 (diff)
downloadtalos-petitboot-167387fd92cc204a38bc0afa75b66889dec3decf.tar.gz
talos-petitboot-167387fd92cc204a38bc0afa75b66889dec3decf.zip
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 <jk@ozlabs.org>
Diffstat (limited to 'devices')
-rw-r--r--devices/udev-helper.c15
1 files changed, 15 insertions, 0 deletions
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))
OpenPOWER on IntegriCloud