summaryrefslogtreecommitdiff
path: root/libudev/libudev-device-private.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-04-13 22:33:01 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-04-13 22:33:01 +0200
commit9ead662791b5e59a95b6c5a9351d661cb61d76bb (patch)
tree392eb083d47cc9de102fed885c4d8477103bc89c /libudev/libudev-device-private.c
parent09913ced8c6c081840c27a9f2ae4d430045a7c68 (diff)
udevadm: info --cleanup-db
Most of the udev database from initramfs should be deleted before starting udev in the real root. udevadm: info --cleanup-db deletes all database entries in /run/udev. Events that processed IMPORT{db}, or mark devices explicitely as persistent, will be excluded.
Diffstat (limited to 'libudev/libudev-device-private.c')
-rw-r--r--libudev/libudev-device-private.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c
index 6d72d328bd..ee9e297cea 100644
--- a/libudev/libudev-device-private.c
+++ b/libudev/libudev-device-private.c
@@ -134,6 +134,13 @@ int udev_device_update_db(struct udev_device *udev_device)
return -1;
}
+ /*
+ * set 'sticky' bit to indicate that we should not clean the
+ * database when we transition from initramfs to the real root
+ */
+ if (udev_device_get_db_persist(udev_device))
+ fchmod(fileno(f), 01644);
+
if (has_info) {
size_t devlen = strlen(udev_get_dev_path(udev))+1;
struct udev_list_entry *list_entry;