Ny documentation for udev builtins

documentationreferenceudev

The man page for udev mentions in several places that certain rules options can be used to invoke 'builtin' commands, which are apparently built in to the udev program itself. However, I haven't been able to find any reference documentation that clearly explains what udev builtins are available; what they do and how they are used.

I have searched the web without much success. Does anyone know if there is a reference anywhere that provides details about these builtin commands?

Best Answer

Unfortunately, this information is missing on manpages and even knowing how to read them(see below) you will find trouble on trying to find that info.

However, the beauty of the opensource relies on having the power to read the sources. If you take a look at the udev-builtin.c source file inside systemd/udev repository and have basic C language knowledge, you will find the following snippet of code: A structure that maps all existing builtin types.

static const struct udev_builtin *builtins[_UDEV_BUILTIN_MAX] = {
#if HAVE_BLKID
        [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
#endif
        [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
        [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
        [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
        [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
#if HAVE_KMOD
        [UDEV_BUILTIN_KMOD] = &udev_builtin_kmod,
#endif
        [UDEV_BUILTIN_NET_ID] = &udev_builtin_net_id,
        [UDEV_BUILTIN_NET_LINK] = &udev_builtin_net_setup_link,
        [UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id,
        [UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id,
#if HAVE_ACL
        [UDEV_BUILTIN_UACCESS] = &udev_builtin_uaccess,
#endif
};

This struct holds all built-in types, and they map source files depending on what type it is. Example:

Related:

Related Question