2 # Copyright (C) 2009-2018 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 # Cook a "WRGG" image, this board is apparently one in the D-Link
11 # WRGG family and uses the exact same firmware format as other
13 define Build
/dir685-images
14 mkwrggimg
-i
$(IMAGE_KERNEL
) \
17 -s wrgns01_dlwbr_dir685RBWW \
25 # Build D-Link DNS-313 images using the special header tool.
26 # rootfs.tgz and rd.tgz contains nothing, we only need them
27 # to satisfy the boot loader on the device. The zImage is
28 # the only real content.
29 define Build
/dns313-images
32 echo
"dummy" > $@.tmp
/dummyfile
34 dns313-header
$@.tmp
/dummyfile \
35 $@.tmp
/.boot
/rootfs.tgz
36 dns313-header
$@.tmp
/dummyfile \
38 dns313-header
$(IMAGE_KERNEL
) \
41 tar --sort=name
--owner
=0 --group
=0 --numeric-owner
-czf
$@ \
43 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)")
48 define Build
/wiligear-image
49 $(STAGING_DIR_HOST
)/bin
/mkfwimage2 \
50 -m GEOS
-f
0x30000000 -z \
51 -v
$(1).v5.00.SL3512.OpenWrt
.00000.000000.000000 \
52 -p Kernel
:0x020000:0x100000:0:0:$(IMAGE_KERNEL
) \
53 -p Ramdisk
:0x120000:0x500000:0:0:$@ \
59 # Create the special NAS4220B and Itian Square One SQ201 image
60 # format with the squashfs and overlay inside the "rd.gz" file.
61 # We pad it out to 6144K which is the size of the initramfs partition.
63 # The "application" partition is just blank. You can put anything
64 # there when using OpenWRT. We just use that to create the
65 # "sysupgrade" firmware image.
66 define Build
/nas4220b-sq201-images
70 dd if
=/dev
/zero of
=$@.tmp
/hddapp.tgz bs
=6144k count
=1
71 cp
$(IMAGE_KERNEL
) $@.tmp
/zImage
72 cp .
/ImageInfo-
$(1) $@.tmp
/ImageInfo
74 (cd
$@.tmp
; tar --sort=name
--owner
=0 --group
=0 --numeric-owner
-czf
$@
* \
75 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)"))
80 # WBD-111 and WBD-222:
81 # work around the bootloader's bug with extra nops
82 # FIXME: is this really needed now that we no longer append the code
83 # to change the machine ID number? Needs testing on Wiliboard.
86 echo
-en
"\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $@
91 # All DTB files are prefixed with "gemini-"
94 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
96 KERNEL
:= kernel-bin | append-dtb
100 # A reasonable set of default packages handling the NAS type
101 # of devices out of the box (former NAS42x0 IcyBox defaults)
102 GEMINI_NAS_PACKAGES
:=kmod-md-mod kmod-md-linear kmod-md-multipath \
103 kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
104 kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \
105 kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
106 kmod-nls-utf8 kmod-usb-storage-extras \
107 samba36-server mdadm cfdisk fdisk e2fsprogs badblocks
109 define Device
/dlink_dir-685
110 DEVICE_TITLE
:= D-Link DIR-685 Xtreme N Storage Router
111 DEVICE_DTS
:= gemini-dlink-dir-685
112 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
) \
113 kmod-switch-rtl8366rb swconfig \
115 IMAGES
:= factory.bin
116 IMAGE
/factory.bin
:= dir685-images
118 TARGET_DEVICES
+= dlink_dir-685
120 define Device
/dlink_dns-313
121 DEVICE_TITLE
:= D-Link DNS-313
1-Bay Network Storage Enclosure
122 DEVICE_DTS
:= gemini-dlink-dns-313
123 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
124 IMAGES
:= factory.bin
125 IMAGE
/factory.bin
:= dns313-images
127 TARGET_DEVICES
+= dlink_dns-313
129 define Device
/itian-raidsonic
130 IMAGES
:= factory.bin
131 IMAGE
/factory.bin
:= append-rootfs | pad-to
6144k | nas4220b-sq201-images
$(1)
132 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
135 define Device
/itian_sq201
136 $(Device
/itian-raidsonic
)
137 DEVICE_TITLE
:= ITian Square One SQ201
138 DEVICE_DTS
:= gemini-sq201
139 DEVICE_PACKAGES
+= rt61-pci usb2-pci
141 TARGET_DEVICES
+= itian_sq201
143 define Device
/raidsonic_ib-4220-b
144 $(Device
/itian-raidsonic
)
145 DEVICE_TITLE
:= Raidsonic NAS IB-4220-B
146 DEVICE_DTS
:= gemini-nas4220b
148 TARGET_DEVICES
+= raidsonic_ib-4220-b
150 # The wiliboard images need some changes to be functional and buildable.
152 # The dts would need to use the ecoscentric,redboot-fis-partitions partition
153 # parser to get the correct partition offsets and size.
155 # The mkfwimage2 call need to be adjusted to reflect the real size of kernel
156 # and rootfs. It is expected that the OEM firmware adjusts the on flash
157 # partition table with the values defined in the image header.
158 define Device
/wiliboard_wbd111
159 DEVICE_TITLE
:= Wiliboard WBD-111
160 DEVICE_DTS
:= gemini-wbd111
161 KERNEL
:= kernel-bin | append-dtb | wbd-nops
162 IMAGES
:= factory.bin
163 IMAGE
/factory.bin
:= append-rootfs | pad-rootfs | wiligear-image
"WILI-S.WILIBOARD"
166 define Device
/wiliboard_wbd222
167 DEVICE_TITLE
:= Wiliboard WBD-222
168 DEVICE_DTS
:= gemini-wbd222
169 KERNEL
:= kernel-bin | append-dtb | wbd-nops
170 IMAGES
:= factory.bin
171 IMAGE
/factory.bin
:= append-rootfs | pad-rootfs | wiligear-image
"WILI-S.WBD222"
174 $(eval
$(call BuildImage
))