Normally, /dev/mapper and /dev/mapper/control are created by the in-kernel dm driver
and the smack label is set by Systemd as '*'.
When the dm driver is loaded as a module (dm-mod.ko), however,
/dev/mapper's label cannot be initialized by Systemd.
drwxr-xr-x root root * /dev/mapper
crw------- root root * /dev/mapper/control
Change-Id: I74f7b58cbfb80294bb19bd5cff683359d26c1b22
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
# DM_SUSPENDED - suspended state of DM device (0 or 1)
# DM_UDEV_RULES_VSN - DM udev rules version
-KERNEL=="device-mapper", NAME="(DM_DIR)/control"
-
+KERNEL=="device-mapper", NAME="(DM_DIR)/control", SECLABEL{smack}="*", RUN+="/bin/chsmack -a * /dev/mapper"
SUBSYSTEM!="block", GOTO="dm_end"
KERNEL!="dm-[0-9]*", GOTO="dm_end"
(DM_EXEC_RULE)