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
) \
15 -o
$(BIN_DIR
)/$(IMG_PREFIX
)-dir685-fwupdate.bin \
17 -s wrgns01_dlwbr_dir685RBWW \
23 # Build D-Link DNS-313 images using the special header tool.
24 # rootfs.tgz and rd.tgz contains nothing, we only need them
25 # to satisfy the boot loader on the device. The zImage is
26 # the only real content.
27 define Build
/dns313-images
28 if
[ -d
$(BIN_DIR
)/.boot
] ; then
rm -rf
$(BIN_DIR
)/.boot
; fi
29 mkdir
-p
$(BIN_DIR
)/.boot
30 echo
"dummy" > $(BIN_DIR
)/.boot
/dummyfile
31 dns313-header
$(BIN_DIR
)/.boot
/dummyfile \
32 $(BIN_DIR
)/.boot
/rootfs.tgz
33 dns313-header
$(BIN_DIR
)/.boot
/dummyfile \
34 $(BIN_DIR
)/.boot
/rd.gz
35 dns313-header
$(IMAGE_KERNEL
) \
36 $(BIN_DIR
)/.boot
/zImage
37 rm -f
$(BIN_DIR
)/.boot
/dummyfile
38 (cd
$(BIN_DIR
); tar -czf
$(IMG_PREFIX
)-dns313-bootpart.
tar.gz .boot
)
39 if
[ -d
$(BIN_DIR
)/.boot
] ; then
rm -rf
$(BIN_DIR
)/.boot
; fi
42 # Create the special NAS4220B image format with the squashfs
43 # split across two "partitions" named rd.gz and hddapp.tgz but
44 # essentially just being used by OpenWRT as one big partition
45 define Build
/nas4220b-images
46 dd if
=$(IMAGE_ROOTFS
) of
=$(BIN_DIR
)/rd.gz bs
=6144k conv
=sync
47 dd if
=$(IMAGE_ROOTFS
) of
=$(BIN_DIR
)/hddapp.tgz bs
=6144k count
=1 seek
=1
48 cp
$(IMAGE_KERNEL
) $(BIN_DIR
)/zImage
49 cp .
/ImageInfo-ib4220
$(BIN_DIR
)/ImageInfo
50 (cd
$(BIN_DIR
); tar -czf
$(IMG_PREFIX
)-sysupgrade-ib4220b.
tar.gz ImageInfo zImage rd.gz hddapp.tgz
)
51 mv
$(BIN_DIR
)/rd.gz
$(BIN_DIR
)/$(IMG_PREFIX
)-nas4220b-rd.gz
52 mv
$(BIN_DIR
)/hddapp.tgz
$(BIN_DIR
)/$(IMG_PREFIX
)-nas4220b-hddapp.tgz
53 mv
$(BIN_DIR
)/zImage
$(BIN_DIR
)/$(IMG_PREFIX
)-nas4220b-zImage
54 rm -f
$(BIN_DIR
)/ImageInfo
57 # WBD-111 and WBD-222:
58 # work around the bootloader's bug with extra nops
59 # FIXME: is this really needed now that we no longer append the code
60 # to change the machine ID number? Needs testing on Wiliboard.
63 echo
-en
"\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $@
68 # All DTB files are prefixed with "gemini-"
70 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
71 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
73 KERNEL
:= kernel-bin | append-dtb
74 FILESYSTEMS
:= squashfs
75 IMAGE_NAME
:= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
80 # A reasonable set of default packages handling the NAS type
81 # of devices out of the box (former NAS42x0 IcyBox defaults)
82 GEMINI_NAS_PACKAGES
:=kmod-md-mod kmod-md-linear kmod-md-multipath \
83 kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
84 kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \
85 kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
86 kmod-nls-utf8 kmod-usb-storage-extras \
87 samba36-server mdadm cfdisk fdisk e2fsprogs badblocks
89 define Device
/dlink-dir-685
90 DEVICE_TITLE
:= D-Link DIR-685 Xtreme N Storage Router
91 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
) \
92 kmod-switch-rtl8366rb swconfig
93 IMAGES
+= dir685-image
94 IMAGE
/dir685-image
:= dir685-images
96 TARGET_DEVICES
+= dlink-dir-685
98 define Device
/dlink-dns-313
99 DEVICE_TITLE
:= D-Link DNS-313
1-Bay Network Storage Enclosure
100 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
101 IMAGES
+= dns313-image
102 IMAGE
/dns313-image
:= dns313-images
104 TARGET_DEVICES
+= dlink-dns-313
106 define Device
/nas4220b
107 DEVICE_TITLE
:= Raidsonic NAS IB-4220-B
108 IMAGES
+= nas4220b-image
109 IMAGE
/nas4220b-image
:= nas4220b-images
110 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
112 TARGET_DEVICES
+= nas4220b
115 DEVICE_TITLE
:= Teltonika RUT1xx
116 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
)
118 TARGET_DEVICES
+= rut1xx
121 DEVICE_TITLE
:= ITian Square One SQ201
122 DEVICE_PACKAGES
:= $(GEMINI_NAS_PACKAGES
) rt61-pci-firmware
124 TARGET_DEVICES
+= sq201
127 DEVICE_TITLE
:= Wiliboard WBD-111
128 KERNEL
:= kernel-bin | append-dtb | wbd-nops
130 TARGET_DEVICES
+= wbd111
133 DEVICE_TITLE
:= Wiliboard WBD-222
134 KERNEL
:= kernel-bin | append-dtb | wbd-nops
136 TARGET_DEVICES
+= wbd222
138 $(eval
$(call BuildImage
))