noverify-bmc-update: Only commit payload on update

We don't want to allow indirect updates via users issuing `mc reboot
cold` commands after verifying but without peforming the update step.

Change-Id: I42eadfbe41949d15c1ed5475d96d5c2a630a2fa0
Signed-off-by: William A. Kennington III <wak@google.com>
Fixed misspelling of command
Signed-off-by: Brad Bishop<bradleyb@fuzziesquirrel.com>
diff --git a/recipes-phosphor/flash/noverify-bmc-update/config-bmc.json b/recipes-phosphor/flash/noverify-bmc-update/config-bmc.json
index 86afb3b..31df4a1 100644
--- a/recipes-phosphor/flash/noverify-bmc-update/config-bmc.json
+++ b/recipes-phosphor/flash/noverify-bmc-update/config-bmc.json
@@ -14,7 +14,7 @@
 		},
 		"update": {
 			"type": "systemd",
-			"unit": "reboot.target"
+			"unit": "noverify-bmc-update.service"
 		}
 	}
 }]
diff --git a/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-update.service b/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-update.service
new file mode 100644
index 0000000..e30d647
--- /dev/null
+++ b/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-update.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Commit image for update and reboot
+
+[Service]
+Type=oneshot
+ExecStart=/bin/mv /run/initramfs/bmc-image-verified /run/initramfs/image-bmc
+# This command is intentionally blocking to ensure this unit doesn't complete
+# before the BMC reboots.
+ExecStart=/usr/bin/systemctl start --job-mode=replace-irreversibly reboot.target
diff --git a/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-verify.service b/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-verify.service
index 50855b6..a535329 100644
--- a/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-verify.service
+++ b/recipes-phosphor/flash/noverify-bmc-update/noverify-bmc-verify.service
@@ -3,4 +3,4 @@
 
 [Service]
 Type=oneshot
-ExecStart=/bin/mv /run/initramfs/bmc-image /run/initramfs/image-bmc
+ExecStart=/bin/mv /run/initramfs/bmc-image /run/initramfs/bmc-image-verified