openpower-software-manager: Move ubimount.service logic to script
The service files that manage the pnor ubi volumes and mount points are
starting to get too much logic in them. Move the logic to a shell script.
Change-Id: I57d6ff7ffb32d24704ceec77afd1d07622bc6de8
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
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 a2147ea..ee63282 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,18 +6,5 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart=/bin/sh -c 'rw=pnor-rw-%i; \
- if [ ! -d "/media/$rw" ]; then \
- mkdir /media/$rw; fi; \
- if [ ! -d "/media/pnor-prsv" ]; then \
- mkdir /media/pnor-prsv; fi; \
- rw_ubi=`ubinfo -d 0 -a | grep $rw`; \
- if [ -z "$rw_ubi" ]; then \
- {sbindir}/ubimkvol /dev/ubi0 -N $rw -s 1MiB; fi; \
- prsv_ubi=`ubinfo -d 0 -a | grep pnor-prsv`; \
- if [ -z "$prsv_ubi" ]; then \
- {sbindir}/ubimkvol /dev/ubi0 -N pnor-prsv -s 1MiB; fi; \
- if ! grep -q $rw /proc/mounts; then \
- mount -t ubifs ubi0:$rw /media/$rw; fi; \
- if ! grep -q pnor-prsv /proc/mounts; then \
- mount -t ubifs ubi0:pnor-prsv /media/pnor-prsv; fi;'
+ExecStart={sbindir}/obmc-flash-bios ubimount pnor-rw-%i
+ExecStart={sbindir}/obmc-flash-bios ubimount pnor-prsv