Re: [PATCH v2] kernel-shark: Do not hardcode /usr prefix for polkit policies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michal,

Thank you very much for helping us improving kernelshark!


On 11.03.21 г. 16:50, Michal Sojka wrote:
When one wants to install kernel-shark to a non-standard location,
e.g., by configuring it as follows:

     cmake -D_INSTALL_PREFIX=$HOME ..

then "make install" fails, with the following error:

     CMake Error at src/cmake_install.cmake:225 (file):
       file INSTALL cannot copy file
       "/home/user/src/trace-cmd/kernel-shark/org.freedesktop.kshark-record.policy"
       to "/usr/share/polkit-1/actions/org.freedesktop.kshark-record.policy".

This commit fixes that by ensuring that even the
org.freedesktop.kshark-record.policy file is installed to the
user-specified prefix and not to /usr where the user has no write
permission.
In your case the installation fails to install the policy file used by
Polkit. Note that this doesn't mean that the kernelshark installation itself fails.

As far as I know the policy file can only go to a special locations so that Polkit can find it. Otherwise it will have no effect (I may be wrong on this).

If you know how to tell Polkit to search in an arbitrary location for those files, please let me know.

Thanks!
Yordan

---
  kernel-shark/src/CMakeLists.txt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
index 457c100..687e150 100644
--- a/kernel-shark/src/CMakeLists.txt
+++ b/kernel-shark/src/CMakeLists.txt
@@ -92,7 +92,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
              DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME})
install(FILES "${KS_DIR}/org.freedesktop.kshark-record.policy"
-            DESTINATION /usr/share/polkit-1/actions/)
+            DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/)
install(PROGRAMS "${KS_DIR}/bin/kshark-su-record"
              DESTINATION ${_INSTALL_PREFIX}/bin/)




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux