image_version: Add missing os-release dependency

Any recipe inheriting image_version must have a dependency
on os-release to ensure the sysroot is populated before
attempting to get the version out of it.

Also read the version out of the target sysroot rather than the
host sysroot.  os-release does not have a native variant.

Tested: Built image and verified in witherspoon qemu
Change-Id: I8d79280a75577eff48314f0f57c0015e1d6738ef
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/classes/image_version.bbclass b/meta-phosphor/classes/image_version.bbclass
index f9abb5f..a4b4c3d 100644
--- a/meta-phosphor/classes/image_version.bbclass
+++ b/meta-phosphor/classes/image_version.bbclass
@@ -1,9 +1,11 @@
 # Base image version class extension
 
+DEPENDS_append = " os-release"
+
 def do_get_version(d):
     import configparser
     import io
-    path = d.getVar('STAGING_DIR_HOST', True) + d.getVar('sysconfdir', True)
+    path = d.getVar('STAGING_DIR_TARGET', True) + d.getVar('sysconfdir', True)
     path = os.path.join(path, 'os-release')
     parser = configparser.SafeConfigParser(strict=False)
     parser.optionxform = str