X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=include%2Fimage.mk;h=5e4dfb28e965925659b4f4f199388f5377b4a028;hb=a68fb8b9587eed648c1acccea0fb0d66647447ef;hp=2f60ce06d96b08a4fe48777ae8c5dea229df0ab3;hpb=93972bcb49064aaa1295ed0d493cd2ab0585f31c;p=openwrt.git diff --git a/include/image.mk b/include/image.mk index 2f60ce06d9..5e4dfb28e9 100644 --- a/include/image.mk +++ b/include/image.mk @@ -46,7 +46,7 @@ endif JFFS2OPTS += $(MKFS_DEVTABLE_OPT) -SQUASHFS_BLOCKSIZE := 256k +SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE) SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' SQUASHFSCOMP := gzip @@ -129,6 +129,31 @@ ifneq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),) endef endif +# $(1): board name +# $(2): rootfs type +# $(3): kernel image +ifneq ($(CONFIG_NAND_SUPPORT),) + define Image/Build/SysupgradeNAND + mkdir -p "$(KDIR_TMP)/sysupgrade-$(1)/" + echo "BOARD=$(1)" > "$(KDIR_TMP)/sysupgrade-$(1)/CONTROL" + [ -z "$(2)" ] || $(CP) "$(KDIR)/root.$(2)" "$(KDIR_TMP)/sysupgrade-$(1)/root" + [ -z "$(3)" ] || $(CP) "$(3)" "$(KDIR_TMP)/sysupgrade-$(1)/kernel" + (cd "$(KDIR_TMP)"; $(TAR) cvf \ + "$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1)) + endef +# $(1) board name +# $(2) ubinize-image options (e.g. --uboot-env and/or --kernel kernelimage) +# $(3) rootfstype (e.g. squashfs or ubifs) +# $(4) options to pass-through to ubinize (i.e. $($(PROFILE)_UBI_OPTS))) + define Image/Build/UbinizeImage + sh $(TOPDIR)/scripts/ubinize-image.sh $(2) \ + "$(KDIR)/root.$(3)" \ + "$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(3)-ubinized.bin" \ + $(4) + endef + +endif + ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),) define Image/mkfs/ubifs/generate $(CP) ./ubinize$(1).cfg $(KDIR) @@ -188,7 +213,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_EXT4FS),) define Image/mkfs/ext4 # generate an ext2 fs - $(STAGING_DIR_HOST)/bin/genext2fs -U -B $(CONFIG_TARGET_EXT4_BLOCKSIZE) -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext4 -m $(CONFIG_TARGET_ROOTFS_RESERVED_PCT) $(MKFS_DEVTABLE_OPT) + $(STAGING_DIR_HOST)/bin/genext2fs -U -B $(CONFIG_TARGET_EXT4_BLOCKSIZE) -b $(E2SIZE) -N $(CONFIG_TARGET_EXT4_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext4 -m $(CONFIG_TARGET_EXT4_RESERVED_PCT) $(MKFS_DEVTABLE_OPT) # convert it to ext4 $(STAGING_DIR_HOST)/bin/tune2fs $(if $(CONFIG_TARGET_EXT4_JOURNAL),-j) -O extents,uninit_bg,dir_index $(KDIR)/root.ext4 # fix it up