Skip to content

Commit 56f7909

Browse files
committed
Merge tag 'linux-cpupower-6.20-update-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux
Pull one more cpuidle utility update for 6.20 from Shuah Khan: "Improve the installation procedure by making this systemd step optional enabling users to disable installation of systemd's unit file." * tag 'linux-cpupower-6.20-update-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: make systemd unit installation optional
2 parents 2064fe4 + 7799ba2 commit 56f7909

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tools/power/cpupower/Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,17 @@ endif
315315
$(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h
316316
$(INSTALL_DATA) lib/powercap.h $(DESTDIR)${includedir}/powercap.h
317317

318-
install-tools: $(OUTPUT)cpupower
318+
# SYSTEMD=false disables installation of the systemd unit file
319+
SYSTEMD ?= true
320+
321+
install-systemd:
322+
$(INSTALL) -d $(DESTDIR)${unitdir}
323+
sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${unitdir}/cpupower.service'
324+
$(SETPERM_DATA) '$(DESTDIR)${unitdir}/cpupower.service'
325+
326+
INSTALL_SYSTEMD := $(if $(filter true,$(strip $(SYSTEMD))),install-systemd)
327+
328+
install-tools: $(OUTPUT)cpupower $(INSTALL_SYSTEMD)
319329
$(INSTALL) -d $(DESTDIR)${bindir}
320330
$(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
321331
$(INSTALL) -d $(DESTDIR)${bash_completion_dir}
@@ -324,9 +334,6 @@ install-tools: $(OUTPUT)cpupower
324334
$(INSTALL_DATA) cpupower-service.conf '$(DESTDIR)${confdir}'
325335
$(INSTALL) -d $(DESTDIR)${libexecdir}
326336
$(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower'
327-
$(INSTALL) -d $(DESTDIR)${unitdir}
328-
sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${unitdir}/cpupower.service'
329-
$(SETPERM_DATA) '$(DESTDIR)${unitdir}/cpupower.service'
330337

331338
install-man:
332339
$(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1
@@ -406,4 +413,4 @@ help:
406413
@echo ' uninstall - Remove previously installed files from the dir defined by "DESTDIR"'
407414
@echo ' cmdline or Makefile config block option (default: "")'
408415

409-
.PHONY: all utils libcpupower update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean help
416+
.PHONY: all utils libcpupower update-po create-gmo install-lib install-systemd install-tools install-man install-gmo install uninstall clean help

0 commit comments

Comments
 (0)