[][Refactor eMMC image of MT7981]

[Description]
Refactor eMMC image of MT7981.
The whole image format is changed:
 - Kernel and rootfs reside in individual partitions.
 - rootfs_data split from rootfs partition using loop device with offset.
 - Upgrading firmware usig tarball with saving config files supported.
 - No recovery partition needed.
 - No GPT partition offset and size restricted.

Important note:
Please select the following packages to make emmc firmware upgrading work:
e2fsprogs mkf2fs blkid blockdev losetup kmod-fs-ext4 kmod-fs-f2fs

[Release-log]
  N/A

Change-Id: I17ad85efa235d068504eeb848431b0c73ae768b4

Change-Id: Iae56e7776b049d3fd9f79861523379794e99c7f0
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5374466
diff --git a/target/linux/mediatek/image/mt7981.mk b/target/linux/mediatek/image/mt7981.mk
index f42ca75..359351d 100755
--- a/target/linux/mediatek/image/mt7981.mk
+++ b/target/linux/mediatek/image/mt7981.mk
@@ -46,13 +46,28 @@
   DEVICE_VENDOR := MediaTek
   DEVICE_MODEL := mt7981-emmc-rfb
   DEVICE_DTS := mt7981-emmc-rfb
+  SUPPORTED_DEVICES := mediatek,mt7981-emmc-rfb
   DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
-  DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc
-  IMAGES := sysupgrade-emmc.bin.gz
-  IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata
+  DEVICE_PACKAGES := mkf2fs e2fsprogs blkid blockdev losetup kmod-fs-ext4 \
+		     kmod-mmc kmod-fs-f2fs kmod-fs-vfat kmod-nls-cp437 \
+		     kmod-nls-iso8859-1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 TARGET_DEVICES += mt7981-emmc-rfb
 
+define Device/mt7981-sd-rfb
+  DEVICE_VENDOR := MediaTek
+  DEVICE_MODEL := mt7981-sd-rfb
+  DEVICE_DTS := mt7981-sd-rfb
+  SUPPORTED_DEVICES := mediatek,mt7981-sd-rfb
+  DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
+  DEVICE_PACKAGES := mkf2fs e2fsprogs blkid blockdev losetup kmod-fs-ext4 \
+		     kmod-mmc kmod-fs-f2fs kmod-fs-vfat kmod-nls-cp437 \
+		     kmod-nls-iso8859-1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += mt7981-sd-rfb
+
 define Device/mt7981-snfi-nand-2500wan-p5
   DEVICE_VENDOR := MediaTek
   DEVICE_MODEL := mt7981-snfi-nand-2500wan-p5