mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-12 18:05:15 +00:00
9260027535
Libdeflate is a more advanced gzip compressor, which allows for faster decompression, higher compression speed (factor 3-4), while being fully gzip compatible. Some comparison gzip | libdeflate-gzip | delta | image [openwrt-realtek-rtl839x-*] --------+-----------------+--------+----------------------------------------------- 6589174 | 6298794 | 290380 | d-link_dgs-1210-52-initramfs-kernel.bin 6291632 | 6029488 | 262144 | d-link_dgs-1210-52-squashfs-factory_image1.bin 6292270 | 6030128 | 262142 | d-link_dgs-1210-52-squashfs-sysupgrade.bin 6589142 | 6298760 | 290382 | zyxel_gs1900-48-initramfs-kernel.bin 6292264 | 6030122 | 262142 | zyxel_gs1900-48-squashfs-sysupgrade.bin and changing lzma to (libdeflate-)gzip on existing rtl930x target: gzip | libdeflate-gzip | delta | image [openwrt-realtek-rtl930x-*] --------+-----------------+--------+-------------------------------------- 6816230 | 6510382 | 305848 | zyxel_xgs1250-12-initramfs-kernel.bin Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Reviewed-by: Robert Marko <robimarko@gmail.com> Reviewed-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Sander Vanheule <sander@svanheule.net>
115 lines
2.7 KiB
Makefile
115 lines
2.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
KERNEL_LOADADDR = 0x80000000
|
|
KERNEL_ENTRY = 0x80000400
|
|
|
|
DEVICE_VARS += \
|
|
CAMEO_BOARD_VERSION \
|
|
CAMEO_CUSTOMER_SIGNATURE \
|
|
CAMEO_KERNEL_PART \
|
|
CAMEO_ROOTFS_PART \
|
|
DLINK_KERNEL_PART_SIZE \
|
|
H3C_DEVICE_ID \
|
|
H3C_PRODUCT_ID \
|
|
ZYXEL_VERS
|
|
|
|
define Build/zyxel-vers
|
|
( echo VERS;\
|
|
for hw in $(ZYXEL_VERS); do\
|
|
echo -n "V9.99($$hw.0) | ";\
|
|
date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\
|
|
done ) >> $@
|
|
endef
|
|
|
|
define Build/dlink-cameo
|
|
$(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE)
|
|
endef
|
|
|
|
define Build/dlink-version
|
|
echo -n "OpenWrt" >> $@
|
|
dd if=/dev/zero bs=25 count=1 >> $@
|
|
endef
|
|
|
|
define Build/dlink-headers
|
|
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
|
|
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
|
|
$(SCRIPT_DIR)/cameo-imghdr.py $@.kernel_part $@.kernel_part.hex \
|
|
"$(DEVICE_MODEL)" os $(CAMEO_KERNEL_PART) \
|
|
$(CAMEO_CUSTOMER_SIGNATURE) \
|
|
$(CAMEO_BOARD_VERSION) \
|
|
$(KERNEL_LOADADDR); \
|
|
$(SCRIPT_DIR)/cameo-imghdr.py $@.rootfs_part $@.rootfs_part.hex \
|
|
"$(DEVICE_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
|
|
$(CAMEO_CUSTOMER_SIGNATURE) \
|
|
$(CAMEO_BOARD_VERSION); \
|
|
cat $@.kernel_part.hex $@.rootfs_part.hex > $@
|
|
endef
|
|
|
|
define Build/7z
|
|
$(STAGING_DIR_HOST)/bin/7zr a $(@).new -t7z -m0=lzma $(@)
|
|
mv $@.new $@
|
|
endef
|
|
|
|
define Build/h3c-image
|
|
$(STAGING_DIR_HOST)/bin/mkh3cimg \
|
|
-i $(@) \
|
|
-o $(@).new \
|
|
-c 7z \
|
|
-p $(H3C_PRODUCT_ID) \
|
|
-d $(H3C_DEVICE_ID)
|
|
mv $@.new $@
|
|
endef
|
|
|
|
define Build/h3c-vfs
|
|
$(STAGING_DIR_HOST)/bin/mkh3cvfs \
|
|
-i $(@) \
|
|
-o $(@).new \
|
|
-f openwrt-kernel.bin
|
|
mv $@.new $@
|
|
endef
|
|
|
|
define Build/relocate-kernel
|
|
rm -rf $@.relocate
|
|
$(CP) ../../generic/image/relocate $@.relocate
|
|
$(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) LZMA_TEXT_START=0x82000000 \
|
|
CROSS_COMPILE=$(TARGET_CROSS)
|
|
( \
|
|
dd if=$@.relocate/loader.bin bs=32 conv=sync && \
|
|
perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
|
|
cat "$@" \
|
|
) > "$@.new"
|
|
mv "$@.new" "$@"
|
|
rm -rf $@.relocate
|
|
endef
|
|
|
|
define Device/Default
|
|
PROFILES = Default
|
|
KERNEL := \
|
|
kernel-bin | \
|
|
append-dtb | \
|
|
libdeflate-gzip | \
|
|
uImage gzip
|
|
KERNEL_INITRAMFS := \
|
|
kernel-bin | \
|
|
append-dtb | \
|
|
libdeflate-gzip | \
|
|
uImage gzip
|
|
DEVICE_DTS_DIR := ../dts-$(KERNEL_PATCHVER)
|
|
DEVICE_DTS = $$(SOC)_$(1)
|
|
IMAGES := sysupgrade.bin
|
|
IMAGE/sysupgrade.bin := \
|
|
append-kernel | \
|
|
pad-to 64k | \
|
|
append-rootfs | \
|
|
pad-rootfs | \
|
|
check-size | \
|
|
append-metadata
|
|
endef
|
|
|
|
include $(SUBTARGET).mk
|
|
|
|
$(eval $(call BuildImage))
|