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
)
20 QEMU_ARGS
+=-cpu mips32r6-generic
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}'
41 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20
),y
)
42 @echo
"Use following command to install it on SD card:"
43 @echo
"sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
46 ifeq ($(ADK_TARGET_FS
),initramfs
)
48 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
49 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
50 ifeq ($(ADK_TARGET_QEMU
),y
)
51 @echo
"Start qemu with following command line:"
52 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
55 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
57 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
58 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
60 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
62 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
63 ifeq ($(ADK_TARGET_QEMU
),y
)
64 @echo
"Start qemu with following command line:"
65 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
68 ifeq ($(ADK_TARGET_FS
),nfsroot
)
70 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
71 @echo
'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
73 ifeq ($(ADK_TARGET_FS
),usb
)
75 @echo
'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
77 ifeq ($(ADK_TARGET_FS
),genimage
)
79 @echo
"The disk image is: $(FW_DIR)/disk.img"
80 ifeq ($(ADK_TARGET_QEMU
),y
)
81 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
83 @echo
"Use following command to install it on SD card:"
84 @echo
'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
87 ifeq ($(ADK_TARGET_FS
),ubifs
)
89 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
90 @echo
'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
93 # image creation and kernel install
95 ifeq ($(ADK_TARGET_KERNEL_UIMAGE
),)
96 $(TARGET_CROSS
)objcopy
$(OSTRIP
) -S
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
98 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
101 kernel-install
: kernel-strip
102 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/${TARGET_KERNEL}
104 # filesystem specific targets
105 ifeq ($(ADK_TARGET_FS
),archive
)
106 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
108 ifeq ($(ADK_TARGET_FS
),initramfs
)
109 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
111 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
112 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
114 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
115 imageinstall
: createinitramfs targethelp
117 ifeq (${ADK_TARGET_FS},genimage
)
118 imageinstall
: ${FW_DIR}/${GENIMAGE} targethelp
120 ifeq ($(ADK_TARGET_FS
),nfsroot
)
121 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
123 ifeq ($(ADK_TARGET_FS
),ubifs
)
124 imageinstall
: $(FW_DIR
)/$(ROOTFSUBIFS
) targethelp