1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2010 OpenWrt.org
5 include $(TOPDIR
)/rules.mk
6 include $(INCLUDE_DIR
)/image.mk
9 $(STAGING_DIR_HOST
)/bin
/lzma e
$(1) -lc1
-lp2
-pb2
$(2)
13 gzip
-9n
-c
$(1) > $(2)
17 mkimage
-A mips
-O linux
-T kernel
-a
0x80100000 -C
$(1) $(2) \
18 -e
0x80100000 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
23 $(call CompressLzma
,$(KDIR
)/vmlinux
,$(KDIR
)/vmlinux.bin.lzma
)
24 $(call MkuImage
,lzma
,,$(KDIR
)/vmlinux.bin.lzma
,$(KDIR
)/uImage.lzma
)
25 $(call CompressGzip
,$(KDIR
)/vmlinux
,$(KDIR
)/vmlinux.bin.gz
)
26 $(call MkuImage
,gzip
,,$(KDIR
)/vmlinux.bin.gz
,$(KDIR
)/uImage.gz
)
29 define Image
/BuildKernel
30 cp
$(KDIR
)/vmlinux.elf
$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux.elf
31 cp
$(KDIR
)/uImage.lzma
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage-lzma
32 cp
$(KDIR
)/uImage.gz
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage-gzip
35 define Image
/Build
/Initramfs
36 cp
$(KDIR
)/vmlinux-initramfs.elf
$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux-initramfs.elf
37 cp
$(KDIR
)/vmlinux-initramfs
$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux-initramfs.bin
40 define Image
/Build
/gzip
41 gzip
-f9n
$(BIN_DIR
)/$(IMG_ROOTFS
)-$(1).img
44 $(eval
$(call Image
/gzip-ext4-padded-squashfs
))
47 $(call Image
/Build
/$(1))
48 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_ROOTFS
)-$(1).img
49 $(call Image
/Build
/gzip
/$(1))
52 $(eval
$(call BuildImage
))