layerscape: enlarge ext4 rootfs size to 30MB
[openwrt/openwrt.git] / target / linux / layerscape / image / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define Build/append-ls-rcw
11 rm -f $@
12 dd if=$(STAGING_DIR_IMAGE)/$(1)-rcw.bin >> $@
13 endef
14
15 define Build/append-ls-uboot
16 dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@
17 endef
18
19 define Build/append-ls-ppa
20 dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@
21 endef
22
23 define Build/append-ls-fman
24 dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@
25 endef
26
27 define Build/append-ls-mc
28 dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@
29 endef
30
31 define Build/append-ls-ppfe
32 dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@
33 endef
34
35 define Build/append-ls-dpl
36 dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@
37 endef
38
39 define Build/append-ls-dpc
40 dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@
41 endef
42
43 define Build/append-ls-dtb
44 $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb)
45 dd if=$(DTS_DIR)/$(1).dtb >> $@
46 endef
47
48 define Build/append-ls-rootfs-ext4
49 $(STAGING_DIR_HOST)/bin/make_ext4fs -l $(word 2,$(1)) -b 4096 -i 6000 -m 0 -J $(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 $(TARGET_DIR)
50 dd if=$(KDIR)/$(word 1,$(1))-$(word 2,$(1)).root.ext4 >> $@
51 endef
52
53 define Device/Default
54 PROFILES = Default
55 FILESYSTEMS := squashfs
56 DEVICE_DTS :=
57 IMAGES = firmware.bin
58
59 ifeq ($(SUBTARGET),armv8_64b)
60 KERNEL := kernel-bin | gzip | uImage gzip
61 KERNEL_LOADADDR = 0x80080000
62 KERNEL_ENTRY_POINT = 0x80080000
63 endif
64 ifeq ($(SUBTARGET),armv8_32b)
65 KERNEL := kernel-bin | uImage none
66 KERNEL_NAME := zImage
67 KERNEL_LOADADDR = 0x80008000
68 KERNEL_ENTRY_POINT = 0x80008000
69 endif
70 endef
71
72 define Device/ls1043ardb
73 DEVICE_TITLE := ls1043ardb-$(SUBTARGET)
74 DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \
75 fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb
76 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk
77 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
78 append-ls-uboot $(1) | pad-to 4M | \
79 append-ls-ppa $(1) | pad-to 9M | \
80 append-ls-fman $(1) | pad-to 15M | \
81 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
82 append-kernel | pad-to 32M | \
83 append-rootfs | pad-rootfs | check-size 67108865
84 endef
85 TARGET_DEVICES += ls1043ardb
86
87 define Device/ls1046ardb
88 DEVICE_TITLE := ls1046ardb-$(SUBTARGET)
89 DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \
90 fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb
91 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk
92 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
93 append-ls-uboot $(1) | pad-to 4M | \
94 append-ls-ppa $(1) | pad-to 9M | \
95 append-ls-fman $(1) | pad-to 15M | \
96 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
97 append-kernel | pad-to 32M | \
98 append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
99 endef
100 TARGET_DEVICES += ls1046ardb
101
102 define Device/ls1012ardb
103 DEVICE_TITLE := ls1012ardb-$(SUBTARGET)
104 DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \
105 kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb
106 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb
107 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
108 append-ls-uboot $(1) | pad-to 4M | \
109 append-ls-ppa $(1) | pad-to 10M | \
110 append-ls-ppfe | pad-to 15M | \
111 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
112 append-kernel | pad-to 32M | \
113 append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
114 endef
115 TARGET_DEVICES += ls1012ardb
116
117 ifeq ($(SUBTARGET),armv8_64b)
118 define Device/ls1088ardb
119 DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
120 DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \
121 layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \
122 layerscape-ppa-ls1088ardb
123 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb
124 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
125 append-ls-uboot $(1) | pad-to 4M | \
126 append-ls-ppa $(1) | pad-to 10M | \
127 append-ls-mc $(1) | pad-to 13M | \
128 append-ls-dpl $(1) | pad-to 14M | \
129 append-ls-dpc $(1) | pad-to 15M | \
130 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
131 append-kernel | pad-to 32M | \
132 append-ls-rootfs-ext4 $(1) 30M | check-size 67108865
133 endef
134 TARGET_DEVICES += ls1088ardb
135
136 define Device/ls2088ardb
137 DEVICE_TITLE := ls2088ardb-$(SUBTARGET)
138 DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \
139 layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \
140 layerscape-ppa-ls2088ardb
141 DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb
142 IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \
143 append-ls-uboot $(1) | pad-to 4M | \
144 append-ls-ppa $(1) | pad-to 10M | \
145 append-ls-mc $(1) | pad-to 13M | \
146 append-ls-dpl $(1) | pad-to 14M | \
147 append-ls-dpc $(1) | pad-to 15M | \
148 append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \
149 append-kernel | pad-to 32M | \
150 append-rootfs | pad-rootfs | check-size 67108865
151 endef
152 TARGET_DEVICES += ls2088ardb
153 endif
154
155 $(eval $(call BuildImage))