odhcp6c: various fixes
[openwrt/staging/chunkeey.git] / target / linux / imx23 / image / Makefile
1 #
2 # Copyright (C) 2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/image.mk
10
11 define Image/BuildKernel/olinuxino-bootlet
12 cat $(LINUX_DIR)/arch/arm/boot/zImage $(LINUX_DIR)/arch/arm/boot/dts/imx23-olinuxino.dtb > $(STAGING_DIR)/zImage_dtb
13 (cd $(STAGING_DIR); \
14 $(STAGING_DIR)/../host/bin/elftosb -z -c ./linux_prebuilt.db -o linux.sb; \
15 dd if=/dev/zero of=sd_mmc_bootstream.raw bs=512 count=4; \
16 dd if=linux.sb of=$(BIN_DIR)/openwrt-imx23-sbImage ibs=512 seek=4; \
17 )
18 endef
19
20 define Image/BuildKernel/olinuxino-uboot
21 mkimage -A arm -O linux -T kernel -C none \
22 -a 0x42000000 -e 0x42000000 \
23 -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
24 -d $(KDIR)/vmlinux $(KDIR)/uImage
25 cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
26 endef
27
28 define Image/BuildKernel
29
30 ifeq ($(CONFIG_PACKAGE_imx-bootlets),y)
31 $(call Image/BuildKernel/olinuxino-bootlet)
32 endif
33
34 ifeq ($(CONFIG_PACKAGE_uboot-imx23-mx23_olinuxino),y)
35 $(call Image/BuildKernel/olinuxino-uboot)
36 endif
37 endef
38
39 define Image/Build
40 $(call Image/Build/$(1))
41 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
42 endef
43
44 $(eval $(call BuildImage))
45