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/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service
index f925cdf..de0aff1 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service
+++ b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service
@@ -6,6 +6,7 @@
# Adding 5 seconds to allow OCC to collect debug data
# before processing checkstop
ExecStart={base_bindir}/sleep 5
-ExecStart={sbindir}/checkstop_app
+ExecStart=/usr/bin/env checkstop_app
+SyslogIdentifier=checkstop_app
Type=oneshot
Restart=no
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service
index 0bb2221..6fc3fec 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service
+++ b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service
@@ -3,6 +3,7 @@
Before=obmc-host-quiesce@%i.target
[Service]
-ExecStart={sbindir}/watchdog_timeout
+ExecStart=/usr/bin/env watchdog_timeout
+SyslogIdentifier=watchdog_timeout
Type=oneshot
Restart=no
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-squashfsmount@.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-squashfsmount@.service
index 9109532..96c1eb6 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-squashfsmount@.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-squashfsmount@.service
@@ -6,4 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios squashfsmount pnor-ro-%i %i
+ExecStart=/usr/bin/env obmc-flash-bios squashfsmount pnor-ro-%i %i
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service
index bae633d..d0785c9 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service
@@ -4,4 +4,5 @@
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart={sbindir}/obmc-flash-bios ubiattach
+ExecStart=/usr/bin/env obmc-flash-bios ubiattach
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service
index ee63282..b4bd2d7 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service
@@ -6,5 +6,6 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubimount pnor-rw-%i
-ExecStart={sbindir}/obmc-flash-bios ubimount pnor-prsv
+ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-rw-%i
+ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-prsv
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service
index c280193..8afc327 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service
@@ -6,4 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubimount pnor-patch
+ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-patch
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service
index 0b5a077..f52cac6 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service
@@ -6,7 +6,8 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubiremount
+ExecStart=/usr/bin/env obmc-flash-bios ubiremount
+SyslogIdentifier=obmc-flash-bios
[Install]
WantedBy=multi-user.target
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-prsv.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-prsv.service
index 463714c..1c3939e 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-prsv.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-prsv.service
@@ -6,4 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubiumount pnor-prsv
+ExecStart=/usr/bin/env obmc-flash-bios ubiumount pnor-prsv
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service
index acf1931..c6dc553 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service
@@ -6,4 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubiumount pnor-ro-%i
+ExecStart=/usr/bin/env obmc-flash-bios ubiumount pnor-ro-%i
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service
index 84fd523..c0ea8e6 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service
@@ -6,4 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios ubiumount pnor-rw-%i
+ExecStart=/usr/bin/env obmc-flash-bios ubiumount pnor-rw-%i
+SyslogIdentifier=obmc-flash-bios
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service
index c0a2bbb..49e495e 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service
@@ -6,7 +6,8 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart={sbindir}/obmc-flash-bios updatesymlinks
+ExecStart=/usr/bin/env obmc-flash-bios updatesymlinks
+SyslogIdentifier=obmc-flash-bios
[Install]
WantedBy=mboxd.service mboxd-reload@.service
diff --git a/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service b/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service
index 13bc5b7..d7ccaae 100644
--- a/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service
+++ b/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service
@@ -7,7 +7,8 @@
Before=obmc-flash-bios-ubipatch.service
[Service]
-ExecStart={sbindir}/openpower-update-manager
+ExecStart=/usr/bin/env openpower-update-manager
+SyslogIdentifier=openpower-update-manager
Restart=always
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/host/op-host-control/cfam_override@.service b/common/recipes-phosphor/host/op-host-control/cfam_override@.service
index 4433fd0..221bceb 100644
--- a/common/recipes-phosphor/host/op-host-control/cfam_override@.service
+++ b/common/recipes-phosphor/host/op-host-control/cfam_override@.service
@@ -11,7 +11,8 @@
ConditionPathExists=/var/lib/obmc/cfam_overrides
[Service]
-ExecStart={sbindir}/openpower-proc-control CFAMOverride
+ExecStart=/usr/bin/env openpower-proc-control CFAMOverride
+SyslogIdentifier=openpower-proc-control
Type=oneshot
RemainAfterExit=yes
diff --git a/common/recipes-phosphor/host/op-host-control/start_host@.service b/common/recipes-phosphor/host/op-host-control/start_host@.service
index af26186..77a88e8 100644
--- a/common/recipes-phosphor/host/op-host-control/start_host@.service
+++ b/common/recipes-phosphor/host/op-host-control/start_host@.service
@@ -10,7 +10,8 @@
ConditionPathExists=!/run/openbmc/host@%i-on
[Service]
-ExecStart={sbindir}/openpower-proc-control startHost
+ExecStart=/usr/bin/env openpower-proc-control startHost
+SyslogIdentifier=openpower-proc-control
Type=oneshot
RemainAfterExit=yes
diff --git a/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service b/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
index acad945..d7d9f12 100644
--- a/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
+++ b/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
@@ -10,7 +10,8 @@
ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
-ExecStart={sbindir}/openpower-proc-control vcsWorkaround
+ExecStart=/usr/bin/env openpower-proc-control vcsWorkaround
+SyslogIdentifier=openpower-proc-control
Type=oneshot
RemainAfterExit=yes
diff --git a/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service b/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service
index 2da73e3..022f6e7 100644
--- a/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service
+++ b/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service
@@ -8,7 +8,8 @@
Restart=no
Type=oneshot
RemainAfterExit=yes
-ExecStart={sbindir}/inventory_upload.py
+ExecStart=/usr/bin/env inventory_upload.py
+SyslogIdentifier=inventory_upload.py
Environment="PYTHONUNBUFFERED=1"
[Install]
diff --git a/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service b/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service
index 3b19c2b..f89d0f0 100644
--- a/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service
+++ b/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service
@@ -3,7 +3,8 @@
Before=obmc-host-stop-pre@%i.target
[Service]
-ExecStart={bindir}/occ-active.sh disable
+ExecStart=/usr/bin/env occ-active.sh disable
+SyslogIdentifier=occ-active.sh
Type=oneshot
[Install]
diff --git a/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service b/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service
index dbf34d5..a63e186 100644
--- a/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service
+++ b/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service
@@ -4,7 +4,8 @@
After=mapper-wait@-xyz-openbmc_project-inventory.service
[Service]
-ExecStart={sbindir}/openpower-occ-control
+ExecStart=/usr/bin/env openpower-occ-control
+SyslogIdentifier=openpower-occ-control
Restart=always
Type=dbus
BusName={BUSNAME}
diff --git a/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service b/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service
index 32d6a82..6eadebf 100644
--- a/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service
+++ b/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service
@@ -8,4 +8,5 @@
Restart=no
Type=oneshot
EnvironmentFile={envfiledir}/obmc/inventory
-ExecStart={sbindir}/openpower-read-vpd --vpd $EEPROM --fru $FRUS --object $PATHS
+ExecStart=/usr/bin/env openpower-read-vpd --vpd $EEPROM --fru $FRUS --object $PATHS
+SyslogIdentifier=openpower-read-vpd