diff options
author | Kyle Nieman <kyle.nieman@fii-na.com> | 2023-10-16 21:44:14 +0300 |
---|---|---|
committer | Kyle Nieman <kyle.nieman@fii-na.com> | 2024-01-06 01:52:32 +0300 |
commit | 86347becd852967e550b3f427eebe80ec3ac7618 (patch) | |
tree | 75b3647a741b0862faa888d6c82c5123fdab4de3 /meta-fii | |
parent | 15f018161f68a422bf9f8ed6dcc75db675dae626 (diff) | |
download | openbmc-86347becd852967e550b3f427eebe80ec3ac7618.tar.xz |
meta-fii: meta-mori: Launch apps by correct path to avoid anti-pattern
As specified by OpenBMC anti-pattern document, calls to a binary/script
should be the fully qualified path to the application being launched.
https://github.com/openbmc/docs/blob/717d273cf8bceac3868a278aeb34d19e8d74c1b3/anti-patterns.md#resolution-4
This follows the systemd recommendation to use the full
path to avoid ambiguity.
https://www.freedesktop.org/software/systemd/man/systemd.service.html#:~:text=Using%20an%20absolute%20path%20is%20recommended%20to%20avoid%20ambiguity
In addition, OpenBMC applications that are intended to be used by users
should be located in /usr/bin.
Changes:
Place user scripts in /usr/bin instead of /usr/sbin. Start scripts by
their absolute path in service files.
Testing:
The services that are modified can find and start their scripts. The
scripts that had their locations modified can be called by the user
without providing their full path.
Change-Id: Ibe7fbb1644aa1b0df0f296ea1f1a8ceaf444fe35
Signed-off-by: Kyle Nieman <kyle.nieman@fii-na.com>
Diffstat (limited to 'meta-fii')
5 files changed, 7 insertions, 7 deletions
diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-bios-update/phosphor-ipmi-flash-bios-update.service b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-bios-update/phosphor-ipmi-flash-bios-update.service index bf819a3e8e..6f75c28543 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-bios-update/phosphor-ipmi-flash-bios-update.service +++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-bios-update/phosphor-ipmi-flash-bios-update.service @@ -2,5 +2,5 @@ Description=Phosphor-ipmi-flash update BIOS firmware service [Service] -ExecStart=mori-fw.sh bios /run/initramfs/bios-image +ExecStart=/usr/bin/mori-fw.sh bios /run/initramfs/bios-image Type=oneshot diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-bmccpld-update.service b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-bmccpld-update.service index 2ed0e2f500..0e03f6fcdc 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-bmccpld-update.service +++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-bmccpld-update.service @@ -2,7 +2,7 @@ Description=Phosphor-ipmi-flash update BMC CPLD firmware service [Service] -ExecStart=mori-fw.sh bmccpld /run/initramfs/bmc-cpld.svf +ExecStart=/usr/bin/mori-fw.sh bmccpld /run/initramfs/bmc-cpld.svf Type=oneshot [Install] diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-mbcpld-update.service b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-mbcpld-update.service index 0036606438..20f6c51d68 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-mbcpld-update.service +++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-cpld-update/phosphor-ipmi-flash-mbcpld-update.service @@ -2,7 +2,7 @@ Description=Phosphor-ipmi-flash update MB CPLD firmware service [Service] -ExecStart=mori-fw.sh mbcpld /run/initramfs/mb-cpld.svf +ExecStart=/usr/bin/mori-fw.sh mbcpld /run/initramfs/mb-cpld.svf Type=oneshot [Install] diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw.bb b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw.bb index 71c69b0b2c..4121135373 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw.bb +++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw.bb @@ -17,9 +17,9 @@ SYSTEMD_SERVICE:${PN} = "mori-fw-ver.service" inherit systemd obmc-phosphor-systemd do_install () { - install -d ${D}${sbindir} + install -d ${D}${bindir} install -d ${D}${libexecdir}/${PN} - install -m 0755 ${WORKDIR}/mori-fw.sh ${D}${sbindir}/mori-fw.sh + install -m 0755 ${WORKDIR}/mori-fw.sh ${D}${bindir}/mori-fw.sh install -m 0755 ${WORKDIR}/mori-fw-ver.sh \ ${D}${libexecdir}/${PN}/mori-fw-ver.sh install -m 0755 ${WORKDIR}/mori-lib.sh ${D}${libexecdir}/${PN}/mori-lib.sh diff --git a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd.bb b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd.bb index 3fb90a20df..a664d78cf9 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd.bb +++ b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd.bb @@ -7,8 +7,8 @@ PR = "r1" SRC_URI = "file://mori.sh" do_install () { - install -d ${D}${sbindir} - install -m 0755 ${WORKDIR}/mori.sh ${D}${sbindir}/mori.sh + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/mori.sh ${D}${bindir}/mori.sh } RDEPENDS:${PN}:append = " bash" |