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 # Create the special NAS4220B and Itian Square One SQ201 image
49 # format with the squashfs and overlay inside the "rd.gz" file.
50 # We pad it out to 6144K which is the size of the initramfs partition.
52 # The "application" partition is just blank. You can put anything
53 # there when using OpenWRT. We just use that to create the
54 # "sysupgrade" firmware image.
55 define Build
/nas4220b-sq201-images
59 dd if
=/dev
/zero of
=$@
-tmp
/hddapp.tgz bs
=6144k count
=1
60 cp
$(IMAGE_KERNEL
) $@
-tmp
/zImage
61 cp .
/ImageInfo-
$(1) $@
-tmp
/ImageInfo
62 (cd
$@
-tmp
; tar --sort=name
--owner
=0 --group
=0 --numeric-owner
-czf
$@
* \
63 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)"))
67 # WBD-111 and WBD-222:
68 # work around the bootloader's bug with extra nops
69 # FIXME: is this really needed now that we no longer append the code
70 # to change the machine ID number? Needs testing on Wiliboard.
73 echo
-en
"\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $@
78 # All DTB files are prefixed with "gemini-"
81 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
82 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
84 KERNEL
:= kernel-bin | append-dtb
85 FILESYSTEMS
:= squashfs
86 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
91 # A reasonable set of default packages handling the NAS type
92 # of devices out of the box (former NAS42x0 IcyBox defaults)
93 GEMINI_NAS_PACKAGES
:=kmod-md-mod kmod-md-linear kmod-md-multipath \
94 kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
95 kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \
96 kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
97 kmod-nls-utf8 kmod-usb-storage-extras \
98 samba36-server mdadm cfdisk fdisk e2fsprogs badblocks
100 define Device
/dlink-dir-685
101 DEVICE_TITLE
:= D-Link DIR-685 Xtreme N Storage Router
102 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
) \
103 kmod-switch-rtl8366rb swconfig \
105 IMAGES
:= fwupdate.bin
106 IMAGE
/fwupdate.bin
:= dir685-images
108 TARGET_DEVICES
+= dlink-dir-685
110 define Device
/dlink-dns-313
111 DEVICE_TITLE
:= D-Link DNS-313
1-Bay Network Storage Enclosure
112 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
113 IMAGES
:= dns313-bootpart.
tar.gz
114 IMAGE
/dns313-bootpart.
tar.gz
:= dns313-images
116 TARGET_DEVICES
+= dlink-dns-313
118 define Device
/nas4220b-sq201
120 ARTIFACT
/zImage
:= append-kernel
121 IMAGES
+= rd.gz sysupgrade.
tar.gz
122 IMAGE
/rd.gz
:= append-rootfs | pad-to
6144k
123 IMAGE
/sysupgrade.
tar.gz
:= append-rootfs | pad-to
6144k | nas4220b-sq201-images
$(1)
124 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
127 define Device
/nas4220b
128 $(Device
/nas4220b-sq201
)
129 DEVICE_TITLE
:= Raidsonic NAS IB-4220-B
131 TARGET_DEVICES
+= nas4220b
134 DEVICE_TITLE
:= Teltonika RUT1xx
135 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
137 TARGET_DEVICES
+= rut1xx
140 $(Device
/nas4220b-sq201
)
141 DEVICE_TITLE
:= ITian Square One SQ201
142 DEVICE_PACKAGES
+= rt61-pci usb2-pci
144 TARGET_DEVICES
+= sq201
147 DEVICE_TITLE
:= Wiliboard WBD-111
148 KERNEL
:= kernel-bin | append-dtb | wbd-nops
150 TARGET_DEVICES
+= wbd111
153 DEVICE_TITLE
:= Wiliboard WBD-222
154 KERNEL
:= kernel-bin | append-dtb | wbd-nops
156 TARGET_DEVICES
+= wbd222
158 $(eval
$(call BuildImage
))