Skip to content

Commit 3760244

Browse files
committed
build: drop implicit gzip of ext4 images
With CONFIG_TARGET_IMAGES_GZIP enabled, which is the default, ext4 images are gzipped when they are copied to $(BIN_DIR), unless their name ends with .gz or .dtb. This causes several problems: - The JSON info contains the uncompressed name and hash, so profiles.json lists images which don't exist on the download server: profiles.json: openwrt-at91-sam9x-atmel_at91sam9263ek-ext4-root.ubi sha256sums: openwrt-at91-sam9x-atmel_at91sam9263ek-ext4-root.ubi.gz - The image is gzipped as a whole, including the metadata and signature added by append-metadata. fwtool looks for them at the end of the file, so sysupgrade rejects these images. Explicitly gzipped images run append-metadata after gzip instead. - A rule for the gzipped name is defined for every image, which clashes with images that are built both plain and gzipped, as it was the case for malta. The previous commits removed the ext4 images which can't be used and gzip the remaining ones explicitly, so drop the implicit gzip. The file name in $(BIN_DIR) is now always the one from IMAGES. Targets wanting gzipped images define them explicitly, e.g. sdcard.img.gz, or select them via CONFIG_TARGET_IMAGES_GZIP like x86, armsr, loongarch64 and malta. Limit the option to these targets. The ext4 kernel.bin and factory.bin of ixp4xx, which only contain the kernel, and the optional ext4 VM images of x86 and armsr are now stored uncompressed, like their squashfs counterparts. Link: openwrt/openwrt#25658 Signed-off-by: Paul Spooren <mail@aparcar.org>
1 parent 6a0fc5d commit 3760244

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎config/Config-images.in‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ menu "Target Images"
332332

333333
config TARGET_IMAGES_GZIP
334334
bool "GZip images"
335-
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta || TARGET_loongarch64
335+
depends on TARGET_x86 || TARGET_armsr || TARGET_malta || TARGET_loongarch64
336336
default y
337337

338338
comment "Image Options"

‎include/image.mk‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,11 @@ define Device/Build/kernel
737737
endef
738738

739739
define Device/Build/image
740-
GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
741740
$$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
742741
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
743-
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
742+
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)))
744743
$(eval $(call Device/Export,$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)),$(1)))
745-
$(3)-images: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)
744+
$(3)-images: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))
746745

747746
ROOTFS/$(1)/$(3) := \
748747
$(KDIR)/root.$(1)$$(strip \
@@ -760,13 +759,10 @@ define Device/Build/image
760759

761760
.IGNORE: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))
762761

763-
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
764-
gzip -c -9n $$^ > $$@
765-
766762
$(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)): $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
767763
cp $$^ $$@
768764

769-
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)
765+
$(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))
770766
@mkdir -p $$(shell dirname $$@)
771767
DEVICE_ID="$(DEVICE_NAME)" \
772768
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \

0 commit comments

Comments
 (0)