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 include $(ADK_TOPDIR
)/rules.mk
5 include $(ADK_TOPDIR
)/mk
/kernel-build.mk
6 include $(ADK_TOPDIR
)/mk
/image.mk
8 KERNEL
:=$(LINUX_DIR
)/$(ADK_TARGET_KERNEL
)
9 ifeq ($(ADK_TARGET_KERNEL_UIMAGE
),y
)
10 KERNEL
:=$(LINUX_DIR
)/arch
/mips
/boot
/uImage
13 OSTRIP
:=-R .reginfo
-R .notes
-R .note
-R .comment
-R .mdebug
-R .note.gnu.build-id
16 QEMU_ARGS
+=${ADK_QEMU_ARGS}
17 QEMU_ARGS
+=-device e1000
,netdev
=adk0
-netdev user
,id
=adk0
19 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32R6
),y
)
24 ifeq ($(ADK_TARGET_FS
),archive
)
26 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
27 ifeq ($(ADK_TARGET_QEMU
),y
)
28 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
29 @echo
"Use following command to create a QEMU Image:"
30 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo
"Start qemu with following options:"
32 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
34 ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532
),y
)
35 @echo
"Use following command to install it on CF card:"
36 @echo
"sudo ./scripts/install-rb532.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
37 @echo
'Or boot your Routerboard via NFS and'
38 @echo
'then install kernel and filesystem via:'
39 @echo
'adkinstall -c -a ${ROOTFSTARBALL}'
42 ifeq ($(ADK_TARGET_FS
),initramfs
)
44 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
45 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
46 ifeq ($(ADK_TARGET_QEMU
),y
)
47 @echo
"Start qemu with following command line:"
48 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
51 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
53 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
54 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
56 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
58 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
59 ifeq ($(ADK_TARGET_QEMU
),y
)
60 @echo
"Start qemu with following command line:"
61 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
64 ifeq ($(ADK_TARGET_FS
),nfsroot
)
66 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
67 @echo
'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
69 ifeq ($(ADK_TARGET_FS
),usb
)
71 @echo
'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
73 ifeq ($(ADK_TARGET_FS
),genimage
)
75 @echo
"The disk image is: $(FW_DIR)/disk.img"
76 ifeq ($(ADK_TARGET_QEMU
),y
)
77 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
79 @echo
"Use following command to install it on SD card:"
80 @echo
'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
83 ifeq ($(ADK_TARGET_FS
),ubifs
)
85 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
86 @echo
'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
89 # image creation and kernel install
91 ifeq ($(ADK_TARGET_KERNEL_UIMAGE
),)
92 $(TARGET_CROSS
)objcopy
$(OSTRIP
) -S
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
94 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
97 kernel-install
: kernel-strip
98 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/${TARGET_KERNEL}
100 # filesystem specific targets
101 ifeq ($(ADK_TARGET_FS
),archive
)
102 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
104 ifeq ($(ADK_TARGET_FS
),initramfs
)
105 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
107 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
108 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
110 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
111 imageinstall
: createinitramfs targethelp
113 ifeq (${ADK_TARGET_FS},genimage
)
114 imageinstall
: ${FW_DIR}/${GENIMAGE} targethelp
116 ifeq ($(ADK_TARGET_FS
),nfsroot
)
117 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
119 ifeq ($(ADK_TARGET_FS
),ubifs
)
120 imageinstall
: $(FW_DIR
)/$(ROOTFSUBIFS
) targethelp