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() {
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-bios-update/phosphor-ipmi-flash-bios-update.service b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-bios-update/phosphor-ipmi-flash-bios-update.service
index 1702153..cc5f4aa 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-bios-update/phosphor-ipmi-flash-bios-update.service
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-bios-update/phosphor-ipmi-flash-bios-update.service
@@ -3,4 +3,4 @@
[Service]
ExecStart=/usr/sbin/kudo-fw.sh bios /run/initramfs/bios-image
-Type=oneshot
\ No newline at end of file
+Type=oneshot
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw.bb b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw.bb
index 28d276f..9b5d32d 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw.bb
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw.bb
@@ -27,10 +27,11 @@
"
do_install () {
- install -d ${D}/${sbindir}
- install -m 0755 ${WORKDIR}/kudo-fw.sh ${D}/${sbindir}/kudo-fw.sh
- install -m 0755 ${WORKDIR}/kudo-fw-ver.sh ${D}/${sbindir}/kudo-fw-ver.sh
- install -m 0755 ${WORKDIR}/kudo-lib.sh ${D}/${sbindir}/kudo-lib.sh
+ install -d ${D}${sbindir}
+ install -d ${D}${libexecdir}/${PN}
+ install -m 0755 ${WORKDIR}/kudo-fw.sh ${D}${sbindir}/kudo-fw.sh
+ install -m 0755 ${WORKDIR}/kudo-fw-ver.sh ${D}${libexecdir}/${PN}/kudo-fw-ver.sh
+ install -m 0755 ${WORKDIR}/kudo-lib.sh ${D}${libexecdir}/${PN}/kudo-lib.sh
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/kudo-fw-ver.service ${D}${systemd_system_unitdir}
}
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.service b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.service
index 24e21d2..a49dcb4 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.service
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.service
@@ -4,7 +4,7 @@
[Service]
RemainAfterExit=yes
Type=oneshot
-ExecStart=/usr/sbin/kudo-fw-ver.sh
+ExecStart=/usr/libexec/kudo-fw/kudo-fw-ver.sh
[Install]
WantedBy=multi-user.target
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
index bb35b29..0f8868f 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
@@ -2,7 +2,7 @@
devpath="/sys/bus/i2c/devices/13-0077/driver"
-source /usr/sbin/kudo-lib.sh
+source /usr/libexec/kudo-fw/kudo-lib.sh
function fwbios() {
KERNEL_FIU_ID="c0000000.spi"
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot.bb b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot.bb
index c800f26..57ddc66 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot.bb
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot.bb
@@ -23,8 +23,8 @@
"
do_install () {
- install -d ${D}${sbindir}
- install -m 0755 ${WORKDIR}/init_once.sh ${D}${sbindir}/
+ install -d ${D}${libexecdir}/${PN}
+ install -m 0755 ${WORKDIR}/init_once.sh ${D}${libexecdir}/${PN}/init_once.sh
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/host-powerctrl.service ${D}${systemd_unitdir}/system
}
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/host-powerctrl.service b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/host-powerctrl.service
index 8a8d46f..072cf8f 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/host-powerctrl.service
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/host-powerctrl.service
@@ -9,7 +9,7 @@
Restart=no
RemainAfterExit=true
Type=oneshot
-ExecStart=/usr/sbin/init_once.sh
+ExecStart=/usr/libexec/kudo-boot/init_once.sh
StandardOutput=syslog
[Install]
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh
index 7f1c39d..ea13b17 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-source /usr/sbin/kudo-lib.sh
+source /usr/libexec/kudo-fw/kudo-lib.sh
function set_mux_default(){
# set all mux route to CPU before power on host
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd.bb b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd.bb
index 324bd64..617e71c 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd.bb
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd.bb
@@ -15,7 +15,7 @@
SYSTEMD_PACKAGES = "${PN}"
do_install () {
- install -d ${D}/${sbindir}
- install -m 0755 ${WORKDIR}/kudo.sh ${D}/${sbindir}/kudo.sh
- install -m 0755 ${WORKDIR}/kudo-ras.sh ${D}/${sbindir}/kudo-ras.sh
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/kudo.sh ${D}${sbindir}/kudo.sh
+ install -m 0755 ${WORKDIR}/kudo-ras.sh ${D}${sbindir}/kudo-ras.sh
}
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
index 3a528ab..b8e7824 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# help information
-source /usr/sbin/kudo-lib.sh
+source /usr/libexec/kudo-fw/kudo-lib.sh
function usage_rst() {
echo " kudo rst [parameter]"
diff --git a/meta-fii/meta-kudo/recipes-kudo/network/usb-network.bb b/meta-fii/meta-kudo/recipes-kudo/network/usb-network.bb
index 6e7be67..5668840 100644
--- a/meta-fii/meta-kudo/recipes-kudo/network/usb-network.bb
+++ b/meta-fii/meta-kudo/recipes-kudo/network/usb-network.bb
@@ -18,8 +18,8 @@
FILES:${PN} += "${sysconfdir_native}/systemd/network/00-bmc-usb0.network"
do_install() {
- install -d ${D}/${sbindir}
- install -m 0755 ${WORKDIR}/usb_network.sh ${D}/${sbindir}
+ install -d ${D}${libexecdir}/${PN}
+ install -m 0755 ${WORKDIR}/usb_network.sh ${D}${libexecdir}/${PN}/usb_network.sh
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/usb_network.service ${D}${systemd_unitdir}/system
diff --git a/meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.service b/meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.service
index 81a4e42..d5115fe 100644
--- a/meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.service
+++ b/meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.service
@@ -4,7 +4,7 @@
[Service]
Type=oneshot
-ExecStart=/bin/bash -c '/usr/sbin/usb_network.sh'
+ExecStart=/bin/bash -c '/usr/libexec/usb-network/usb_network.sh'
[Install]
WantedBy=multi-user.target