tizen: Set the smack label of /dev/mapper and /dev/mapper/control as '*' accepted/tizen_unified_toolchain sandbox/klewandowski/tizen_2.03.22 accepted/tizen/unified/20240216.054936 accepted/tizen/unified/toolchain/20240311.065937 accepted/tizen/unified/x/20240219.013834
authorHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 19 Sep 2018 10:23:03 +0000 (19:23 +0900)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 13 Feb 2024 22:21:02 +0000 (23:21 +0100)
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>
packaging/99-dm-tizen.rules [new file with mode: 0644]
packaging/device-mapper.spec

diff --git a/packaging/99-dm-tizen.rules b/packaging/99-dm-tizen.rules
new file mode 100644 (file)
index 0000000..09dc8e0
--- /dev/null
@@ -0,0 +1 @@
+KERNEL=="device-mapper", NAME="mapper/control", SECLABEL{smack}="*", RUN+="/bin/chsmack -a * /dev/mapper"
index dc8f2c8ce239fe8944d118c094ae0d1897382fa7..454e84130b3791e66ff703e58c15e5ce2bd157d2 100644 (file)
@@ -9,6 +9,7 @@ Summary:        Device mapper utility
 Url:            http://sources.redhat.com/dm
 Group:          Base/Device Management
 Source0:        ftp://sources.redhat.com/pub/lvm2/lvm2-v%{lvm2_version}.tar.gz
+Source101:      99-dm-tizen.rules
 Source1001:     device-mapper.manifest
 BuildRequires:  pkgconfig(libsystemd)
 
@@ -61,6 +62,7 @@ make CFLAGS="-fPIC" LDFLAGS="-pie" V=1 \
 %install
 make install_device-mapper DESTDIR=%{buildroot} usrlibdir=%{buildroot}/usr/%{_lib}
 sed -i 's/ (.*)//g' %{buildroot}%{_libdir}/pkgconfig/*.pc
+install -m644 99-dm-tizen.rules %{buildroot}/%{udev_dir}/99-dm-tizen.rules
 rm -rf %{buildroot}/usr/share/man