aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/image/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mvebu/image/Makefile')
-rw-r--r--target/linux/mvebu/image/Makefile37
1 files changed, 35 insertions, 2 deletions
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index a09cf24f1a..05321e1dc5 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -29,6 +29,38 @@ define Build/clearfog-bundle
gzip -9n -c $@.new > $@
endef
+# SD-Card Images:
+# these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
+# MBR: 2048 sectors
+# Partition 1: 32768 sectors
+# Partition 2: 98304 sectors (configurable)
+# Partition 3: 7611392 sectors (configurable, depends on p2 size)
+
+define Build/boot-scr
+ rm -f $@.bootscript
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d boot.script $@.bootscript
+endef
+
+define Build/boot-img
+ rm -f $@.boot
+ mkfs.fat -C $@.boot 16384
+ $(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::$(dts).dtb)
+ mcopy -i $@.boot $(IMAGE_KERNEL) ::zImage
+ mcopy -i $@.boot $@.bootscript ::boot.scr
+endef
+
+define Build/sdcard-img
+ rm -rf $@ $@.rootfsdata $@.tmp
+ mkdir -p $@.tmp
+ ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
+ DATA_SIZE=$$(( 7709696 - ($(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2) )); \
+ make_ext4fs -J -l $$DATA_SIZE $@.rootfsdata $@.tmp && \
+ ./gen_mvebu_sdcard_img.sh 7744512 $@ \
+ "$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
+ c 32768 $@.boot \
+ 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) \
+ 83 $$DATA_SIZE $@.rootfsdata
+endef
define Device/Default
PROFILES := Default
@@ -150,9 +182,10 @@ define Device/armada-388-clearfog
KERNEL_INSTALL := 1
KERNEL := dtb | kernel-bin
DEVICE_TITLE := SolidRun ClearFog
- DEVICE_PACKAGES := uboot-mvebu-clearfog
- IMAGES := bundle.tar.gz
+ DEVICE_PACKAGES := uboot-mvebu-clearfog kmod-fs-ext4
+ IMAGES := bundle.tar.gz sdcard.img.gz
IMAGE/bundle.tar.gz := clearfog-bundle
+ IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
endef
TARGET_DEVICES += armada-388-clearfog