systemd-conf: machine-configurable power key behavior
Use placeholders and machine-configurable variables to determine systemd behavior when receiving power key events. By default, these are: - short press: suspend - long press: graceful poweroff Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
parent
ebe606d9ac
commit
6b9d2e4114
|
|
@ -130,3 +130,7 @@ IMAGE_FSTYPES ?= "${@ \
|
||||||
'' , d), \
|
'' , d), \
|
||||||
d) \
|
d) \
|
||||||
}"
|
}"
|
||||||
|
|
||||||
|
# Systemd logind power key event
|
||||||
|
LOGIND_HANDLE_POWER_KEY ??= "suspend"
|
||||||
|
LOGIND_HANDLE_POWER_KEY_LONGPRESS ??= "poweroff"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
[Login]
|
[Login]
|
||||||
HandlePowerKey=suspend
|
HandlePowerKey=##HANDLEPOWERKEY##
|
||||||
HandlePowerKeyLongPress=poweroff
|
HandlePowerKeyLongPress=##HANDLEPOWERKEYLONGPRESS##
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,12 @@ do_install:append() {
|
||||||
|
|
||||||
do_install:append:stm32mpcommon() {
|
do_install:append:stm32mpcommon() {
|
||||||
install -D -m0644 ${WORKDIR}/logind.conf-digi ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
install -D -m0644 ${WORKDIR}/logind.conf-digi ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
||||||
|
sed -i -e 's,##HANDLEPOWERKEY##,${LOGIND_HANDLE_POWER_KEY},g' \
|
||||||
|
-e 's,##HANDLEPOWERKEYLONGPRESS##,${LOGIND_HANDLE_POWER_KEY_LONGPRESS},g' ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install:append:ccimx9() {
|
do_install:append:ccimx9() {
|
||||||
install -D -m0644 ${WORKDIR}/logind.conf-digi ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
install -D -m0644 ${WORKDIR}/logind.conf-digi ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
||||||
|
sed -i -e 's,##HANDLEPOWERKEY##,${LOGIND_HANDLE_POWER_KEY},g' \
|
||||||
|
-e 's,##HANDLEPOWERKEYLONGPRESS##,${LOGIND_HANDLE_POWER_KEY_LONGPRESS},g' ${D}${systemd_unitdir}/logind.conf.d/01-${PN}.conf
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue