openpower-pnor: build a PNOR squashfs as consumed by OpenBMC

Recently, OpenBMC has started supporting a firmware update mechanism
that requires a specially formatted tarball to be passed to it.

Since we want op-build to produce images that are easily consumable,
this patch makes the openpower-pnor build produce one of these images.

There is currently no documentation of this format, although the code
that produces it from a PNOR is open source.

Signed-off-by: Charles P. Hofer <charles.hofer@ibm.com>
[stewart@linux.vnet.ibm.com: flattened commit history, rewrote commit message]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
diff --git a/openpower/package/libflash/libflash.mk b/openpower/package/libflash/libflash.mk
index d47edf7..a409b46 100644
--- a/openpower/package/libflash/libflash.mk
+++ b/openpower/package/libflash/libflash.mk
@@ -5,8 +5,8 @@
 ################################################################################
 
 LIBFLASH_VERSION = v5.7-76-g830fc9a0ed0a
-
 LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
+
 LIBFLASH_INSTALL_STAGING = YES
 LIBFLASH_INSTALL_TARGET = YES
 
@@ -29,6 +29,10 @@
 		       -C $(@D)/external/pflash)
 endef
 
+define HOST_LIBFLASH_BUILD_CMDS
+    $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/external/pflash
+endef
+
 define LIBFLASH_INSTALL_STAGING_CMDS
 	PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
 	       install
@@ -42,4 +46,9 @@
 		       -C $(@D)/external/pflash install)
 endef
 
+define HOST_LIBFLASH_INSTALL_CMDS
+    $(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))