X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fmkresin.git;a=blobdiff_plain;f=target%2Flinux%2Fmvebu%2Fimage%2FMakefile;h=05321e1dc5398e2348c38b9105b61b18149209f9;hp=a09cf24f1a90adc3a9b00b665c2db6c683ce05bc;hb=3242c076492a46ddf5da92fb4bd3de813cab56f4;hpb=a67183a7bc6f65535877f98ca25f662affbc1df5;ds=sidebyside 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