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-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
index 7b131af..ae5ad37 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
+++ b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/kudo_uart_mux_ctrl.sh
@@ -18,7 +18,7 @@
 # Usage: ampere_uartmux_ctrl.sh <CPU UART port number> <UARTx_MODE>
 #        <UARTx_MODE> of 1 sets CPU To BSP
 #        <UARTx_MODE> of 2 sets SCP1 to SI2 
-source /usr/sbin/kudo-lib.sh
+source /usr/libexec/kudo-fw/kudo-lib.sh
 
 if [ $# -lt 1 ]; then
   exit 1
@@ -39,4 +39,3 @@
     echo "Invalid tty passed to $0. Exiting!" > /dev/ttyS0
     ;;
 esac
-
diff --git a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/obmc-console@.service
index 695eec3..3b6959e 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/obmc-console@.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console/obmc-console@.service
@@ -6,7 +6,7 @@
 StartLimitIntervalSec=300
 
 [Service]
-ExecStartPre=/usr/sbin/kudo_uart_mux_ctrl.sh %i
+ExecStartPre=/usr/libexec/obmc-console/kudo_uart_mux_ctrl.sh %i
 ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf %i
 SyslogIdentifier=obmc-console-server
 Restart=always
diff --git a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console_%.bbappend b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console_%.bbappend
index b08aab3..990c709 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-fii/meta-kudo/recipes-phosphor/console/obmc-console_%.bbappend
@@ -30,8 +30,8 @@
 
     # Overwrite base package's obmc-console@.service with our own
     install -m 0644 ${WORKDIR}/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
-    install -d ${D}/usr/sbin
-    install -m 0755 ${WORKDIR}/kudo_uart_mux_ctrl.sh ${D}/${sbindir}/kudo_uart_mux_ctrl.sh
+    install -d ${D}${libexecdir}/${PN}
+    install -m 0755 ${WORKDIR}/kudo_uart_mux_ctrl.sh ${D}${libexecdir}/${PN}/kudo_uart_mux_ctrl.sh
 
 }
 
@@ -39,3 +39,4 @@
     systemctl --root=$D enable obmc-console@ttyS1.service
     systemctl --root=$D enable obmc-console@ttyS3.service
 }
+
diff --git a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init.bb b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init.bb
index f4b04e6..97daab6 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init.bb
+++ b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init.bb
@@ -22,8 +22,8 @@
 FILES:${PN} += "${bindir}/* ${systemd_system_unitdir}/*"
 
 do_install:append() {
-    install -d ${D}${bindir}
-    install -m 0755 ${S}/bin/* ${D}${bindir}/
+    install -d ${D}${libexecdir}/${PN}
+    install -m 0755 ${S}/bin/* ${D}${libexecdir}/${PN}/
     install -d ${D}${systemd_system_unitdir}
     install -m 0644 ${S}/*.service ${D}${systemd_system_unitdir}
 }
diff --git a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/pwm_init.service b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/pwm_init.service
index 981b877..351d5f1 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/pwm_init.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/pwm_init.service
@@ -4,7 +4,7 @@
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/pwm_init.sh
+ExecStart=/usr/libexec/pwm-init/pwm_init.sh
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor/tla2024-enable.service b/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor/tla2024-enable.service
index 8d42594..3bdf0ef 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor/tla2024-enable.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor/tla2024-enable.service
@@ -3,7 +3,7 @@
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/tla2024-enable.sh
+ExecStart=/usr/libexec/phosphor-virtual-sensor/tla2024-enable.sh
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend b/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
index f89f5d9..17a0dfb 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
+++ b/meta-fii/meta-kudo/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
@@ -14,7 +14,9 @@
 do_install:append:kudo() {
     install -d ${D}${datadir}/${PN}
     install -m 0644 ${WORKDIR}/virtual_sensor_config.json ${D}${datadir}/${PN}/virtual_sensor_config.json
-    install -m 0755 ${WORKDIR}/tla2024-enable.sh ${D}${bindir}/tla2024-enable.sh
+
+    install -d ${D}${libexecdir}/${PN}
+    install -m 0755 ${WORKDIR}/tla2024-enable.sh ${D}${libexecdir}/${PN}/tla2024-enable.sh
 
     install -d ${D}${systemd_system_unitdir}
     install -m 0644 ${WORKDIR}/tla2024-enable.service ${D}${systemd_system_unitdir}/tla2024-enable.service
diff --git a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service
index 73aabb6..68b1fb4 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service
@@ -4,5 +4,5 @@
 [Service]
 Type=oneshot
 RemainAfterExit=no
-ExecStart=/usr/bin/env kudo.sh rst hotswap
+ExecStart=/usr/sbin/kudo.sh rst hotswap
 SyslogIdentifier=phosphor-watchdog
diff --git a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service
index 1baf4ca..33dbe4b 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service
@@ -4,5 +4,5 @@
 [Service]
 Type=oneshot
 RemainAfterExit=no
-ExecStart=/usr/bin/env ampere_power_util.sh mb off
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb off
 SyslogIdentifier=phosphor-watchdog
diff --git a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service
index b6d453f..cd7e261 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service
+++ b/meta-fii/meta-kudo/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service
@@ -4,5 +4,5 @@
 [Service]
 Type=oneshot
 RemainAfterExit=no
-ExecStart=/usr/bin/env ampere_power_util.sh mb force_reset
+ExecStart=/usr/libexec/ampere-hostctrl/ampere_power_util.sh mb force_reset
 SyslogIdentifier=phosphor-watchdog