mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
198385b69d
MediaTek targets always use U-Boot's modern uImage.FIT format which allows bundling several blobs into a single file including hashes, descriptions and more. In fact, we are already using that to bundle the Flattened Device Tree blob with the kernel on this and many other targets. In the same fashion, we can now make use of the newly introduced support for building seperate ramdisk to uImage.FIT with a dedicated initrd blob checked and loaded by U-Boot instead of embedding the cpio archive into the kernel itself. This allows for having larger ramdisks, choosing ramdisk compression independently of kernel compression (while only kernel is decompressed by the bootloader) and for more easily replacing or modifying the filesystem contained in an initramfs image. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
42 lines
989 B
Makefile
42 lines
989 B
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Copyright (C) 2012-2015 OpenWrt.org
|
|
# Copyright (C) 2016-2017 LEDE project
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
define Build/sysupgrade-emmc
|
|
rm -f $@.recovery
|
|
mkfs.fat -C $@.recovery 3070
|
|
|
|
./gen_$(SUBTARGET)_emmc_img.sh $@ \
|
|
$(IMAGE_KERNEL) \
|
|
$@.recovery \
|
|
$(IMAGE_ROOTFS)
|
|
endef
|
|
|
|
# default all platform image(fit) build
|
|
define Device/Default
|
|
PROFILES = Default $$(DEVICE_NAME)
|
|
KERNEL_NAME := Image
|
|
KERNEL = kernel-bin | lzma | \
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
|
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
|
FILESYSTEMS := squashfs
|
|
DEVICE_DTS_DIR := $(DTS_DIR)
|
|
IMAGES := sysupgrade.bin
|
|
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \
|
|
pad-rootfs | append-metadata
|
|
endef
|
|
|
|
include $(SUBTARGET).mk
|
|
|
|
define Image/Build
|
|
$(call Image/Build/$(1),$(1))
|
|
endef
|
|
|
|
$(eval $(call BuildImage))
|
|
|