s4: gpowerd: Gate gpowerd.service via /var/google/gPowerD/enable-gpowerd.flag

On gBMC :prod and server-3-0 images, clean-rwfs clears
/etc/systemd/system on every boot because it is not in the RWFS
whitelist, wiping the symlink created by systemctl enable
gpowerd.service. In contrast, /var/google/gPowerD is preserved across
BMC reboots.

Keep gpowerd.service enabled by default in the base gBMC image (removing
SYSTEMD_AUTO_ENABLE = "disable" from gpowerd_git.bb) and add an
ExecCondition checking for /var/google/gPowerD/enable-gpowerd.flag so
that gpowerd only starts when the gpowerd-enable MSV package has staged
the flag file.

Tested: fusion2/3b776b05-380a-341e-b406-21b089bb8999 + verified that gpowerd enable persists across rwfs clean.
Google-Bug-Id: 570897926
Change-Id: I269f141e9aa5209feba4949cc27e78fd495ed518
Signed-off-by: Shounak Mitra <shounak@google.com>
1 file changed