Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 1 | From 209f346d55eeaf74e21c541d70ec43d39b6c8c3c Mon Sep 17 00:00:00 2001 |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 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> |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 11 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 12 | --- |
| 13 | CMakeLists.txt | 5 ++++- |
| 14 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 17 | index 98985e7ee..001efb800 100644 |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 18 | --- a/CMakeLists.txt |
| 19 | +++ b/CMakeLists.txt |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 20 | @@ -237,7 +237,10 @@ else() |
| 21 | endif() |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 22 | endif() |
| 23 | |
| 24 | -find_program(SYSTEMCTL_BIN systemctl HINTS "/usr/bin" "/bin") |
| 25 | +if (NOT SYSTEMCTL_BIN) |
| 26 | + find_program(SYSTEMCTL_BIN systemctl HINTS "/usr/bin" "/bin") |
| 27 | +endif() |
| 28 | + |
| 29 | if (NOT SYSTEMCTL_BIN) |
| 30 | set (SYSTEMCTL_BIN "/bin/systemctl") |
| 31 | endif() |