Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame^] | 1 | From 92747aab189aa3cee954ab31ee019205f8984155 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 27 May 2023 17:22:10 -0700 |
| 4 | Subject: [PATCH] cmake: Allow SYSTEMCTL_BIN to be overridden from environment |
| 5 | |
| 6 | This allows to encode correct paths which are inside the target rootfs |
| 7 | for systemctl |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | CMakeLists.txt | 5 ++++- |
| 13 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 16 | index 9b7462861..c4d82fb49 100644 |
| 17 | --- a/CMakeLists.txt |
| 18 | +++ b/CMakeLists.txt |
| 19 | @@ -226,7 +226,10 @@ else() |
| 20 | set(CYTHON_EXECUTABLE "") |
| 21 | endif() |
| 22 | |
| 23 | -find_program(SYSTEMCTL_BIN systemctl HINTS "/usr/bin" "/bin") |
| 24 | +if (NOT SYSTEMCTL_BIN) |
| 25 | + find_program(SYSTEMCTL_BIN systemctl HINTS "/usr/bin" "/bin") |
| 26 | +endif() |
| 27 | + |
| 28 | if (NOT SYSTEMCTL_BIN) |
| 29 | set (SYSTEMCTL_BIN "/bin/systemctl") |
| 30 | endif() |
| 31 | -- |
| 32 | 2.40.1 |
| 33 | |