diff options
author | Pawel Dembicki <paweldembicki@gmail.com> | 2020-08-24 14:29:32 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-10-26 00:40:12 +0100 |
commit | a254279a6c3048feb83909649c41ee4a7d37ec93 (patch) | |
tree | bc6d544a7d45fbf6f7362f28289c1d94dd894e38 /target/linux/layerscape/image/Makefile | |
parent | c51f8030b623e03567a73fbcedc4ee69a8896688 (diff) | |
download | upstream-a254279a6c3048feb83909649c41ee4a7d37ec93.tar.gz upstream-a254279a6c3048feb83909649c41ee4a7d37ec93.tar.bz2 upstream-a254279a6c3048feb83909649c41ee4a7d37ec93.zip |
layerscape: Change to combined rootfs on sd images
At this moment layerscape images are ext4 only. It causes problem with
save changes durring sysupgrade and make "firstboot" and failsafe mode
useless.
This patch changes sd-card images to squashfs + f2fs combined images.
To make place, for saving config, kernel space ar now ext4 partition
with fit kernel.
This method of image generation is similar to rest of OpenWrt sd-card
targets.
Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[reword README, reword DEVICE_COMPAT_MESSAGE, keep original indent]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/layerscape/image/Makefile')
-rw-r--r-- | target/linux/layerscape/image/Makefile | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 08864b1316..bfc4af4ca4 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -7,13 +7,22 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk +LS_SD_KERNELPART_SIZE = 40 +LS_SD_KERNELPART_OFFSET = 16 LS_SD_ROOTFSPART_OFFSET = 64 LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024))) + $(CONFIG_TARGET_ROOTFS_PARTSIZE))))) # The limitation of flash sysupgrade.bin is 1MB dtb + 16MB kernel + 32MB rootfs LS_SYSUPGRADE_IMAGE_SIZE = 49m +define Image/Prepare + # Build .dtb for all boards we may run on + $(foreach dts,$(DEVICE_DTS_LIST), + $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTS_DIR)/$(dts).dtb) + ) +endef + define Build/ls-clean rm -f $@ endef @@ -23,12 +32,21 @@ define Build/ls-append endef define Build/ls-append-dtb - $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb) dd if=$(DTS_DIR)/$(1).dtb >> $@ endef +define Build/ls-append-kernel + mkdir -p $@.tmp && \ + cp $(IMAGE_KERNEL) $@.tmp/fitImage && \ + make_ext4fs -J -L kernel -l "$(LS_SD_KERNELPART_SIZE)M" "$@.kernel.part" "$@.tmp" && \ + dd if=$@.kernel.part >> $@ && \ + rm -rf $@.tmp && \ + rm -f $@.kernel.part +endef + define Build/ls-append-sdhead ./gen_sdcard_head_img.sh $(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img \ + $(LS_SD_KERNELPART_OFFSET) $(LS_SD_KERNELPART_SIZE) \ $(LS_SD_ROOTFSPART_OFFSET) $(CONFIG_TARGET_ROOTFS_PARTSIZE) dd if=$(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img >> $@ endef @@ -53,6 +71,12 @@ define Device/fix-sysupgrade After that, You can use "sysupgrade -F". endef +define Device/rework-sdcard-images + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := SD-card images were changed to squashfs + ext4 overlay combined images. \ + It is required to flash the entire sd-card again and manually copy config. +endef + include $(SUBTARGET).mk $(eval $(call BuildImage)) |