Enable BMC patching from the /usr/local path
This commit enables patches from the /usr/local path by replacing
absolute paths to /usr/sbin or /usr/bin in every service file with
"/usr/bin/env ". Additionally, SyslogIdentifier is added to each
file to ensure that journal entries are still distinct.
In two cases, service files also had to change due to references
to ${{PATH}}, which doesn't work with /usr/bin/env. These
references - and the corresponding definitions - were changed to
${{DEVPATH}}.
Resolves openbmc/openbmc#2149
Change-Id: I12c5c6e5101eef6820b985a563313836250ff2c7
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service
index 5c0650b..c26273f 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service
@@ -4,4 +4,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubisetenv %i
+ExecStart=/usr/bin/env obmc-flash-bmc ubisetenv %i
+SyslogIdentifier=obmc-flash-bmc
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service
index 36b5551..ff571d7 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service
@@ -6,7 +6,8 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubiremount
+ExecStart=/usr/bin/env obmc-flash-bmc ubiremount
+SyslogIdentifier=obmc-flash-bmc
[Install]
WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service
index 7897513..42aa026 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service
@@ -4,5 +4,6 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubiremove rofs-%i
-ExecStart={sbindir}/obmc-flash-bmc ubiremove kernel-%i
+ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rofs-%i
+ExecStart=/usr/bin/env obmc-flash-bmc ubiremove kernel-%i
+SyslogIdentifier=obmc-flash-bmc
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
index 2d7b703..3e4c15d 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
@@ -4,5 +4,6 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubiro {RO_MTD} rofs-%i %i
-ExecStart={sbindir}/obmc-flash-bmc ubikernel {KERNEL_MTD} kernel-%i %i
+ExecStart=/usr/bin/env obmc-flash-bmc ubiro {RO_MTD} rofs-%i %i
+ExecStart=/usr/bin/env obmc-flash-bmc ubikernel {KERNEL_MTD} kernel-%i %i
+SyslogIdentifier=obmc-flash-bmc
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service
index c57040e..68c4ab2 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service
@@ -4,4 +4,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubiremove rwfs
+ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rwfs
+SyslogIdentifier=obmc-flash-bmc
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service
index 07820fb..4a955f2 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service
@@ -4,4 +4,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bmc ubirw {RW_MTD} rwfs
+ExecStart=/usr/bin/env obmc-flash-bmc ubirw {RW_MTD} rwfs
+SyslogIdentifier=obmc-flash-bmc
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service
index e43b005..ff96e8c 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service
@@ -4,7 +4,8 @@
Before=xyz.openbmc_project.Software.Version.service
[Service]
-ExecStart={sbindir}/phosphor-image-updater
+ExecStart=/usr/bin/env phosphor-image-updater
+SyslogIdentifier=phosphor-image-updater
Restart=always
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service
index b0ee4ba..a4934f8 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service
@@ -2,7 +2,8 @@
Description=Phosphor Download Manager
[Service]
-ExecStart={sbindir}/phosphor-download-manager
+ExecStart=/usr/bin/env phosphor-download-manager
+SyslogIdentifier=phosphor-download-manager
Restart=always
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service
index 0825ebf..0141245 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service
@@ -3,7 +3,8 @@
[Service]
ExecStartPre=/bin/sh -c 'mkdir -p /tmp/images'
-ExecStart={sbindir}/phosphor-version-software-manager
+ExecStart=/usr/bin/env phosphor-version-software-manager
+SyslogIdentifier=phosphor-version-software-manager
Restart=always
Type=dbus
BusName={BUSNAME}