summaryrefslogtreecommitdiff
path: root/meta-fii/meta-kudo/recipes-kudo
diff options
context:
space:
mode:
authorCharles Boyer <Charles.Boyer@fii-usa.com>2021-11-25 00:58:03 +0300
committerCharles Boyer <Charles.Boyer@fii-usa.com>2022-01-18 19:39:26 +0300
commit2adad365773fb2018fb65d5dbbd2ab5b9c68d97d (patch)
tree378a25c014f0f1cfcdcb3a32f70e6baffb708937 /meta-fii/meta-kudo/recipes-kudo
parenta4c5b7f99891bd08d5c11b88f7abbc57b2ab8ea6 (diff)
downloadopenbmc-2adad365773fb2018fb65d5dbbd2ab5b9c68d97d.tar.xz
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
Diffstat (limited to 'meta-fii/meta-kudo/recipes-kudo')
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl.bb4
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-powercycle.service2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweroff.service3
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-chassis-poweron.service3
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-power-cycle.service3
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-reset.service4
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown-ack.service3
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/ampere-hostctrl/ampere-host-shutdown.service3
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-bios-update/phosphor-ipmi-flash-bios-update.service2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw.bb9
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.service2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot.bb4
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/host-powerctrl.service2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-boot/init_once.sh2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd.bb6
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-sys-utility/kudo-cmd/kudo.sh2
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/network/usb-network.bb4
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/network/usb-network/usb_network.service2
20 files changed, 30 insertions, 34 deletions
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 5e41d6b9e3..cc5bf78821 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 @@ FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
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 c55fcd3db3..fb5fff94a2 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 @@ Description=Ampere Computing LLC Power OFF Chassis
[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 c3a4dce375..30407471fe 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 @@ Conflicts=obmc-chassis-poweron@0.target
[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 1ab492202e..95561cef3a 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 @@ Conflicts=obmc-chassis-poweroff@0.target
[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 b020aa3f29..87c437179d 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 @@ After=kudo-bios-verify.service
[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 830fb44975..c3ae7b9ab5 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 @@ After=kudo-bios-verify.service
[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 fe05915ac4..eb3eb4ca81 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 @@ Conflicts=obmc-chassis-poweron@0.target
[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 b7a458eded..5fec8fa784 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 @@ OnFailure=obmc-chassis-poweroff@0.target
[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 d9bcb0cf27..877951313c 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 1702153d7b..cc5f4aad88 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 @@ Description=Phosphor-ipmi-flash update BIOS firmware service
[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 28d276f966..9b5d32d4b2 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 @@ SYSTEMD_SERVICE:${PN} = " \
"
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 24e21d2367..a49dcb44fc 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 @@ Description=Firmware Version Daemon
[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 bb35b29be8..0f8868f073 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 c800f266e6..57ddc666b8 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 @@ SYSTEMD_SERVICE:${PN} = " \
"
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 8a8d46f14e..072cf8fa9f 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 @@ After=kudo-bios-verify.service
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 7f1c39d28e..ea13b17e00 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 324bd640c5..617e71ce0f 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 @@ SRC_URI = " \
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 3a528abb4d..b8e7824380 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 6e7be67c2c..5668840d29 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 @@ SYSTEMD_SERVICE:${PN}:append = " usb_network.service"
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 81a4e42442..d5115fe6d6 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 @@ After=phosphor-ipmi-host.service
[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