toybox: disable swap tools
[openadk.git] / mk / image.mk
blobb69cd80d247f6cd87bcf9d79f5f8e4979c74bff8
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 ifeq ($(ADK_RUNTIME_FIX_PERMISSION),y)
5 FAKEROOT:=$(STAGING_HOST_DIR)/usr/bin/fakeroot --
6 else
7 FAKEROOT:=
8 endif
10 ifeq ($(ADK_TARGET_OS_LINUX),y)
11 # relative paths, like 'mksh' or '../usr/bin/foosh'
12 ifeq (${ADK_BINSH_ASH},y)
13 BINSH:=ash
14 else ifeq (${ADK_BINSH_BASH},y)
15 BINSH:=bash
16 else ifeq (${ADK_BINSH_SASH},y)
17 BINSH:=sash
18 else ifeq (${ADK_BINSH_HUSH},y)
19 BINSH:=hush
20 else ifeq (${ADK_BINSH_MKSH},y)
21 BINSH:=mksh
22 else ifeq (${ADK_BINSH_ZSH},y)
23 BINSH:=zsh
24 else
25 $(error No /bin/sh configured!)
26 endif
28 # absolute paths
29 ifeq (${ADK_ROOTSH_ASH},y)
30 ROOTSH:=/bin/ash
31 else ifeq (${ADK_ROOTSH_BASH},y)
32 ROOTSH:=/bin/bash
33 else ifeq (${ADK_ROOTSH_SASH},y)
34 ROOTSH:=/bin/sash
35 else ifeq (${ADK_ROOTSH_HUSH},y)
36 ROOTSH:=/bin/hush
37 else ifeq (${ADK_ROOTSH_MKSH},y)
38 ROOTSH:=/bin/mksh
39 else ifeq (${ADK_ROOTSH_TCSH},y)
40 ROOTSH:=/usr/bin/tcsh
41 else ifeq (${ADK_ROOTSH_ZSH},y)
42 ROOTSH:=/bin/zsh
43 else
44 $(error No login shell configured!)
45 endif
46 endif
48 imageprepare: image-prepare-post extra-install prelink
50 # if an extra directory exist in ADK_TOPDIR, copy all content over the
51 # root directory, do the same if make extra=/dir/to/extra is used
52 extra-install:
53 @-if [ -h ${TARGET_DIR}/etc/resolv.conf -a -f $(ADK_TOPDIR)/extra/etc/resolv.conf ];then \
54 rm ${TARGET_DIR}/etc/resolv.conf;\
56 @if test -d '${ADK_TOPDIR}/extra'; then \
57 (cd '${ADK_TOPDIR}/extra' && tar -cf - .) | \
58 (cd ${TARGET_DIR}; tar -xf -); \
60 ifneq (,$(strip ${extra}))
61 @(cd '${extra}' && tar -cf - .) | (cd ${TARGET_DIR}; tar -xf -)
62 endif
64 image-prepare-post:
65 $(BASH) $(ADK_TOPDIR)/scripts/update-rcconf
66 rng=/dev/arandom; test -e $$rng || rng=/dev/urandom; \
67 dd if=$$rng bs=512 count=1 >>${TARGET_DIR}/etc/.rnd 2>/dev/null; \
68 chmod 600 ${TARGET_DIR}/etc/.rnd
69 -for dir in X11 truetype; do \
70 if [ -d ${TARGET_DIR}/usr/share/fonts/$${dir} ];then \
71 for i in $$(ls ${TARGET_DIR}/usr/share/fonts/$${dir}/);do \
72 mkfontdir ${TARGET_DIR}/usr/share/fonts/$${dir}/$${i}; \
73 mkfontscale ${TARGET_DIR}/usr/share/fonts/$${dir}/$${i}; \
74 done; \
75 fi; \
76 done
77 $(SED) '/^root:/s!:/bin/sh$$!:${ROOTSH}!' ${TARGET_DIR}/etc/passwd
78 -rm -f ${TARGET_DIR}/bin/sh
79 ln -sf ${BINSH} ${TARGET_DIR}/bin/sh
81 ifeq ($(ADK_RUNTIME_INIT_SYSTEMD),y)
82 ln -fs ../usr/${ADK_TARGET_LIBC_PATH}/systemd/systemd $(TARGET_DIR)/sbin/init
83 ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/halt
84 ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/poweroff
85 ln -fs ../usr/bin/systemctl $(TARGET_DIR)/sbin/reboot
86 endif
87 test -z $(GIT) || \
88 $(GIT) log -1|head -1|sed -e 's#commit ##' \
89 > $(TARGET_DIR)/etc/.adkgithash
90 echo $(ADK_APPLIANCE_VERSION) > $(TARGET_DIR)/etc/.adkversion
91 echo $(ADK_TARGET_SYSTEM) > $(TARGET_DIR)/etc/.adktarget
92 $(TARGET_CC) -v 2> $(TARGET_DIR)/etc/.adkcompiler
93 $(TARGET_LD) -v > $(TARGET_DIR)/etc/.adklinker
94 ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
95 gzip -9c ${ADK_TOPDIR}/.config > $(TARGET_DIR)/etc/adkconfig.gz
96 chmod 600 $(TARGET_DIR)/etc/adkconfig.gz
97 endif
98 ifneq ($(ADK_TARGET_ARCH_AARCH64)$(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_PPC64)$(ADK_TARGET_ARCH_SPARC64)$(ADK_TARGET_ABI_N32)$(ADK_TARGET_ABI_N64),)
99 test ! -d ${TARGET_DIR}/lib || mv ${TARGET_DIR}/lib/* ${TARGET_DIR}/${ADK_TARGET_LIBC_PATH}
100 test ! -d ${TARGET_DIR}/lib || rm -rf ${TARGET_DIR}/lib
101 ln -sf /${ADK_TARGET_LIBC_PATH} ${TARGET_DIR}/lib
102 mkdir -p ${TARGET_DIR}/usr/${ADK_TARGET_LIBC_PATH} 2>/dev/null
103 -test ! -d ${TARGET_DIR}/usr/lib || mv ${TARGET_DIR}/usr/lib/* ${TARGET_DIR}/usr/${ADK_TARGET_LIBC_PATH} 2>/dev/null
104 test ! -d ${TARGET_DIR}/usr/lib || rm -rf ${TARGET_DIR}/usr/lib/
105 (cd ${TARGET_DIR}/usr ; ln -sf ${ADK_TARGET_LIBC_PATH} lib)
106 endif
107 ifeq ($(ADK_TARGET_ARCH_S390),y)
108 (cd ${TARGET_DIR}/; ln -sf lib lib64)
109 endif
111 ifeq (${ADK_PRELINK},)
112 prelink:
113 else
114 ${TARGET_DIR}/etc/prelink.conf:
115 echo '/' > $@
117 prelink: ${TARGET_DIR}/etc/prelink.conf
118 $(TRACE) target/prelink
119 ${TARGET_CROSS}prelink ${ADK_PRELINK_OPTS} \
120 --ld-library-path=${STAGING_TARGET_DIR}/usr/lib:${STAGING_TARGET_DIR}/lib \
121 --root=${TARGET_DIR} -a $(MAKE_TRACE)
122 endif
124 KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg
125 KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(KERNEL_VERSION)_$(ADK_TARGET_CPU_ARCH).$(PKG_SUFFIX)
126 TARGET_KERNEL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_FS}-kernel
127 INITRAMFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}
128 ROOTFSSQUASHFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.img
129 ROOTFSJFFS2= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-jffs2.img
130 ROOTFSUBIFS= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-ubifs.img
131 ROOTFSTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}+kernel.tar.xz
132 ROOTFSUSERTARBALL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}-${ADK_TARGET_FS}.tar.xz
133 ROOTFSISO= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_LIBC}.iso
135 kernel-package: kernel-strip
136 $(START_TRACE) "target/$(ADK_TARGET_ARCH)-create-kernel-package.. "
137 rm -rf $(KERNEL_PKGDIR)
138 ifeq ($(ADK_TARGET_DUAL_BOOT),y)
139 @mkdir -p $(KERNEL_PKGDIR)
140 cp $(BUILD_DIR)/$(TARGET_KERNEL) $(KERNEL_PKGDIR)/kernel
141 else
142 @mkdir -p $(KERNEL_PKGDIR)/boot
143 cp $(BUILD_DIR)/$(TARGET_KERNEL) $(KERNEL_PKGDIR)/boot/kernel
144 endif
145 @${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
146 ../linux/kernel.control ${KERNEL_VERSION} ${ADK_TARGET_CPU_ARCH}
147 PATH='$(HOST_PATH)' $(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
148 $(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE)
149 $(CMD_TRACE) " done"
150 $(END_TRACE)
152 ${FW_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR}/.adk kernel-package
153 cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | sort | \
154 $(CPIO) --quiet -o -Hustar --owner=0:0 | $(XZ) -c >$@
155 ifeq ($(ADK_TARGET_QEMU),y)
156 @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
157 endif
159 ${FW_DIR}/${ROOTFSUSERTARBALL}: ${TARGET_DIR}/.adk
160 cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | sort | \
161 $(CPIO) --quiet -o -Hustar --owner=0:0 | $(XZ) -c >$@
163 ${STAGING_TARGET_DIR}/${INITRAMFS}_list: ${TARGET_DIR}/.adk
164 PATH='${HOST_PATH}' $(BASH) ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
165 ${TARGET_DIR}/ >$@
167 echo "nod /dev/console 0644 0 0 c 5 1"; \
168 echo "nod /dev/tty 0644 0 0 c 5 0"; \
169 for i in 0 1 2 3 4; do \
170 echo "nod /dev/tty$$i 0644 0 0 c 4 $$$$i"; \
171 done; \
172 echo "nod /dev/null 0644 0 0 c 1 3"; \
173 echo "nod /dev/ram 0655 0 0 b 1 1"; \
174 echo "nod /dev/ttyS0 0660 0 0 c 4 64"; \
175 echo "nod /dev/ttyS1 0660 0 0 c 4 65"; \
176 echo "nod /dev/ttyAMA0 0660 0 0 c 204 64"; \
177 echo "nod /dev/ttyAMA1 0660 0 0 c 204 65"; \
178 echo "nod /dev/ttySC0 0660 0 0 c 204 8"; \
179 echo "nod /dev/ttySC1 0660 0 0 c 204 9"; \
180 echo "nod /dev/ttySC2 0660 0 0 c 204 10"; \
181 echo "nod /dev/ttyBF0 0660 0 0 c 204 64"; \
182 echo "nod /dev/ttyBF1 0660 0 0 c 204 65"; \
183 echo "nod /dev/ttyUL0 0660 0 0 c 204 187"; \
184 echo "nod /dev/ttyUL1 0660 0 0 c 204 188"; \
185 ) >>$@
188 ${FW_DIR}/${INITRAMFS}: ${STAGING_TARGET_DIR}/${INITRAMFS}_list
189 ${LINUX_DIR}/usr/gen_init_cpio ${STAGING_TARGET_DIR}/${INITRAMFS}_list | \
190 ${ADK_COMPRESSION_TOOL} -c >$@
192 ${BUILD_DIR}/root.squashfs: ${TARGET_DIR}/.adk
193 ${STAGING_HOST_DIR}/usr/bin/mksquashfs ${TARGET_DIR} \
194 ${BUILD_DIR}/root.squashfs -comp xz \
195 -nopad -noappend -root-owned $(MAKE_TRACE)
197 ${FW_DIR}/${ROOTFSJFFS2}: ${TARGET_DIR}
198 PATH='${HOST_PATH}' mkfs.jffs2 $(ADK_JFFS2_OPTS) -q -r ${TARGET_DIR} \
199 --pad=$(ADK_TARGET_MTD_SIZE) -o ${FW_DIR}/${ROOTFSJFFS2} $(MAKE_TRACE)
201 ${FW_DIR}/${ROOTFSUBIFS}: ${TARGET_DIR}
203 PATH='${HOST_PATH}'; \
204 SP_SIZE='${ADK_TARGET_FLASH_SUBPAGE_SIZE}'; \
205 PG_SIZE='${ADK_TARGET_FLASH_PAGE_SIZE}'; \
206 LEB_SIZE=$$(((($$SP_SIZE + $$PG_SIZE) / $$PG_SIZE) * $$PG_SIZE)); \
207 mkfs.ubifs -r ${TARGET_DIR} \
208 -m $$PG_SIZE \
209 -e $$((${ADK_TARGET_FLASH_PEB_SIZE} - $$LEB_SIZE)) \
210 -c $$(((${ADK_TARGET_MTD_SIZE} / $$LEB_SIZE))) \
211 -o ${FW_DIR}/rootfs.ubifs; \
212 cd ${FW_DIR} && ubinize -o $@ \
213 -p ${ADK_TARGET_FLASH_PEB_SIZE} \
214 -m ${ADK_TARGET_FLASH_PAGE_SIZE} \
215 -s ${ADK_TARGET_FLASH_SUBPAGE_SIZE} \
216 "${ADK_TOPDIR}/target/${ADK_TARGET_ARCH}/${ADK_TARGET_SYSTEM}/ubinize.cfg"; \
217 ) $(MAKE_TRACE)
219 createinitramfs: ${STAGING_TARGET_DIR}/${INITRAMFS}_list
220 ${SED} 's/.*CONFIG_\(RD_\|BLK_DEV_INITRD\|INITRAMFS_\).*//' \
221 ${LINUX_DIR}/.config
223 echo "CONFIG_BLK_DEV_INITRD=y"; \
224 echo "CONFIG_ACPI_INITRD_TABLE_OVERRIDE=n"; \
225 echo 'CONFIG_INITRAMFS_SOURCE="${STAGING_TARGET_DIR}/${INITRAMFS}_list"'; \
226 echo '# CONFIG_INITRAMFS_COMPRESSION_NONE is not set'; \
227 echo 'CONFIG_CRC32_BIT=y'; \
228 echo '# CONFIG_CRC32_SELFTEST is not set'; \
229 echo '# CONFIG_CRC32_SLICEBY8 is not set'; \
230 echo '# CONFIG_CRC32_SLICEBY4 is not set'; \
231 echo '# CONFIG_CRC32_SARWATE is not set'; \
232 echo 'CONFIG_INITRAMFS_ROOT_UID=0'; \
233 echo 'CONFIG_INITRAMFS_ROOT_GID=0'; \
234 echo 'CONFIG_INITRAMFS_IS_LARGE=n'; \
235 ) >> ${LINUX_DIR}/.config
236 ifeq ($(ADK_KERNEL_COMP_XZ),y)
237 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
238 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
239 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
240 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
241 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
242 echo "CONFIG_RD_XZ=y" >> ${LINUX_DIR}/.config
243 echo "CONFIG_INITRAMFS_COMPRESSION_XZ=y" >> ${LINUX_DIR}/.config
244 echo "CONFIG_XZ_DEC_X86=n" >> ${LINUX_DIR}/.config
245 echo "CONFIG_XZ_DEC_POWERPC=n" >> ${LINUX_DIR}/.config
246 echo "CONFIG_XZ_DEC_IA64=n" >> ${LINUX_DIR}/.config
247 echo "CONFIG_XZ_DEC_ARM=n" >> ${LINUX_DIR}/.config
248 echo "CONFIG_XZ_DEC_ARMTHUMB=n" >> ${LINUX_DIR}/.config
249 echo "CONFIG_XZ_DEC_SPARC=n" >> ${LINUX_DIR}/.config
250 echo "CONFIG_XZ_DEC_TEST=n" >> ${LINUX_DIR}/.config
251 endif
252 ifeq ($(ADK_KERNEL_COMP_LZ4),y)
253 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
254 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
255 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
256 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
257 echo "CONFIG_RD_LZ4=y" >> ${LINUX_DIR}/.config
258 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
259 echo "CONFIG_INITRAMFS_COMPRESSION_LZ4=y" >> ${LINUX_DIR}/.config
260 endif
261 ifeq ($(ADK_KERNEL_COMP_LZMA),y)
262 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
263 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
264 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
265 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
266 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
267 echo "CONFIG_RD_LZMA=y" >> ${LINUX_DIR}/.config
268 echo "CONFIG_INITRAMFS_COMPRESSION_LZMA=y" >> ${LINUX_DIR}/.config
269 endif
270 ifeq ($(ADK_KERNEL_COMP_LZO),y)
271 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
272 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
273 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
274 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
275 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
276 echo "CONFIG_RD_LZO=y" >> ${LINUX_DIR}/.config
277 echo "CONFIG_INITRAMFS_COMPRESSION_LZO=y" >> ${LINUX_DIR}/.config
278 endif
279 ifeq ($(ADK_KERNEL_COMP_GZIP),y)
280 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
281 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
282 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
283 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
284 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
285 echo "CONFIG_RD_GZIP=y" >> ${LINUX_DIR}/.config
286 echo "CONFIG_INITRAMFS_COMPRESSION_GZIP=y" >> ${LINUX_DIR}/.config
287 endif
288 ifeq ($(ADK_KERNEL_COMP_BZIP2),y)
289 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
290 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
291 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
292 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
293 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
294 echo "CONFIG_RD_BZIP2=y" >> ${LINUX_DIR}/.config
295 echo "CONFIG_INITRAMFS_COMPRESSION_BZIP2=y" >> ${LINUX_DIR}/.config
296 endif
297 ifeq ($(ADK_KERNEL_COMPRESS_NONE),y)
298 echo "CONFIG_RD_XZ=n" >> ${LINUX_DIR}/.config
299 echo "CONFIG_RD_BZIP2=n" >> ${LINUX_DIR}/.config
300 echo "CONFIG_RD_LZO=n" >> ${LINUX_DIR}/.config
301 echo "CONFIG_RD_LZMA=n" >> ${LINUX_DIR}/.config
302 echo "CONFIG_RD_LZ4=n" >> ${LINUX_DIR}/.config
303 echo "CONFIG_RD_GZIP=n" >> ${LINUX_DIR}/.config
304 endif
305 @-rm $(LINUX_DIR)/usr/initramfs_data.cpio* 2>/dev/null
306 env $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \
307 -j${ADK_MAKE_JOBS} $(ADK_TARGET_KERNEL) $(MAKE_TRACE)
308 @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
310 ${FW_DIR}/${ROOTFSISO}: ${TARGET_DIR} kernel-package
311 mkdir -p ${TARGET_DIR}/boot/syslinux
312 cp ${STAGING_HOST_DIR}/usr/share/syslinux/{isolinux.bin,ldlinux.c32} \
313 ${TARGET_DIR}/boot/syslinux
314 echo 'DEFAULT /boot/kernel root=/dev/sr0' > \
315 ${TARGET_DIR}/boot/syslinux/isolinux.cfg
316 PATH='${HOST_PATH}' mkisofs -R -uid 0 -gid 0 -o $@ \
317 -b boot/syslinux/isolinux.bin \
318 -c boot/syslinux/boot.cat -no-emul-boot \
319 -boot-load-size 4 -boot-info-table ${TARGET_DIR}
321 ifeq (,$(wildcard $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/$(ADK_TARGET_GENIMAGE_FILENAME)))
322 GENCFG:=$(ADK_TOPDIR)/adk/genimage/$(ADK_TARGET_GENIMAGE_FILENAME)
323 else
324 GENCFG:=$(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/$(ADK_TARGET_GENIMAGE_FILENAME)
325 endif
327 ${FW_DIR}/${GENIMAGE}: ${TARGET_DIR} kernel-package
328 @rm -rf ${FW_DIR}/temp
329 @mkdir -p ${FW_DIR}/temp
330 @$(CP) $(KERNEL) $(FW_DIR)/kernel
331 @dd if=/dev/zero of=${FW_DIR}/cfgfs.img bs=16384 count=1 $(MAKE_TRACE)
332 ifeq ($(ADK_RUNTIME_FIX_PERMISSION),y)
333 echo '#!/bin/sh' > $(ADK_TOPDIR)/scripts/fakeroot.sh
334 echo "chown -R 0:0 $(TARGET_DIR)" >> $(ADK_TOPDIR)/scripts/fakeroot.sh
335 echo 'cd $(TARGET_DIR)' >> $(ADK_TOPDIR)/scripts/fakeroot.sh
336 -@cat $(STAGING_TARGET_DIR)/scripts/permissions.sh >> $(ADK_TOPDIR)/scripts/fakeroot.sh 2>/dev/null
337 chmod 755 $(ADK_TOPDIR)/scripts/fakeroot.sh
338 PATH='$(HOST_PATH)' $(FAKEROOT) $(ADK_TOPDIR)/scripts/fakeroot.sh
339 rm $(ADK_TOPDIR)/scripts/fakeroot.sh $(STAGING_TARGET_DIR)/scripts/permissions.sh
340 endif
341 PATH='${HOST_PATH}' $(FAKEROOT) mke2img \
342 -G 4 \
343 -d "$(TARGET_DIR)" \
344 -o $(FW_DIR)/rootfs.ext $(MAKE_TRACE)
345 PATH='${HOST_PATH}' genimage \
346 --config "$(GENCFG)" \
347 --tmppath "${FW_DIR}/temp" \
348 --rootpath "$(TARGET_DIR)" \
349 --inputpath "$(FW_DIR)" \
350 --outputpath "$(FW_DIR)" $(MAKE_TRACE)
351 ifeq ($(ADK_TARGET_DUAL_BOOT),y)
352 (cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | sort | \
353 PATH='${HOST_PATH}' $(CPIO) -o --quiet -Hustar --owner=0:0 | \
354 ${XZ} -c > ${FW_DIR}/openadk.tar.xz)
355 (cd ${FW_DIR}; PATH='${HOST_PATH}' sha256sum openadk.tar.xz \
356 | cut -d\ -f1 > sha256.txt)
357 (cd ${FW_DIR}; PATH='${HOST_PATH}' tar -cf ${ADK_TARGET_SYSTEM}-update.tar openadk.tar.xz sha256.txt)
358 @rm -rf ${FW_DIR}/temp
359 endif
360 ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
361 @if [ ! -f $(ADK_TOPDIR)/bios-$(ADK_TARGET_ARCH).bin ]; then \
362 cd $(ADK_TOPDIR); wget http://distfiles.openadk.org/bios-$(ADK_TARGET_ARCH).bin ;\
364 endif
366 imageclean:
367 rm -f $(FW_DIR)/$(ADK_TARGET_SYSTEM)-* ${BUILD_DIR}/$(ADK_TARGET_SYSTEM)-*