openpower-software-manager: Move squashfsmount.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: I4396bcd9fcfd253eeaa3a5ce00621d97386ff399
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
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 5cca347..9109532 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,9 +6,4 @@
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart=/bin/sh -c '{sbindir}/ubimkvol /dev/ubi0 -N pnor-ro-%i -s 32MiB --type=static; \
- mkdir /media/pnor-ro-%i; \
- volumeid%i=`ubinfo -d 0 -N pnor-ro-%i | grep "Volume ID" | sed -e "s|Volume ID:||" -e "s/^ *//" | grep -o "^\S*"`; \
- ubiblock --create /dev/ubi0_$volumeid%i; \
- ubiupdatevol /dev/ubi0_$volumeid%i /tmp/images/%i/pnor.xz.squashfs; \
- mount -t squashfs -o ro /dev/ubiblock0_$volumeid%i /media/pnor-ro-%i'
+ExecStart={sbindir}/obmc-flash-bios squashfsmount pnor-ro-%i %i