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
12 ifeq ($(ADK_TARGET_KERNEL_UIMAGEGZ
),y
)
13 KERNEL
:=$(LINUX_DIR
)/arch
/mips
/boot
/uImage.gz
16 OSTRIP
:=-R .reginfo
-R .notes
-R .note
-R .comment
-R .mdebug
-R .note.gnu.build-id
19 QEMU_ARGS
+=${ADK_QEMU_ARGS}
20 QEMU_ARGS
+=-device e1000
,netdev
=adk0
-netdev user
,id
=adk0
22 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32R6
),y
)
23 QEMU_ARGS
+=-cpu mips32r6-generic
27 ifeq ($(ADK_TARGET_FS
),archive
)
29 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
30 ifeq ($(ADK_TARGET_QEMU
),y
)
31 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
32 @echo
"Use following command to create a QEMU Image:"
33 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
34 @echo
"Start qemu with following options:"
35 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
37 ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532
),y
)
38 @echo
"Use following command to install it on CF card:"
39 @echo
"sudo ./scripts/install-rb532.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
40 @echo
'Or boot your Routerboard via NFS and'
41 @echo
'then install kernel and filesystem via:'
42 @echo
'adkinstall -c -a ${ROOTFSTARBALL}'
44 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20
),y
)
45 @echo
"Use following command to install it on SD card:"
46 @echo
"sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
49 ifeq ($(ADK_TARGET_FS
),initramfs
)
51 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
52 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
53 ifeq ($(ADK_TARGET_QEMU
),y
)
54 @echo
"Start qemu with following command line:"
55 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
58 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
60 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
61 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
63 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
65 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
66 ifeq ($(ADK_TARGET_QEMU
),y
)
67 @echo
"Start qemu with following command line:"
68 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
71 ifeq ($(ADK_TARGET_FS
),nfsroot
)
73 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
74 @echo
'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
76 ifeq ($(ADK_TARGET_FS
),usb
)
78 @echo
'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
80 ifeq ($(ADK_TARGET_FS
),genimage
)
82 @echo
"The disk image is: $(FW_DIR)/sdcard.img"
83 ifeq ($(ADK_TARGET_QEMU
),y
)
84 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
86 @echo
"Use following command to install it on SD card:"
87 @echo
'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k'
90 ifeq ($(ADK_TARGET_FS
),ubifs
)
92 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
93 @echo
'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
98 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
100 kernel-install
: kernel-strip
101 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/${TARGET_KERNEL}
103 # filesystem specific targets
104 ifeq ($(ADK_TARGET_FS
),archive
)
105 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
107 ifeq ($(ADK_TARGET_FS
),initramfs
)
108 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
110 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
111 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
113 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
114 imageinstall
: createinitramfs targethelp
116 ifeq (${ADK_TARGET_FS},genimage
)
117 imageinstall
: ${FW_DIR}/${GENIMAGE} targethelp
119 ifeq ($(ADK_TARGET_FS
),nfsroot
)
120 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
122 ifeq ($(ADK_TARGET_FS
),ubifs
)
123 imageinstall
: $(FW_DIR
)/$(ROOTFSUBIFS
) targethelp