summaryrefslogtreecommitdiff
path: root/target/linux/kirkwood/image
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2013-10-04 03:45:52 +0000
committerLuka Perkov <luka@openwrt.org>2013-10-04 03:45:52 +0000
commitfa3ab0c237b76eed2a7ee5f56d47802adfdc5c3a (patch)
tree6a90963081fa3f2cdff8fca2427fcc0e084c1cc5 /target/linux/kirkwood/image
parente96695df101b0c019b9b51b4618063ea99693284 (diff)
downloadmtk-20170518-fa3ab0c237b76eed2a7ee5f56d47802adfdc5c3a.zip
mtk-20170518-fa3ab0c237b76eed2a7ee5f56d47802adfdc5c3a.tar.gz
mtk-20170518-fa3ab0c237b76eed2a7ee5f56d47802adfdc5c3a.tar.bz2
kirkwood: add support for UBI (3.10.x)
Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 38301
Diffstat (limited to 'target/linux/kirkwood/image')
-rw-r--r--target/linux/kirkwood/image/Makefile28
-rw-r--r--target/linux/kirkwood/image/ubinize.cfg13
2 files changed, 36 insertions, 5 deletions
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 51af440..b3d25f5 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -8,21 +8,39 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
NAND_BLOCKSIZE := 2048:128k
+UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 -U
+UBINIZE_OPTS := -m 2048 -p 128KiB -s 512
define Image/BuildKernel
- cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+ $(CP) $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/uImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs
endif
+
+ $(foreach board,$(BOARDS),
+ $(LINUX_DIR)/scripts/dtc/dtc \
+ -O dtb -o $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb \
+ -I dts $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(board).dts
+ )
endef
-define Image/Build
+define Image/InstallKernel
+
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
+ $(INSTALL_DIR) $(TARGET_DIR)/boot
+ $(CP) $(KDIR)/uImage $(TARGET_DIR)/boot/
+ endif
+
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
+ $(INSTALL_DIR) $(TARGET_DIR)/boot
$(foreach board,$(BOARDS),
- $(LINUX_DIR)/scripts/dtc/dtc \
- -O dtb -o $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb \
- -I dts $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(board).dts ;
+ $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb $(TARGET_DIR)/boot/
)
+ endif
+endef
+define Image/Build
$(if $(Image/Build/$(1)), \
$(call Image/Build/$(1),$(1)), \
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
diff --git a/target/linux/kirkwood/image/ubinize.cfg b/target/linux/kirkwood/image/ubinize.cfg
new file mode 100644
index 0000000..e4149ec
--- /dev/null
+++ b/target/linux/kirkwood/image/ubinize.cfg
@@ -0,0 +1,13 @@
+[rootfs]
+# Volume mode (other option is static)
+mode=ubi
+# Source image
+image=root.ubifs
+# Volume ID in UBI image
+vol_id=0
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs
+# Autoresize volume at first mount
+vol_flags=autoresize