mmc: Add mount services

The iterm updater relies on the versions being mounted in the
MEDIA_DIR in order to create the D-Bus objects when the BMC
first starts up.

Create two services: one to mount the emmc rootfs partitions
so that the version D-Bus objects get created, and another one
to unmount them after the item updater has run because there's
no need to keep the mounts around, actually they shouldn't be
mounted during a code update. The UBI layout does an unmount
at the start of an update, but it's less risky to just unmount
once the mount is no longer needed in case the update is done
manually by starting the update service file or directly
calling obmc-flash-bmc.

These services get started automatically by adding a dependency
to the item updater service:
"WantedBy=xyz.openbmc_project.Software.BMC.Updater.service"
The mount has a "Before" directive and the unmount has an "After"
directive. This allows the item updater to have the mounts
available for processing and they are unmounted once the processing
is complete.

Also add a dash "-" to ExecStart to ignore errors:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=
This is needed since the non-running filesystem may had been
invalidated during a Delete operation. This directive still logs
an error but does not put the service file in Failed state: Ex:

Jul 11 16:36:07 rainier systemd[1]: Starting Mount BMC rofs volumes after a reboot...
Jul 11 16:36:07 rainier sh[423]: mount: /media/rofs-b: wrong fs type, bad option, bad superblock on /dev/mmcblk0p5, missing codepage or helper program, or other
 error.
Jul 11 16:36:07 rainier systemd[1]: obmc-flash-mmc-mount.service: Succeeded.
Jul 11 16:36:07 rainier systemd[1]: Finished Mount BMC rofs volumes after a reboot.
Jul 11 16:36:07 rainier systemd[1]: Started OpenBMC Software Update Manager.
Jul 11 16:36:07 rainier systemd[1]: Starting Unmount BMC rofs volumes...
Jul 11 16:36:08 rainier umount[427]: umount: /media/rofs-b: no mount point specified.
Jul 11 16:36:08 rainier systemd[1]: obmc-flash-mmc-umount.service: Succeeded.
Jul 11 16:36:08 rainier systemd[1]: Finished Unmount BMC rofs volumes.

Tested: Verified the D-Bus version objects are created after
BMC reboot, and the item updater service starts successfully
after a Delete operation.

Change-Id: Ic0c83391a2879b8508bf5aa9f18941590d96352d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
3 files changed