gpio-shutdown.bb 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. SUMMARY = "GPIO shutdown bindings for SysV init"
  2. LICENSE = "GPL-2.0-only"
  3. LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
  4. SRC_URI = "file://bind_gpio_shutdown.tab \
  5. file://gpio-shutdown-keymap.sh \
  6. "
  7. inherit update-rc.d
  8. INITSCRIPT_NAME = "gpio-shutdown-keymap.sh"
  9. # Run only once during startup
  10. INITSCRIPT_PARAMS = "start 99 S ."
  11. do_install() {
  12. # The files are only needed if using SysV init.
  13. if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
  14. install -d ${D}${sysconfdir} \
  15. ${D}${sysconfdir}/inittab.d \
  16. ${D}${sysconfdir}/init.d
  17. install -m 0755 ${UNPACKDIR}/gpio-shutdown-keymap.sh ${D}${sysconfdir}/init.d/
  18. install -m 0755 ${UNPACKDIR}/bind_gpio_shutdown.tab ${D}${sysconfdir}/inittab.d/
  19. elif ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  20. # Systemd init does not require any configuration.
  21. # Note: cannot have an empty branch, hence the redundant dir install.
  22. install -d ${D}${sysconfdir}
  23. else
  24. bbwarn "Not using sysvinit or systemd. The gpio-shutdown may require additional configuration."
  25. fi
  26. }