msg: handle partition table read request

Map host's request to read the flash at offset less than the partition
table length as a request to read the pnor partition table.

Resolves openbmc/openbmc#1439.

Change-Id: I0f5b98f073d983b0d4749b0aba84b37d7f42f884
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 8c779f8..78aeffa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,8 +14,10 @@
 mboxd_CFLAGS = $(LIBSYSTEMD_CFLAGS)
 
 if VIRTUAL_PNOR_ENABLED
-mboxd_SOURCES += pnor_partition_table.cpp mboxd_pnor_partition_table.cpp
+mboxd_SOURCES += pnor_partition_table.cpp mboxd_pnor_partition_table.cpp mboxd_flash_virtual.cpp
 mboxd_LDFLAGS += -lstdc++fs
+else
+mboxd_SOURCES += mboxd_flash_physical.c
 endif
 
 mboxctl_SOURCES = mboxctl.c
@@ -31,13 +33,13 @@
 
 test_sanity_SOURCES = test/sanity.c
 
-test_copy_flash_SOURCES = test/copy_flash.c mboxd_flash.c common.c mtd.c test/tmpf.c
+test_copy_flash_SOURCES = test/copy_flash.c mboxd_flash.c mboxd_flash_physical.c common.c mtd.c test/tmpf.c
 
 test_erase_flash_SOURCES = test/erase_flash.c mboxd_flash.c common.c test/tmpf.c
 
 test_write_flash_SOURCES = test/write_flash.c mboxd_flash.c common.c test/tmpf.c
 
-TEST_MBOX_SRCS = mboxd_msg.c mboxd_windows.c mboxd_lpc.c mboxd_flash.c common.c
+TEST_MBOX_SRCS = mboxd_msg.c mboxd_windows.c mboxd_lpc.c mboxd_flash.c common.c mboxd_flash_physical.c
 TEST_MOCK_SRCS = test/tmpf.c test/mbox.c test/system.c
 
 test_get_mbox_info_v2_SOURCES = test/get_mbox_info_v2.c \