diff --git a/Config.in b/Config.in index ae1ba9ffe..9abbb9103 100644 --- a/Config.in +++ b/Config.in @@ -87,6 +87,13 @@ menu "Target Images" help Create some bootable ISO image + config TARGET_ROOTFS_UBIFS + bool "ubifs" + default y if USES_UBIFS + depends !TARGET_ROOTFS_INITRAMFS + help + Build a ubifs root filesystem + comment "Image Options" source "target/linux/*/image/Config.in" diff --git a/include/image.mk b/include/image.mk index 237d87c90..6175c334b 100644 --- a/include/image.mk +++ b/include/image.mk @@ -82,6 +82,14 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9 >$(BIN_DIR)/openwrt-$(BOARD)-rootfs.cpio.gz ) endef endif + ifeq ($(CONFIG_TARGET_ROOTFS_UBIFS),y) + define Image/mkfs/ubifs + $(CP) ./ubinize.cfg $(KDIR) + mkfs.ubifs $(UBIFS_OPTS) -o $(KDIR)/root.ubifs -d $(TARGET_DIR) + (cd $(KDIR); \ + ubinize $(UBINIZE_OPTS) -o $(BIN_DIR)/openwrt-$(BOARD)-rootfs.ubi ubinize.cfg) + endef + endif else define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(BIN_DIR)/openwrt-$(BOARD)-vmlinux.elf @@ -146,6 +154,7 @@ ifneq ($(IB),1) $(call Image/mkfs/cpiogz) $(call Image/mkfs/ext2) $(call Image/mkfs/iso) + $(call Image/mkfs/ubifs) $(call Image/Checksum) else install: compile install-targets @@ -156,6 +165,7 @@ else $(call Image/mkfs/cpiogz) $(call Image/mkfs/ext2) $(call Image/mkfs/iso) + $(call Image/mkfs/ubifs) $(call Image/Checksum) endif diff --git a/target/linux/xburst/image/Makefile b/target/linux/xburst/image/Makefile index 8dd419ec5..63828170e 100644 --- a/target/linux/xburst/image/Makefile +++ b/target/linux/xburst/image/Makefile @@ -9,6 +9,9 @@ include $(INCLUDE_DIR)/image.mk JFFS2_BLOCKSIZE=256k 512k +UBIFS_OPTS = -m 4096 -e 516096 -c 4095 +UBINIZE_OPTS = -m 4096 -p 512KiB + ifneq ($(CONFIG_XBURST_UBOOT),) define Build/Clean $(MAKE) -C u-boot clean diff --git a/target/linux/xburst/image/ubinize.cfg b/target/linux/xburst/image/ubinize.cfg new file mode 100644 index 000000000..49d55b984 --- /dev/null +++ b/target/linux/xburst/image/ubinize.cfg @@ -0,0 +1,14 @@ +[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 +