Preparing an image for VIA Epia boards

Credits for the GRUB2 setup go to [1]; in the end it's actually a bit
simpler.

[1] http://lists.busybox.net/pipermail/buildroot/2014-April/095234.html

Change-Id: I47a30be4a62f32d09c5c329809e2f958d05d6c64
diff --git a/board/czechlight/epia/genimage.cfg b/board/czechlight/epia/genimage.cfg
new file mode 100644
index 0000000..a84794f
--- /dev/null
+++ b/board/czechlight/epia/genimage.cfg
@@ -0,0 +1,20 @@
+image hdimage.img {
+	hdimage {
+		align = 1M
+	}
+	partition mbr {
+		in-partition-table = "no"
+		image = "boot.img"
+		offset = 0
+		size = 512
+	}
+	partition grub {
+		in-partition-table = "no"
+		image = "grub.img"
+		offset = 512
+	}
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
diff --git a/board/czechlight/epia/kconfig b/board/czechlight/epia/kconfig
new file mode 100644
index 0000000..a61af28
--- /dev/null
+++ b/board/czechlight/epia/kconfig
@@ -0,0 +1,6 @@
+CONFIG_SATA_VIA=y
+CONFIG_PATA_VIA=y
+CONFIG_VIA_RHINE=y
+CONFIG_VIA_VELOCITY=y
+CONFIG_I2C_VIA=y
+CONFIG_I2C_VIAPRO=y
diff --git a/board/czechlight/epia/post-image.sh b/board/czechlight/epia/post-image.sh
new file mode 100755
index 0000000..4ea1afb
--- /dev/null
+++ b/board/czechlight/epia/post-image.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+cp $HOST_DIR/usr/lib/grub/i386-pc/boot.img $BINARIES_DIR
+
+genimage \
+	--rootpath "${TARGET_DIR}" \
+	--tmppath "${GENIMAGE_TMP}" \
+	--inputpath "${BINARIES_DIR}" \
+	--outputpath "${BINARIES_DIR}" \
+	--config "${GENIMAGE_CFG}"
+
+exit $?
+