meta-fii/meta-kudo: Organize executables to follow anti-patterns.md
According to
https://github.com/openbmc/docs/blob/master/anti-patterns.md,
/usr/sbin is reserved for system administration executables. The
executables called by services or internal use are placed in
/usr/libexec/<package>.
Executables kept in /usr/sbin,
- kudo.sh
- kudo-ras.sh
- kudo-fw.sh
Executables moved to /usr/libexec,
- ampere-hostctrl/ampere_power_util.sh
- kudo-fw/kudo-fw-ver.sh
- kudo-fw/kudo-lib.sh
- kudo-boot/init_once.sh
- usb-network/usb_network.sh
- obmc-console/kudo_uart_mux_ctrl.sh
- pwm-init/pwm_init.sh
- phosphor-virtual-sensor/tla2024-enable.sh
Also removed /usr/bin/env from service files.
Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com>
Change-Id: I270eee5cb9c0ca248f1b84a87d1cff5c6dc129f3
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl.bb b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl.bb
index 5e41d6b..cc5bf78 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl.bb
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl.bb
@@ -68,6 +68,6 @@
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
do_install() {
- install -d ${D}/usr/sbin
- install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
+ install -d ${D}${libexecdir}/${PN}
+ install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}${libexecdir}/${PN}/ampere_power_util.sh
}
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-powercycle.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-powercycle.service
index c55fcd3..fb5fff9 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-powercycle.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-powercycle.service
@@ -4,5 +4,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb hotswap
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb hotswap
SyslogIdentifier=ampere_power_util.sh
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweroff.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweroff.service
index c3a4dce..3040747 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweroff.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweroff.service
@@ -7,6 +7,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb off
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb off
SyslogIdentifier=ampere_power_util.sh
-
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweron.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweron.service
index 1ab4922..95561ce 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweron.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweron.service
@@ -5,6 +5,5 @@
[Service]
RemainAfterExit=yes
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb on
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb on
SyslogIdentifier=ampere_power_util.sh
-
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-power-cycle.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-power-cycle.service
index b020aa3..87c4371 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-power-cycle.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-power-cycle.service
@@ -8,6 +8,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb host_cycle
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb host_cycle
SyslogIdentifier=ampere_power_util.sh
-
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-reset.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-reset.service
index 830fb44..c3ae7b9 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-reset.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-reset.service
@@ -8,5 +8,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb host_reset
-SyslogIdentifier=ampere_power_util.sh
\ No newline at end of file
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb host_reset
+SyslogIdentifier=ampere_power_util.sh
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown-ack.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown-ack.service
index fe05915..eb3eb4c 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown-ack.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown-ack.service
@@ -7,6 +7,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb shutdown_ack
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb shutdown_ack
SyslogIdentifier=ampere_power_util.sh
-
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown.service b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown.service
index b7a458e..5fec8fa 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown.service
+++ b/meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown.service
@@ -6,6 +6,5 @@
[Service]
RemainAfterExit=no
Type=oneshot
-ExecStart=/usr/bin/env ampere_power_util.sh mb graceful_shutdown
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb graceful_shutdown
SyslogIdentifier=ampere_power_util.sh
-
diff --git a/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh b/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
index d9bcb0c..8779513 100644
--- a/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-source /usr/sbin/kudo-lib.sh
+source /usr/libexec/kudo-fw/kudo-lib.sh
# Usage of this utility
function usage() {